From 7efc16990e5c7c92f45b3241ad4fffd2d2389a89 Mon Sep 17 00:00:00 2001 From: xboard Date: Sun, 22 Jun 2025 18:04:29 +0800 Subject: [PATCH] feat(admin): optimize user traffic management features - Improve traffic reset dialog interactions - Enhance traffic reset logs display --- public/assets/admin/assets/index.js | 16 +-- public/assets/admin/assets/vendor.js | 184 ++++++++++++++------------- public/assets/admin/locales/en-US.js | 6 + public/assets/admin/locales/ko-KR.js | 6 + public/assets/admin/locales/zh-CN.js | 6 + 5 files changed, 123 insertions(+), 95 deletions(-) diff --git a/public/assets/admin/assets/index.js b/public/assets/admin/assets/index.js index ca16438..a76c532 100644 --- a/public/assets/admin/assets/index.js +++ b/public/assets/admin/assets/index.js @@ -1,20 +1,20 @@ -import{r as m,j as e,t as Oi,c as zi,I as Yt,a as it,S as vn,u as As,b as $i,d as bn,R as Nr,e as _r,f as Ai,F as qi,C as Hi,L as wr,T as Cr,g as Sr,h as Ui,i as Ki,k as Bi,l as Gi,m as A,z as x,n as V,o as we,p as Ce,q as ne,s as Ts,v as ke,w as Wi,x as Yi,O as yn,y as Ji,A as Qi,B as Xi,D as Zi,E as eo,G as so,Q as to,H as ao,J as no,K as ro,P as lo,M as io,N as oo,U as co,V as mo,W as kr,X as Tr,Y as Da,Z as Pa,_ as Nn,$ as ms,a0 as La,a1 as Ra,a2 as Dr,a3 as Pr,a4 as Lr,a5 as _n,a6 as Rr,a7 as uo,a8 as Er,a9 as Fr,aa as Ir,ab as Vr,ac as ot,ad as Mr,ae as xo,af as Or,ag as zr,ah as ho,ai as go,aj as fo,ak as po,al as jo,am as vo,an as bo,ao as yo,ap as No,aq as _o,ar as wo,as as $r,at as Co,au as So,av as Ys,aw as Ar,ax as ko,ay as To,az as qr,aA as wn,aB as Do,aC as Po,aD as Jn,aE as Lo,aF as Hr,aG as Ro,aH as Ur,aI as Eo,aJ as Fo,aK as Io,aL as Vo,aM as Mo,aN as Oo,aO as Kr,aP as zo,aQ as $o,aR as Ao,aS as es,aT as qo,aU as Cn,aV as Ho,aW as Uo,aX as Br,aY as Gr,aZ as Wr,a_ as Ko,a$ as Bo,b0 as Go,b1 as Yr,b2 as Wo,b3 as Sn,b4 as Jr,b5 as Yo,b6 as Qr,b7 as Jo,b8 as Xr,b9 as Qo,ba as Zr,bb as el,bc as Xo,bd as Zo,be as sl,bf as ec,bg as sc,bh as tl,bi as tc,bj as al,bk as ac,bl as nc,bm as ws,bn as Pe,bo as Ss,bp as rc,bq as lc,br as ic,bs as oc,bt as cc,bu as dc,bv as Qn,bw as Xn,bx as mc,by as uc,bz as kn,bA as xc,bB as hc,bC as ja,bD as wt,bE as va,bF as gc,bG as nl,bH as fc,bI as pc,bJ as rl,bK as jc,bL as vc,bM as Zn,bN as dn,bO as mn,bP as bc,bQ as yc,bR as ll,bS as Nc,bT as _c,bU as wc,bV as ba,bW as un,bX as ss,bY as ya,bZ as Cc,b_ as Qa,b$ as Sc,c0 as er,c1 as ds,c2 as qt,c3 as Ht,c4 as xn,c5 as il,c6 as ts,c7 as us,c8 as ol,c9 as cl,ca as kc,cb as Tc,cc as Dc,cd as Pc,ce as Lc,cf as dl,cg as Rc,ch as Ec,ci as Be,cj as sr,ck as Fc,cl as ml,cm as ul,cn as xl,co as hl,cp as gl,cq as fl,cr as Ic,cs as Vc,ct as Mc,cu as Ea,cv as ct,cw as bs,cx as ys,cy as Oc,cz as zc,cA as $c,cB as Ac,cC as pl,cD as qc,cE as Hc,cF as Uc,cG as Kc,cH as hn,cI as Tn,cJ as Dn,cK as Bc,cL as Rs,cM as Es,cN as Fa,cO as Gc,cP as Na,cQ as Wc,cR as tr,cS as jl,cT as ar,cU as _a,cV as Yc,cW as Jc,cX as Qc,cY as Xc,cZ as Zc,c_ as vl,c$ as ed,d0 as sd,d1 as bl,d2 as gn,d3 as yl,d4 as td,d5 as fn,d6 as Nl,d7 as ad,d8 as Ut,d9 as Pn,da as nd,db as rd,dc as nr,dd as _l,de as ld,df as id,dg as od,dh as rr}from"./vendor.js";import"./index.js";var yg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ng(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function cd(s){if(s.__esModule)return s;var n=s.default;if(typeof n=="function"){var t=function r(){return this instanceof r?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var a=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return s[r]}})}),t}const dd={theme:"system",setTheme:()=>null},wl=m.createContext(dd);function md({children:s,defaultTheme:n="system",storageKey:t="vite-ui-theme",...r}){const[a,i]=m.useState(()=>localStorage.getItem(t)||n);m.useEffect(()=>{const d=window.document.documentElement;if(d.classList.remove("light","dark"),a==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";d.classList.add(u);return}d.classList.add(a)},[a]);const l={theme:a,setTheme:d=>{localStorage.setItem(t,d),i(d)}};return e.jsx(wl.Provider,{...r,value:l,children:s})}const ud=()=>{const s=m.useContext(wl);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},xd=function(){const n=typeof document<"u"&&document.createElement("link").relList;return n&&n.supports&&n.supports("modulepreload")?"modulepreload":"preload"}(),hd=function(s,n){return new URL(s,n).href},lr={},ye=function(n,t,r){let a=Promise.resolve();if(t&&t.length>0){const l=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),u=d?.nonce||d?.getAttribute("nonce");a=Promise.allSettled(t.map(o=>{if(o=hd(o,r),o in lr)return;lr[o]=!0;const c=o.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(!!r)for(let S=l.length-1;S>=0;S--){const f=l[S];if(f.href===o&&(!c||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${h}`))return;const C=document.createElement("link");if(C.rel=c?"stylesheet":xd,c||(C.as="script"),C.crossOrigin="",C.href=o,u&&C.setAttribute("nonce",u),document.head.appendChild(C),c)return new Promise((S,f)=>{C.addEventListener("load",S),C.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${o}`)))})}))}function i(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return a.then(l=>{for(const d of l||[])d.status==="rejected"&&i(d.reason);return n().catch(i)})};function b(...s){return Oi(zi(s))}const Tt=it("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),L=m.forwardRef(({className:s,variant:n,size:t,asChild:r=!1,children:a,disabled:i,loading:l=!1,leftSection:d,rightSection:u,...o},c)=>{const h=r?vn:"button";return e.jsxs(h,{className:b(Tt({variant:n,size:t,className:s})),disabled:l||i,ref:c,...o,children:[(d&&l||!d&&!u&&l)&&e.jsx(Yt,{className:"mr-2 h-4 w-4 animate-spin"}),!l&&d&&e.jsx("div",{className:"mr-2",children:d}),a,!l&&u&&e.jsx("div",{className:"ml-2",children:u}),u&&l&&e.jsx(Yt,{className:"ml-2 h-4 w-4 animate-spin"})]})});L.displayName="Button";function ht({className:s,minimal:n=!1}){const t=As(),r=$i(),a=r?.message||r?.statusText||"Unknown error occurred";return e.jsx("div",{className:b("h-svh w-full",s),children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[!n&&e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"500"}),e.jsxs("span",{className:"font-medium",children:["Oops! Something went wrong ",":')"]}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["We apologize for the inconvenience. ",e.jsx("br",{}),a]}),!n&&e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(L,{variant:"outline",onClick:()=>t(-1),children:"Go Back"}),e.jsx(L,{onClick:()=>t("/"),children:"Back to Home"})]})]})})}function ir(){const s=As();return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"404"}),e.jsx("span",{className:"font-medium",children:"Oops! Page Not Found!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["It seems like the page you're looking for ",e.jsx("br",{}),"does not exist or might have been removed."]}),e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(L,{variant:"outline",onClick:()=>s(-1),children:"Go Back"}),e.jsx(L,{onClick:()=>s("/"),children:"Back to Home"})]})]})})}function gd(){return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"503"}),e.jsx("span",{className:"font-medium",children:"Website is under maintenance!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["The site is not available at the moment. ",e.jsx("br",{}),"We'll be back online shortly."]}),e.jsx("div",{className:"mt-6 flex gap-4",children:e.jsx(L,{variant:"outline",children:"Learn more"})})]})})}function fd(s){return typeof s>"u"}function pd(s){return s===null}function jd(s){return pd(s)||fd(s)}class vd{storage;prefixKey;constructor(n){this.storage=n.storage,this.prefixKey=n.prefixKey}getKey(n){return`${this.prefixKey}${n}`.toUpperCase()}set(n,t,r=null){const a=JSON.stringify({value:t,time:Date.now(),expire:r!==null?new Date().getTime()+r*1e3:null});this.storage.setItem(this.getKey(n),a)}get(n,t=null){const r=this.storage.getItem(this.getKey(n));if(!r)return{value:t,time:0};try{const a=JSON.parse(r),{value:i,time:l,expire:d}=a;return jd(d)||d>new Date().getTime()?{value:i,time:l}:(this.remove(n),{value:t,time:0})}catch{return this.remove(n),{value:t,time:0}}}remove(n){this.storage.removeItem(this.getKey(n))}clear(){this.storage.clear()}}function Cl({prefixKey:s="",storage:n=sessionStorage}){return new vd({prefixKey:s,storage:n})}const Sl="Xboard_",bd=function(s={}){return Cl({prefixKey:s.prefixKey||"",storage:localStorage})},yd=function(s={}){return Cl({prefixKey:s.prefixKey||"",storage:sessionStorage})},Ln=bd({prefixKey:Sl});yd({prefixKey:Sl});const kl="access_token";function Jt(){return Ln.get(kl)}function Tl(){Ln.remove(kl)}const or=["/sign-in","/sign-in-2","/sign-up","/forgot-password","/otp"];function Nd({children:s}){const n=As(),t=bn(),r=Jt();return m.useEffect(()=>{if(!r.value&&!or.includes(t.pathname)){const a=encodeURIComponent(t.pathname+t.search);n(`/sign-in?redirect=${a}`)}},[r.value,t.pathname,t.search,n]),or.includes(t.pathname)||r.value?e.jsx(e.Fragment,{children:s}):null}const Te=m.forwardRef(({className:s,orientation:n="horizontal",decorative:t=!0,...r},a)=>e.jsx(Nr,{ref:a,decorative:t,orientation:n,className:b("shrink-0 bg-border",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...r}));Te.displayName=Nr.displayName;const _d=it("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ae=m.forwardRef(({className:s,...n},t)=>e.jsx(_r,{ref:t,className:b(_d(),s),...n}));Ae.displayName=_r.displayName;const Se=qi,Dl=m.createContext({}),v=({...s})=>e.jsx(Dl.Provider,{value:{name:s.name},children:e.jsx(Hi,{...s})}),Ia=()=>{const s=m.useContext(Dl),n=m.useContext(Pl),{getFieldState:t,formState:r}=Ai(),a=t(s.name,r);if(!s)throw new Error("useFormField should be used within ");const{id:i}=n;return{id:i,name:s.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...a}},Pl=m.createContext({}),p=m.forwardRef(({className:s,...n},t)=>{const r=m.useId();return e.jsx(Pl.Provider,{value:{id:r},children:e.jsx("div",{ref:t,className:b("space-y-2",s),...n})})});p.displayName="FormItem";const j=m.forwardRef(({className:s,...n},t)=>{const{error:r,formItemId:a}=Ia();return e.jsx(Ae,{ref:t,className:b(r&&"text-destructive",s),htmlFor:a,...n})});j.displayName="FormLabel";const y=m.forwardRef(({...s},n)=>{const{error:t,formItemId:r,formDescriptionId:a,formMessageId:i}=Ia();return e.jsx(vn,{ref:n,id:r,"aria-describedby":t?`${a} ${i}`:`${a}`,"aria-invalid":!!t,...s})});y.displayName="FormControl";const O=m.forwardRef(({className:s,...n},t)=>{const{formDescriptionId:r}=Ia();return e.jsx("p",{ref:t,id:r,className:b("text-[0.8rem] text-muted-foreground",s),...n})});O.displayName="FormDescription";const E=m.forwardRef(({className:s,children:n,...t},r)=>{const{error:a,formMessageId:i}=Ia(),l=a?String(a?.message):n;return l?e.jsx("p",{ref:r,id:i,className:b("text-[0.8rem] font-medium text-destructive",s),...t,children:l}):null});E.displayName="FormMessage";const Dt=Ui,dt=m.forwardRef(({className:s,...n},t)=>e.jsx(wr,{ref:t,className:b("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...n}));dt.displayName=wr.displayName;const Xe=m.forwardRef(({className:s,...n},t)=>e.jsx(Cr,{ref:t,className:b("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",s),...n}));Xe.displayName=Cr.displayName;const ks=m.forwardRef(({className:s,...n},t)=>e.jsx(Sr,{ref:t,className:b("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...n}));ks.displayName=Sr.displayName;function me(s=void 0,n="YYYY-MM-DD HH:mm:ss"){return s==null?"":(Math.floor(s).toString().length===10&&(s=s*1e3),Ki(s).format(n))}function wd(s=void 0,n="YYYY-MM-DD"){return me(s,n)}function bt(s){const n=typeof s=="string"?parseFloat(s):s;return isNaN(n)?"0.00":n.toFixed(2)}function Vs(s,n=!0){if(s==null)return n?"¥0.00":"0.00";const t=typeof s=="string"?parseFloat(s):s;if(isNaN(t))return n?"¥0.00":"0.00";const a=(t/100).toFixed(2).replace(/\.?0+$/,i=>i.includes(".")?".00":i);return n?`¥${a}`:a}function wa(s){return new Promise(n=>{try{const t=document.createElement("button");t.style.position="fixed",t.style.left="-9999px",t.style.opacity="0",t.setAttribute("data-clipboard-text",s),document.body.appendChild(t);const r=new Bi(t);r.on("success",()=>{r.destroy(),document.body.removeChild(t),n(!0)}),r.on("error",a=>{console.error("Clipboard.js failed:",a),r.destroy(),document.body.removeChild(t),n(!1)}),t.click()}catch(t){console.error("copyToClipboard failed:",t),n(!1)}})}function Oe(s){const n=s/1024,t=n/1024,r=t/1024,a=r/1024;return a>=1?bt(a)+" TB":r>=1?bt(r)+" GB":t>=1?bt(t)+" MB":bt(n)+" KB"}const cr="i18nextLng";function Cd(){return console.log(localStorage.getItem(cr)),localStorage.getItem(cr)}function Ll(){Tl();const s=window.location.pathname,n=s&&!["/404","/sign-in"].includes(s),t=new URL(window.location.href),a=`${t.pathname.split("/")[1]?`/${t.pathname.split("/")[1]}`:""}#/sign-in`;window.location.href=a+(n?`?redirect=${s}`:"")}const Sd=["/passport/auth/login","/passport/auth/token2Login","/passport/auth/register","/guest/comm/config","/passport/comm/sendEmailVerify","/passport/auth/forget"];function kd(){const s=window.settings?.base_url||"/";return s.endsWith("/")?s+"api/v2":s+"/api/v2"}const yt=Gi.create({baseURL:kd(),timeout:12e3,headers:{"Content-Type":"application/json"}});yt.interceptors.request.use(s=>{s.method?.toLowerCase()==="get"&&(s.params={...s.params,t:Date.now()});const n=Jt();if(!Sd.includes(s.url?.split("?")[0]||"")){if(!n.value)return Ll(),Promise.reject({code:-1,message:"未登录"});s.headers.Authorization=n.value}return s.headers["Content-Language"]=Cd()||"zh-CN",s},s=>Promise.reject(s));yt.interceptors.response.use(s=>s?.data||{code:-1,message:"未知错误"},s=>{const n=s.response?.status,t=s.response?.data?.message;return(n===401||n===403)&&Ll(),A.error(t||{401:"登录已过期",403:"没有权限",404:"资源或接口不存在"}[n]||"未知异常"),Promise.reject(s.response?.data||{data:null,code:-1,message:"未知错误"})});const M={get:(s,n)=>yt.get(s,n),post:(s,n,t)=>yt.post(s,n,t),put:(s,n,t)=>yt.put(s,n,t),delete:(s,n)=>yt.delete(s,n)},Td="access_token";function Dd(s){Ln.set(Td,s)}const et=window?.settings?.secure_path,Ca={getStats:()=>M.get(et+"/monitor/api/stats"),getOverride:()=>M.get(et+"/stat/getOverride"),getOrderStat:s=>M.get(et+"/stat/getOrder",{params:s}),getStatsData:()=>M.get(et+"/stat/getStats"),getNodeTrafficData:s=>M.get(et+"/stat/getTrafficRank",{params:s}),getServerLastRank:()=>M.get(et+"/stat/getServerLastRank"),getServerYesterdayRank:()=>M.get(et+"/stat/getServerYesterdayRank")},Et=window?.settings?.secure_path,Kt={getList:()=>M.get(Et+"/theme/getThemes"),getConfig:s=>M.post(Et+"/theme/getThemeConfig",{name:s}),updateConfig:(s,n)=>M.post(Et+"/theme/saveThemeConfig",{name:s,config:n}),upload:s=>{const n=new FormData;return n.append("file",s),M.post(Et+"/theme/upload",n,{headers:{"Content-Type":"multipart/form-data"}})},drop:s=>M.post(Et+"/theme/delete",{name:s})},gt=window?.settings?.secure_path,at={getList:()=>M.get(gt+"/server/manage/getNodes"),save:s=>M.post(gt+"/server/manage/save",s),drop:s=>M.post(gt+"/server/manage/drop",s),copy:s=>M.post(gt+"/server/manage/copy",s),update:s=>M.post(gt+"/server/manage/update",s),sort:s=>M.post(gt+"/server/manage/sort",s)},Xa=window?.settings?.secure_path,mt={getList:()=>M.get(Xa+"/server/group/fetch"),save:s=>M.post(Xa+"/server/group/save",s),drop:s=>M.post(Xa+"/server/group/drop",s)},Za=window?.settings?.secure_path,Va={getList:()=>M.get(Za+"/server/route/fetch"),save:s=>M.post(Za+"/server/route/save",s),drop:s=>M.post(Za+"/server/route/drop",s)},st=window?.settings?.secure_path,nt={getList:()=>M.get(st+"/payment/fetch"),getMethodList:()=>M.get(st+"/payment/getPaymentMethods"),getMethodForm:s=>M.post(st+"/payment/getPaymentForm",s),save:s=>M.post(st+"/payment/save",s),drop:s=>M.post(st+"/payment/drop",s),updateStatus:s=>M.post(st+"/payment/show",s),sort:s=>M.post(st+"/payment/sort",s)},Ft=window?.settings?.secure_path,Qt={getList:()=>M.get(`${Ft}/notice/fetch`),save:s=>M.post(`${Ft}/notice/save`,s),drop:s=>M.post(`${Ft}/notice/drop`,{id:s}),updateStatus:s=>M.post(`${Ft}/notice/show`,{id:s}),sort:s=>M.post(`${Ft}/notice/sort`,{ids:s})},ft=window?.settings?.secure_path,Ct={getList:()=>M.get(ft+"/knowledge/fetch"),getInfo:s=>M.get(ft+"/knowledge/fetch?id="+s),save:s=>M.post(ft+"/knowledge/save",s),drop:s=>M.post(ft+"/knowledge/drop",s),updateStatus:s=>M.post(ft+"/knowledge/show",s),sort:s=>M.post(ft+"/knowledge/sort",s)},It=window?.settings?.secure_path,gs={getList:()=>M.get(It+"/plan/fetch"),save:s=>M.post(It+"/plan/save",s),update:s=>M.post(It+"/plan/update",s),drop:s=>M.post(It+"/plan/drop",s),sort:s=>M.post(It+"/plan/sort",{ids:s})},pt=window?.settings?.secure_path,tt={getList:s=>M.post(pt+"/order/fetch",s),getInfo:s=>M.post(pt+"/order/detail",s),markPaid:s=>M.post(pt+"/order/paid",s),makeCancel:s=>M.post(pt+"/order/cancel",s),update:s=>M.post(pt+"/order/update",s),assign:s=>M.post(pt+"/order/assign",s)},ra=window?.settings?.secure_path,Sa={getList:s=>M.post(ra+"/coupon/fetch",s),save:s=>M.post(ra+"/coupon/generate",s),drop:s=>M.post(ra+"/coupon/drop",s),update:s=>M.post(ra+"/coupon/update",s)},ls=window?.settings?.secure_path,Ps={getList:s=>M.post(`${ls}/user/fetch`,s),update:s=>M.post(`${ls}/user/update`,s),resetSecret:s=>M.post(`${ls}/user/resetSecret`,{id:s}),generate:s=>s.download_csv?M.post(`${ls}/user/generate`,s,{responseType:"blob"}):M.post(`${ls}/user/generate`,s),getStats:s=>M.post(`${ls}/stat/getStatUser`,s),destroy:s=>M.post(`${ls}/user/destroy`,{id:s}),sendMail:s=>M.post(`${ls}/user/sendMail`,s),dumpCSV:s=>M.post(`${ls}/user/dumpCSV`,s,{responseType:"blob"}),batchBan:s=>M.post(`${ls}/user/ban`,s)},Xt={getLogs:s=>M.get(`${ls}/traffic-reset/logs`,{params:s}),getStats:s=>M.get(`${ls}/traffic-reset/stats`,{params:s}),resetUser:s=>M.post(`${ls}/traffic-reset/reset-user`,s),getUserHistory:(s,n)=>M.get(`${ls}/traffic-reset/user/${s}/history`,{params:n})},la=window?.settings?.secure_path,Nt={getList:s=>M.post(la+"/ticket/fetch",s),getInfo:s=>M.get(la+"/ticket/fetch?id= "+s),reply:s=>M.post(la+"/ticket/reply",s),close:s=>M.post(la+"/ticket/close",{id:s})},Ue=window?.settings?.secure_path,he={getSettings:(s="")=>M.get(Ue+"/config/fetch?key="+s),saveSettings:s=>M.post(Ue+"/config/save",s),getEmailTemplate:()=>M.get(Ue+"/config/getEmailTemplate"),sendTestMail:()=>M.post(Ue+"/config/testSendMail"),setTelegramWebhook:()=>M.post(Ue+"/config/setTelegramWebhook"),updateSystemConfig:s=>M.post(Ue+"/config/save",s),getSystemStatus:()=>M.get(`${Ue}/system/getSystemStatus`),getQueueStats:()=>M.get(`${Ue}/system/getQueueStats`),getQueueWorkload:()=>M.get(`${Ue}/system/getQueueWorkload`),getQueueMasters:()=>M.get(`${Ue}/system/getQueueMasters`),getHorizonFailedJobs:s=>M.get(`${Ue}/system/getHorizonFailedJobs`,{params:s}),getSystemLog:s=>M.get(`${Ue}/system/getSystemLog`,{params:s}),getLogFiles:()=>M.get(`${Ue}/log/files`),getLogContent:s=>M.get(`${Ue}/log/fetch`,{params:s}),getLogClearStats:s=>M.get(`${Ue}/system/getLogClearStats`,{params:s}),clearSystemLog:s=>M.post(`${Ue}/system/clearSystemLog`,s)},Is=window?.settings?.secure_path,Ms={getPluginList:()=>M.get(`${Is}/plugin/getPlugins`),uploadPlugin:s=>{const n=new FormData;return n.append("file",s),M.post(`${Is}/plugin/upload`,n,{headers:{"Content-Type":"multipart/form-data"}})},deletePlugin:s=>M.post(`${Is}/plugin/delete`,{code:s}),installPlugin:s=>M.post(`${Is}/plugin/install`,{code:s}),uninstallPlugin:s=>M.post(`${Is}/plugin/uninstall`,{code:s}),enablePlugin:s=>M.post(`${Is}/plugin/enable`,{code:s}),disablePlugin:s=>M.post(`${Is}/plugin/disable`,{code:s}),getPluginConfig:s=>M.get(`${Is}/plugin/config`,{params:{code:s}}),updatePluginConfig:(s,n)=>M.post(`${Is}/plugin/config`,{code:s,config:n})};window?.settings?.secure_path;const Pd=x.object({subscribe_template_singbox:x.string().optional().default(""),subscribe_template_clash:x.string().optional().default(""),subscribe_template_clashmeta:x.string().optional().default(""),subscribe_template_stash:x.string().optional().default(""),subscribe_template_surge:x.string().optional().default(""),subscribe_template_surfboard:x.string().optional().default("")}),dr=[{key:"singbox",label:"Sing-box",language:"json"},{key:"clash",label:"Clash",language:"yaml"},{key:"clashmeta",label:"Clash Meta",language:"yaml"},{key:"stash",label:"Stash",language:"yaml"},{key:"surge",label:"Surge",language:"ini"},{key:"surfboard",label:"Surfboard",language:"ini"}],mr={subscribe_template_singbox:"",subscribe_template_clash:"",subscribe_template_clashmeta:"",subscribe_template_stash:"",subscribe_template_surge:"",subscribe_template_surfboard:""};function Ld(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),[a,i]=m.useState("singbox"),l=we({resolver:Ce(Pd),defaultValues:mr,mode:"onChange"}),{data:d,isLoading:u}=ne({queryKey:["settings","client"],queryFn:()=>he.getSettings("subscribe_template")}),{mutateAsync:o}=Ts({mutationFn:he.saveSettings,onSuccess:()=>{A.success(s("common.autoSaved"))},onError:C=>{console.error("保存失败:",C),A.error(s("common.saveFailed"))}});m.useEffect(()=>{if(d?.data?.subscribe_template){const C=d.data.subscribe_template;Object.entries(C).forEach(([S,f])=>{if(S in mr){const N=typeof f=="string"?f:"";l.setValue(S,N)}}),r.current=l.getValues()}},[d,l]);const c=m.useCallback(ke.debounce(async C=>{if(!r.current||!ke.isEqual(C,r.current)){t(!0);try{await o(C),r.current=C}catch(S){console.error("保存设置失败:",S)}finally{t(!1)}}},1500),[o]),h=m.useCallback(()=>{const C=l.getValues();c(C)},[l,c]),k=m.useCallback((C,S)=>e.jsx(v,{control:l.control,name:C,render:({field:f})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s(`subscribe_template.${C.replace("subscribe_template_","")}.title`)}),e.jsx(y,{children:e.jsx(Wi,{height:"500px",defaultLanguage:S,value:f.value||"",onChange:N=>{f.onChange(N||""),h()},options:{minimap:{enabled:!1},fontSize:14,wordWrap:"on",scrollBeyondLastLine:!1,automaticLayout:!0}})}),e.jsx(O,{children:s(`subscribe_template.${C.replace("subscribe_template_","")}.description`)}),e.jsx(E,{})]})}),[l.control,s,h]);return u?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.loading")})}):e.jsx(Se,{...l,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs(Dt,{value:a,onValueChange:i,className:"w-full",children:[e.jsx(dt,{className:"",children:dr.map(({key:C,label:S})=>e.jsx(Xe,{value:C,className:"text-xs",children:S},C))}),dr.map(({key:C,language:S})=>e.jsx(ks,{value:C,className:"mt-4",children:k(`subscribe_template_${C}`,S)},C))]}),n&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-blue-500"}),s("common.saving")]})]})})}function Rd(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("subscribe_template.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("subscribe_template.description")})]}),e.jsx(Te,{}),e.jsx(Ld,{})]})}const Ed=()=>e.jsx(Nd,{children:e.jsx(yn,{})}),Fd=Yi([{path:"/sign-in",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Qd);return{default:s}},void 0,import.meta.url)).default})},{element:e.jsx(Ed,{}),children:[{path:"/",lazy:async()=>({Component:(await ye(()=>Promise.resolve().then(()=>lm),void 0,import.meta.url)).default}),errorElement:e.jsx(ht,{}),children:[{index:!0,lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Sm);return{default:s}},void 0,import.meta.url)).default})},{path:"config",errorElement:e.jsx(ht,{}),children:[{path:"system",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Pm);return{default:s}},void 0,import.meta.url)).default}),children:[{index:!0,lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Fm);return{default:s}},void 0,import.meta.url)).default})},{path:"safe",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>zm);return{default:s}},void 0,import.meta.url)).default})},{path:"subscribe",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Um);return{default:s}},void 0,import.meta.url)).default})},{path:"invite",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Ym);return{default:s}},void 0,import.meta.url)).default})},{path:"frontend",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>eu);return{default:s}},void 0,import.meta.url)).default})},{path:"server",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>ru);return{default:s}},void 0,import.meta.url)).default})},{path:"email",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>du);return{default:s}},void 0,import.meta.url)).default})},{path:"telegram",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>gu);return{default:s}},void 0,import.meta.url)).default})},{path:"APP",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>bu);return{default:s}},void 0,import.meta.url)).default})},{path:"subscribe-template",element:e.jsx(Rd,{})}]},{path:"payment",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>ku);return{default:s}},void 0,import.meta.url)).default})},{path:"plugin",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Pu);return{default:s}},void 0,import.meta.url)).default})},{path:"theme",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Fu);return{default:s}},void 0,import.meta.url)).default})},{path:"notice",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Au);return{default:s}},void 0,import.meta.url)).default})},{path:"knowledge",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Yu);return{default:s}},void 0,import.meta.url)).default})}]},{path:"server",errorElement:e.jsx(ht,{}),children:[{path:"manage",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Cx);return{default:s}},void 0,import.meta.url)).default})},{path:"group",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Px);return{default:s}},void 0,import.meta.url)).default})},{path:"route",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Vx);return{default:s}},void 0,import.meta.url)).default})}]},{path:"finance",errorElement:e.jsx(ht,{}),children:[{path:"plan",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Kx);return{default:s}},void 0,import.meta.url)).default})},{path:"order",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>rh);return{default:s}},void 0,import.meta.url)).default})},{path:"coupon",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>gh);return{default:s}},void 0,import.meta.url)).default})}]},{path:"user",errorElement:e.jsx(ht,{}),children:[{path:"manage",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Kh);return{default:s}},void 0,import.meta.url)).default})},{path:"ticket",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>mg);return{default:s}},void 0,import.meta.url)).default})},{path:"traffic-reset-logs",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>pg);return{default:s}},void 0,import.meta.url)).default})}]}]}]},{path:"/500",Component:ht},{path:"/404",Component:ir},{path:"/503",Component:gd},{path:"*",Component:ir}]);function Id(){return M.get("/user/info")}const en={token:Jt()?.value||"",userInfo:null,isLoggedIn:!!Jt()?.value,loading:!1,error:null},Bt=Ji("user/fetchUserInfo",async()=>(await Id()).data,{condition:(s,{getState:n})=>{const{user:t}=n();return!!t.token&&!t.loading}}),Rl=Qi({name:"user",initialState:en,reducers:{setToken(s,n){s.token=n.payload,s.isLoggedIn=!!n.payload},resetUserState:()=>en},extraReducers:s=>{s.addCase(Bt.pending,n=>{n.loading=!0,n.error=null}).addCase(Bt.fulfilled,(n,t)=>{n.loading=!1,n.userInfo=t.payload,n.error=null}).addCase(Bt.rejected,(n,t)=>{if(n.loading=!1,n.error=t.error.message||"Failed to fetch user info",!n.token)return en})}}),{setToken:Vd,resetUserState:Md}=Rl.actions,Od=s=>s.user.userInfo,zd=Rl.reducer,El=Xi({reducer:{user:zd}});Jt()?.value&&El.dispatch(Bt());Zi.use(eo).use(so).init({resources:{"en-US":window.XBOARD_TRANSLATIONS?.["en-US"]||{},"zh-CN":window.XBOARD_TRANSLATIONS?.["zh-CN"]||{},"ko-KR":window.XBOARD_TRANSLATIONS?.["ko-KR"]||{}},fallbackLng:"zh-CN",supportedLngs:["en-US","zh-CN","ko-KR"],detection:{order:["querystring","localStorage","navigator"],lookupQuerystring:"lang",lookupLocalStorage:"i18nextLng",caches:["localStorage"]},interpolation:{escapeValue:!1}});const $d=new to;ao.createRoot(document.getElementById("root")).render(e.jsx(no.StrictMode,{children:e.jsx(ro,{client:$d,children:e.jsx(lo,{store:El,children:e.jsxs(md,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[e.jsx(io,{router:Fd}),e.jsx(oo,{richColors:!0,position:"top-right"})]})})})}));const Re=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{ref:t,className:b("rounded-xl border bg-card text-card-foreground shadow",s),...n}));Re.displayName="Card";const Fe=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{ref:t,className:b("flex flex-col space-y-1.5 p-6",s),...n}));Fe.displayName="CardHeader";const Ge=m.forwardRef(({className:s,...n},t)=>e.jsx("h3",{ref:t,className:b("font-semibold leading-none tracking-tight",s),...n}));Ge.displayName="CardTitle";const Os=m.forwardRef(({className:s,...n},t)=>e.jsx("p",{ref:t,className:b("text-sm text-muted-foreground",s),...n}));Os.displayName="CardDescription";const Ie=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{ref:t,className:b("p-6 pt-0",s),...n}));Ie.displayName="CardContent";const Ad=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{ref:t,className:b("flex items-center p-6 pt-0",s),...n}));Ad.displayName="CardFooter";const P=m.forwardRef(({className:s,type:n,...t},r)=>e.jsx("input",{type:n,className:b("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:r,...t}));P.displayName="Input";const Fl=m.forwardRef(({className:s,...n},t)=>{const[r,a]=m.useState(!1);return e.jsxs("div",{className:"relative rounded-md",children:[e.jsx("input",{type:r?"text":"password",className:b("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...n}),e.jsx(L,{type:"button",size:"icon",variant:"ghost",className:"absolute right-1 top-1/2 h-6 w-6 -translate-y-1/2 rounded-md text-muted-foreground",onClick:()=>a(i=>!i),children:r?e.jsx(co,{size:18}):e.jsx(mo,{size:18})})]})});Fl.displayName="PasswordInput";const qd=s=>M.post("/passport/auth/login",s);function Hd({className:s,onForgotPassword:n,...t}){const r=As(),a=kr(),{t:i}=V("auth"),l=x.object({email:x.string().min(1,{message:i("signIn.validation.emailRequired")}),password:x.string().min(1,{message:i("signIn.validation.passwordRequired")}).min(7,{message:i("signIn.validation.passwordLength")})}),d=we({resolver:Ce(l),defaultValues:{email:"",password:""}});async function u(o){try{const{data:c}=await qd(o);Dd(c.auth_data),a(Vd(c.auth_data)),await a(Bt()).unwrap(),r("/")}catch(c){console.error("Login failed:",c),c.response?.data?.message&&d.setError("root",{message:c.response.data.message})}}return e.jsx("div",{className:b("grid gap-6",s),...t,children:e.jsx(Se,{...d,children:e.jsx("form",{onSubmit:d.handleSubmit(u),className:"space-y-4",children:e.jsxs("div",{className:"space-y-4",children:[d.formState.errors.root&&e.jsx("div",{className:"text-sm text-destructive",children:d.formState.errors.root.message}),e.jsx(v,{control:d.control,name:"email",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:i("signIn.email")}),e.jsx(y,{children:e.jsx(P,{placeholder:i("signIn.emailPlaceholder"),autoComplete:"email",...o})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"password",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:i("signIn.password")}),e.jsx(y,{children:e.jsx(Fl,{placeholder:i("signIn.passwordPlaceholder"),autoComplete:"current-password",...o})}),e.jsx(E,{})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(L,{variant:"link",type:"button",className:"px-0 text-sm font-normal text-muted-foreground hover:text-primary",onClick:n,children:i("signIn.forgotPassword")})}),e.jsx(L,{className:"w-full",size:"lg",loading:d.formState.isSubmitting,children:i("signIn.submit")})]})})})})}const ge=Tr,as=Dr,Ud=Pr,Gs=Nn,Il=m.forwardRef(({className:s,...n},t)=>e.jsx(Da,{ref:t,className:b("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",s),...n}));Il.displayName=Da.displayName;const de=m.forwardRef(({className:s,children:n,...t},r)=>e.jsxs(Ud,{children:[e.jsx(Il,{}),e.jsxs(Pa,{ref:r,className:b("max-h-[95%] overflow-auto 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",s),...t,children:[n,e.jsxs(Nn,{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:[e.jsx(ms,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));de.displayName=Pa.displayName;const ve=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",s),...n});ve.displayName="DialogHeader";const Le=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...n});Le.displayName="DialogFooter";const fe=m.forwardRef(({className:s,...n},t)=>e.jsx(La,{ref:t,className:b("text-lg font-semibold leading-none tracking-tight",s),...n}));fe.displayName=La.displayName;const Ve=m.forwardRef(({className:s,...n},t)=>e.jsx(Ra,{ref:t,className:b("text-sm text-muted-foreground",s),...n}));Ve.displayName=Ra.displayName;const St=it("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),G=m.forwardRef(({className:s,variant:n,size:t,asChild:r=!1,...a},i)=>{const l=r?vn:"button";return e.jsx(l,{className:b(St({variant:n,size:t,className:s})),ref:i,...a})});G.displayName="Button";const zs=ho,$s=go,Kd=fo,Bd=m.forwardRef(({className:s,inset:n,children:t,...r},a)=>e.jsxs(Lr,{ref:a,className:b("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",n&&"pl-8",s),...r,children:[t,e.jsx(_n,{className:"ml-auto h-4 w-4"})]}));Bd.displayName=Lr.displayName;const Gd=m.forwardRef(({className:s,...n},t)=>e.jsx(Rr,{ref:t,className:b("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",s),...n}));Gd.displayName=Rr.displayName;const Ls=m.forwardRef(({className:s,sideOffset:n=4,...t},r)=>e.jsx(uo,{children:e.jsx(Er,{ref:r,sideOffset:n,className:b("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",s),...t})}));Ls.displayName=Er.displayName;const _e=m.forwardRef(({className:s,inset:n,...t},r)=>e.jsx(Fr,{ref:r,className:b("relative flex cursor-default cursor-pointer 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",n&&"pl-8",s),...t}));_e.displayName=Fr.displayName;const Wd=m.forwardRef(({className:s,children:n,checked:t,...r},a)=>e.jsxs(Ir,{ref:a,className:b("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",s),checked:t,...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Vr,{children:e.jsx(ot,{className:"h-4 w-4"})})}),n]}));Wd.displayName=Ir.displayName;const Yd=m.forwardRef(({className:s,children:n,...t},r)=>e.jsxs(Mr,{ref:r,className:b("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",s),...t,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Vr,{children:e.jsx(xo,{className:"h-4 w-4 fill-current"})})}),n]}));Yd.displayName=Mr.displayName;const Rn=m.forwardRef(({className:s,inset:n,...t},r)=>e.jsx(Or,{ref:r,className:b("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",s),...t}));Rn.displayName=Or.displayName;const rt=m.forwardRef(({className:s,...n},t)=>e.jsx(zr,{ref:t,className:b("-mx-1 my-1 h-px bg-muted",s),...n}));rt.displayName=zr.displayName;const pn=({className:s,...n})=>e.jsx("span",{className:b("ml-auto text-xs tracking-widest opacity-60",s),...n});pn.displayName="DropdownMenuShortcut";const sn=[{code:"en-US",name:"English",flag:po,shortName:"EN"},{code:"zh-CN",name:"中文",flag:jo,shortName:"CN"},{code:"ko-KR",name:"한국어",flag:vo,shortName:"KR"}];function Vl(){const{i18n:s}=V(),n=a=>{s.changeLanguage(a)},t=sn.find(a=>a.code===s.language)||sn[1],r=t.flag;return e.jsxs(zs,{children:[e.jsx($s,{asChild:!0,children:e.jsxs(G,{variant:"ghost",size:"sm",className:"h-8 px-2 gap-1",children:[e.jsx(r,{className:"h-4 w-5 rounded-sm shadow-sm"}),e.jsx("span",{className:"text-sm font-medium",children:t.shortName})]})}),e.jsx(Ls,{align:"end",className:"w-[120px]",children:sn.map(a=>{const i=a.flag,l=a.code===s.language;return e.jsxs(_e,{onClick:()=>n(a.code),className:b("flex items-center gap-2 px-2 py-1.5 cursor-pointer",l&&"bg-accent"),children:[e.jsx(i,{className:"h-4 w-5 rounded-sm shadow-sm"}),e.jsx("span",{className:b("text-sm",l&&"font-medium"),children:a.name})]},a.code)})})]})}function Jd(){const[s,n]=m.useState(!1),{t}=V("auth"),r=t("signIn.resetPassword.command");return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"container relative flex min-h-svh flex-col items-center justify-center bg-primary-foreground px-4 py-8 lg:max-w-none lg:px-0",children:[e.jsx("div",{className:"absolute right-4 top-4 md:right-8 md:top-8",children:e.jsx(Vl,{})}),e.jsxs("div",{className:"mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px] md:w-[420px] lg:p-8",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold sm:text-3xl",children:window?.settings?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:window?.settings?.description})]}),e.jsxs(Re,{className:"p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-left",children:[e.jsx("h1",{className:"text-xl font-semibold tracking-tight sm:text-2xl",children:t("signIn.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("signIn.description")})]}),e.jsx(Hd,{onForgotPassword:()=>n(!0)})]})]})]}),e.jsx(ge,{open:s,onOpenChange:n,children:e.jsx(de,{className:"max-w-[90vw] sm:max-w-lg",children:e.jsxs(ve,{children:[e.jsx(fe,{children:t("signIn.resetPassword.title")}),e.jsx(Ve,{children:t("signIn.resetPassword.description")}),e.jsx("div",{className:"mt-4",children:e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"max-w-full overflow-x-auto rounded-md bg-secondary p-4 pr-12 text-sm",children:r}),e.jsx(G,{variant:"ghost",size:"icon",className:"absolute right-2 top-2 h-8 w-8 hover:bg-secondary-foreground/10",onClick:()=>wa(r).then(()=>{A.success(t("common:copy.success"))}),children:e.jsx(bo,{className:"h-4 w-4"})})]})})]})})})]})}const Qd=Object.freeze(Object.defineProperty({__proto__:null,default:Jd},Symbol.toStringTag,{value:"Module"})),ze=m.forwardRef(({className:s,fadedBelow:n=!1,fixedHeight:t=!1,...r},a)=>e.jsx("div",{ref:a,className:b("relative flex h-full w-full flex-col",n&&"after:pointer-events-none after:absolute after:bottom-0 after:left-0 after:hidden after:h-32 after:w-full after:bg-[linear-gradient(180deg,_transparent_10%,_hsl(var(--background))_70%)] after:md:block",t&&"md:h-svh",s),...r}));ze.displayName="Layout";const $e=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{ref:t,className:b("flex h-[var(--header-height)] flex-none items-center gap-4 bg-background p-4 md:px-8",s),...n}));$e.displayName="LayoutHeader";const He=m.forwardRef(({className:s,fixedHeight:n,...t},r)=>e.jsx("div",{ref:r,className:b("flex-1 overflow-hidden px-4 py-6 md:px-8",n&&"h-[calc(100%-var(--header-height))]",s),...t}));He.displayName="LayoutBody";const Ml=yo,Ol=No,zl=_o,be=wo,ue=Co,xe=So,ce=m.forwardRef(({className:s,sideOffset:n=4,...t},r)=>e.jsx($r,{ref:r,sideOffset:n,className:b("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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",s),...t}));ce.displayName=$r.displayName;function Ma(){const{pathname:s}=bn();return{checkActiveNav:t=>{if(t==="/"&&s==="/")return!0;const r=t.replace(/^\//,""),a=s.replace(/^\//,"");return r?a.startsWith(r):!1}}}function $l({key:s,defaultValue:n}){const[t,r]=m.useState(()=>{const a=localStorage.getItem(s);return a!==null?JSON.parse(a):n});return m.useEffect(()=>{localStorage.setItem(s,JSON.stringify(t))},[t,s]),[t,r]}function Xd(){const[s,n]=$l({key:"collapsed-sidebar-items",defaultValue:[]}),t=a=>!s.includes(a);return{isExpanded:t,toggleItem:a=>{t(a)?n([...s,a]):n(s.filter(i=>i!==a))}}}function Zd({links:s,isCollapsed:n,className:t,closeNav:r}){const{t:a}=V(),i=({sub:l,...d})=>{const u=`${a(d.title)}-${d.href}`;return n&&l?m.createElement(tm,{...d,sub:l,key:u,closeNav:r}):n?m.createElement(sm,{...d,key:u,closeNav:r}):l?m.createElement(em,{...d,sub:l,key:u,closeNav:r}):m.createElement(Al,{...d,key:u,closeNav:r})};return e.jsx("div",{"data-collapsed":n,className:b("group border-b bg-background py-2 transition-[max-height,padding] duration-500 data-[collapsed=true]:py-2 md:border-none",t),children:e.jsx(be,{delayDuration:0,children:e.jsx("nav",{className:"grid gap-1 group-[[data-collapsed=true]]:justify-center group-[[data-collapsed=true]]:px-2",children:s.map(i)})})})}function Al({title:s,icon:n,label:t,href:r,closeNav:a,subLink:i=!1}){const{checkActiveNav:l}=Ma(),{t:d}=V();return e.jsxs(Ys,{to:r,onClick:a,className:b(Tt({variant:l(r)?"secondary":"ghost",size:"sm"}),"h-12 justify-start text-wrap rounded-none px-6",i&&"h-10 w-full border-l border-l-slate-500 px-2"),"aria-current":l(r)?"page":void 0,children:[e.jsx("div",{className:"mr-2",children:n}),d(s),t&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:d(t)})]})}function em({title:s,icon:n,label:t,sub:r,closeNav:a}){const{checkActiveNav:i}=Ma(),{isExpanded:l,toggleItem:d}=Xd(),{t:u}=V(),o=!!r?.find(k=>i(k.href)),c=u(s),h=l(c)||o;return e.jsxs(Ml,{open:h,onOpenChange:()=>d(c),children:[e.jsxs(Ol,{className:b(Tt({variant:o?"secondary":"ghost",size:"sm"}),"group h-12 w-full justify-start rounded-none px-6"),children:[e.jsx("div",{className:"mr-2",children:n}),u(s),t&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:u(t)}),e.jsx("span",{className:b('ml-auto transition-all group-data-[state="open"]:-rotate-180'),children:e.jsx(Ar,{stroke:1})})]}),e.jsx(zl,{className:"collapsibleDropdown",asChild:!0,children:e.jsx("ul",{children:r.map(k=>e.jsx("li",{className:"my-1 ml-8",children:e.jsx(Al,{...k,subLink:!0,closeNav:a})},u(k.title)))})})]})}function sm({title:s,icon:n,label:t,href:r,closeNav:a}){const{checkActiveNav:i}=Ma(),{t:l}=V();return e.jsxs(ue,{delayDuration:0,children:[e.jsx(xe,{asChild:!0,children:e.jsxs(Ys,{to:r,onClick:a,className:b(Tt({variant:i(r)?"secondary":"ghost",size:"icon"}),"h-12 w-12"),children:[n,e.jsx("span",{className:"sr-only",children:l(s)})]})}),e.jsxs(ce,{side:"right",className:"flex items-center gap-4",children:[l(s),t&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:l(t)})]})]})}function tm({title:s,icon:n,label:t,sub:r,closeNav:a}){const{checkActiveNav:i}=Ma(),{t:l}=V(),d=!!r?.find(u=>i(u.href));return e.jsxs(zs,{children:[e.jsxs(ue,{delayDuration:0,children:[e.jsx(xe,{asChild:!0,children:e.jsx($s,{asChild:!0,children:e.jsx(L,{variant:d?"secondary":"ghost",size:"icon",className:"h-12 w-12",children:n})})}),e.jsxs(ce,{side:"right",className:"flex items-center gap-4",children:[l(s)," ",t&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:l(t)}),e.jsx(Ar,{size:18,className:"-rotate-90 text-muted-foreground"})]})]}),e.jsxs(Ls,{side:"right",align:"start",sideOffset:4,children:[e.jsxs(Rn,{children:[l(s)," ",t?`(${l(t)})`:""]}),e.jsx(rt,{}),r.map(({title:u,icon:o,label:c,href:h})=>e.jsx(_e,{asChild:!0,children:e.jsxs(Ys,{to:h,onClick:a,className:`${i(h)?"bg-secondary":""}`,children:[o," ",e.jsx("span",{className:"ml-2 max-w-52 text-wrap",children:l(u)}),c&&e.jsx("span",{className:"ml-auto text-xs",children:l(c)})]})},`${l(u)}-${h}`))]})]})}const ql=[{title:"nav:dashboard",label:"",href:"/",icon:e.jsx(ko,{size:18})},{title:"nav:systemManagement",label:"",href:"",icon:e.jsx(To,{size:18}),sub:[{title:"nav:systemConfig",label:"",href:"/config/system",icon:e.jsx(qr,{size:18})},{title:"nav:pluginManagement",label:"",href:"/config/plugin",icon:e.jsx(wn,{size:18})},{title:"nav:themeConfig",label:"",href:"/config/theme",icon:e.jsx(Do,{size:18})},{title:"nav:noticeManagement",label:"",href:"/config/notice",icon:e.jsx(Po,{size:18})},{title:"nav:paymentConfig",label:"",href:"/config/payment",icon:e.jsx(Jn,{size:18})},{title:"nav:knowledgeManagement",label:"",href:"/config/knowledge",icon:e.jsx(Lo,{size:18})}]},{title:"nav:nodeManagement",label:"",href:"",icon:e.jsx(Hr,{size:18}),sub:[{title:"nav:nodeManagement",label:"",href:"/server/manage",icon:e.jsx(Ro,{size:18})},{title:"nav:permissionGroupManagement",label:"",href:"/server/group",icon:e.jsx(Ur,{size:18})},{title:"nav:routeManagement",label:"",href:"/server/route",icon:e.jsx(Eo,{size:18})}]},{title:"nav:subscriptionManagement",label:"",href:"",icon:e.jsx(Fo,{size:18}),sub:[{title:"nav:planManagement",label:"",href:"/finance/plan",icon:e.jsx(Io,{size:18})},{title:"nav:orderManagement",label:"",href:"/finance/order",icon:e.jsx(Jn,{size:18})},{title:"nav:couponManagement",label:"",href:"/finance/coupon",icon:e.jsx(Vo,{size:18})}]},{title:"nav:userManagement",label:"",href:"",icon:e.jsx(Mo,{size:18}),sub:[{title:"nav:userManagement",label:"",href:"/user/manage",icon:e.jsx(Oo,{size:18})},{title:"nav:ticketManagement",label:"",href:"/user/ticket",icon:e.jsx(Kr,{size:18})}]}];function am({className:s,isCollapsed:n,setIsCollapsed:t}){const[r,a]=m.useState(!1),{t:i}=V();return m.useEffect(()=>{r?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")},[r]),e.jsxs("aside",{className:b(`fixed left-0 right-0 top-0 z-50 flex h-auto flex-col border-r-2 border-r-muted transition-[width] md:bottom-0 md:right-auto md:h-svh ${n?"md:w-14":"md:w-64"}`,s),children:[e.jsx("div",{onClick:()=>a(!1),className:`absolute inset-0 transition-[opacity] delay-100 duration-700 ${r?"h-svh opacity-50":"h-0 opacity-0"} w-full bg-black md:hidden`}),e.jsxs(ze,{className:`flex h-full flex-col ${r?"h-[100vh] md:h-full":""}`,children:[e.jsxs($e,{className:"sticky top-0 justify-between px-4 py-3 shadow md:px-4",children:[e.jsxs("div",{className:`flex items-center ${n?"":"gap-2"}`,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",className:`transition-all ${n?"h-6 w-6":"h-8 w-8"}`,children:[e.jsx("rect",{width:"256",height:"256",fill:"none"}),e.jsx("line",{x1:"208",y1:"128",x2:"128",y2:"208",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("line",{x1:"192",y1:"40",x2:"40",y2:"192",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("span",{className:"sr-only",children:"Website Name"})]}),e.jsx("div",{className:`flex flex-col justify-end truncate ${n?"invisible w-0":"visible w-auto"}`,children:e.jsx("span",{className:"font-medium",children:window?.settings?.title})})]}),e.jsx(L,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":i("common:toggleNavigation"),"aria-controls":"sidebar-menu","aria-expanded":r,onClick:()=>a(l=>!l),children:r?e.jsx(zo,{}):e.jsx($o,{})})]}),e.jsx(Zd,{id:"sidebar-menu",className:b("flex-1 overflow-auto overscroll-contain",r?"block":"hidden md:block","md:py-2"),closeNav:()=>a(!1),isCollapsed:n,links:ql}),e.jsx("div",{className:b("border-t border-border/50 bg-background","px-4 py-2.5 text-xs text-muted-foreground",r?"block":"hidden md:block",n?"text-center":"text-left"),children:e.jsxs("div",{className:b("flex items-center gap-1.5",n?"justify-center":"justify-start"),children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),e.jsxs("span",{className:b("whitespace-nowrap tracking-wide","transition-opacity duration-200",n&&"md:opacity-0"),children:["v",window?.settings?.version]})]})}),e.jsx(L,{onClick:()=>t(l=>!l),size:"icon",variant:"outline",className:"absolute -right-5 top-1/2 hidden rounded-full md:inline-flex","aria-label":i("common:toggleSidebar"),children:e.jsx(Ao,{stroke:1.5,className:`h-5 w-5 ${n?"rotate-180":""}`})})]})]})}function nm(){const[s,n]=$l({key:"collapsed-sidebar",defaultValue:!1});return m.useEffect(()=>{const t=()=>{n(window.innerWidth<768?!1:s)};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[s,n]),[s,n]}function rm(){const[s,n]=nm();return e.jsxs("div",{className:"relative h-full overflow-hidden bg-background",children:[e.jsx(am,{isCollapsed:s,setIsCollapsed:n}),e.jsx("main",{id:"content",className:`overflow-x-hidden pt-16 transition-[margin] md:overflow-y-hidden md:pt-0 ${s?"md:ml-14":"md:ml-64"} h-full`,children:e.jsx(yn,{})})]})}const lm=Object.freeze(Object.defineProperty({__proto__:null,default:rm},Symbol.toStringTag,{value:"Module"})),Js=m.forwardRef(({className:s,...n},t)=>e.jsx(es,{ref:t,className:b("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",s),...n}));Js.displayName=es.displayName;const im=({children:s,...n})=>e.jsx(ge,{...n,children:e.jsx(de,{className:"overflow-hidden p-0",children:e.jsx(Js,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:s})})}),ut=m.forwardRef(({className:s,...n},t)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(qo,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(es.Input,{ref:t,className:b("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",s),...n})]}));ut.displayName=es.Input.displayName;const Qs=m.forwardRef(({className:s,...n},t)=>e.jsx(es.List,{ref:t,className:b("max-h-[300px] overflow-y-auto overflow-x-hidden",s),...n}));Qs.displayName=es.List.displayName;const xt=m.forwardRef((s,n)=>e.jsx(es.Empty,{ref:n,className:"py-6 text-center text-sm",...s}));xt.displayName=es.Empty.displayName;const fs=m.forwardRef(({className:s,...n},t)=>e.jsx(es.Group,{ref:t,className:b("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",s),...n}));fs.displayName=es.Group.displayName;const Pt=m.forwardRef(({className:s,...n},t)=>e.jsx(es.Separator,{ref:t,className:b("-mx-1 h-px bg-border",s),...n}));Pt.displayName=es.Separator.displayName;const We=m.forwardRef(({className:s,...n},t)=>e.jsx(es.Item,{ref:t,className:b("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",s),...n}));We.displayName=es.Item.displayName;function om(){const s=[];for(const n of ql)if(n.href&&s.push(n),n.sub)for(const t of n.sub)s.push({...t,parent:n.title});return s}function ns(){const[s,n]=m.useState(!1),t=As(),r=om(),{t:a}=V("search"),{t:i}=V("nav");m.useEffect(()=>{const d=u=>{u.key==="k"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),n(o=>!o))};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]);const l=m.useCallback(d=>{n(!1),t(d)},[t]);return e.jsxs(e.Fragment,{children:[e.jsxs(G,{variant:"outline",className:"relative h-9 w-9 p-0 xl:h-10 xl:w-60 xl:justify-start xl:px-3 xl:py-2",onClick:()=>n(!0),children:[e.jsx(Cn,{className:"h-4 w-4 xl:mr-2"}),e.jsx("span",{className:"hidden xl:inline-flex",children:a("placeholder")}),e.jsx("span",{className:"sr-only",children:a("shortcut.label")}),e.jsx("kbd",{className:"pointer-events-none absolute right-1.5 top-2 hidden h-6 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 xl:flex",children:a("shortcut.key")})]}),e.jsxs(im,{open:s,onOpenChange:n,children:[e.jsx(ut,{placeholder:a("placeholder")}),e.jsxs(Qs,{children:[e.jsx(xt,{children:a("noResults")}),e.jsx(fs,{heading:a("title"),children:r.map(d=>e.jsxs(We,{value:`${d.parent?d.parent+" ":""}${d.title}`,onSelect:()=>l(d.href),children:[e.jsx("div",{className:"mr-2",children:d.icon}),e.jsx("span",{children:i(d.title)}),d.parent&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i(d.parent)})]},d.href))})]})]})]})}function Ye(){const{theme:s,setTheme:n}=ud();return m.useEffect(()=>{const t=s==="dark"?"#020817":"#fff",r=document.querySelector("meta[name='theme-color']");r&&r.setAttribute("content",t)},[s]),e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"icon",variant:"ghost",className:"rounded-full",onClick:()=>n(s==="light"?"dark":"light"),children:s==="light"?e.jsx(Ho,{size:20}):e.jsx(Uo,{size:20})}),e.jsx(Vl,{})]})}const Hl=m.forwardRef(({className:s,...n},t)=>e.jsx(Br,{ref:t,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",s),...n}));Hl.displayName=Br.displayName;const Ul=m.forwardRef(({className:s,...n},t)=>e.jsx(Gr,{ref:t,className:b("aspect-square h-full w-full",s),...n}));Ul.displayName=Gr.displayName;const Kl=m.forwardRef(({className:s,...n},t)=>e.jsx(Wr,{ref:t,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",s),...n}));Kl.displayName=Wr.displayName;function Je(){const s=As(),n=kr(),t=Ko(Od),{t:r}=V(["common"]),a=()=>{Tl(),n(Md()),s("/sign-in")},i=t?.email?.split("@")[0]||r("common:user"),l=i.substring(0,2).toUpperCase();return e.jsxs(zs,{children:[e.jsx($s,{asChild:!0,children:e.jsx(L,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:e.jsxs(Hl,{className:"h-8 w-8",children:[e.jsx(Ul,{src:t?.avatar_url,alt:i}),e.jsx(Kl,{children:l})]})})}),e.jsxs(Ls,{className:"w-56",align:"end",forceMount:!0,children:[e.jsx(Rn,{className:"font-normal",children:e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("p",{className:"text-sm font-medium leading-none",children:i}),e.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:t?.email||r("common:defaultEmail")})]})}),e.jsx(rt,{}),e.jsx(_e,{asChild:!0,children:e.jsxs(Ys,{to:"/config/system",children:[r("common:settings"),e.jsx(pn,{children:"⌘S"})]})}),e.jsx(rt,{}),e.jsxs(_e,{onClick:a,children:[r("common:logout"),e.jsx(pn,{children:"⇧⌘Q"})]})]})]})}const J=Bo,rs=ec,Q=Go,W=m.forwardRef(({className:s,children:n,...t},r)=>e.jsxs(Yr,{ref:r,className:b("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...t,children:[n,e.jsx(Wo,{asChild:!0,children:e.jsx(Sn,{className:"h-4 w-4 opacity-50"})})]}));W.displayName=Yr.displayName;const Bl=m.forwardRef(({className:s,...n},t)=>e.jsx(Jr,{ref:t,className:b("flex cursor-default items-center justify-center py-1",s),...n,children:e.jsx(Yo,{className:"h-4 w-4"})}));Bl.displayName=Jr.displayName;const Gl=m.forwardRef(({className:s,...n},t)=>e.jsx(Qr,{ref:t,className:b("flex cursor-default items-center justify-center py-1",s),...n,children:e.jsx(Sn,{className:"h-4 w-4"})}));Gl.displayName=Qr.displayName;const Y=m.forwardRef(({className:s,children:n,position:t="popper",...r},a)=>e.jsx(Jo,{children:e.jsxs(Xr,{ref:a,className:b("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",t==="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",s),position:t,...r,children:[e.jsx(Bl,{}),e.jsx(Qo,{className:b("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),e.jsx(Gl,{})]})}));Y.displayName=Xr.displayName;const cm=m.forwardRef(({className:s,...n},t)=>e.jsx(Zr,{ref:t,className:b("px-2 py-1.5 text-sm font-semibold",s),...n}));cm.displayName=Zr.displayName;const $=m.forwardRef(({className:s,children:n,...t},r)=>e.jsxs(el,{ref:r,className:b("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...t,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Xo,{children:e.jsx(ot,{className:"h-4 w-4"})})}),e.jsx(Zo,{children:n})]}));$.displayName=el.displayName;const dm=m.forwardRef(({className:s,...n},t)=>e.jsx(sl,{ref:t,className:b("-mx-1 my-1 h-px bg-muted",s),...n}));dm.displayName=sl.displayName;function vs({className:s,classNames:n,showOutsideDays:t=!0,...r}){return e.jsx(sc,{showOutsideDays:t,className:b("p-3",s),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:b(St({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-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:b("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:b(St({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",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 aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...n},components:{IconLeft:({className:a,...i})=>e.jsx(tl,{className:b("h-4 w-4",a),...i}),IconRight:({className:a,...i})=>e.jsx(_n,{className:b("h-4 w-4",a),...i})},...r})}vs.displayName="Calendar";const os=ac,cs=nc,Ze=m.forwardRef(({className:s,align:n="center",sideOffset:t=4,...r},a)=>e.jsx(tc,{children:e.jsx(al,{ref:a,align:n,sideOffset:t,className:b("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",s),...r})}));Ze.displayName=al.displayName;const Us={income:{main:"hsl(var(--primary))",gradient:{start:"hsl(var(--primary))",end:"transparent"}},commission:{main:"hsl(var(--secondary))",gradient:{start:"hsl(var(--secondary))",end:"transparent"}}},$t=s=>(s/100).toFixed(2),mm=({active:s,payload:n,label:t})=>{const{t:r}=V();return s&&n&&n.length?e.jsxs("div",{className:"rounded-lg border bg-background p-3 shadow-sm",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:t}),n.map((a,i)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:a.color}}),e.jsxs("span",{className:"text-muted-foreground",children:[r(a.name),":"]}),e.jsx("span",{className:"font-medium",children:a.name.includes(r("dashboard:overview.amount"))?`¥${$t(a.value)}`:r("dashboard:overview.transactions",{count:a.value})})]},i))]}):null},um=[{value:"7d",label:"dashboard:overview.last7Days"},{value:"30d",label:"dashboard:overview.last30Days"},{value:"90d",label:"dashboard:overview.last90Days"},{value:"180d",label:"dashboard:overview.last180Days"},{value:"365d",label:"dashboard:overview.lastYear"},{value:"custom",label:"dashboard:overview.customRange"}],xm=(s,n)=>{const t=new Date;if(s==="custom"&&n)return{startDate:n.from,endDate:n.to};let r;switch(s){case"7d":r=ws(t,7);break;case"30d":r=ws(t,30);break;case"90d":r=ws(t,90);break;case"180d":r=ws(t,180);break;case"365d":r=ws(t,365);break;default:r=ws(t,30)}return{startDate:r,endDate:t}};function hm(){const[s,n]=m.useState("amount"),[t,r]=m.useState("30d"),[a,i]=m.useState({from:ws(new Date,7),to:new Date}),{t:l}=V(),{startDate:d,endDate:u}=xm(t,a),{data:o}=ne({queryKey:["orderStat",{start_date:Pe(d,"yyyy-MM-dd"),end_date:Pe(u,"yyyy-MM-dd")}],queryFn:async()=>{const{data:c}=await Ca.getOrderStat({start_date:Pe(d,"yyyy-MM-dd"),end_date:Pe(u,"yyyy-MM-dd")});return c},refetchInterval:3e4});return e.jsxs(Re,{children:[e.jsx(Fe,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(Ge,{children:l("dashboard:overview.title")}),e.jsxs(Os,{children:[o?.summary.start_date," ",l("dashboard:overview.to")," ",o?.summary.end_date]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsxs(J,{value:t,onValueChange:c=>r(c),children:[e.jsx(W,{className:"w-[120px]",children:e.jsx(Q,{placeholder:l("dashboard:overview.selectTimeRange")})}),e.jsx(Y,{children:um.map(c=>e.jsx($,{value:c.value,children:l(c.label)},c.value))})]}),t==="custom"&&e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(G,{variant:"outline",className:b("min-w-0 justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:a?.from?a.to?e.jsxs(e.Fragment,{children:[Pe(a.from,"yyyy-MM-dd")," -"," ",Pe(a.to,"yyyy-MM-dd")]}):Pe(a.from,"yyyy-MM-dd"):l("dashboard:overview.selectDate")})]})}),e.jsx(Ze,{className:"w-auto p-0",align:"end",children:e.jsx(vs,{mode:"range",defaultMonth:a?.from,selected:{from:a?.from,to:a?.to},onSelect:c=>{c?.from&&c?.to&&i({from:c.from,to:c.to})},numberOfMonths:2})})]})]}),e.jsx(Dt,{value:s,onValueChange:c=>n(c),children:e.jsxs(dt,{children:[e.jsx(Xe,{value:"amount",children:l("dashboard:overview.amount")}),e.jsx(Xe,{value:"count",children:l("dashboard:overview.count")})]})})]})]})}),e.jsxs(Ie,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:l("dashboard:overview.totalIncome")}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",$t(o?.summary?.paid_total||0)]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:l("dashboard:overview.totalTransactions",{count:o?.summary?.paid_count||0})}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[l("dashboard:overview.avgOrderAmount")," ¥",$t(o?.summary?.avg_paid_amount||0)]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:l("dashboard:overview.totalCommission")}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",$t(o?.summary?.commission_total||0)]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:l("dashboard:overview.totalTransactions",{count:o?.summary?.commission_count||0})}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[l("dashboard:overview.commissionRate")," ",o?.summary?.commission_rate.toFixed(2)||0,"%"]})]})]}),e.jsx("div",{className:"h-[400px] w-full",children:e.jsx(rc,{width:"100%",height:"100%",children:e.jsxs(lc,{data:o?.list||[],margin:{top:20,right:20,left:0,bottom:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"incomeGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:Us.income.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:Us.income.gradient.end,stopOpacity:.1})]}),e.jsxs("linearGradient",{id:"commissionGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:Us.commission.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:Us.commission.gradient.end,stopOpacity:.1})]})]}),e.jsx(ic,{dataKey:"date",axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:c=>Pe(new Date(c),"MM-dd",{locale:mc})}),e.jsx(oc,{axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:c=>s==="amount"?`¥${$t(c)}`:l("dashboard:overview.transactions",{count:c})}),e.jsx(cc,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))",opacity:.3}),e.jsx(dc,{content:e.jsx(mm,{})}),s==="amount"?e.jsxs(e.Fragment,{children:[e.jsx(Qn,{type:"monotone",dataKey:"paid_total",name:l("dashboard:overview.orderAmount"),stroke:Us.income.main,fill:"url(#incomeGradient)",strokeWidth:2}),e.jsx(Qn,{type:"monotone",dataKey:"commission_total",name:l("dashboard:overview.commissionAmount"),stroke:Us.commission.main,fill:"url(#commissionGradient)",strokeWidth:2})]}):e.jsxs(e.Fragment,{children:[e.jsx(Xn,{dataKey:"paid_count",name:l("dashboard:overview.orderCount"),fill:Us.income.main,radius:[4,4,0,0],maxBarSize:40}),e.jsx(Xn,{dataKey:"commission_count",name:l("dashboard:overview.commissionCount"),fill:Us.commission.main,radius:[4,4,0,0],maxBarSize:40})]})]})})})]})]})}function je({className:s,...n}){return e.jsx("div",{className:b("animate-pulse rounded-md bg-primary/10",s),...n})}function gm(){return e.jsxs(Re,{children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(je,{className:"h-4 w-[120px]"}),e.jsx(je,{className:"h-4 w-4"})]}),e.jsxs(Ie,{children:[e.jsx(je,{className:"h-8 w-[140px] mb-2"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(je,{className:"h-4 w-4"}),e.jsx(je,{className:"h-4 w-[100px]"})]})]})]})}function fm(){return e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:Array.from({length:8}).map((s,n)=>e.jsx(gm,{},n))})}var le=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.CANCELLED=2]="CANCELLED",s[s.COMPLETED=3]="COMPLETED",s[s.DISCOUNTED=4]="DISCOUNTED",s))(le||{});const Vt={0:"待支付",1:"开通中",2:"已取消",3:"已完成",4:"已折抵"},Mt={0:"yellow-500",1:"blue-500",2:"red-500",3:"green-500",4:"green-500"};var Cs=(s=>(s[s.NEW=1]="NEW",s[s.RENEWAL=2]="RENEWAL",s[s.UPGRADE=3]="UPGRADE",s[s.RESET_FLOW=4]="RESET_FLOW",s))(Cs||{}),Ne=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.VALID=2]="VALID",s[s.INVALID=3]="INVALID",s))(Ne||{});const ia={0:"待确认",1:"发放中",2:"有效",3:"无效"},oa={0:"yellow-500",1:"blue-500",2:"green-500",3:"red-500"};var qe=(s=>(s.MONTH_PRICE="month_price",s.QUARTER_PRICE="quarter_price",s.HALF_YEAR_PRICE="half_year_price",s.YEAR_PRICE="year_price",s.TWO_YEAR_PRICE="two_year_price",s.THREE_YEAR_PRICE="three_year_price",s.ONETIME_PRICE="onetime_price",s.RESET_PRICE="reset_price",s))(qe||{});const pm={month_price:"月付",quarter_price:"季付",half_year_price:"半年付",year_price:"年付",two_year_price:"两年付",three_year_price:"三年付",onetime_price:"一次性",reset_price:"流量重置包"};var oe=(s=>(s.Shadowsocks="shadowsocks",s.Vmess="vmess",s.Trojan="trojan",s.Hysteria="hysteria",s.Vless="vless",s.Tuic="tuic",s.Socks="socks",s.Naive="naive",s.Http="http",s.Mieru="mieru",s.AnyTLS="anytls",s))(oe||{});const js=[{type:"shadowsocks",label:"Shadowsocks"},{type:"vmess",label:"VMess"},{type:"trojan",label:"Trojan"},{type:"hysteria",label:"Hysteria"},{type:"vless",label:"VLess"},{type:"tuic",label:"TUIC"},{type:"socks",label:"SOCKS"},{type:"naive",label:"Naive"},{type:"http",label:"HTTP"},{type:"mieru",label:"Mieru"},{type:"anytls",label:"AnyTLS"}],is={shadowsocks:"#489851",vmess:"#CB3180",trojan:"#EBB749",hysteria:"#5684e6",vless:"#1a1a1a",tuic:"#00C853",socks:"#2196F3",naive:"#9C27B0",http:"#FF5722",mieru:"#4CAF50",anytls:"#7E57C2"};var hs=(s=>(s[s.AMOUNT=1]="AMOUNT",s[s.PERCENTAGE=2]="PERCENTAGE",s))(hs||{});const jm={1:"按金额优惠",2:"按比例优惠"};var Ws=(s=>(s[s.OPENING=0]="OPENING",s[s.CLOSED=1]="CLOSED",s))(Ws||{}),Qe=(s=>(s[s.LOW=0]="LOW",s[s.MIDDLE=1]="MIDDLE",s[s.HIGH=2]="HIGH",s))(Qe||{}),Gt=(s=>(s.MONTH="monthly",s.QUARTER="quarterly",s.HALF_YEAR="half_yearly",s.YEAR="yearly",s.TWO_YEAR="two_yearly",s.THREE_YEAR="three_yearly",s.ONETIME="onetime",s.RESET="reset_traffic",s))(Gt||{});function Ks({title:s,value:n,icon:t,trend:r,description:a,onClick:i,highlight:l,className:d}){return e.jsxs(Re,{className:b("transition-colors",i&&"cursor-pointer hover:bg-muted/50",l&&"border-primary/50",d),onClick:i,children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ge,{className:"text-sm font-medium",children:s}),t]}),e.jsxs(Ie,{children:[e.jsx("div",{className:"text-2xl font-bold",children:n}),r?e.jsxs("div",{className:"flex items-center pt-1",children:[e.jsx(gc,{className:b("h-4 w-4",r.isPositive?"text-emerald-500":"text-red-500")}),e.jsxs("span",{className:b("ml-1 text-xs",r.isPositive?"text-emerald-500":"text-red-500"),children:[r.isPositive?"+":"-",Math.abs(r.value),"%"]}),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:r.label})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:a})]})]})}function vm({className:s}){const n=As(),{t}=V(),{data:r,isLoading:a}=ne({queryKey:["dashboardStats"],queryFn:async()=>(await Ca.getStatsData()).data,refetchInterval:1e3*60*5});if(a||!r)return e.jsx(fm,{});const i=()=>{const l=new URLSearchParams;l.set("commission_status",Ne.PENDING.toString()),l.set("status",le.COMPLETED.toString()),l.set("commission_balance","gt:0"),n(`/finance/order?${l.toString()}`)};return e.jsxs("div",{className:b("grid gap-4 md:grid-cols-2 lg:grid-cols-4",s),children:[e.jsx(Ks,{title:t("dashboard:stats.todayIncome"),value:Vs(r.todayIncome),icon:e.jsx(uc,{className:"h-4 w-4 text-emerald-500"}),trend:{value:r.dayIncomeGrowth,label:t("dashboard:stats.vsYesterday"),isPositive:r.dayIncomeGrowth>0}}),e.jsx(Ks,{title:t("dashboard:stats.monthlyIncome"),value:Vs(r.currentMonthIncome),icon:e.jsx(kn,{className:"h-4 w-4 text-blue-500"}),trend:{value:r.monthIncomeGrowth,label:t("dashboard:stats.vsLastMonth"),isPositive:r.monthIncomeGrowth>0}}),e.jsx(Ks,{title:t("dashboard:stats.pendingTickets"),value:r.ticketPendingTotal,icon:e.jsx(xc,{className:b("h-4 w-4",r.ticketPendingTotal>0?"text-orange-500":"text-muted-foreground")}),description:r.ticketPendingTotal>0?t("dashboard:stats.hasPendingTickets"):t("dashboard:stats.noPendingTickets"),onClick:()=>n("/user/ticket"),highlight:r.ticketPendingTotal>0}),e.jsx(Ks,{title:t("dashboard:stats.pendingCommission"),value:r.commissionPendingTotal,icon:e.jsx(hc,{className:b("h-4 w-4",r.commissionPendingTotal>0?"text-blue-500":"text-muted-foreground")}),description:r.commissionPendingTotal>0?t("dashboard:stats.hasPendingCommission"):t("dashboard:stats.noPendingCommission"),onClick:i,highlight:r.commissionPendingTotal>0}),e.jsx(Ks,{title:t("dashboard:stats.monthlyNewUsers"),value:r.currentMonthNewUsers,icon:e.jsx(ja,{className:"h-4 w-4 text-blue-500"}),trend:{value:r.userGrowth,label:t("dashboard:stats.vsLastMonth"),isPositive:r.userGrowth>0}}),e.jsx(Ks,{title:t("dashboard:stats.totalUsers"),value:r.totalUsers,icon:e.jsx(ja,{className:"h-4 w-4 text-muted-foreground"}),description:t("dashboard:stats.activeUsers",{count:r.activeUsers})}),e.jsx(Ks,{title:t("dashboard:stats.monthlyUpload"),value:Oe(r.monthTraffic.upload),icon:e.jsx(wt,{className:"h-4 w-4 text-emerald-500"}),description:t("dashboard:stats.todayTraffic",{value:Oe(r.todayTraffic.upload)})}),e.jsx(Ks,{title:t("dashboard:stats.monthlyDownload"),value:Oe(r.monthTraffic.download),icon:e.jsx(va,{className:"h-4 w-4 text-blue-500"}),description:t("dashboard:stats.todayTraffic",{value:Oe(r.todayTraffic.download)})})]})}const lt=m.forwardRef(({className:s,children:n,...t},r)=>e.jsxs(nl,{ref:r,className:b("relative overflow-hidden",s),...t,children:[e.jsx(fc,{className:"h-full w-full rounded-[inherit]",children:n}),e.jsx(ka,{}),e.jsx(pc,{})]}));lt.displayName=nl.displayName;const ka=m.forwardRef(({className:s,orientation:n="vertical",...t},r)=>e.jsx(rl,{ref:r,orientation:n,className:b("flex touch-none select-none transition-colors",n==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",n==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...t,children:e.jsx(jc,{className:"relative flex-1 rounded-full bg-border"})}));ka.displayName=rl.displayName;const jn={today:{getValue:()=>{const s=bc();return{start:s,end:yc(s,1)}}},last7days:{getValue:()=>{const s=new Date;return{start:ws(s,7),end:s}}},last30days:{getValue:()=>{const s=new Date;return{start:ws(s,30),end:s}}},custom:{getValue:()=>null}};function ur({selectedRange:s,customDateRange:n,onRangeChange:t,onCustomRangeChange:r}){const{t:a}=V(),i={today:a("dashboard:trafficRank.today"),last7days:a("dashboard:trafficRank.last7days"),last30days:a("dashboard:trafficRank.last30days"),custom:a("dashboard:trafficRank.customRange")};return e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[e.jsxs(J,{value:s,onValueChange:t,children:[e.jsx(W,{className:"w-[120px]",children:e.jsx(Q,{placeholder:a("dashboard:trafficRank.selectTimeRange")})}),e.jsx(Y,{position:"popper",className:"z-50",children:Object.entries(jn).map(([l])=>e.jsx($,{value:l,children:i[l]},l))})]}),s==="custom"&&e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(G,{variant:"outline",className:b("min-w-0 justify-start text-left font-normal",!n&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:n?.from?n.to?e.jsxs(e.Fragment,{children:[Pe(n.from,"yyyy-MM-dd")," -"," ",Pe(n.to,"yyyy-MM-dd")]}):Pe(n.from,"yyyy-MM-dd"):e.jsx("span",{children:a("dashboard:trafficRank.selectDateRange")})})]})}),e.jsx(Ze,{className:"w-auto p-0",align:"end",children:e.jsx(vs,{mode:"range",defaultMonth:n?.from,selected:{from:n?.from,to:n?.to},onSelect:l=>{l?.from&&l?.to&&r({from:l.from,to:l.to})},numberOfMonths:2})})]})]})}const jt=s=>`${(s/1024/1024/1024).toFixed(2)} GB`;function bm({className:s}){const{t:n}=V(),[t,r]=m.useState("today"),[a,i]=m.useState({from:ws(new Date,7),to:new Date}),[l,d]=m.useState("today"),[u,o]=m.useState({from:ws(new Date,7),to:new Date}),c=m.useMemo(()=>t==="custom"?{start:a.from,end:a.to}:jn[t].getValue(),[t,a]),h=m.useMemo(()=>l==="custom"?{start:u.from,end:u.to}:jn[l].getValue(),[l,u]),{data:k}=ne({queryKey:["nodeTrafficRank",c.start,c.end],queryFn:()=>Ca.getNodeTrafficData({type:"node",start_time:ke.round(c.start.getTime()/1e3),end_time:ke.round(c.end.getTime()/1e3)}),refetchInterval:3e4}),{data:C}=ne({queryKey:["userTrafficRank",h.start,h.end],queryFn:()=>Ca.getNodeTrafficData({type:"user",start_time:ke.round(h.start.getTime()/1e3),end_time:ke.round(h.end.getTime()/1e3)}),refetchInterval:3e4});return e.jsxs("div",{className:b("grid gap-4 md:grid-cols-2",s),children:[e.jsxs(Re,{children:[e.jsx(Fe,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(Ge,{className:"flex items-center text-base font-medium",children:[e.jsx(vc,{className:"mr-2 h-4 w-4"}),n("dashboard:trafficRank.nodeTrafficRank")]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(ur,{selectedRange:t,customDateRange:a,onRangeChange:r,onCustomRangeChange:i}),e.jsx(Zn,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(Ie,{className:"flex-1",children:k?.data?e.jsxs(lt,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:k.data.map(S=>e.jsx(be,{delayDuration:200,children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:S.name}),e.jsxs("span",{className:b("ml-2 flex items-center text-xs font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?e.jsx(dn,{className:"mr-1 h-3 w-3"}):e.jsx(mn,{className:"mr-1 h-3 w-3"}),Math.abs(S.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${S.value/k.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:jt(S.value)})]})]})})}),e.jsx(ce,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.currentTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:jt(S.value)}),e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.previousTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:jt(S.previousValue)}),e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.changeRate"),":"]}),e.jsxs("span",{className:b("font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?"+":"",S.change,"%"]})]})})]})},S.id))}),e.jsx(ka,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:n("common:loading")})})})]}),e.jsxs(Re,{children:[e.jsx(Fe,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(Ge,{className:"flex items-center text-base font-medium",children:[e.jsx(ja,{className:"mr-2 h-4 w-4"}),n("dashboard:trafficRank.userTrafficRank")]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(ur,{selectedRange:l,customDateRange:u,onRangeChange:d,onCustomRangeChange:o}),e.jsx(Zn,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(Ie,{className:"flex-1",children:C?.data?e.jsxs(lt,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:C.data.map(S=>e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:S.name}),e.jsxs("span",{className:b("ml-2 flex items-center text-xs font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?e.jsx(dn,{className:"mr-1 h-3 w-3"}):e.jsx(mn,{className:"mr-1 h-3 w-3"}),Math.abs(S.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${S.value/C.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:jt(S.value)})]})]})})}),e.jsx(ce,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.currentTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:jt(S.value)}),e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.previousTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:jt(S.previousValue)}),e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.changeRate"),":"]}),e.jsxs("span",{className:b("font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?"+":"",S.change,"%"]})]})})]})},S.id))}),e.jsx(ka,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:n("common:loading")})})})]})]})}const ym=it("inline-flex items-center rounded-md 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 shadow hover:bg-primary/10",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function U({className:s,variant:n,...t}){return e.jsx("div",{className:b(ym({variant:n}),s),...t})}const ha=m.forwardRef(({className:s,value:n,...t},r)=>e.jsx(ll,{ref:r,className:b("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",s),...t,children:e.jsx(Nc,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(n||0)}%)`}})}));ha.displayName=ll.displayName;const En=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:t,className:b("w-full caption-bottom text-sm",s),...n})}));En.displayName="Table";const Fn=m.forwardRef(({className:s,...n},t)=>e.jsx("thead",{ref:t,className:b("[&_tr]:border-b",s),...n}));Fn.displayName="TableHeader";const In=m.forwardRef(({className:s,...n},t)=>e.jsx("tbody",{ref:t,className:b("[&_tr:last-child]:border-0",s),...n}));In.displayName="TableBody";const Nm=m.forwardRef(({className:s,...n},t)=>e.jsx("tfoot",{ref:t,className:b("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...n}));Nm.displayName="TableFooter";const Bs=m.forwardRef(({className:s,...n},t)=>e.jsx("tr",{ref:t,className:b("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...n}));Bs.displayName="TableRow";const Vn=m.forwardRef(({className:s,...n},t)=>e.jsx("th",{ref:t,className:b("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...n}));Vn.displayName="TableHead";const _t=m.forwardRef(({className:s,...n},t)=>e.jsx("td",{ref:t,className:b("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...n}));_t.displayName="TableCell";const _m=m.forwardRef(({className:s,...n},t)=>e.jsx("caption",{ref:t,className:b("mt-4 text-sm text-muted-foreground",s),...n}));_m.displayName="TableCaption";function Mn({table:s}){const[n,t]=m.useState(""),{t:r}=V("common");m.useEffect(()=>{t((s.getState().pagination.pageIndex+1).toString())},[s.getState().pagination.pageIndex]);const a=i=>{const l=parseInt(i);!isNaN(l)&&l>=1&&l<=s.getPageCount()?s.setPageIndex(l-1):t((s.getState().pagination.pageIndex+1).toString())};return e.jsxs("div",{className:"flex flex-col-reverse gap-4 px-2 py-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{className:"flex-1 text-sm text-muted-foreground",children:r("table.pagination.selected",{selected:s.getFilteredSelectedRowModel().rows.length,total:s.getFilteredRowModel().rows.length})}),e.jsxs("div",{className:"flex flex-col-reverse items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:r("table.pagination.itemsPerPage")}),e.jsxs(J,{value:`${s.getState().pagination.pageSize}`,onValueChange:i=>{s.setPageSize(Number(i))},children:[e.jsx(W,{className:"h-8 w-[70px]",children:e.jsx(Q,{placeholder:s.getState().pagination.pageSize})}),e.jsx(Y,{side:"top",children:[10,20,30,40,50,100,500].map(i=>e.jsx($,{value:`${i}`,children:i},i))})]})]}),e.jsxs("div",{className:"flex items-center justify-center space-x-2 text-sm font-medium",children:[e.jsx("span",{children:r("table.pagination.page")}),e.jsx(P,{type:"text",value:n,onChange:i=>t(i.target.value),onBlur:i=>a(i.target.value),onKeyDown:i=>{i.key==="Enter"&&a(i.currentTarget.value)},className:"h-8 w-[50px] text-center"}),e.jsx("span",{children:r("table.pagination.pageOf",{total:s.getPageCount()})})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(L,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(0),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:r("table.pagination.firstPage")}),e.jsx(_c,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.previousPage(),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:r("table.pagination.previousPage")}),e.jsx(tl,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.nextPage(),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:r("table.pagination.nextPage")}),e.jsx(_n,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(s.getPageCount()-1),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:r("table.pagination.lastPage")}),e.jsx(wc,{className:"h-4 w-4"})]})]})]})]})}function xs({table:s,toolbar:n,draggable:t=!1,onDragStart:r,onDragEnd:a,onDragOver:i,onDragLeave:l,onDrop:d,showPagination:u=!0,isLoading:o=!1}){const{t:c}=V("common"),h=m.useRef(null),k=s.getAllColumns().filter(N=>N.getIsPinned()==="left"),C=s.getAllColumns().filter(N=>N.getIsPinned()==="right"),S=N=>k.slice(0,N).reduce((_,T)=>_+(T.getSize()??0),0),f=N=>C.slice(N+1).reduce((_,T)=>_+(T.getSize()??0),0);return e.jsxs("div",{className:"space-y-4",children:[typeof n=="function"?n(s):n,e.jsx("div",{ref:h,className:"relative overflow-auto rounded-md border bg-card",children:e.jsx("div",{className:"overflow-auto",children:e.jsxs(En,{children:[e.jsx(Fn,{children:s.getHeaderGroups().map(N=>e.jsx(Bs,{className:"hover:bg-transparent",children:N.headers.map((_,T)=>{const D=_.column.getIsPinned()==="left",g=_.column.getIsPinned()==="right",w=D?S(k.indexOf(_.column)):void 0,R=g?f(C.indexOf(_.column)):void 0;return e.jsx(Vn,{colSpan:_.colSpan,style:{width:_.getSize(),...D&&{left:w},...g&&{right:R}},className:b("h-11 bg-card px-4 text-muted-foreground",(D||g)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",D&&"before:right-0",g&&"before:left-0"]),children:_.isPlaceholder?null:ba(_.column.columnDef.header,_.getContext())},_.id)})},N.id))}),e.jsx(In,{children:s.getRowModel().rows?.length?s.getRowModel().rows.map((N,_)=>e.jsx(Bs,{"data-state":N.getIsSelected()&&"selected",className:"hover:bg-muted/50",draggable:t,onDragStart:T=>r?.(T,_),onDragEnd:a,onDragOver:i,onDragLeave:l,onDrop:T=>d?.(T,_),children:N.getVisibleCells().map((T,D)=>{const g=T.column.getIsPinned()==="left",w=T.column.getIsPinned()==="right",R=g?S(k.indexOf(T.column)):void 0,H=w?f(C.indexOf(T.column)):void 0;return e.jsx(_t,{style:{width:T.column.getSize(),...g&&{left:R},...w&&{right:H}},className:b("bg-card",(g||w)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",g&&"before:right-0",w&&"before:left-0"]),children:ba(T.column.columnDef.cell,T.getContext())},T.id)})},N.id)):e.jsx(Bs,{children:e.jsx(_t,{colSpan:s.getAllColumns().length,className:"h-24 text-center",children:c("table.noData")})})})]})})}),u&&e.jsx(Mn,{table:s})]})}const ga=s=>{if(!s)return"";let n;if(typeof s=="string"){if(n=parseInt(s),isNaN(n))return s}else n=s;return(n.toString().length===10?new Date(n*1e3):new Date(n)).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})},Ot=il(),zt=il();function ca({data:s,isLoading:n,searchKeyword:t,selectedLevel:r,total:a,currentPage:i,pageSize:l,onViewDetail:d,onPageChange:u}){const{t:o}=V(),c=C=>{switch(C.toLowerCase()){case"info":return e.jsx(qt,{className:"h-4 w-4 text-blue-500"});case"warning":return e.jsx(Ht,{className:"h-4 w-4 text-yellow-500"});case"error":return e.jsx(xn,{className:"h-4 w-4 text-red-500"});default:return e.jsx(qt,{className:"h-4 w-4 text-slate-500"})}},h=m.useMemo(()=>[Ot.accessor("level",{id:"level",header:()=>o("dashboard:systemLog.level","级别"),size:80,cell:({getValue:C,row:S})=>{const f=C();return e.jsxs("div",{className:"flex items-center gap-1",children:[c(f),e.jsx("span",{className:b(f.toLowerCase()==="error"&&"text-red-600",f.toLowerCase()==="warning"&&"text-yellow-600",f.toLowerCase()==="info"&&"text-blue-600"),children:f})]})}}),Ot.accessor("created_at",{id:"created_at",header:()=>o("dashboard:systemLog.time","时间"),size:160,cell:({getValue:C})=>ga(C())}),Ot.accessor(C=>C.title||C.message||"",{id:"title",header:()=>o("dashboard:systemLog.logTitle","标题"),cell:({getValue:C})=>e.jsx("span",{className:"inline-block max-w-[300px] truncate",children:C()})}),Ot.accessor("method",{id:"method",header:()=>o("dashboard:systemLog.method","请求方法"),size:100,cell:({getValue:C})=>{const S=C();return S?e.jsx(U,{variant:"outline",className:b(S==="GET"&&"border-blue-200 bg-blue-50 text-blue-700",S==="POST"&&"border-green-200 bg-green-50 text-green-700",S==="PUT"&&"border-amber-200 bg-amber-50 text-amber-700",S==="DELETE"&&"border-red-200 bg-red-50 text-red-700"),children:S}):null}}),Ot.display({id:"actions",header:()=>o("dashboard:systemLog.action","操作"),size:80,cell:({row:C})=>e.jsx(G,{variant:"ghost",size:"sm",onClick:()=>d(C.original),"aria-label":o("dashboard:systemLog.viewDetail","查看详情"),children:e.jsx(un,{className:"h-4 w-4"})})})],[o,d]),k=ss({data:s,columns:h,getCoreRowModel:ts(),getPaginationRowModel:us(),pageCount:Math.ceil(a/l),manualPagination:!0,state:{pagination:{pageIndex:i-1,pageSize:l}},onPaginationChange:C=>{if(typeof C=="function"){const S=C({pageIndex:i-1,pageSize:l});u(S.pageIndex+1)}else u(C.pageIndex+1)}});return e.jsxs("div",{className:"overflow-x-auto",children:[e.jsx(xs,{table:k,showPagination:!1,isLoading:n}),e.jsx(Mn,{table:k}),(t||r&&r!=="all")&&e.jsx("div",{className:"text-center text-sm text-muted-foreground",children:t&&r&&r!=="all"?`筛选结果: 包含"${t}"且级别为"${r}"的日志共 ${a} 条`:t?`搜索结果: 包含"${t}"的日志共 ${a} 条`:`筛选结果: 级别为"${r}"的日志共 ${a} 条`})]})}function wm(){const{t:s}=V(),[n,t]=m.useState(0),[r,a]=m.useState(!1),[i,l]=m.useState(1),[d]=m.useState(10),[u,o]=m.useState(null),[c,h]=m.useState(!1),[k,C]=m.useState(!1),[S,f]=m.useState(1),[N]=m.useState(10),[_,T]=m.useState(null),[D,g]=m.useState(!1),[w,R]=m.useState(""),[H,I]=m.useState(""),[K,ae]=m.useState("all"),[ee,te]=m.useState(!1),[q,F]=m.useState(30),[X,Ns]=m.useState("all"),[De,ie]=m.useState(1e3),[_s,Fs]=m.useState(!1),[Xs,Lt]=m.useState(null),[Zt,Rt]=m.useState(!1);m.useEffect(()=>{const B=setTimeout(()=>{I(w),w!==H&&f(1)},500);return()=>clearTimeout(B)},[w]);const{data:qs,isLoading:Ja,refetch:se,isRefetching:pe}=ne({queryKey:["systemStatus",n],queryFn:async()=>(await he.getSystemStatus()).data,refetchInterval:3e4}),{data:re,isLoading:Zs,refetch:jg,isRefetching:Un}=ne({queryKey:["queueStats",n],queryFn:async()=>(await he.getQueueStats()).data,refetchInterval:3e4}),{data:Kn,isLoading:_i,refetch:wi}=ne({queryKey:["failedJobs",i,d],queryFn:async()=>{const B=await he.getHorizonFailedJobs({current:i,page_size:d});return{data:B.data,total:B.total||0}},enabled:r}),{data:Bn,isLoading:ea,refetch:Ci}=ne({queryKey:["systemLogs",S,N,K,H],queryFn:async()=>{const B={current:S,page_size:N};K&&K!=="all"&&(B.level=K),H.trim()&&(B.keyword=H.trim());const Hs=await he.getSystemLog(B);return{data:Hs.data,total:Hs.total||0}},enabled:k}),Gn=Kn?.data||[],Si=Kn?.total||0,sa=Bn?.data||[],ta=Bn?.total||0,ki=m.useMemo(()=>[zt.display({id:"failed_at",header:()=>s("dashboard:queue.details.time","时间"),cell:({row:B})=>ga(B.original.failed_at)}),zt.display({id:"queue",header:()=>s("dashboard:queue.details.queue","队列"),cell:({row:B})=>B.original.queue}),zt.display({id:"name",header:()=>s("dashboard:queue.details.name","任务名称"),cell:({row:B})=>e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("span",{className:"inline-block max-w-[150px] truncate",children:B.original.name})}),e.jsx(ce,{children:e.jsx("span",{children:B.original.name})})]})})}),zt.display({id:"exception",header:()=>s("dashboard:queue.details.exception","异常信息"),cell:({row:B})=>e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("span",{className:"inline-block max-w-[200px] truncate",children:B.original.exception.split(` -`)[0]})}),e.jsx(ce,{className:"max-w-[300px] whitespace-pre-wrap",children:e.jsx("span",{children:B.original.exception})})]})})}),zt.display({id:"actions",header:()=>s("dashboard:queue.details.action","操作"),size:80,cell:({row:B})=>e.jsx(G,{variant:"ghost",size:"sm",onClick:()=>Li(B.original),"aria-label":s("dashboard:queue.details.viewDetail","查看详情"),children:e.jsx(un,{className:"h-4 w-4"})})})],[s]),Wn=ss({data:Gn,columns:ki,getCoreRowModel:ts(),getPaginationRowModel:us(),pageCount:Math.ceil(Si/d),manualPagination:!0,state:{pagination:{pageIndex:i-1,pageSize:d}},onPaginationChange:B=>{if(typeof B=="function"){const Hs=B({pageIndex:i-1,pageSize:d});Yn(Hs.pageIndex+1)}else Yn(B.pageIndex+1)}}),Ti=()=>{t(B=>B+1)},Yn=B=>{l(B)},aa=B=>{f(B)},Di=B=>{ae(B),f(1)},Pi=()=>{R(""),I(""),ae("all"),f(1)},na=B=>{T(B),g(!0)},Li=B=>{o(B),h(!0)},Ri=async()=>{try{const B=await he.getLogClearStats({days:q,level:X==="all"?void 0:X});Lt(B.data),Rt(!0)}catch(B){console.error("获取清理统计失败:",B),A.error("获取清理统计失败")}},Ei=async()=>{Fs(!0);try{const B=await he.clearSystemLog({days:q,level:X==="all"?void 0:X,limit:De});B.data.status==="success"?(A.success(`清理完成!已清理 ${B.data.cleared_count} 条日志`),te(!1),Rt(!1),Lt(null),se()):A.error(B.data.message||"清理失败")}catch(B){console.error("清理日志失败:",B),A.error("清理日志失败")}finally{Fs(!1)}};if(Ja||Zs)return e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(ya,{className:"h-6 w-6 animate-spin"})});const Fi=B=>B?e.jsx(ol,{className:"h-5 w-5 text-green-500"}):e.jsx(cl,{className:"h-5 w-5 text-red-500"});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(Re,{children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"flex items-center gap-2",children:[e.jsx(Cc,{className:"h-5 w-5"}),s("dashboard:queue.title")]}),e.jsx(Os,{children:s("dashboard:queue.status.description")})]}),e.jsx(G,{variant:"outline",size:"icon",onClick:Ti,disabled:pe||Un,children:e.jsx(Qa,{className:b("h-4 w-4",(pe||Un)&&"animate-spin")})})]}),e.jsx(Ie,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[Fi(re?.status||!1),e.jsx("span",{className:"font-medium",children:s("dashboard:queue.status.running")})]}),e.jsx(U,{variant:re?.status?"secondary":"destructive",children:re?.status?s("dashboard:queue.status.normal"):s("dashboard:queue.status.abnormal")})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.status.waitTime",{seconds:re?.wait?.default||0})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.recentJobs")}),e.jsx("p",{className:"text-2xl font-bold",children:re?.recentJobs||0}),e.jsx(ha,{value:(re?.recentJobs||0)/(re?.periods?.recentJobs||1)*100,className:"h-1"})]})}),e.jsx(ce,{children:e.jsx("p",{children:s("dashboard:queue.details.statisticsPeriod",{hours:re?.periods?.recentJobs||0})})})]})}),e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.jobsPerMinute")}),e.jsx("p",{className:"text-2xl font-bold",children:re?.jobsPerMinute||0}),e.jsx(ha,{value:(re?.jobsPerMinute||0)/(re?.queueWithMaxThroughput?.throughput||1)*100,className:"h-1"})]})}),e.jsx(ce,{children:e.jsx("p",{children:s("dashboard:queue.details.maxThroughput",{value:re?.queueWithMaxThroughput?.throughput||0})})})]})})]})]})})]}),e.jsxs(Re,{children:[e.jsxs(Fe,{children:[e.jsxs(Ge,{className:"flex items-center gap-2",children:[e.jsx(Sc,{className:"h-5 w-5"}),s("dashboard:queue.jobDetails")]}),e.jsx(Os,{children:s("dashboard:queue.details.description")})]}),e.jsx(Ie,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.failedJobs7Days")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"cursor-pointer text-2xl font-bold text-destructive hover:underline",title:s("dashboard:queue.details.viewFailedJobs"),onClick:()=>a(!0),style:{userSelect:"none"},children:re?.failedJobs||0}),e.jsx(un,{className:"h-4 w-4 cursor-pointer text-muted-foreground hover:text-destructive",onClick:()=>a(!0),"aria-label":s("dashboard:queue.details.viewFailedJobs")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("dashboard:queue.details.retentionPeriod",{hours:re?.periods?.failedJobs||0})})]}),e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.longestRunningQueue")}),e.jsxs("p",{className:"text-2xl font-bold",children:[re?.queueWithMaxRuntime?.runtime||0,"s"]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:re?.queueWithMaxRuntime?.name||"N/A"})]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.activeProcesses")}),e.jsxs("span",{className:"font-medium",children:[re?.processes||0," /"," ",(re?.processes||0)+(re?.pausedMasters||0)]})]}),e.jsx(ha,{value:(re?.processes||0)/((re?.processes||0)+(re?.pausedMasters||0))*100,className:"mt-2 h-1"})]})]})})]})]}),e.jsxs(Re,{children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"flex items-center gap-2",children:[e.jsx(er,{className:"h-5 w-5"}),s("dashboard:systemLog.title","系统日志")]}),e.jsx(Os,{children:s("dashboard:systemLog.description","查看系统运行日志记录")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(G,{variant:"outline",onClick:()=>C(!0),children:s("dashboard:systemLog.viewAll","查看全部")}),e.jsxs(G,{variant:"outline",onClick:()=>te(!0),className:"text-destructive hover:text-destructive",children:[e.jsx(ds,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.clearLogs","清理日志")]})]})]}),e.jsx(Ie,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-900 dark:bg-blue-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qt,{className:"h-5 w-5 text-blue-500"}),e.jsx("p",{className:"font-medium text-blue-700 dark:text-blue-300",children:s("dashboard:systemLog.tabs.info","信息")})]}),e.jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:qs?.logs?.info||0})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-yellow-200 bg-yellow-50 p-3 dark:border-yellow-900 dark:bg-yellow-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ht,{className:"h-5 w-5 text-yellow-500"}),e.jsx("p",{className:"font-medium text-yellow-700 dark:text-yellow-300",children:s("dashboard:systemLog.tabs.warning","警告")})]}),e.jsx("p",{className:"text-2xl font-bold text-yellow-700 dark:text-yellow-300",children:qs?.logs?.warning||0})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-900 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xn,{className:"h-5 w-5 text-red-500"}),e.jsx("p",{className:"font-medium text-red-700 dark:text-red-300",children:s("dashboard:systemLog.tabs.error","错误")})]}),e.jsx("p",{className:"text-2xl font-bold text-red-700 dark:text-red-300",children:qs?.logs?.error||0})]})]}),qs?.logs&&qs.logs.total>0&&e.jsxs("div",{className:"mt-3 text-center text-sm text-muted-foreground",children:[s("dashboard:systemLog.totalLogs","总日志数"),":"," ",qs.logs.total]})]})})]}),e.jsx(ge,{open:r,onOpenChange:a,children:e.jsxs(de,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(ve,{children:e.jsx(fe,{children:s("dashboard:queue.details.failedJobsDetailTitle","失败任务详情")})}),e.jsxs("div",{className:"overflow-x-auto",children:[e.jsx(xs,{table:Wn,showPagination:!1,isLoading:_i}),e.jsx(Mn,{table:Wn}),Gn.length===0&&e.jsx("div",{className:"py-8 text-center text-muted-foreground",children:s("dashboard:queue.details.noFailedJobs","暂无失败任务")})]}),e.jsxs(Le,{children:[e.jsxs(G,{variant:"outline",onClick:()=>wi(),children:[e.jsx(Qa,{className:"mr-2 h-4 w-4"}),s("dashboard:common.refresh","刷新")]}),e.jsx(Gs,{asChild:!0,children:e.jsx(G,{variant:"outline",children:s("common.close","关闭")})})]})]})}),e.jsx(ge,{open:c,onOpenChange:h,children:e.jsxs(de,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(ve,{children:e.jsx(fe,{children:s("dashboard:queue.details.jobDetailTitle","任务详情")})}),u&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.id","任务ID")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:u.id})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.time","时间")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.failed_at})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.queue","队列")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.queue})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.connection","连接")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.connection})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.name","任务名称")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:u.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.exception","异常信息")}),e.jsx("div",{className:"max-h-[200px] overflow-y-auto rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:e.jsx("pre",{className:"whitespace-pre-wrap text-xs text-red-700 dark:text-red-300",children:u.exception})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.payload","任务数据")}),e.jsx("div",{className:"max-h-[200px] overflow-y-auto rounded-md bg-muted/50 p-3",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs",children:(()=>{try{return JSON.stringify(JSON.parse(u.payload),null,2)}catch{return u.payload}})()})})]})]}),e.jsx(Le,{children:e.jsx(G,{variant:"outline",onClick:()=>h(!1),children:s("common.close","关闭")})})]})}),e.jsx(ge,{open:k,onOpenChange:C,children:e.jsxs(de,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(ve,{children:e.jsx(fe,{children:s("dashboard:systemLog.title","系统日志")})}),e.jsxs(Dt,{value:K,onValueChange:Di,className:"w-full overflow-x-auto",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-2 p-1 md:flex-row md:items-center md:justify-between",children:[e.jsxs(dt,{className:"grid w-auto grid-cols-4",children:[e.jsxs(Xe,{value:"all",className:"flex items-center gap-2",children:[e.jsx(er,{className:"h-4 w-4"}),s("dashboard:systemLog.tabs.all","全部")]}),e.jsxs(Xe,{value:"info",className:"flex items-center gap-2",children:[e.jsx(qt,{className:"h-4 w-4 text-blue-500"}),s("dashboard:systemLog.tabs.info","信息")]}),e.jsxs(Xe,{value:"warning",className:"flex items-center gap-2",children:[e.jsx(Ht,{className:"h-4 w-4 text-yellow-500"}),s("dashboard:systemLog.tabs.warning","警告")]}),e.jsxs(Xe,{value:"error",className:"flex items-center gap-2",children:[e.jsx(xn,{className:"h-4 w-4 text-red-500"}),s("dashboard:systemLog.tabs.error","错误")]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Cn,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(P,{placeholder:s("dashboard:systemLog.search","搜索日志内容..."),value:w,onChange:B=>R(B.target.value),className:"w-full md:w-64"})]})]}),e.jsx(ks,{value:"all",className:"mt-0",children:e.jsx(ca,{data:sa,isLoading:ea,searchKeyword:H,selectedLevel:K,total:ta,currentPage:S,pageSize:N,onViewDetail:na,onPageChange:aa})}),e.jsx(ks,{value:"info",className:"mt-0 overflow-x-auto",children:e.jsx(ca,{data:sa,isLoading:ea,searchKeyword:H,selectedLevel:K,total:ta,currentPage:S,pageSize:N,onViewDetail:na,onPageChange:aa})}),e.jsx(ks,{value:"warning",className:"mt-0",children:e.jsx(ca,{data:sa,isLoading:ea,searchKeyword:H,selectedLevel:K,total:ta,currentPage:S,pageSize:N,onViewDetail:na,onPageChange:aa})}),e.jsx(ks,{value:"error",className:"mt-0",children:e.jsx(ca,{data:sa,isLoading:ea,searchKeyword:H,selectedLevel:K,total:ta,currentPage:S,pageSize:N,onViewDetail:na,onPageChange:aa})})]}),e.jsxs(Le,{children:[e.jsxs(G,{variant:"outline",onClick:()=>Ci(),children:[e.jsx(Qa,{className:"mr-2 h-4 w-4"}),s("dashboard:common.refresh","刷新")]}),e.jsx(G,{variant:"outline",onClick:Pi,children:s("dashboard:systemLog.filter.reset","重置筛选")}),e.jsx(Gs,{asChild:!0,children:e.jsx(G,{variant:"outline",children:s("common.close","关闭")})})]})]})}),e.jsx(ge,{open:D,onOpenChange:g,children:e.jsxs(de,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(ve,{children:e.jsx(fe,{children:s("dashboard:systemLog.detailTitle","日志详情")})}),_&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.level","级别")}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(qt,{className:"h-4 w-4"}),e.jsx("p",{className:"font-medium",children:_.level})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.time","时间")}),e.jsx("p",{children:ga(_.created_at)||ga(_.updated_at)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.logTitle","标题")}),e.jsx("div",{className:"whitespace-pre-wrap rounded-md bg-muted/50 p-3",children:_.title||_.message||""})]}),(_.host||_.ip)&&e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.host&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.host","主机")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:_.host})]}),_.ip&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.ip","IP地址")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:_.ip})]})]}),_.uri&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.uri","URI")}),e.jsx("div",{className:"overflow-x-auto rounded-md bg-muted/50 p-3",children:e.jsx("code",{className:"text-sm",children:_.uri})})]}),_.method&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.method","请求方法")}),e.jsx("div",{children:e.jsx(U,{variant:"outline",className:"text-base font-medium",children:_.method})})]}),_.data&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.requestData","请求数据")}),e.jsx("div",{className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/50 p-3",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs",children:(()=>{try{return JSON.stringify(JSON.parse(_.data),null,2)}catch{return _.data}})()})})]}),_.context&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.exception","异常信息")}),e.jsx("div",{className:"max-h-[250px] overflow-y-auto rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs text-red-700 dark:text-red-300",children:(()=>{try{const B=JSON.parse(_.context);if(B.exception){const Hs=B.exception,Ii=Hs["\0*\0message"]||"",Vi=Hs["\0*\0file"]||"",Mi=Hs["\0*\0line"]||"";return`${Ii} +import{r as m,j as e,t as Oi,c as zi,I as Yt,a as it,S as bn,u as As,b as $i,d as yn,R as _r,e as wr,f as Ai,F as qi,C as Hi,L as Cr,T as Sr,g as kr,h as Ui,i as Ki,k as Bi,l as Gi,m as A,z as x,n as V,o as we,p as Ce,q as ne,s as Ts,v as ke,w as Wi,x as Yi,O as Nn,y as Ji,A as Qi,B as Xi,D as Zi,E as eo,G as so,Q as to,H as ao,J as no,K as ro,P as lo,M as io,N as oo,U as co,V as mo,W as Tr,X as Dr,Y as Pa,Z as La,_ as _n,$ as ms,a0 as Ra,a1 as Ea,a2 as Pr,a3 as Lr,a4 as Rr,a5 as wn,a6 as Er,a7 as uo,a8 as Fr,a9 as Ir,aa as Vr,ab as Mr,ac as ot,ad as Or,ae as xo,af as zr,ag as $r,ah as ho,ai as go,aj as fo,ak as po,al as jo,am as vo,an as bo,ao as yo,ap as No,aq as _o,ar as wo,as as Ar,at as Co,au as So,av as Ys,aw as qr,ax as ko,ay as To,az as Hr,aA as Cn,aB as Do,aC as Po,aD as Qn,aE as Lo,aF as Ur,aG as Ro,aH as Kr,aI as Eo,aJ as Fo,aK as Io,aL as Vo,aM as Mo,aN as Oo,aO as Br,aP as zo,aQ as $o,aR as Ao,aS as es,aT as qo,aU as Sn,aV as Ho,aW as Uo,aX as Gr,aY as Wr,aZ as Yr,a_ as Ko,a$ as Bo,b0 as Go,b1 as Jr,b2 as Wo,b3 as kn,b4 as Qr,b5 as Yo,b6 as Xr,b7 as Jo,b8 as Zr,b9 as Qo,ba as el,bb as sl,bc as Xo,bd as Zo,be as tl,bf as ec,bg as sc,bh as al,bi as tc,bj as nl,bk as ac,bl as nc,bm as ws,bn as Pe,bo as Ss,bp as rc,bq as lc,br as ic,bs as oc,bt as cc,bu as dc,bv as Xn,bw as Zn,bx as mc,by as uc,bz as Tn,bA as xc,bB as hc,bC as ja,bD as wt,bE as va,bF as gc,bG as rl,bH as fc,bI as pc,bJ as ll,bK as jc,bL as vc,bM as er,bN as mn,bO as un,bP as bc,bQ as yc,bR as il,bS as Nc,bT as _c,bU as wc,bV as ba,bW as xn,bX as ss,bY as ya,bZ as Cc,b_ as Xa,b$ as Sc,c0 as sr,c1 as ds,c2 as qt,c3 as Ht,c4 as hn,c5 as ol,c6 as ts,c7 as us,c8 as cl,c9 as dl,ca as kc,cb as Tc,cc as Dc,cd as Pc,ce as Lc,cf as ml,cg as Rc,ch as Ec,ci as Be,cj as tr,ck as Fc,cl as ul,cm as xl,cn as hl,co as gl,cp as fl,cq as pl,cr as Ic,cs as Vc,ct as Mc,cu as Fa,cv as ct,cw as bs,cx as ys,cy as Oc,cz as zc,cA as $c,cB as Ac,cC as Na,cD as qc,cE as Hc,cF as Uc,cG as Kc,cH as gn,cI as Dn,cJ as Pn,cK as Bc,cL as Rs,cM as Es,cN as Ia,cO as Gc,cP as _a,cQ as Wc,cR as ar,cS as jl,cT as nr,cU as wa,cV as Yc,cW as Jc,cX as Qc,cY as Xc,cZ as Zc,c_ as vl,c$ as ed,d0 as sd,d1 as bl,d2 as fn,d3 as yl,d4 as td,d5 as pn,d6 as Nl,d7 as ad,d8 as Ut,d9 as Ln,da as nd,db as rd,dc as rr,dd as _l,de as ld,df as id,dg as od,dh as lr,di as cd,dj as dd}from"./vendor.js";import"./index.js";var _g=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wg(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function md(s){if(s.__esModule)return s;var n=s.default;if(typeof n=="function"){var t=function r(){return this instanceof r?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var a=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return s[r]}})}),t}const ud={theme:"system",setTheme:()=>null},wl=m.createContext(ud);function xd({children:s,defaultTheme:n="system",storageKey:t="vite-ui-theme",...r}){const[a,i]=m.useState(()=>localStorage.getItem(t)||n);m.useEffect(()=>{const d=window.document.documentElement;if(d.classList.remove("light","dark"),a==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";d.classList.add(u);return}d.classList.add(a)},[a]);const l={theme:a,setTheme:d=>{localStorage.setItem(t,d),i(d)}};return e.jsx(wl.Provider,{...r,value:l,children:s})}const hd=()=>{const s=m.useContext(wl);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},gd=function(){const n=typeof document<"u"&&document.createElement("link").relList;return n&&n.supports&&n.supports("modulepreload")?"modulepreload":"preload"}(),fd=function(s,n){return new URL(s,n).href},ir={},ye=function(n,t,r){let a=Promise.resolve();if(t&&t.length>0){const l=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),u=d?.nonce||d?.getAttribute("nonce");a=Promise.allSettled(t.map(o=>{if(o=fd(o,r),o in ir)return;ir[o]=!0;const c=o.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(!!r)for(let S=l.length-1;S>=0;S--){const f=l[S];if(f.href===o&&(!c||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${h}`))return;const C=document.createElement("link");if(C.rel=c?"stylesheet":gd,c||(C.as="script"),C.crossOrigin="",C.href=o,u&&C.setAttribute("nonce",u),document.head.appendChild(C),c)return new Promise((S,f)=>{C.addEventListener("load",S),C.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${o}`)))})}))}function i(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return a.then(l=>{for(const d of l||[])d.status==="rejected"&&i(d.reason);return n().catch(i)})};function b(...s){return Oi(zi(s))}const Tt=it("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),L=m.forwardRef(({className:s,variant:n,size:t,asChild:r=!1,children:a,disabled:i,loading:l=!1,leftSection:d,rightSection:u,...o},c)=>{const h=r?bn:"button";return e.jsxs(h,{className:b(Tt({variant:n,size:t,className:s})),disabled:l||i,ref:c,...o,children:[(d&&l||!d&&!u&&l)&&e.jsx(Yt,{className:"mr-2 h-4 w-4 animate-spin"}),!l&&d&&e.jsx("div",{className:"mr-2",children:d}),a,!l&&u&&e.jsx("div",{className:"ml-2",children:u}),u&&l&&e.jsx(Yt,{className:"ml-2 h-4 w-4 animate-spin"})]})});L.displayName="Button";function ht({className:s,minimal:n=!1}){const t=As(),r=$i(),a=r?.message||r?.statusText||"Unknown error occurred";return e.jsx("div",{className:b("h-svh w-full",s),children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[!n&&e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"500"}),e.jsxs("span",{className:"font-medium",children:["Oops! Something went wrong ",":')"]}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["We apologize for the inconvenience. ",e.jsx("br",{}),a]}),!n&&e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(L,{variant:"outline",onClick:()=>t(-1),children:"Go Back"}),e.jsx(L,{onClick:()=>t("/"),children:"Back to Home"})]})]})})}function or(){const s=As();return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"404"}),e.jsx("span",{className:"font-medium",children:"Oops! Page Not Found!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["It seems like the page you're looking for ",e.jsx("br",{}),"does not exist or might have been removed."]}),e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(L,{variant:"outline",onClick:()=>s(-1),children:"Go Back"}),e.jsx(L,{onClick:()=>s("/"),children:"Back to Home"})]})]})})}function pd(){return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"503"}),e.jsx("span",{className:"font-medium",children:"Website is under maintenance!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["The site is not available at the moment. ",e.jsx("br",{}),"We'll be back online shortly."]}),e.jsx("div",{className:"mt-6 flex gap-4",children:e.jsx(L,{variant:"outline",children:"Learn more"})})]})})}function jd(s){return typeof s>"u"}function vd(s){return s===null}function bd(s){return vd(s)||jd(s)}class yd{storage;prefixKey;constructor(n){this.storage=n.storage,this.prefixKey=n.prefixKey}getKey(n){return`${this.prefixKey}${n}`.toUpperCase()}set(n,t,r=null){const a=JSON.stringify({value:t,time:Date.now(),expire:r!==null?new Date().getTime()+r*1e3:null});this.storage.setItem(this.getKey(n),a)}get(n,t=null){const r=this.storage.getItem(this.getKey(n));if(!r)return{value:t,time:0};try{const a=JSON.parse(r),{value:i,time:l,expire:d}=a;return bd(d)||d>new Date().getTime()?{value:i,time:l}:(this.remove(n),{value:t,time:0})}catch{return this.remove(n),{value:t,time:0}}}remove(n){this.storage.removeItem(this.getKey(n))}clear(){this.storage.clear()}}function Cl({prefixKey:s="",storage:n=sessionStorage}){return new yd({prefixKey:s,storage:n})}const Sl="Xboard_",Nd=function(s={}){return Cl({prefixKey:s.prefixKey||"",storage:localStorage})},_d=function(s={}){return Cl({prefixKey:s.prefixKey||"",storage:sessionStorage})},Rn=Nd({prefixKey:Sl});_d({prefixKey:Sl});const kl="access_token";function Jt(){return Rn.get(kl)}function Tl(){Rn.remove(kl)}const cr=["/sign-in","/sign-in-2","/sign-up","/forgot-password","/otp"];function wd({children:s}){const n=As(),t=yn(),r=Jt();return m.useEffect(()=>{if(!r.value&&!cr.includes(t.pathname)){const a=encodeURIComponent(t.pathname+t.search);n(`/sign-in?redirect=${a}`)}},[r.value,t.pathname,t.search,n]),cr.includes(t.pathname)||r.value?e.jsx(e.Fragment,{children:s}):null}const Te=m.forwardRef(({className:s,orientation:n="horizontal",decorative:t=!0,...r},a)=>e.jsx(_r,{ref:a,decorative:t,orientation:n,className:b("shrink-0 bg-border",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...r}));Te.displayName=_r.displayName;const Cd=it("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ae=m.forwardRef(({className:s,...n},t)=>e.jsx(wr,{ref:t,className:b(Cd(),s),...n}));Ae.displayName=wr.displayName;const Se=qi,Dl=m.createContext({}),v=({...s})=>e.jsx(Dl.Provider,{value:{name:s.name},children:e.jsx(Hi,{...s})}),Va=()=>{const s=m.useContext(Dl),n=m.useContext(Pl),{getFieldState:t,formState:r}=Ai(),a=t(s.name,r);if(!s)throw new Error("useFormField should be used within ");const{id:i}=n;return{id:i,name:s.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...a}},Pl=m.createContext({}),p=m.forwardRef(({className:s,...n},t)=>{const r=m.useId();return e.jsx(Pl.Provider,{value:{id:r},children:e.jsx("div",{ref:t,className:b("space-y-2",s),...n})})});p.displayName="FormItem";const j=m.forwardRef(({className:s,...n},t)=>{const{error:r,formItemId:a}=Va();return e.jsx(Ae,{ref:t,className:b(r&&"text-destructive",s),htmlFor:a,...n})});j.displayName="FormLabel";const y=m.forwardRef(({...s},n)=>{const{error:t,formItemId:r,formDescriptionId:a,formMessageId:i}=Va();return e.jsx(bn,{ref:n,id:r,"aria-describedby":t?`${a} ${i}`:`${a}`,"aria-invalid":!!t,...s})});y.displayName="FormControl";const O=m.forwardRef(({className:s,...n},t)=>{const{formDescriptionId:r}=Va();return e.jsx("p",{ref:t,id:r,className:b("text-[0.8rem] text-muted-foreground",s),...n})});O.displayName="FormDescription";const E=m.forwardRef(({className:s,children:n,...t},r)=>{const{error:a,formMessageId:i}=Va(),l=a?String(a?.message):n;return l?e.jsx("p",{ref:r,id:i,className:b("text-[0.8rem] font-medium text-destructive",s),...t,children:l}):null});E.displayName="FormMessage";const Dt=Ui,dt=m.forwardRef(({className:s,...n},t)=>e.jsx(Cr,{ref:t,className:b("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...n}));dt.displayName=Cr.displayName;const Xe=m.forwardRef(({className:s,...n},t)=>e.jsx(Sr,{ref:t,className:b("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",s),...n}));Xe.displayName=Sr.displayName;const ks=m.forwardRef(({className:s,...n},t)=>e.jsx(kr,{ref:t,className:b("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...n}));ks.displayName=kr.displayName;function xe(s=void 0,n="YYYY-MM-DD HH:mm:ss"){return s==null?"":(Math.floor(s).toString().length===10&&(s=s*1e3),Ki(s).format(n))}function Sd(s=void 0,n="YYYY-MM-DD"){return xe(s,n)}function bt(s){const n=typeof s=="string"?parseFloat(s):s;return isNaN(n)?"0.00":n.toFixed(2)}function Vs(s,n=!0){if(s==null)return n?"¥0.00":"0.00";const t=typeof s=="string"?parseFloat(s):s;if(isNaN(t))return n?"¥0.00":"0.00";const a=(t/100).toFixed(2).replace(/\.?0+$/,i=>i.includes(".")?".00":i);return n?`¥${a}`:a}function Ca(s){return new Promise(n=>{try{const t=document.createElement("button");t.style.position="fixed",t.style.left="-9999px",t.style.opacity="0",t.setAttribute("data-clipboard-text",s),document.body.appendChild(t);const r=new Bi(t);r.on("success",()=>{r.destroy(),document.body.removeChild(t),n(!0)}),r.on("error",a=>{console.error("Clipboard.js failed:",a),r.destroy(),document.body.removeChild(t),n(!1)}),t.click()}catch(t){console.error("copyToClipboard failed:",t),n(!1)}})}function Oe(s){const n=s/1024,t=n/1024,r=t/1024,a=r/1024;return a>=1?bt(a)+" TB":r>=1?bt(r)+" GB":t>=1?bt(t)+" MB":bt(n)+" KB"}const dr="i18nextLng";function kd(){return console.log(localStorage.getItem(dr)),localStorage.getItem(dr)}function Ll(){Tl();const s=window.location.pathname,n=s&&!["/404","/sign-in"].includes(s),t=new URL(window.location.href),a=`${t.pathname.split("/")[1]?`/${t.pathname.split("/")[1]}`:""}#/sign-in`;window.location.href=a+(n?`?redirect=${s}`:"")}const Td=["/passport/auth/login","/passport/auth/token2Login","/passport/auth/register","/guest/comm/config","/passport/comm/sendEmailVerify","/passport/auth/forget"];function Dd(){const s=window.settings?.base_url||"/";return s.endsWith("/")?s+"api/v2":s+"/api/v2"}const yt=Gi.create({baseURL:Dd(),timeout:12e3,headers:{"Content-Type":"application/json"}});yt.interceptors.request.use(s=>{s.method?.toLowerCase()==="get"&&(s.params={...s.params,t:Date.now()});const n=Jt();if(!Td.includes(s.url?.split("?")[0]||"")){if(!n.value)return Ll(),Promise.reject({code:-1,message:"未登录"});s.headers.Authorization=n.value}return s.headers["Content-Language"]=kd()||"zh-CN",s},s=>Promise.reject(s));yt.interceptors.response.use(s=>s?.data||{code:-1,message:"未知错误"},s=>{const n=s.response?.status,t=s.response?.data?.message;return(n===401||n===403)&&Ll(),A.error(t||{401:"登录已过期",403:"没有权限",404:"资源或接口不存在"}[n]||"未知异常"),Promise.reject(s.response?.data||{data:null,code:-1,message:"未知错误"})});const M={get:(s,n)=>yt.get(s,n),post:(s,n,t)=>yt.post(s,n,t),put:(s,n,t)=>yt.put(s,n,t),delete:(s,n)=>yt.delete(s,n)},Pd="access_token";function Ld(s){Rn.set(Pd,s)}const et=window?.settings?.secure_path,Sa={getStats:()=>M.get(et+"/monitor/api/stats"),getOverride:()=>M.get(et+"/stat/getOverride"),getOrderStat:s=>M.get(et+"/stat/getOrder",{params:s}),getStatsData:()=>M.get(et+"/stat/getStats"),getNodeTrafficData:s=>M.get(et+"/stat/getTrafficRank",{params:s}),getServerLastRank:()=>M.get(et+"/stat/getServerLastRank"),getServerYesterdayRank:()=>M.get(et+"/stat/getServerYesterdayRank")},Et=window?.settings?.secure_path,Kt={getList:()=>M.get(Et+"/theme/getThemes"),getConfig:s=>M.post(Et+"/theme/getThemeConfig",{name:s}),updateConfig:(s,n)=>M.post(Et+"/theme/saveThemeConfig",{name:s,config:n}),upload:s=>{const n=new FormData;return n.append("file",s),M.post(Et+"/theme/upload",n,{headers:{"Content-Type":"multipart/form-data"}})},drop:s=>M.post(Et+"/theme/delete",{name:s})},gt=window?.settings?.secure_path,at={getList:()=>M.get(gt+"/server/manage/getNodes"),save:s=>M.post(gt+"/server/manage/save",s),drop:s=>M.post(gt+"/server/manage/drop",s),copy:s=>M.post(gt+"/server/manage/copy",s),update:s=>M.post(gt+"/server/manage/update",s),sort:s=>M.post(gt+"/server/manage/sort",s)},Za=window?.settings?.secure_path,mt={getList:()=>M.get(Za+"/server/group/fetch"),save:s=>M.post(Za+"/server/group/save",s),drop:s=>M.post(Za+"/server/group/drop",s)},en=window?.settings?.secure_path,Ma={getList:()=>M.get(en+"/server/route/fetch"),save:s=>M.post(en+"/server/route/save",s),drop:s=>M.post(en+"/server/route/drop",s)},st=window?.settings?.secure_path,nt={getList:()=>M.get(st+"/payment/fetch"),getMethodList:()=>M.get(st+"/payment/getPaymentMethods"),getMethodForm:s=>M.post(st+"/payment/getPaymentForm",s),save:s=>M.post(st+"/payment/save",s),drop:s=>M.post(st+"/payment/drop",s),updateStatus:s=>M.post(st+"/payment/show",s),sort:s=>M.post(st+"/payment/sort",s)},Ft=window?.settings?.secure_path,Qt={getList:()=>M.get(`${Ft}/notice/fetch`),save:s=>M.post(`${Ft}/notice/save`,s),drop:s=>M.post(`${Ft}/notice/drop`,{id:s}),updateStatus:s=>M.post(`${Ft}/notice/show`,{id:s}),sort:s=>M.post(`${Ft}/notice/sort`,{ids:s})},ft=window?.settings?.secure_path,Ct={getList:()=>M.get(ft+"/knowledge/fetch"),getInfo:s=>M.get(ft+"/knowledge/fetch?id="+s),save:s=>M.post(ft+"/knowledge/save",s),drop:s=>M.post(ft+"/knowledge/drop",s),updateStatus:s=>M.post(ft+"/knowledge/show",s),sort:s=>M.post(ft+"/knowledge/sort",s)},It=window?.settings?.secure_path,gs={getList:()=>M.get(It+"/plan/fetch"),save:s=>M.post(It+"/plan/save",s),update:s=>M.post(It+"/plan/update",s),drop:s=>M.post(It+"/plan/drop",s),sort:s=>M.post(It+"/plan/sort",{ids:s})},pt=window?.settings?.secure_path,tt={getList:s=>M.post(pt+"/order/fetch",s),getInfo:s=>M.post(pt+"/order/detail",s),markPaid:s=>M.post(pt+"/order/paid",s),makeCancel:s=>M.post(pt+"/order/cancel",s),update:s=>M.post(pt+"/order/update",s),assign:s=>M.post(pt+"/order/assign",s)},ra=window?.settings?.secure_path,ka={getList:s=>M.post(ra+"/coupon/fetch",s),save:s=>M.post(ra+"/coupon/generate",s),drop:s=>M.post(ra+"/coupon/drop",s),update:s=>M.post(ra+"/coupon/update",s)},ls=window?.settings?.secure_path,Ps={getList:s=>M.post(`${ls}/user/fetch`,s),update:s=>M.post(`${ls}/user/update`,s),resetSecret:s=>M.post(`${ls}/user/resetSecret`,{id:s}),generate:s=>s.download_csv?M.post(`${ls}/user/generate`,s,{responseType:"blob"}):M.post(`${ls}/user/generate`,s),getStats:s=>M.post(`${ls}/stat/getStatUser`,s),destroy:s=>M.post(`${ls}/user/destroy`,{id:s}),sendMail:s=>M.post(`${ls}/user/sendMail`,s),dumpCSV:s=>M.post(`${ls}/user/dumpCSV`,s,{responseType:"blob"}),batchBan:s=>M.post(`${ls}/user/ban`,s)},Xt={getLogs:s=>M.get(`${ls}/traffic-reset/logs`,{params:s}),getStats:s=>M.get(`${ls}/traffic-reset/stats`,{params:s}),resetUser:s=>M.post(`${ls}/traffic-reset/reset-user`,s),getUserHistory:(s,n)=>M.get(`${ls}/traffic-reset/user/${s}/history`,{params:n})},la=window?.settings?.secure_path,Nt={getList:s=>M.post(la+"/ticket/fetch",s),getInfo:s=>M.get(la+"/ticket/fetch?id= "+s),reply:s=>M.post(la+"/ticket/reply",s),close:s=>M.post(la+"/ticket/close",{id:s})},Ue=window?.settings?.secure_path,he={getSettings:(s="")=>M.get(Ue+"/config/fetch?key="+s),saveSettings:s=>M.post(Ue+"/config/save",s),getEmailTemplate:()=>M.get(Ue+"/config/getEmailTemplate"),sendTestMail:()=>M.post(Ue+"/config/testSendMail"),setTelegramWebhook:()=>M.post(Ue+"/config/setTelegramWebhook"),updateSystemConfig:s=>M.post(Ue+"/config/save",s),getSystemStatus:()=>M.get(`${Ue}/system/getSystemStatus`),getQueueStats:()=>M.get(`${Ue}/system/getQueueStats`),getQueueWorkload:()=>M.get(`${Ue}/system/getQueueWorkload`),getQueueMasters:()=>M.get(`${Ue}/system/getQueueMasters`),getHorizonFailedJobs:s=>M.get(`${Ue}/system/getHorizonFailedJobs`,{params:s}),getSystemLog:s=>M.get(`${Ue}/system/getSystemLog`,{params:s}),getLogFiles:()=>M.get(`${Ue}/log/files`),getLogContent:s=>M.get(`${Ue}/log/fetch`,{params:s}),getLogClearStats:s=>M.get(`${Ue}/system/getLogClearStats`,{params:s}),clearSystemLog:s=>M.post(`${Ue}/system/clearSystemLog`,s)},Is=window?.settings?.secure_path,Ms={getPluginList:()=>M.get(`${Is}/plugin/getPlugins`),uploadPlugin:s=>{const n=new FormData;return n.append("file",s),M.post(`${Is}/plugin/upload`,n,{headers:{"Content-Type":"multipart/form-data"}})},deletePlugin:s=>M.post(`${Is}/plugin/delete`,{code:s}),installPlugin:s=>M.post(`${Is}/plugin/install`,{code:s}),uninstallPlugin:s=>M.post(`${Is}/plugin/uninstall`,{code:s}),enablePlugin:s=>M.post(`${Is}/plugin/enable`,{code:s}),disablePlugin:s=>M.post(`${Is}/plugin/disable`,{code:s}),getPluginConfig:s=>M.get(`${Is}/plugin/config`,{params:{code:s}}),updatePluginConfig:(s,n)=>M.post(`${Is}/plugin/config`,{code:s,config:n})};window?.settings?.secure_path;const Rd=x.object({subscribe_template_singbox:x.string().optional().default(""),subscribe_template_clash:x.string().optional().default(""),subscribe_template_clashmeta:x.string().optional().default(""),subscribe_template_stash:x.string().optional().default(""),subscribe_template_surge:x.string().optional().default(""),subscribe_template_surfboard:x.string().optional().default("")}),mr=[{key:"singbox",label:"Sing-box",language:"json"},{key:"clash",label:"Clash",language:"yaml"},{key:"clashmeta",label:"Clash Meta",language:"yaml"},{key:"stash",label:"Stash",language:"yaml"},{key:"surge",label:"Surge",language:"ini"},{key:"surfboard",label:"Surfboard",language:"ini"}],ur={subscribe_template_singbox:"",subscribe_template_clash:"",subscribe_template_clashmeta:"",subscribe_template_stash:"",subscribe_template_surge:"",subscribe_template_surfboard:""};function Ed(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),[a,i]=m.useState("singbox"),l=we({resolver:Ce(Rd),defaultValues:ur,mode:"onChange"}),{data:d,isLoading:u}=ne({queryKey:["settings","client"],queryFn:()=>he.getSettings("subscribe_template")}),{mutateAsync:o}=Ts({mutationFn:he.saveSettings,onSuccess:()=>{A.success(s("common.autoSaved"))},onError:C=>{console.error("保存失败:",C),A.error(s("common.saveFailed"))}});m.useEffect(()=>{if(d?.data?.subscribe_template){const C=d.data.subscribe_template;Object.entries(C).forEach(([S,f])=>{if(S in ur){const N=typeof f=="string"?f:"";l.setValue(S,N)}}),r.current=l.getValues()}},[d,l]);const c=m.useCallback(ke.debounce(async C=>{if(!r.current||!ke.isEqual(C,r.current)){t(!0);try{await o(C),r.current=C}catch(S){console.error("保存设置失败:",S)}finally{t(!1)}}},1500),[o]),h=m.useCallback(()=>{const C=l.getValues();c(C)},[l,c]),k=m.useCallback((C,S)=>e.jsx(v,{control:l.control,name:C,render:({field:f})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s(`subscribe_template.${C.replace("subscribe_template_","")}.title`)}),e.jsx(y,{children:e.jsx(Wi,{height:"500px",defaultLanguage:S,value:f.value||"",onChange:N=>{f.onChange(N||""),h()},options:{minimap:{enabled:!1},fontSize:14,wordWrap:"on",scrollBeyondLastLine:!1,automaticLayout:!0}})}),e.jsx(O,{children:s(`subscribe_template.${C.replace("subscribe_template_","")}.description`)}),e.jsx(E,{})]})}),[l.control,s,h]);return u?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.loading")})}):e.jsx(Se,{...l,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs(Dt,{value:a,onValueChange:i,className:"w-full",children:[e.jsx(dt,{className:"",children:mr.map(({key:C,label:S})=>e.jsx(Xe,{value:C,className:"text-xs",children:S},C))}),mr.map(({key:C,language:S})=>e.jsx(ks,{value:C,className:"mt-4",children:k(`subscribe_template_${C}`,S)},C))]}),n&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-blue-500"}),s("common.saving")]})]})})}function Fd(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("subscribe_template.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("subscribe_template.description")})]}),e.jsx(Te,{}),e.jsx(Ed,{})]})}const Id=()=>e.jsx(wd,{children:e.jsx(Nn,{})}),Vd=Yi([{path:"/sign-in",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Zd);return{default:s}},void 0,import.meta.url)).default})},{element:e.jsx(Id,{}),children:[{path:"/",lazy:async()=>({Component:(await ye(()=>Promise.resolve().then(()=>om),void 0,import.meta.url)).default}),errorElement:e.jsx(ht,{}),children:[{index:!0,lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Tm);return{default:s}},void 0,import.meta.url)).default})},{path:"config",errorElement:e.jsx(ht,{}),children:[{path:"system",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Rm);return{default:s}},void 0,import.meta.url)).default}),children:[{index:!0,lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Vm);return{default:s}},void 0,import.meta.url)).default})},{path:"safe",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Am);return{default:s}},void 0,import.meta.url)).default})},{path:"subscribe",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Bm);return{default:s}},void 0,import.meta.url)).default})},{path:"invite",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Qm);return{default:s}},void 0,import.meta.url)).default})},{path:"frontend",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>tu);return{default:s}},void 0,import.meta.url)).default})},{path:"server",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>iu);return{default:s}},void 0,import.meta.url)).default})},{path:"email",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>uu);return{default:s}},void 0,import.meta.url)).default})},{path:"telegram",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>pu);return{default:s}},void 0,import.meta.url)).default})},{path:"APP",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Nu);return{default:s}},void 0,import.meta.url)).default})},{path:"subscribe-template",element:e.jsx(Fd,{})}]},{path:"payment",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Du);return{default:s}},void 0,import.meta.url)).default})},{path:"plugin",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Ru);return{default:s}},void 0,import.meta.url)).default})},{path:"theme",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Vu);return{default:s}},void 0,import.meta.url)).default})},{path:"notice",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Hu);return{default:s}},void 0,import.meta.url)).default})},{path:"knowledge",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Qu);return{default:s}},void 0,import.meta.url)).default})}]},{path:"server",errorElement:e.jsx(ht,{}),children:[{path:"manage",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>kx);return{default:s}},void 0,import.meta.url)).default})},{path:"group",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Rx);return{default:s}},void 0,import.meta.url)).default})},{path:"route",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Ox);return{default:s}},void 0,import.meta.url)).default})}]},{path:"finance",errorElement:e.jsx(ht,{}),children:[{path:"plan",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Gx);return{default:s}},void 0,import.meta.url)).default})},{path:"order",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>ih);return{default:s}},void 0,import.meta.url)).default})},{path:"coupon",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>ph);return{default:s}},void 0,import.meta.url)).default})}]},{path:"user",errorElement:e.jsx(ht,{}),children:[{path:"manage",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>Gh);return{default:s}},void 0,import.meta.url)).default})},{path:"ticket",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>xg);return{default:s}},void 0,import.meta.url)).default})},{path:"traffic-reset-logs",lazy:async()=>({Component:(await ye(async()=>{const{default:s}=await Promise.resolve().then(()=>vg);return{default:s}},void 0,import.meta.url)).default})}]}]}]},{path:"/500",Component:ht},{path:"/404",Component:or},{path:"/503",Component:pd},{path:"*",Component:or}]);function Md(){return M.get("/user/info")}const sn={token:Jt()?.value||"",userInfo:null,isLoggedIn:!!Jt()?.value,loading:!1,error:null},Bt=Ji("user/fetchUserInfo",async()=>(await Md()).data,{condition:(s,{getState:n})=>{const{user:t}=n();return!!t.token&&!t.loading}}),Rl=Qi({name:"user",initialState:sn,reducers:{setToken(s,n){s.token=n.payload,s.isLoggedIn=!!n.payload},resetUserState:()=>sn},extraReducers:s=>{s.addCase(Bt.pending,n=>{n.loading=!0,n.error=null}).addCase(Bt.fulfilled,(n,t)=>{n.loading=!1,n.userInfo=t.payload,n.error=null}).addCase(Bt.rejected,(n,t)=>{if(n.loading=!1,n.error=t.error.message||"Failed to fetch user info",!n.token)return sn})}}),{setToken:Od,resetUserState:zd}=Rl.actions,$d=s=>s.user.userInfo,Ad=Rl.reducer,El=Xi({reducer:{user:Ad}});Jt()?.value&&El.dispatch(Bt());Zi.use(eo).use(so).init({resources:{"en-US":window.XBOARD_TRANSLATIONS?.["en-US"]||{},"zh-CN":window.XBOARD_TRANSLATIONS?.["zh-CN"]||{},"ko-KR":window.XBOARD_TRANSLATIONS?.["ko-KR"]||{}},fallbackLng:"zh-CN",supportedLngs:["en-US","zh-CN","ko-KR"],detection:{order:["querystring","localStorage","navigator"],lookupQuerystring:"lang",lookupLocalStorage:"i18nextLng",caches:["localStorage"]},interpolation:{escapeValue:!1}});const qd=new to;ao.createRoot(document.getElementById("root")).render(e.jsx(no.StrictMode,{children:e.jsx(ro,{client:qd,children:e.jsx(lo,{store:El,children:e.jsxs(xd,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[e.jsx(io,{router:Vd}),e.jsx(oo,{richColors:!0,position:"top-right"})]})})})}));const Re=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{ref:t,className:b("rounded-xl border bg-card text-card-foreground shadow",s),...n}));Re.displayName="Card";const Fe=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{ref:t,className:b("flex flex-col space-y-1.5 p-6",s),...n}));Fe.displayName="CardHeader";const Ge=m.forwardRef(({className:s,...n},t)=>e.jsx("h3",{ref:t,className:b("font-semibold leading-none tracking-tight",s),...n}));Ge.displayName="CardTitle";const Os=m.forwardRef(({className:s,...n},t)=>e.jsx("p",{ref:t,className:b("text-sm text-muted-foreground",s),...n}));Os.displayName="CardDescription";const Ie=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{ref:t,className:b("p-6 pt-0",s),...n}));Ie.displayName="CardContent";const Hd=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{ref:t,className:b("flex items-center p-6 pt-0",s),...n}));Hd.displayName="CardFooter";const P=m.forwardRef(({className:s,type:n,...t},r)=>e.jsx("input",{type:n,className:b("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:r,...t}));P.displayName="Input";const Fl=m.forwardRef(({className:s,...n},t)=>{const[r,a]=m.useState(!1);return e.jsxs("div",{className:"relative rounded-md",children:[e.jsx("input",{type:r?"text":"password",className:b("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...n}),e.jsx(L,{type:"button",size:"icon",variant:"ghost",className:"absolute right-1 top-1/2 h-6 w-6 -translate-y-1/2 rounded-md text-muted-foreground",onClick:()=>a(i=>!i),children:r?e.jsx(co,{size:18}):e.jsx(mo,{size:18})})]})});Fl.displayName="PasswordInput";const Ud=s=>M.post("/passport/auth/login",s);function Kd({className:s,onForgotPassword:n,...t}){const r=As(),a=Tr(),{t:i}=V("auth"),l=x.object({email:x.string().min(1,{message:i("signIn.validation.emailRequired")}),password:x.string().min(1,{message:i("signIn.validation.passwordRequired")}).min(7,{message:i("signIn.validation.passwordLength")})}),d=we({resolver:Ce(l),defaultValues:{email:"",password:""}});async function u(o){try{const{data:c}=await Ud(o);Ld(c.auth_data),a(Od(c.auth_data)),await a(Bt()).unwrap(),r("/")}catch(c){console.error("Login failed:",c),c.response?.data?.message&&d.setError("root",{message:c.response.data.message})}}return e.jsx("div",{className:b("grid gap-6",s),...t,children:e.jsx(Se,{...d,children:e.jsx("form",{onSubmit:d.handleSubmit(u),className:"space-y-4",children:e.jsxs("div",{className:"space-y-4",children:[d.formState.errors.root&&e.jsx("div",{className:"text-sm text-destructive",children:d.formState.errors.root.message}),e.jsx(v,{control:d.control,name:"email",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:i("signIn.email")}),e.jsx(y,{children:e.jsx(P,{placeholder:i("signIn.emailPlaceholder"),autoComplete:"email",...o})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"password",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:i("signIn.password")}),e.jsx(y,{children:e.jsx(Fl,{placeholder:i("signIn.passwordPlaceholder"),autoComplete:"current-password",...o})}),e.jsx(E,{})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(L,{variant:"link",type:"button",className:"px-0 text-sm font-normal text-muted-foreground hover:text-primary",onClick:n,children:i("signIn.forgotPassword")})}),e.jsx(L,{className:"w-full",size:"lg",loading:d.formState.isSubmitting,children:i("signIn.submit")})]})})})})}const ge=Dr,as=Pr,Bd=Lr,Gs=_n,Il=m.forwardRef(({className:s,...n},t)=>e.jsx(Pa,{ref:t,className:b("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",s),...n}));Il.displayName=Pa.displayName;const ue=m.forwardRef(({className:s,children:n,...t},r)=>e.jsxs(Bd,{children:[e.jsx(Il,{}),e.jsxs(La,{ref:r,className:b("max-h-[95%] overflow-auto 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",s),...t,children:[n,e.jsxs(_n,{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:[e.jsx(ms,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ue.displayName=La.displayName;const be=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",s),...n});be.displayName="DialogHeader";const Le=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...n});Le.displayName="DialogFooter";const fe=m.forwardRef(({className:s,...n},t)=>e.jsx(Ra,{ref:t,className:b("text-lg font-semibold leading-none tracking-tight",s),...n}));fe.displayName=Ra.displayName;const Ve=m.forwardRef(({className:s,...n},t)=>e.jsx(Ea,{ref:t,className:b("text-sm text-muted-foreground",s),...n}));Ve.displayName=Ea.displayName;const St=it("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),G=m.forwardRef(({className:s,variant:n,size:t,asChild:r=!1,...a},i)=>{const l=r?bn:"button";return e.jsx(l,{className:b(St({variant:n,size:t,className:s})),ref:i,...a})});G.displayName="Button";const zs=ho,$s=go,Gd=fo,Wd=m.forwardRef(({className:s,inset:n,children:t,...r},a)=>e.jsxs(Rr,{ref:a,className:b("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",n&&"pl-8",s),...r,children:[t,e.jsx(wn,{className:"ml-auto h-4 w-4"})]}));Wd.displayName=Rr.displayName;const Yd=m.forwardRef(({className:s,...n},t)=>e.jsx(Er,{ref:t,className:b("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",s),...n}));Yd.displayName=Er.displayName;const Ls=m.forwardRef(({className:s,sideOffset:n=4,...t},r)=>e.jsx(uo,{children:e.jsx(Fr,{ref:r,sideOffset:n,className:b("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",s),...t})}));Ls.displayName=Fr.displayName;const _e=m.forwardRef(({className:s,inset:n,...t},r)=>e.jsx(Ir,{ref:r,className:b("relative flex cursor-default cursor-pointer 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",n&&"pl-8",s),...t}));_e.displayName=Ir.displayName;const Jd=m.forwardRef(({className:s,children:n,checked:t,...r},a)=>e.jsxs(Vr,{ref:a,className:b("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",s),checked:t,...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Mr,{children:e.jsx(ot,{className:"h-4 w-4"})})}),n]}));Jd.displayName=Vr.displayName;const Qd=m.forwardRef(({className:s,children:n,...t},r)=>e.jsxs(Or,{ref:r,className:b("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",s),...t,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Mr,{children:e.jsx(xo,{className:"h-4 w-4 fill-current"})})}),n]}));Qd.displayName=Or.displayName;const En=m.forwardRef(({className:s,inset:n,...t},r)=>e.jsx(zr,{ref:r,className:b("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",s),...t}));En.displayName=zr.displayName;const rt=m.forwardRef(({className:s,...n},t)=>e.jsx($r,{ref:t,className:b("-mx-1 my-1 h-px bg-muted",s),...n}));rt.displayName=$r.displayName;const jn=({className:s,...n})=>e.jsx("span",{className:b("ml-auto text-xs tracking-widest opacity-60",s),...n});jn.displayName="DropdownMenuShortcut";const tn=[{code:"en-US",name:"English",flag:po,shortName:"EN"},{code:"zh-CN",name:"中文",flag:jo,shortName:"CN"},{code:"ko-KR",name:"한국어",flag:vo,shortName:"KR"}];function Vl(){const{i18n:s}=V(),n=a=>{s.changeLanguage(a)},t=tn.find(a=>a.code===s.language)||tn[1],r=t.flag;return e.jsxs(zs,{children:[e.jsx($s,{asChild:!0,children:e.jsxs(G,{variant:"ghost",size:"sm",className:"h-8 px-2 gap-1",children:[e.jsx(r,{className:"h-4 w-5 rounded-sm shadow-sm"}),e.jsx("span",{className:"text-sm font-medium",children:t.shortName})]})}),e.jsx(Ls,{align:"end",className:"w-[120px]",children:tn.map(a=>{const i=a.flag,l=a.code===s.language;return e.jsxs(_e,{onClick:()=>n(a.code),className:b("flex items-center gap-2 px-2 py-1.5 cursor-pointer",l&&"bg-accent"),children:[e.jsx(i,{className:"h-4 w-5 rounded-sm shadow-sm"}),e.jsx("span",{className:b("text-sm",l&&"font-medium"),children:a.name})]},a.code)})})]})}function Xd(){const[s,n]=m.useState(!1),{t}=V("auth"),r=t("signIn.resetPassword.command");return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"container relative flex min-h-svh flex-col items-center justify-center bg-primary-foreground px-4 py-8 lg:max-w-none lg:px-0",children:[e.jsx("div",{className:"absolute right-4 top-4 md:right-8 md:top-8",children:e.jsx(Vl,{})}),e.jsxs("div",{className:"mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px] md:w-[420px] lg:p-8",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold sm:text-3xl",children:window?.settings?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:window?.settings?.description})]}),e.jsxs(Re,{className:"p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-left",children:[e.jsx("h1",{className:"text-xl font-semibold tracking-tight sm:text-2xl",children:t("signIn.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("signIn.description")})]}),e.jsx(Kd,{onForgotPassword:()=>n(!0)})]})]})]}),e.jsx(ge,{open:s,onOpenChange:n,children:e.jsx(ue,{className:"max-w-[90vw] sm:max-w-lg",children:e.jsxs(be,{children:[e.jsx(fe,{children:t("signIn.resetPassword.title")}),e.jsx(Ve,{children:t("signIn.resetPassword.description")}),e.jsx("div",{className:"mt-4",children:e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"max-w-full overflow-x-auto rounded-md bg-secondary p-4 pr-12 text-sm",children:r}),e.jsx(G,{variant:"ghost",size:"icon",className:"absolute right-2 top-2 h-8 w-8 hover:bg-secondary-foreground/10",onClick:()=>Ca(r).then(()=>{A.success(t("common:copy.success"))}),children:e.jsx(bo,{className:"h-4 w-4"})})]})})]})})})]})}const Zd=Object.freeze(Object.defineProperty({__proto__:null,default:Xd},Symbol.toStringTag,{value:"Module"})),ze=m.forwardRef(({className:s,fadedBelow:n=!1,fixedHeight:t=!1,...r},a)=>e.jsx("div",{ref:a,className:b("relative flex h-full w-full flex-col",n&&"after:pointer-events-none after:absolute after:bottom-0 after:left-0 after:hidden after:h-32 after:w-full after:bg-[linear-gradient(180deg,_transparent_10%,_hsl(var(--background))_70%)] after:md:block",t&&"md:h-svh",s),...r}));ze.displayName="Layout";const $e=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{ref:t,className:b("flex h-[var(--header-height)] flex-none items-center gap-4 bg-background p-4 md:px-8",s),...n}));$e.displayName="LayoutHeader";const He=m.forwardRef(({className:s,fixedHeight:n,...t},r)=>e.jsx("div",{ref:r,className:b("flex-1 overflow-hidden px-4 py-6 md:px-8",n&&"h-[calc(100%-var(--header-height))]",s),...t}));He.displayName="LayoutBody";const Ml=yo,Ol=No,zl=_o,pe=wo,de=Co,me=So,oe=m.forwardRef(({className:s,sideOffset:n=4,...t},r)=>e.jsx(Ar,{ref:r,sideOffset:n,className:b("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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",s),...t}));oe.displayName=Ar.displayName;function Oa(){const{pathname:s}=yn();return{checkActiveNav:t=>{if(t==="/"&&s==="/")return!0;const r=t.replace(/^\//,""),a=s.replace(/^\//,"");return r?a.startsWith(r):!1}}}function $l({key:s,defaultValue:n}){const[t,r]=m.useState(()=>{const a=localStorage.getItem(s);return a!==null?JSON.parse(a):n});return m.useEffect(()=>{localStorage.setItem(s,JSON.stringify(t))},[t,s]),[t,r]}function em(){const[s,n]=$l({key:"collapsed-sidebar-items",defaultValue:[]}),t=a=>!s.includes(a);return{isExpanded:t,toggleItem:a=>{t(a)?n([...s,a]):n(s.filter(i=>i!==a))}}}function sm({links:s,isCollapsed:n,className:t,closeNav:r}){const{t:a}=V(),i=({sub:l,...d})=>{const u=`${a(d.title)}-${d.href}`;return n&&l?m.createElement(nm,{...d,sub:l,key:u,closeNav:r}):n?m.createElement(am,{...d,key:u,closeNav:r}):l?m.createElement(tm,{...d,sub:l,key:u,closeNav:r}):m.createElement(Al,{...d,key:u,closeNav:r})};return e.jsx("div",{"data-collapsed":n,className:b("group border-b bg-background py-2 transition-[max-height,padding] duration-500 data-[collapsed=true]:py-2 md:border-none",t),children:e.jsx(pe,{delayDuration:0,children:e.jsx("nav",{className:"grid gap-1 group-[[data-collapsed=true]]:justify-center group-[[data-collapsed=true]]:px-2",children:s.map(i)})})})}function Al({title:s,icon:n,label:t,href:r,closeNav:a,subLink:i=!1}){const{checkActiveNav:l}=Oa(),{t:d}=V();return e.jsxs(Ys,{to:r,onClick:a,className:b(Tt({variant:l(r)?"secondary":"ghost",size:"sm"}),"h-12 justify-start text-wrap rounded-none px-6",i&&"h-10 w-full border-l border-l-slate-500 px-2"),"aria-current":l(r)?"page":void 0,children:[e.jsx("div",{className:"mr-2",children:n}),d(s),t&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:d(t)})]})}function tm({title:s,icon:n,label:t,sub:r,closeNav:a}){const{checkActiveNav:i}=Oa(),{isExpanded:l,toggleItem:d}=em(),{t:u}=V(),o=!!r?.find(k=>i(k.href)),c=u(s),h=l(c)||o;return e.jsxs(Ml,{open:h,onOpenChange:()=>d(c),children:[e.jsxs(Ol,{className:b(Tt({variant:o?"secondary":"ghost",size:"sm"}),"group h-12 w-full justify-start rounded-none px-6"),children:[e.jsx("div",{className:"mr-2",children:n}),u(s),t&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:u(t)}),e.jsx("span",{className:b('ml-auto transition-all group-data-[state="open"]:-rotate-180'),children:e.jsx(qr,{stroke:1})})]}),e.jsx(zl,{className:"collapsibleDropdown",asChild:!0,children:e.jsx("ul",{children:r.map(k=>e.jsx("li",{className:"my-1 ml-8",children:e.jsx(Al,{...k,subLink:!0,closeNav:a})},u(k.title)))})})]})}function am({title:s,icon:n,label:t,href:r,closeNav:a}){const{checkActiveNav:i}=Oa(),{t:l}=V();return e.jsxs(de,{delayDuration:0,children:[e.jsx(me,{asChild:!0,children:e.jsxs(Ys,{to:r,onClick:a,className:b(Tt({variant:i(r)?"secondary":"ghost",size:"icon"}),"h-12 w-12"),children:[n,e.jsx("span",{className:"sr-only",children:l(s)})]})}),e.jsxs(oe,{side:"right",className:"flex items-center gap-4",children:[l(s),t&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:l(t)})]})]})}function nm({title:s,icon:n,label:t,sub:r,closeNav:a}){const{checkActiveNav:i}=Oa(),{t:l}=V(),d=!!r?.find(u=>i(u.href));return e.jsxs(zs,{children:[e.jsxs(de,{delayDuration:0,children:[e.jsx(me,{asChild:!0,children:e.jsx($s,{asChild:!0,children:e.jsx(L,{variant:d?"secondary":"ghost",size:"icon",className:"h-12 w-12",children:n})})}),e.jsxs(oe,{side:"right",className:"flex items-center gap-4",children:[l(s)," ",t&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:l(t)}),e.jsx(qr,{size:18,className:"-rotate-90 text-muted-foreground"})]})]}),e.jsxs(Ls,{side:"right",align:"start",sideOffset:4,children:[e.jsxs(En,{children:[l(s)," ",t?`(${l(t)})`:""]}),e.jsx(rt,{}),r.map(({title:u,icon:o,label:c,href:h})=>e.jsx(_e,{asChild:!0,children:e.jsxs(Ys,{to:h,onClick:a,className:`${i(h)?"bg-secondary":""}`,children:[o," ",e.jsx("span",{className:"ml-2 max-w-52 text-wrap",children:l(u)}),c&&e.jsx("span",{className:"ml-auto text-xs",children:l(c)})]})},`${l(u)}-${h}`))]})]})}const ql=[{title:"nav:dashboard",label:"",href:"/",icon:e.jsx(ko,{size:18})},{title:"nav:systemManagement",label:"",href:"",icon:e.jsx(To,{size:18}),sub:[{title:"nav:systemConfig",label:"",href:"/config/system",icon:e.jsx(Hr,{size:18})},{title:"nav:pluginManagement",label:"",href:"/config/plugin",icon:e.jsx(Cn,{size:18})},{title:"nav:themeConfig",label:"",href:"/config/theme",icon:e.jsx(Do,{size:18})},{title:"nav:noticeManagement",label:"",href:"/config/notice",icon:e.jsx(Po,{size:18})},{title:"nav:paymentConfig",label:"",href:"/config/payment",icon:e.jsx(Qn,{size:18})},{title:"nav:knowledgeManagement",label:"",href:"/config/knowledge",icon:e.jsx(Lo,{size:18})}]},{title:"nav:nodeManagement",label:"",href:"",icon:e.jsx(Ur,{size:18}),sub:[{title:"nav:nodeManagement",label:"",href:"/server/manage",icon:e.jsx(Ro,{size:18})},{title:"nav:permissionGroupManagement",label:"",href:"/server/group",icon:e.jsx(Kr,{size:18})},{title:"nav:routeManagement",label:"",href:"/server/route",icon:e.jsx(Eo,{size:18})}]},{title:"nav:subscriptionManagement",label:"",href:"",icon:e.jsx(Fo,{size:18}),sub:[{title:"nav:planManagement",label:"",href:"/finance/plan",icon:e.jsx(Io,{size:18})},{title:"nav:orderManagement",label:"",href:"/finance/order",icon:e.jsx(Qn,{size:18})},{title:"nav:couponManagement",label:"",href:"/finance/coupon",icon:e.jsx(Vo,{size:18})}]},{title:"nav:userManagement",label:"",href:"",icon:e.jsx(Mo,{size:18}),sub:[{title:"nav:userManagement",label:"",href:"/user/manage",icon:e.jsx(Oo,{size:18})},{title:"nav:ticketManagement",label:"",href:"/user/ticket",icon:e.jsx(Br,{size:18})}]}];function rm({className:s,isCollapsed:n,setIsCollapsed:t}){const[r,a]=m.useState(!1),{t:i}=V();return m.useEffect(()=>{r?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")},[r]),e.jsxs("aside",{className:b(`fixed left-0 right-0 top-0 z-50 flex h-auto flex-col border-r-2 border-r-muted transition-[width] md:bottom-0 md:right-auto md:h-svh ${n?"md:w-14":"md:w-64"}`,s),children:[e.jsx("div",{onClick:()=>a(!1),className:`absolute inset-0 transition-[opacity] delay-100 duration-700 ${r?"h-svh opacity-50":"h-0 opacity-0"} w-full bg-black md:hidden`}),e.jsxs(ze,{className:`flex h-full flex-col ${r?"h-[100vh] md:h-full":""}`,children:[e.jsxs($e,{className:"sticky top-0 justify-between px-4 py-3 shadow md:px-4",children:[e.jsxs("div",{className:`flex items-center ${n?"":"gap-2"}`,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",className:`transition-all ${n?"h-6 w-6":"h-8 w-8"}`,children:[e.jsx("rect",{width:"256",height:"256",fill:"none"}),e.jsx("line",{x1:"208",y1:"128",x2:"128",y2:"208",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("line",{x1:"192",y1:"40",x2:"40",y2:"192",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("span",{className:"sr-only",children:"Website Name"})]}),e.jsx("div",{className:`flex flex-col justify-end truncate ${n?"invisible w-0":"visible w-auto"}`,children:e.jsx("span",{className:"font-medium",children:window?.settings?.title})})]}),e.jsx(L,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":i("common:toggleNavigation"),"aria-controls":"sidebar-menu","aria-expanded":r,onClick:()=>a(l=>!l),children:r?e.jsx(zo,{}):e.jsx($o,{})})]}),e.jsx(sm,{id:"sidebar-menu",className:b("flex-1 overflow-auto overscroll-contain",r?"block":"hidden md:block","md:py-2"),closeNav:()=>a(!1),isCollapsed:n,links:ql}),e.jsx("div",{className:b("border-t border-border/50 bg-background","px-4 py-2.5 text-xs text-muted-foreground",r?"block":"hidden md:block",n?"text-center":"text-left"),children:e.jsxs("div",{className:b("flex items-center gap-1.5",n?"justify-center":"justify-start"),children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),e.jsxs("span",{className:b("whitespace-nowrap tracking-wide","transition-opacity duration-200",n&&"md:opacity-0"),children:["v",window?.settings?.version]})]})}),e.jsx(L,{onClick:()=>t(l=>!l),size:"icon",variant:"outline",className:"absolute -right-5 top-1/2 hidden rounded-full md:inline-flex","aria-label":i("common:toggleSidebar"),children:e.jsx(Ao,{stroke:1.5,className:`h-5 w-5 ${n?"rotate-180":""}`})})]})]})}function lm(){const[s,n]=$l({key:"collapsed-sidebar",defaultValue:!1});return m.useEffect(()=>{const t=()=>{n(window.innerWidth<768?!1:s)};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[s,n]),[s,n]}function im(){const[s,n]=lm();return e.jsxs("div",{className:"relative h-full overflow-hidden bg-background",children:[e.jsx(rm,{isCollapsed:s,setIsCollapsed:n}),e.jsx("main",{id:"content",className:`overflow-x-hidden pt-16 transition-[margin] md:overflow-y-hidden md:pt-0 ${s?"md:ml-14":"md:ml-64"} h-full`,children:e.jsx(Nn,{})})]})}const om=Object.freeze(Object.defineProperty({__proto__:null,default:im},Symbol.toStringTag,{value:"Module"})),Js=m.forwardRef(({className:s,...n},t)=>e.jsx(es,{ref:t,className:b("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",s),...n}));Js.displayName=es.displayName;const cm=({children:s,...n})=>e.jsx(ge,{...n,children:e.jsx(ue,{className:"overflow-hidden p-0",children:e.jsx(Js,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:s})})}),ut=m.forwardRef(({className:s,...n},t)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(qo,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(es.Input,{ref:t,className:b("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",s),...n})]}));ut.displayName=es.Input.displayName;const Qs=m.forwardRef(({className:s,...n},t)=>e.jsx(es.List,{ref:t,className:b("max-h-[300px] overflow-y-auto overflow-x-hidden",s),...n}));Qs.displayName=es.List.displayName;const xt=m.forwardRef((s,n)=>e.jsx(es.Empty,{ref:n,className:"py-6 text-center text-sm",...s}));xt.displayName=es.Empty.displayName;const fs=m.forwardRef(({className:s,...n},t)=>e.jsx(es.Group,{ref:t,className:b("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",s),...n}));fs.displayName=es.Group.displayName;const Pt=m.forwardRef(({className:s,...n},t)=>e.jsx(es.Separator,{ref:t,className:b("-mx-1 h-px bg-border",s),...n}));Pt.displayName=es.Separator.displayName;const We=m.forwardRef(({className:s,...n},t)=>e.jsx(es.Item,{ref:t,className:b("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",s),...n}));We.displayName=es.Item.displayName;function dm(){const s=[];for(const n of ql)if(n.href&&s.push(n),n.sub)for(const t of n.sub)s.push({...t,parent:n.title});return s}function ns(){const[s,n]=m.useState(!1),t=As(),r=dm(),{t:a}=V("search"),{t:i}=V("nav");m.useEffect(()=>{const d=u=>{u.key==="k"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),n(o=>!o))};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]);const l=m.useCallback(d=>{n(!1),t(d)},[t]);return e.jsxs(e.Fragment,{children:[e.jsxs(G,{variant:"outline",className:"relative h-9 w-9 p-0 xl:h-10 xl:w-60 xl:justify-start xl:px-3 xl:py-2",onClick:()=>n(!0),children:[e.jsx(Sn,{className:"h-4 w-4 xl:mr-2"}),e.jsx("span",{className:"hidden xl:inline-flex",children:a("placeholder")}),e.jsx("span",{className:"sr-only",children:a("shortcut.label")}),e.jsx("kbd",{className:"pointer-events-none absolute right-1.5 top-2 hidden h-6 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 xl:flex",children:a("shortcut.key")})]}),e.jsxs(cm,{open:s,onOpenChange:n,children:[e.jsx(ut,{placeholder:a("placeholder")}),e.jsxs(Qs,{children:[e.jsx(xt,{children:a("noResults")}),e.jsx(fs,{heading:a("title"),children:r.map(d=>e.jsxs(We,{value:`${d.parent?d.parent+" ":""}${d.title}`,onSelect:()=>l(d.href),children:[e.jsx("div",{className:"mr-2",children:d.icon}),e.jsx("span",{children:i(d.title)}),d.parent&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i(d.parent)})]},d.href))})]})]})]})}function Ye(){const{theme:s,setTheme:n}=hd();return m.useEffect(()=>{const t=s==="dark"?"#020817":"#fff",r=document.querySelector("meta[name='theme-color']");r&&r.setAttribute("content",t)},[s]),e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"icon",variant:"ghost",className:"rounded-full",onClick:()=>n(s==="light"?"dark":"light"),children:s==="light"?e.jsx(Ho,{size:20}):e.jsx(Uo,{size:20})}),e.jsx(Vl,{})]})}const Hl=m.forwardRef(({className:s,...n},t)=>e.jsx(Gr,{ref:t,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",s),...n}));Hl.displayName=Gr.displayName;const Ul=m.forwardRef(({className:s,...n},t)=>e.jsx(Wr,{ref:t,className:b("aspect-square h-full w-full",s),...n}));Ul.displayName=Wr.displayName;const Kl=m.forwardRef(({className:s,...n},t)=>e.jsx(Yr,{ref:t,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",s),...n}));Kl.displayName=Yr.displayName;function Je(){const s=As(),n=Tr(),t=Ko($d),{t:r}=V(["common"]),a=()=>{Tl(),n(zd()),s("/sign-in")},i=t?.email?.split("@")[0]||r("common:user"),l=i.substring(0,2).toUpperCase();return e.jsxs(zs,{children:[e.jsx($s,{asChild:!0,children:e.jsx(L,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:e.jsxs(Hl,{className:"h-8 w-8",children:[e.jsx(Ul,{src:t?.avatar_url,alt:i}),e.jsx(Kl,{children:l})]})})}),e.jsxs(Ls,{className:"w-56",align:"end",forceMount:!0,children:[e.jsx(En,{className:"font-normal",children:e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("p",{className:"text-sm font-medium leading-none",children:i}),e.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:t?.email||r("common:defaultEmail")})]})}),e.jsx(rt,{}),e.jsx(_e,{asChild:!0,children:e.jsxs(Ys,{to:"/config/system",children:[r("common:settings"),e.jsx(jn,{children:"⌘S"})]})}),e.jsx(rt,{}),e.jsxs(_e,{onClick:a,children:[r("common:logout"),e.jsx(jn,{children:"⇧⌘Q"})]})]})]})}const J=Bo,rs=ec,Q=Go,W=m.forwardRef(({className:s,children:n,...t},r)=>e.jsxs(Jr,{ref:r,className:b("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...t,children:[n,e.jsx(Wo,{asChild:!0,children:e.jsx(kn,{className:"h-4 w-4 opacity-50"})})]}));W.displayName=Jr.displayName;const Bl=m.forwardRef(({className:s,...n},t)=>e.jsx(Qr,{ref:t,className:b("flex cursor-default items-center justify-center py-1",s),...n,children:e.jsx(Yo,{className:"h-4 w-4"})}));Bl.displayName=Qr.displayName;const Gl=m.forwardRef(({className:s,...n},t)=>e.jsx(Xr,{ref:t,className:b("flex cursor-default items-center justify-center py-1",s),...n,children:e.jsx(kn,{className:"h-4 w-4"})}));Gl.displayName=Xr.displayName;const Y=m.forwardRef(({className:s,children:n,position:t="popper",...r},a)=>e.jsx(Jo,{children:e.jsxs(Zr,{ref:a,className:b("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",t==="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",s),position:t,...r,children:[e.jsx(Bl,{}),e.jsx(Qo,{className:b("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),e.jsx(Gl,{})]})}));Y.displayName=Zr.displayName;const mm=m.forwardRef(({className:s,...n},t)=>e.jsx(el,{ref:t,className:b("px-2 py-1.5 text-sm font-semibold",s),...n}));mm.displayName=el.displayName;const $=m.forwardRef(({className:s,children:n,...t},r)=>e.jsxs(sl,{ref:r,className:b("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...t,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Xo,{children:e.jsx(ot,{className:"h-4 w-4"})})}),e.jsx(Zo,{children:n})]}));$.displayName=sl.displayName;const um=m.forwardRef(({className:s,...n},t)=>e.jsx(tl,{ref:t,className:b("-mx-1 my-1 h-px bg-muted",s),...n}));um.displayName=tl.displayName;function vs({className:s,classNames:n,showOutsideDays:t=!0,...r}){return e.jsx(sc,{showOutsideDays:t,className:b("p-3",s),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:b(St({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-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:b("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:b(St({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",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 aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...n},components:{IconLeft:({className:a,...i})=>e.jsx(al,{className:b("h-4 w-4",a),...i}),IconRight:({className:a,...i})=>e.jsx(wn,{className:b("h-4 w-4",a),...i})},...r})}vs.displayName="Calendar";const os=ac,cs=nc,Ze=m.forwardRef(({className:s,align:n="center",sideOffset:t=4,...r},a)=>e.jsx(tc,{children:e.jsx(nl,{ref:a,align:n,sideOffset:t,className:b("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",s),...r})}));Ze.displayName=nl.displayName;const Us={income:{main:"hsl(var(--primary))",gradient:{start:"hsl(var(--primary))",end:"transparent"}},commission:{main:"hsl(var(--secondary))",gradient:{start:"hsl(var(--secondary))",end:"transparent"}}},$t=s=>(s/100).toFixed(2),xm=({active:s,payload:n,label:t})=>{const{t:r}=V();return s&&n&&n.length?e.jsxs("div",{className:"rounded-lg border bg-background p-3 shadow-sm",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:t}),n.map((a,i)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:a.color}}),e.jsxs("span",{className:"text-muted-foreground",children:[r(a.name),":"]}),e.jsx("span",{className:"font-medium",children:a.name.includes(r("dashboard:overview.amount"))?`¥${$t(a.value)}`:r("dashboard:overview.transactions",{count:a.value})})]},i))]}):null},hm=[{value:"7d",label:"dashboard:overview.last7Days"},{value:"30d",label:"dashboard:overview.last30Days"},{value:"90d",label:"dashboard:overview.last90Days"},{value:"180d",label:"dashboard:overview.last180Days"},{value:"365d",label:"dashboard:overview.lastYear"},{value:"custom",label:"dashboard:overview.customRange"}],gm=(s,n)=>{const t=new Date;if(s==="custom"&&n)return{startDate:n.from,endDate:n.to};let r;switch(s){case"7d":r=ws(t,7);break;case"30d":r=ws(t,30);break;case"90d":r=ws(t,90);break;case"180d":r=ws(t,180);break;case"365d":r=ws(t,365);break;default:r=ws(t,30)}return{startDate:r,endDate:t}};function fm(){const[s,n]=m.useState("amount"),[t,r]=m.useState("30d"),[a,i]=m.useState({from:ws(new Date,7),to:new Date}),{t:l}=V(),{startDate:d,endDate:u}=gm(t,a),{data:o}=ne({queryKey:["orderStat",{start_date:Pe(d,"yyyy-MM-dd"),end_date:Pe(u,"yyyy-MM-dd")}],queryFn:async()=>{const{data:c}=await Sa.getOrderStat({start_date:Pe(d,"yyyy-MM-dd"),end_date:Pe(u,"yyyy-MM-dd")});return c},refetchInterval:3e4});return e.jsxs(Re,{children:[e.jsx(Fe,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(Ge,{children:l("dashboard:overview.title")}),e.jsxs(Os,{children:[o?.summary.start_date," ",l("dashboard:overview.to")," ",o?.summary.end_date]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsxs(J,{value:t,onValueChange:c=>r(c),children:[e.jsx(W,{className:"w-[120px]",children:e.jsx(Q,{placeholder:l("dashboard:overview.selectTimeRange")})}),e.jsx(Y,{children:hm.map(c=>e.jsx($,{value:c.value,children:l(c.label)},c.value))})]}),t==="custom"&&e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(G,{variant:"outline",className:b("min-w-0 justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:a?.from?a.to?e.jsxs(e.Fragment,{children:[Pe(a.from,"yyyy-MM-dd")," -"," ",Pe(a.to,"yyyy-MM-dd")]}):Pe(a.from,"yyyy-MM-dd"):l("dashboard:overview.selectDate")})]})}),e.jsx(Ze,{className:"w-auto p-0",align:"end",children:e.jsx(vs,{mode:"range",defaultMonth:a?.from,selected:{from:a?.from,to:a?.to},onSelect:c=>{c?.from&&c?.to&&i({from:c.from,to:c.to})},numberOfMonths:2})})]})]}),e.jsx(Dt,{value:s,onValueChange:c=>n(c),children:e.jsxs(dt,{children:[e.jsx(Xe,{value:"amount",children:l("dashboard:overview.amount")}),e.jsx(Xe,{value:"count",children:l("dashboard:overview.count")})]})})]})]})}),e.jsxs(Ie,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:l("dashboard:overview.totalIncome")}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",$t(o?.summary?.paid_total||0)]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:l("dashboard:overview.totalTransactions",{count:o?.summary?.paid_count||0})}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[l("dashboard:overview.avgOrderAmount")," ¥",$t(o?.summary?.avg_paid_amount||0)]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:l("dashboard:overview.totalCommission")}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",$t(o?.summary?.commission_total||0)]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:l("dashboard:overview.totalTransactions",{count:o?.summary?.commission_count||0})}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[l("dashboard:overview.commissionRate")," ",o?.summary?.commission_rate.toFixed(2)||0,"%"]})]})]}),e.jsx("div",{className:"h-[400px] w-full",children:e.jsx(rc,{width:"100%",height:"100%",children:e.jsxs(lc,{data:o?.list||[],margin:{top:20,right:20,left:0,bottom:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"incomeGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:Us.income.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:Us.income.gradient.end,stopOpacity:.1})]}),e.jsxs("linearGradient",{id:"commissionGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:Us.commission.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:Us.commission.gradient.end,stopOpacity:.1})]})]}),e.jsx(ic,{dataKey:"date",axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:c=>Pe(new Date(c),"MM-dd",{locale:mc})}),e.jsx(oc,{axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:c=>s==="amount"?`¥${$t(c)}`:l("dashboard:overview.transactions",{count:c})}),e.jsx(cc,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))",opacity:.3}),e.jsx(dc,{content:e.jsx(xm,{})}),s==="amount"?e.jsxs(e.Fragment,{children:[e.jsx(Xn,{type:"monotone",dataKey:"paid_total",name:l("dashboard:overview.orderAmount"),stroke:Us.income.main,fill:"url(#incomeGradient)",strokeWidth:2}),e.jsx(Xn,{type:"monotone",dataKey:"commission_total",name:l("dashboard:overview.commissionAmount"),stroke:Us.commission.main,fill:"url(#commissionGradient)",strokeWidth:2})]}):e.jsxs(e.Fragment,{children:[e.jsx(Zn,{dataKey:"paid_count",name:l("dashboard:overview.orderCount"),fill:Us.income.main,radius:[4,4,0,0],maxBarSize:40}),e.jsx(Zn,{dataKey:"commission_count",name:l("dashboard:overview.commissionCount"),fill:Us.commission.main,radius:[4,4,0,0],maxBarSize:40})]})]})})})]})]})}function ve({className:s,...n}){return e.jsx("div",{className:b("animate-pulse rounded-md bg-primary/10",s),...n})}function pm(){return e.jsxs(Re,{children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ve,{className:"h-4 w-[120px]"}),e.jsx(ve,{className:"h-4 w-4"})]}),e.jsxs(Ie,{children:[e.jsx(ve,{className:"h-8 w-[140px] mb-2"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"h-4 w-4"}),e.jsx(ve,{className:"h-4 w-[100px]"})]})]})]})}function jm(){return e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:Array.from({length:8}).map((s,n)=>e.jsx(pm,{},n))})}var le=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.CANCELLED=2]="CANCELLED",s[s.COMPLETED=3]="COMPLETED",s[s.DISCOUNTED=4]="DISCOUNTED",s))(le||{});const Vt={0:"待支付",1:"开通中",2:"已取消",3:"已完成",4:"已折抵"},Mt={0:"yellow-500",1:"blue-500",2:"red-500",3:"green-500",4:"green-500"};var Cs=(s=>(s[s.NEW=1]="NEW",s[s.RENEWAL=2]="RENEWAL",s[s.UPGRADE=3]="UPGRADE",s[s.RESET_FLOW=4]="RESET_FLOW",s))(Cs||{}),Ne=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.VALID=2]="VALID",s[s.INVALID=3]="INVALID",s))(Ne||{});const ia={0:"待确认",1:"发放中",2:"有效",3:"无效"},oa={0:"yellow-500",1:"blue-500",2:"green-500",3:"red-500"};var qe=(s=>(s.MONTH_PRICE="month_price",s.QUARTER_PRICE="quarter_price",s.HALF_YEAR_PRICE="half_year_price",s.YEAR_PRICE="year_price",s.TWO_YEAR_PRICE="two_year_price",s.THREE_YEAR_PRICE="three_year_price",s.ONETIME_PRICE="onetime_price",s.RESET_PRICE="reset_price",s))(qe||{});const vm={month_price:"月付",quarter_price:"季付",half_year_price:"半年付",year_price:"年付",two_year_price:"两年付",three_year_price:"三年付",onetime_price:"一次性",reset_price:"流量重置包"};var ce=(s=>(s.Shadowsocks="shadowsocks",s.Vmess="vmess",s.Trojan="trojan",s.Hysteria="hysteria",s.Vless="vless",s.Tuic="tuic",s.Socks="socks",s.Naive="naive",s.Http="http",s.Mieru="mieru",s.AnyTLS="anytls",s))(ce||{});const js=[{type:"shadowsocks",label:"Shadowsocks"},{type:"vmess",label:"VMess"},{type:"trojan",label:"Trojan"},{type:"hysteria",label:"Hysteria"},{type:"vless",label:"VLess"},{type:"tuic",label:"TUIC"},{type:"socks",label:"SOCKS"},{type:"naive",label:"Naive"},{type:"http",label:"HTTP"},{type:"mieru",label:"Mieru"},{type:"anytls",label:"AnyTLS"}],is={shadowsocks:"#489851",vmess:"#CB3180",trojan:"#EBB749",hysteria:"#5684e6",vless:"#1a1a1a",tuic:"#00C853",socks:"#2196F3",naive:"#9C27B0",http:"#FF5722",mieru:"#4CAF50",anytls:"#7E57C2"};var hs=(s=>(s[s.AMOUNT=1]="AMOUNT",s[s.PERCENTAGE=2]="PERCENTAGE",s))(hs||{});const bm={1:"按金额优惠",2:"按比例优惠"};var Ws=(s=>(s[s.OPENING=0]="OPENING",s[s.CLOSED=1]="CLOSED",s))(Ws||{}),Qe=(s=>(s[s.LOW=0]="LOW",s[s.MIDDLE=1]="MIDDLE",s[s.HIGH=2]="HIGH",s))(Qe||{}),Gt=(s=>(s.MONTH="monthly",s.QUARTER="quarterly",s.HALF_YEAR="half_yearly",s.YEAR="yearly",s.TWO_YEAR="two_yearly",s.THREE_YEAR="three_yearly",s.ONETIME="onetime",s.RESET="reset_traffic",s))(Gt||{});function Ks({title:s,value:n,icon:t,trend:r,description:a,onClick:i,highlight:l,className:d}){return e.jsxs(Re,{className:b("transition-colors",i&&"cursor-pointer hover:bg-muted/50",l&&"border-primary/50",d),onClick:i,children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ge,{className:"text-sm font-medium",children:s}),t]}),e.jsxs(Ie,{children:[e.jsx("div",{className:"text-2xl font-bold",children:n}),r?e.jsxs("div",{className:"flex items-center pt-1",children:[e.jsx(gc,{className:b("h-4 w-4",r.isPositive?"text-emerald-500":"text-red-500")}),e.jsxs("span",{className:b("ml-1 text-xs",r.isPositive?"text-emerald-500":"text-red-500"),children:[r.isPositive?"+":"-",Math.abs(r.value),"%"]}),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:r.label})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:a})]})]})}function ym({className:s}){const n=As(),{t}=V(),{data:r,isLoading:a}=ne({queryKey:["dashboardStats"],queryFn:async()=>(await Sa.getStatsData()).data,refetchInterval:1e3*60*5});if(a||!r)return e.jsx(jm,{});const i=()=>{const l=new URLSearchParams;l.set("commission_status",Ne.PENDING.toString()),l.set("status",le.COMPLETED.toString()),l.set("commission_balance","gt:0"),n(`/finance/order?${l.toString()}`)};return e.jsxs("div",{className:b("grid gap-4 md:grid-cols-2 lg:grid-cols-4",s),children:[e.jsx(Ks,{title:t("dashboard:stats.todayIncome"),value:Vs(r.todayIncome),icon:e.jsx(uc,{className:"h-4 w-4 text-emerald-500"}),trend:{value:r.dayIncomeGrowth,label:t("dashboard:stats.vsYesterday"),isPositive:r.dayIncomeGrowth>0}}),e.jsx(Ks,{title:t("dashboard:stats.monthlyIncome"),value:Vs(r.currentMonthIncome),icon:e.jsx(Tn,{className:"h-4 w-4 text-blue-500"}),trend:{value:r.monthIncomeGrowth,label:t("dashboard:stats.vsLastMonth"),isPositive:r.monthIncomeGrowth>0}}),e.jsx(Ks,{title:t("dashboard:stats.pendingTickets"),value:r.ticketPendingTotal,icon:e.jsx(xc,{className:b("h-4 w-4",r.ticketPendingTotal>0?"text-orange-500":"text-muted-foreground")}),description:r.ticketPendingTotal>0?t("dashboard:stats.hasPendingTickets"):t("dashboard:stats.noPendingTickets"),onClick:()=>n("/user/ticket"),highlight:r.ticketPendingTotal>0}),e.jsx(Ks,{title:t("dashboard:stats.pendingCommission"),value:r.commissionPendingTotal,icon:e.jsx(hc,{className:b("h-4 w-4",r.commissionPendingTotal>0?"text-blue-500":"text-muted-foreground")}),description:r.commissionPendingTotal>0?t("dashboard:stats.hasPendingCommission"):t("dashboard:stats.noPendingCommission"),onClick:i,highlight:r.commissionPendingTotal>0}),e.jsx(Ks,{title:t("dashboard:stats.monthlyNewUsers"),value:r.currentMonthNewUsers,icon:e.jsx(ja,{className:"h-4 w-4 text-blue-500"}),trend:{value:r.userGrowth,label:t("dashboard:stats.vsLastMonth"),isPositive:r.userGrowth>0}}),e.jsx(Ks,{title:t("dashboard:stats.totalUsers"),value:r.totalUsers,icon:e.jsx(ja,{className:"h-4 w-4 text-muted-foreground"}),description:t("dashboard:stats.activeUsers",{count:r.activeUsers})}),e.jsx(Ks,{title:t("dashboard:stats.monthlyUpload"),value:Oe(r.monthTraffic.upload),icon:e.jsx(wt,{className:"h-4 w-4 text-emerald-500"}),description:t("dashboard:stats.todayTraffic",{value:Oe(r.todayTraffic.upload)})}),e.jsx(Ks,{title:t("dashboard:stats.monthlyDownload"),value:Oe(r.monthTraffic.download),icon:e.jsx(va,{className:"h-4 w-4 text-blue-500"}),description:t("dashboard:stats.todayTraffic",{value:Oe(r.todayTraffic.download)})})]})}const lt=m.forwardRef(({className:s,children:n,...t},r)=>e.jsxs(rl,{ref:r,className:b("relative overflow-hidden",s),...t,children:[e.jsx(fc,{className:"h-full w-full rounded-[inherit]",children:n}),e.jsx(Ta,{}),e.jsx(pc,{})]}));lt.displayName=rl.displayName;const Ta=m.forwardRef(({className:s,orientation:n="vertical",...t},r)=>e.jsx(ll,{ref:r,orientation:n,className:b("flex touch-none select-none transition-colors",n==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",n==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...t,children:e.jsx(jc,{className:"relative flex-1 rounded-full bg-border"})}));Ta.displayName=ll.displayName;const vn={today:{getValue:()=>{const s=bc();return{start:s,end:yc(s,1)}}},last7days:{getValue:()=>{const s=new Date;return{start:ws(s,7),end:s}}},last30days:{getValue:()=>{const s=new Date;return{start:ws(s,30),end:s}}},custom:{getValue:()=>null}};function xr({selectedRange:s,customDateRange:n,onRangeChange:t,onCustomRangeChange:r}){const{t:a}=V(),i={today:a("dashboard:trafficRank.today"),last7days:a("dashboard:trafficRank.last7days"),last30days:a("dashboard:trafficRank.last30days"),custom:a("dashboard:trafficRank.customRange")};return e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[e.jsxs(J,{value:s,onValueChange:t,children:[e.jsx(W,{className:"w-[120px]",children:e.jsx(Q,{placeholder:a("dashboard:trafficRank.selectTimeRange")})}),e.jsx(Y,{position:"popper",className:"z-50",children:Object.entries(vn).map(([l])=>e.jsx($,{value:l,children:i[l]},l))})]}),s==="custom"&&e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(G,{variant:"outline",className:b("min-w-0 justify-start text-left font-normal",!n&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:n?.from?n.to?e.jsxs(e.Fragment,{children:[Pe(n.from,"yyyy-MM-dd")," -"," ",Pe(n.to,"yyyy-MM-dd")]}):Pe(n.from,"yyyy-MM-dd"):e.jsx("span",{children:a("dashboard:trafficRank.selectDateRange")})})]})}),e.jsx(Ze,{className:"w-auto p-0",align:"end",children:e.jsx(vs,{mode:"range",defaultMonth:n?.from,selected:{from:n?.from,to:n?.to},onSelect:l=>{l?.from&&l?.to&&r({from:l.from,to:l.to})},numberOfMonths:2})})]})]})}const jt=s=>`${(s/1024/1024/1024).toFixed(2)} GB`;function Nm({className:s}){const{t:n}=V(),[t,r]=m.useState("today"),[a,i]=m.useState({from:ws(new Date,7),to:new Date}),[l,d]=m.useState("today"),[u,o]=m.useState({from:ws(new Date,7),to:new Date}),c=m.useMemo(()=>t==="custom"?{start:a.from,end:a.to}:vn[t].getValue(),[t,a]),h=m.useMemo(()=>l==="custom"?{start:u.from,end:u.to}:vn[l].getValue(),[l,u]),{data:k}=ne({queryKey:["nodeTrafficRank",c.start,c.end],queryFn:()=>Sa.getNodeTrafficData({type:"node",start_time:ke.round(c.start.getTime()/1e3),end_time:ke.round(c.end.getTime()/1e3)}),refetchInterval:3e4}),{data:C}=ne({queryKey:["userTrafficRank",h.start,h.end],queryFn:()=>Sa.getNodeTrafficData({type:"user",start_time:ke.round(h.start.getTime()/1e3),end_time:ke.round(h.end.getTime()/1e3)}),refetchInterval:3e4});return e.jsxs("div",{className:b("grid gap-4 md:grid-cols-2",s),children:[e.jsxs(Re,{children:[e.jsx(Fe,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(Ge,{className:"flex items-center text-base font-medium",children:[e.jsx(vc,{className:"mr-2 h-4 w-4"}),n("dashboard:trafficRank.nodeTrafficRank")]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(xr,{selectedRange:t,customDateRange:a,onRangeChange:r,onCustomRangeChange:i}),e.jsx(er,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(Ie,{className:"flex-1",children:k?.data?e.jsxs(lt,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:k.data.map(S=>e.jsx(pe,{delayDuration:200,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:S.name}),e.jsxs("span",{className:b("ml-2 flex items-center text-xs font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?e.jsx(mn,{className:"mr-1 h-3 w-3"}):e.jsx(un,{className:"mr-1 h-3 w-3"}),Math.abs(S.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${S.value/k.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:jt(S.value)})]})]})})}),e.jsx(oe,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.currentTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:jt(S.value)}),e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.previousTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:jt(S.previousValue)}),e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.changeRate"),":"]}),e.jsxs("span",{className:b("font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?"+":"",S.change,"%"]})]})})]})},S.id))}),e.jsx(Ta,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:n("common:loading")})})})]}),e.jsxs(Re,{children:[e.jsx(Fe,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(Ge,{className:"flex items-center text-base font-medium",children:[e.jsx(ja,{className:"mr-2 h-4 w-4"}),n("dashboard:trafficRank.userTrafficRank")]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(xr,{selectedRange:l,customDateRange:u,onRangeChange:d,onCustomRangeChange:o}),e.jsx(er,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(Ie,{className:"flex-1",children:C?.data?e.jsxs(lt,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:C.data.map(S=>e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:S.name}),e.jsxs("span",{className:b("ml-2 flex items-center text-xs font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?e.jsx(mn,{className:"mr-1 h-3 w-3"}):e.jsx(un,{className:"mr-1 h-3 w-3"}),Math.abs(S.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${S.value/C.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:jt(S.value)})]})]})})}),e.jsx(oe,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.currentTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:jt(S.value)}),e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.previousTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:jt(S.previousValue)}),e.jsxs("span",{className:"text-muted-foreground",children:[n("dashboard:trafficRank.changeRate"),":"]}),e.jsxs("span",{className:b("font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?"+":"",S.change,"%"]})]})})]})},S.id))}),e.jsx(Ta,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:n("common:loading")})})})]})]})}const _m=it("inline-flex items-center rounded-md 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 shadow hover:bg-primary/10",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function U({className:s,variant:n,...t}){return e.jsx("div",{className:b(_m({variant:n}),s),...t})}const ha=m.forwardRef(({className:s,value:n,...t},r)=>e.jsx(il,{ref:r,className:b("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",s),...t,children:e.jsx(Nc,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(n||0)}%)`}})}));ha.displayName=il.displayName;const Fn=m.forwardRef(({className:s,...n},t)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:t,className:b("w-full caption-bottom text-sm",s),...n})}));Fn.displayName="Table";const In=m.forwardRef(({className:s,...n},t)=>e.jsx("thead",{ref:t,className:b("[&_tr]:border-b",s),...n}));In.displayName="TableHeader";const Vn=m.forwardRef(({className:s,...n},t)=>e.jsx("tbody",{ref:t,className:b("[&_tr:last-child]:border-0",s),...n}));Vn.displayName="TableBody";const wm=m.forwardRef(({className:s,...n},t)=>e.jsx("tfoot",{ref:t,className:b("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...n}));wm.displayName="TableFooter";const Bs=m.forwardRef(({className:s,...n},t)=>e.jsx("tr",{ref:t,className:b("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...n}));Bs.displayName="TableRow";const Mn=m.forwardRef(({className:s,...n},t)=>e.jsx("th",{ref:t,className:b("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...n}));Mn.displayName="TableHead";const _t=m.forwardRef(({className:s,...n},t)=>e.jsx("td",{ref:t,className:b("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...n}));_t.displayName="TableCell";const Cm=m.forwardRef(({className:s,...n},t)=>e.jsx("caption",{ref:t,className:b("mt-4 text-sm text-muted-foreground",s),...n}));Cm.displayName="TableCaption";function On({table:s}){const[n,t]=m.useState(""),{t:r}=V("common");m.useEffect(()=>{t((s.getState().pagination.pageIndex+1).toString())},[s.getState().pagination.pageIndex]);const a=i=>{const l=parseInt(i);!isNaN(l)&&l>=1&&l<=s.getPageCount()?s.setPageIndex(l-1):t((s.getState().pagination.pageIndex+1).toString())};return e.jsxs("div",{className:"flex flex-col-reverse gap-4 px-2 py-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{className:"flex-1 text-sm text-muted-foreground",children:r("table.pagination.selected",{selected:s.getFilteredSelectedRowModel().rows.length,total:s.getFilteredRowModel().rows.length})}),e.jsxs("div",{className:"flex flex-col-reverse items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:r("table.pagination.itemsPerPage")}),e.jsxs(J,{value:`${s.getState().pagination.pageSize}`,onValueChange:i=>{s.setPageSize(Number(i))},children:[e.jsx(W,{className:"h-8 w-[70px]",children:e.jsx(Q,{placeholder:s.getState().pagination.pageSize})}),e.jsx(Y,{side:"top",children:[10,20,30,40,50,100,500].map(i=>e.jsx($,{value:`${i}`,children:i},i))})]})]}),e.jsxs("div",{className:"flex items-center justify-center space-x-2 text-sm font-medium",children:[e.jsx("span",{children:r("table.pagination.page")}),e.jsx(P,{type:"text",value:n,onChange:i=>t(i.target.value),onBlur:i=>a(i.target.value),onKeyDown:i=>{i.key==="Enter"&&a(i.currentTarget.value)},className:"h-8 w-[50px] text-center"}),e.jsx("span",{children:r("table.pagination.pageOf",{total:s.getPageCount()})})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(L,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(0),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:r("table.pagination.firstPage")}),e.jsx(_c,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.previousPage(),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:r("table.pagination.previousPage")}),e.jsx(al,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.nextPage(),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:r("table.pagination.nextPage")}),e.jsx(wn,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(s.getPageCount()-1),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:r("table.pagination.lastPage")}),e.jsx(wc,{className:"h-4 w-4"})]})]})]})]})}function xs({table:s,toolbar:n,draggable:t=!1,onDragStart:r,onDragEnd:a,onDragOver:i,onDragLeave:l,onDrop:d,showPagination:u=!0,isLoading:o=!1}){const{t:c}=V("common"),h=m.useRef(null),k=s.getAllColumns().filter(N=>N.getIsPinned()==="left"),C=s.getAllColumns().filter(N=>N.getIsPinned()==="right"),S=N=>k.slice(0,N).reduce((_,T)=>_+(T.getSize()??0),0),f=N=>C.slice(N+1).reduce((_,T)=>_+(T.getSize()??0),0);return e.jsxs("div",{className:"space-y-4",children:[typeof n=="function"?n(s):n,e.jsx("div",{ref:h,className:"relative overflow-auto rounded-md border bg-card",children:e.jsx("div",{className:"overflow-auto",children:e.jsxs(Fn,{children:[e.jsx(In,{children:s.getHeaderGroups().map(N=>e.jsx(Bs,{className:"hover:bg-transparent",children:N.headers.map((_,T)=>{const D=_.column.getIsPinned()==="left",g=_.column.getIsPinned()==="right",w=D?S(k.indexOf(_.column)):void 0,R=g?f(C.indexOf(_.column)):void 0;return e.jsx(Mn,{colSpan:_.colSpan,style:{width:_.getSize(),...D&&{left:w},...g&&{right:R}},className:b("h-11 bg-card px-4 text-muted-foreground",(D||g)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",D&&"before:right-0",g&&"before:left-0"]),children:_.isPlaceholder?null:ba(_.column.columnDef.header,_.getContext())},_.id)})},N.id))}),e.jsx(Vn,{children:s.getRowModel().rows?.length?s.getRowModel().rows.map((N,_)=>e.jsx(Bs,{"data-state":N.getIsSelected()&&"selected",className:"hover:bg-muted/50",draggable:t,onDragStart:T=>r?.(T,_),onDragEnd:a,onDragOver:i,onDragLeave:l,onDrop:T=>d?.(T,_),children:N.getVisibleCells().map((T,D)=>{const g=T.column.getIsPinned()==="left",w=T.column.getIsPinned()==="right",R=g?S(k.indexOf(T.column)):void 0,H=w?f(C.indexOf(T.column)):void 0;return e.jsx(_t,{style:{width:T.column.getSize(),...g&&{left:R},...w&&{right:H}},className:b("bg-card",(g||w)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",g&&"before:right-0",w&&"before:left-0"]),children:ba(T.column.columnDef.cell,T.getContext())},T.id)})},N.id)):e.jsx(Bs,{children:e.jsx(_t,{colSpan:s.getAllColumns().length,className:"h-24 text-center",children:c("table.noData")})})})]})})}),u&&e.jsx(On,{table:s})]})}const ga=s=>{if(!s)return"";let n;if(typeof s=="string"){if(n=parseInt(s),isNaN(n))return s}else n=s;return(n.toString().length===10?new Date(n*1e3):new Date(n)).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})},Ot=ol(),zt=ol();function ca({data:s,isLoading:n,searchKeyword:t,selectedLevel:r,total:a,currentPage:i,pageSize:l,onViewDetail:d,onPageChange:u}){const{t:o}=V(),c=C=>{switch(C.toLowerCase()){case"info":return e.jsx(qt,{className:"h-4 w-4 text-blue-500"});case"warning":return e.jsx(Ht,{className:"h-4 w-4 text-yellow-500"});case"error":return e.jsx(hn,{className:"h-4 w-4 text-red-500"});default:return e.jsx(qt,{className:"h-4 w-4 text-slate-500"})}},h=m.useMemo(()=>[Ot.accessor("level",{id:"level",header:()=>o("dashboard:systemLog.level","级别"),size:80,cell:({getValue:C,row:S})=>{const f=C();return e.jsxs("div",{className:"flex items-center gap-1",children:[c(f),e.jsx("span",{className:b(f.toLowerCase()==="error"&&"text-red-600",f.toLowerCase()==="warning"&&"text-yellow-600",f.toLowerCase()==="info"&&"text-blue-600"),children:f})]})}}),Ot.accessor("created_at",{id:"created_at",header:()=>o("dashboard:systemLog.time","时间"),size:160,cell:({getValue:C})=>ga(C())}),Ot.accessor(C=>C.title||C.message||"",{id:"title",header:()=>o("dashboard:systemLog.logTitle","标题"),cell:({getValue:C})=>e.jsx("span",{className:"inline-block max-w-[300px] truncate",children:C()})}),Ot.accessor("method",{id:"method",header:()=>o("dashboard:systemLog.method","请求方法"),size:100,cell:({getValue:C})=>{const S=C();return S?e.jsx(U,{variant:"outline",className:b(S==="GET"&&"border-blue-200 bg-blue-50 text-blue-700",S==="POST"&&"border-green-200 bg-green-50 text-green-700",S==="PUT"&&"border-amber-200 bg-amber-50 text-amber-700",S==="DELETE"&&"border-red-200 bg-red-50 text-red-700"),children:S}):null}}),Ot.display({id:"actions",header:()=>o("dashboard:systemLog.action","操作"),size:80,cell:({row:C})=>e.jsx(G,{variant:"ghost",size:"sm",onClick:()=>d(C.original),"aria-label":o("dashboard:systemLog.viewDetail","查看详情"),children:e.jsx(xn,{className:"h-4 w-4"})})})],[o,d]),k=ss({data:s,columns:h,getCoreRowModel:ts(),getPaginationRowModel:us(),pageCount:Math.ceil(a/l),manualPagination:!0,state:{pagination:{pageIndex:i-1,pageSize:l}},onPaginationChange:C=>{if(typeof C=="function"){const S=C({pageIndex:i-1,pageSize:l});u(S.pageIndex+1)}else u(C.pageIndex+1)}});return e.jsxs("div",{className:"overflow-x-auto",children:[e.jsx(xs,{table:k,showPagination:!1,isLoading:n}),e.jsx(On,{table:k}),(t||r&&r!=="all")&&e.jsx("div",{className:"text-center text-sm text-muted-foreground",children:t&&r&&r!=="all"?`筛选结果: 包含"${t}"且级别为"${r}"的日志共 ${a} 条`:t?`搜索结果: 包含"${t}"的日志共 ${a} 条`:`筛选结果: 级别为"${r}"的日志共 ${a} 条`})]})}function Sm(){const{t:s}=V(),[n,t]=m.useState(0),[r,a]=m.useState(!1),[i,l]=m.useState(1),[d]=m.useState(10),[u,o]=m.useState(null),[c,h]=m.useState(!1),[k,C]=m.useState(!1),[S,f]=m.useState(1),[N]=m.useState(10),[_,T]=m.useState(null),[D,g]=m.useState(!1),[w,R]=m.useState(""),[H,I]=m.useState(""),[K,ae]=m.useState("all"),[ee,te]=m.useState(!1),[q,F]=m.useState(30),[X,Ns]=m.useState("all"),[De,ie]=m.useState(1e3),[_s,Fs]=m.useState(!1),[Xs,Lt]=m.useState(null),[Zt,Rt]=m.useState(!1);m.useEffect(()=>{const B=setTimeout(()=>{I(w),w!==H&&f(1)},500);return()=>clearTimeout(B)},[w]);const{data:qs,isLoading:Qa,refetch:se,isRefetching:je}=ne({queryKey:["systemStatus",n],queryFn:async()=>(await he.getSystemStatus()).data,refetchInterval:3e4}),{data:re,isLoading:Zs,refetch:bg,isRefetching:Kn}=ne({queryKey:["queueStats",n],queryFn:async()=>(await he.getQueueStats()).data,refetchInterval:3e4}),{data:Bn,isLoading:_i,refetch:wi}=ne({queryKey:["failedJobs",i,d],queryFn:async()=>{const B=await he.getHorizonFailedJobs({current:i,page_size:d});return{data:B.data,total:B.total||0}},enabled:r}),{data:Gn,isLoading:ea,refetch:Ci}=ne({queryKey:["systemLogs",S,N,K,H],queryFn:async()=>{const B={current:S,page_size:N};K&&K!=="all"&&(B.level=K),H.trim()&&(B.keyword=H.trim());const Hs=await he.getSystemLog(B);return{data:Hs.data,total:Hs.total||0}},enabled:k}),Wn=Bn?.data||[],Si=Bn?.total||0,sa=Gn?.data||[],ta=Gn?.total||0,ki=m.useMemo(()=>[zt.display({id:"failed_at",header:()=>s("dashboard:queue.details.time","时间"),cell:({row:B})=>ga(B.original.failed_at)}),zt.display({id:"queue",header:()=>s("dashboard:queue.details.queue","队列"),cell:({row:B})=>B.original.queue}),zt.display({id:"name",header:()=>s("dashboard:queue.details.name","任务名称"),cell:({row:B})=>e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx("span",{className:"inline-block max-w-[150px] truncate",children:B.original.name})}),e.jsx(oe,{children:e.jsx("span",{children:B.original.name})})]})})}),zt.display({id:"exception",header:()=>s("dashboard:queue.details.exception","异常信息"),cell:({row:B})=>e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx("span",{className:"inline-block max-w-[200px] truncate",children:B.original.exception.split(` +`)[0]})}),e.jsx(oe,{className:"max-w-[300px] whitespace-pre-wrap",children:e.jsx("span",{children:B.original.exception})})]})})}),zt.display({id:"actions",header:()=>s("dashboard:queue.details.action","操作"),size:80,cell:({row:B})=>e.jsx(G,{variant:"ghost",size:"sm",onClick:()=>Li(B.original),"aria-label":s("dashboard:queue.details.viewDetail","查看详情"),children:e.jsx(xn,{className:"h-4 w-4"})})})],[s]),Yn=ss({data:Wn,columns:ki,getCoreRowModel:ts(),getPaginationRowModel:us(),pageCount:Math.ceil(Si/d),manualPagination:!0,state:{pagination:{pageIndex:i-1,pageSize:d}},onPaginationChange:B=>{if(typeof B=="function"){const Hs=B({pageIndex:i-1,pageSize:d});Jn(Hs.pageIndex+1)}else Jn(B.pageIndex+1)}}),Ti=()=>{t(B=>B+1)},Jn=B=>{l(B)},aa=B=>{f(B)},Di=B=>{ae(B),f(1)},Pi=()=>{R(""),I(""),ae("all"),f(1)},na=B=>{T(B),g(!0)},Li=B=>{o(B),h(!0)},Ri=async()=>{try{const B=await he.getLogClearStats({days:q,level:X==="all"?void 0:X});Lt(B.data),Rt(!0)}catch(B){console.error("获取清理统计失败:",B),A.error("获取清理统计失败")}},Ei=async()=>{Fs(!0);try{const B=await he.clearSystemLog({days:q,level:X==="all"?void 0:X,limit:De});B.data.status==="success"?(A.success(`清理完成!已清理 ${B.data.cleared_count} 条日志`),te(!1),Rt(!1),Lt(null),se()):A.error(B.data.message||"清理失败")}catch(B){console.error("清理日志失败:",B),A.error("清理日志失败")}finally{Fs(!1)}};if(Qa||Zs)return e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(ya,{className:"h-6 w-6 animate-spin"})});const Fi=B=>B?e.jsx(cl,{className:"h-5 w-5 text-green-500"}):e.jsx(dl,{className:"h-5 w-5 text-red-500"});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(Re,{children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"flex items-center gap-2",children:[e.jsx(Cc,{className:"h-5 w-5"}),s("dashboard:queue.title")]}),e.jsx(Os,{children:s("dashboard:queue.status.description")})]}),e.jsx(G,{variant:"outline",size:"icon",onClick:Ti,disabled:je||Kn,children:e.jsx(Xa,{className:b("h-4 w-4",(je||Kn)&&"animate-spin")})})]}),e.jsx(Ie,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[Fi(re?.status||!1),e.jsx("span",{className:"font-medium",children:s("dashboard:queue.status.running")})]}),e.jsx(U,{variant:re?.status?"secondary":"destructive",children:re?.status?s("dashboard:queue.status.normal"):s("dashboard:queue.status.abnormal")})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.status.waitTime",{seconds:re?.wait?.default||0})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.recentJobs")}),e.jsx("p",{className:"text-2xl font-bold",children:re?.recentJobs||0}),e.jsx(ha,{value:(re?.recentJobs||0)/(re?.periods?.recentJobs||1)*100,className:"h-1"})]})}),e.jsx(oe,{children:e.jsx("p",{children:s("dashboard:queue.details.statisticsPeriod",{hours:re?.periods?.recentJobs||0})})})]})}),e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.jobsPerMinute")}),e.jsx("p",{className:"text-2xl font-bold",children:re?.jobsPerMinute||0}),e.jsx(ha,{value:(re?.jobsPerMinute||0)/(re?.queueWithMaxThroughput?.throughput||1)*100,className:"h-1"})]})}),e.jsx(oe,{children:e.jsx("p",{children:s("dashboard:queue.details.maxThroughput",{value:re?.queueWithMaxThroughput?.throughput||0})})})]})})]})]})})]}),e.jsxs(Re,{children:[e.jsxs(Fe,{children:[e.jsxs(Ge,{className:"flex items-center gap-2",children:[e.jsx(Sc,{className:"h-5 w-5"}),s("dashboard:queue.jobDetails")]}),e.jsx(Os,{children:s("dashboard:queue.details.description")})]}),e.jsx(Ie,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.failedJobs7Days")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"cursor-pointer text-2xl font-bold text-destructive hover:underline",title:s("dashboard:queue.details.viewFailedJobs"),onClick:()=>a(!0),style:{userSelect:"none"},children:re?.failedJobs||0}),e.jsx(xn,{className:"h-4 w-4 cursor-pointer text-muted-foreground hover:text-destructive",onClick:()=>a(!0),"aria-label":s("dashboard:queue.details.viewFailedJobs")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("dashboard:queue.details.retentionPeriod",{hours:re?.periods?.failedJobs||0})})]}),e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.longestRunningQueue")}),e.jsxs("p",{className:"text-2xl font-bold",children:[re?.queueWithMaxRuntime?.runtime||0,"s"]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:re?.queueWithMaxRuntime?.name||"N/A"})]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.activeProcesses")}),e.jsxs("span",{className:"font-medium",children:[re?.processes||0," /"," ",(re?.processes||0)+(re?.pausedMasters||0)]})]}),e.jsx(ha,{value:(re?.processes||0)/((re?.processes||0)+(re?.pausedMasters||0))*100,className:"mt-2 h-1"})]})]})})]})]}),e.jsxs(Re,{children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"flex items-center gap-2",children:[e.jsx(sr,{className:"h-5 w-5"}),s("dashboard:systemLog.title","系统日志")]}),e.jsx(Os,{children:s("dashboard:systemLog.description","查看系统运行日志记录")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(G,{variant:"outline",onClick:()=>C(!0),children:s("dashboard:systemLog.viewAll","查看全部")}),e.jsxs(G,{variant:"outline",onClick:()=>te(!0),className:"text-destructive hover:text-destructive",children:[e.jsx(ds,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.clearLogs","清理日志")]})]})]}),e.jsx(Ie,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-900 dark:bg-blue-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qt,{className:"h-5 w-5 text-blue-500"}),e.jsx("p",{className:"font-medium text-blue-700 dark:text-blue-300",children:s("dashboard:systemLog.tabs.info","信息")})]}),e.jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:qs?.logs?.info||0})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-yellow-200 bg-yellow-50 p-3 dark:border-yellow-900 dark:bg-yellow-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ht,{className:"h-5 w-5 text-yellow-500"}),e.jsx("p",{className:"font-medium text-yellow-700 dark:text-yellow-300",children:s("dashboard:systemLog.tabs.warning","警告")})]}),e.jsx("p",{className:"text-2xl font-bold text-yellow-700 dark:text-yellow-300",children:qs?.logs?.warning||0})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-900 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(hn,{className:"h-5 w-5 text-red-500"}),e.jsx("p",{className:"font-medium text-red-700 dark:text-red-300",children:s("dashboard:systemLog.tabs.error","错误")})]}),e.jsx("p",{className:"text-2xl font-bold text-red-700 dark:text-red-300",children:qs?.logs?.error||0})]})]}),qs?.logs&&qs.logs.total>0&&e.jsxs("div",{className:"mt-3 text-center text-sm text-muted-foreground",children:[s("dashboard:systemLog.totalLogs","总日志数"),":"," ",qs.logs.total]})]})})]}),e.jsx(ge,{open:r,onOpenChange:a,children:e.jsxs(ue,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(be,{children:e.jsx(fe,{children:s("dashboard:queue.details.failedJobsDetailTitle","失败任务详情")})}),e.jsxs("div",{className:"overflow-x-auto",children:[e.jsx(xs,{table:Yn,showPagination:!1,isLoading:_i}),e.jsx(On,{table:Yn}),Wn.length===0&&e.jsx("div",{className:"py-8 text-center text-muted-foreground",children:s("dashboard:queue.details.noFailedJobs","暂无失败任务")})]}),e.jsxs(Le,{children:[e.jsxs(G,{variant:"outline",onClick:()=>wi(),children:[e.jsx(Xa,{className:"mr-2 h-4 w-4"}),s("dashboard:common.refresh","刷新")]}),e.jsx(Gs,{asChild:!0,children:e.jsx(G,{variant:"outline",children:s("common.close","关闭")})})]})]})}),e.jsx(ge,{open:c,onOpenChange:h,children:e.jsxs(ue,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(be,{children:e.jsx(fe,{children:s("dashboard:queue.details.jobDetailTitle","任务详情")})}),u&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.id","任务ID")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:u.id})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.time","时间")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.failed_at})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.queue","队列")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.queue})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.connection","连接")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.connection})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.name","任务名称")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:u.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.exception","异常信息")}),e.jsx("div",{className:"max-h-[200px] overflow-y-auto rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:e.jsx("pre",{className:"whitespace-pre-wrap text-xs text-red-700 dark:text-red-300",children:u.exception})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.payload","任务数据")}),e.jsx("div",{className:"max-h-[200px] overflow-y-auto rounded-md bg-muted/50 p-3",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs",children:(()=>{try{return JSON.stringify(JSON.parse(u.payload),null,2)}catch{return u.payload}})()})})]})]}),e.jsx(Le,{children:e.jsx(G,{variant:"outline",onClick:()=>h(!1),children:s("common.close","关闭")})})]})}),e.jsx(ge,{open:k,onOpenChange:C,children:e.jsxs(ue,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(be,{children:e.jsx(fe,{children:s("dashboard:systemLog.title","系统日志")})}),e.jsxs(Dt,{value:K,onValueChange:Di,className:"w-full overflow-x-auto",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-2 p-1 md:flex-row md:items-center md:justify-between",children:[e.jsxs(dt,{className:"grid w-auto grid-cols-4",children:[e.jsxs(Xe,{value:"all",className:"flex items-center gap-2",children:[e.jsx(sr,{className:"h-4 w-4"}),s("dashboard:systemLog.tabs.all","全部")]}),e.jsxs(Xe,{value:"info",className:"flex items-center gap-2",children:[e.jsx(qt,{className:"h-4 w-4 text-blue-500"}),s("dashboard:systemLog.tabs.info","信息")]}),e.jsxs(Xe,{value:"warning",className:"flex items-center gap-2",children:[e.jsx(Ht,{className:"h-4 w-4 text-yellow-500"}),s("dashboard:systemLog.tabs.warning","警告")]}),e.jsxs(Xe,{value:"error",className:"flex items-center gap-2",children:[e.jsx(hn,{className:"h-4 w-4 text-red-500"}),s("dashboard:systemLog.tabs.error","错误")]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Sn,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(P,{placeholder:s("dashboard:systemLog.search","搜索日志内容..."),value:w,onChange:B=>R(B.target.value),className:"w-full md:w-64"})]})]}),e.jsx(ks,{value:"all",className:"mt-0",children:e.jsx(ca,{data:sa,isLoading:ea,searchKeyword:H,selectedLevel:K,total:ta,currentPage:S,pageSize:N,onViewDetail:na,onPageChange:aa})}),e.jsx(ks,{value:"info",className:"mt-0 overflow-x-auto",children:e.jsx(ca,{data:sa,isLoading:ea,searchKeyword:H,selectedLevel:K,total:ta,currentPage:S,pageSize:N,onViewDetail:na,onPageChange:aa})}),e.jsx(ks,{value:"warning",className:"mt-0",children:e.jsx(ca,{data:sa,isLoading:ea,searchKeyword:H,selectedLevel:K,total:ta,currentPage:S,pageSize:N,onViewDetail:na,onPageChange:aa})}),e.jsx(ks,{value:"error",className:"mt-0",children:e.jsx(ca,{data:sa,isLoading:ea,searchKeyword:H,selectedLevel:K,total:ta,currentPage:S,pageSize:N,onViewDetail:na,onPageChange:aa})})]}),e.jsxs(Le,{children:[e.jsxs(G,{variant:"outline",onClick:()=>Ci(),children:[e.jsx(Xa,{className:"mr-2 h-4 w-4"}),s("dashboard:common.refresh","刷新")]}),e.jsx(G,{variant:"outline",onClick:Pi,children:s("dashboard:systemLog.filter.reset","重置筛选")}),e.jsx(Gs,{asChild:!0,children:e.jsx(G,{variant:"outline",children:s("common.close","关闭")})})]})]})}),e.jsx(ge,{open:D,onOpenChange:g,children:e.jsxs(ue,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(be,{children:e.jsx(fe,{children:s("dashboard:systemLog.detailTitle","日志详情")})}),_&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.level","级别")}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(qt,{className:"h-4 w-4"}),e.jsx("p",{className:"font-medium",children:_.level})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.time","时间")}),e.jsx("p",{children:ga(_.created_at)||ga(_.updated_at)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.logTitle","标题")}),e.jsx("div",{className:"whitespace-pre-wrap rounded-md bg-muted/50 p-3",children:_.title||_.message||""})]}),(_.host||_.ip)&&e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.host&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.host","主机")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:_.host})]}),_.ip&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.ip","IP地址")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:_.ip})]})]}),_.uri&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.uri","URI")}),e.jsx("div",{className:"overflow-x-auto rounded-md bg-muted/50 p-3",children:e.jsx("code",{className:"text-sm",children:_.uri})})]}),_.method&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.method","请求方法")}),e.jsx("div",{children:e.jsx(U,{variant:"outline",className:"text-base font-medium",children:_.method})})]}),_.data&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.requestData","请求数据")}),e.jsx("div",{className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/50 p-3",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs",children:(()=>{try{return JSON.stringify(JSON.parse(_.data),null,2)}catch{return _.data}})()})})]}),_.context&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.exception","异常信息")}),e.jsx("div",{className:"max-h-[250px] overflow-y-auto rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs text-red-700 dark:text-red-300",children:(()=>{try{const B=JSON.parse(_.context);if(B.exception){const Hs=B.exception,Ii=Hs["\0*\0message"]||"",Vi=Hs["\0*\0file"]||"",Mi=Hs["\0*\0line"]||"";return`${Ii} File: ${Vi} -Line: ${Mi}`}return JSON.stringify(B,null,2)}catch{return _.context}})()})})]})]}),e.jsx(Le,{children:e.jsx(Gs,{asChild:!0,children:e.jsx(G,{variant:"outline",children:s("common.close","关闭")})})})]})}),e.jsx(ge,{open:ee,onOpenChange:te,children:e.jsxs(de,{className:"max-w-2xl",children:[e.jsx(ve,{children:e.jsxs(fe,{className:"flex items-center gap-2",children:[e.jsx(ds,{className:"h-5 w-5 text-destructive"}),s("dashboard:systemLog.clearLogs","清理日志")]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"clearDays",children:s("dashboard:systemLog.clearDays","清理天数")}),e.jsx(P,{id:"clearDays",type:"number",min:"1",max:"365",value:q,onChange:B=>F(parseInt(B.target.value)||30),placeholder:"30"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearDaysDesc","清理多少天前的日志 (1-365天)")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"clearLevel",children:s("dashboard:systemLog.clearLevel","日志级别")}),e.jsxs(J,{value:X,onValueChange:Ns,children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx($,{value:"all",children:s("dashboard:systemLog.tabs.all","全部")}),e.jsx($,{value:"info",children:s("dashboard:systemLog.tabs.info","信息")}),e.jsx($,{value:"warning",children:s("dashboard:systemLog.tabs.warning","警告")}),e.jsx($,{value:"error",children:s("dashboard:systemLog.tabs.error","错误")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"clearLimit",children:s("dashboard:systemLog.clearLimit","单次限制")}),e.jsx(P,{id:"clearLimit",type:"number",min:"100",max:"10000",value:De,onChange:B=>ie(parseInt(B.target.value)||1e3),placeholder:"1000"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearLimitDesc","单次清理数量限制 (100-10000条)")})]})]}),e.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-900 dark:bg-amber-950/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(kn,{className:"h-5 w-5 text-amber-600"}),e.jsx("span",{className:"font-medium text-amber-800 dark:text-amber-200",children:s("dashboard:systemLog.clearPreview","清理预览")})]}),e.jsxs(G,{variant:"outline",size:"sm",onClick:Ri,disabled:_s,children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.getStats","获取统计")]})]}),Zt&&Xs&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.cutoffDate","截止日期")}),e.jsx("p",{className:"font-mono text-sm",children:Xs.cutoff_date})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.totalLogs","总日志数")}),e.jsx("p",{className:"font-mono text-sm font-medium",children:Xs.total_logs.toLocaleString()})]})]}),e.jsxs("div",{className:"rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ht,{className:"h-4 w-4 text-red-600"}),e.jsxs("span",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:[s("dashboard:systemLog.willClear","将要清理"),":",e.jsx("span",{className:"ml-1 font-bold",children:Xs.logs_to_clear.toLocaleString()}),s("dashboard:systemLog.logsUnit"," 条日志")]})]}),e.jsx("p",{className:"mt-1 text-xs text-red-600 dark:text-red-300",children:s("dashboard:systemLog.clearWarning","此操作不可撤销,请谨慎操作!")})]})]})]})]}),e.jsxs(Le,{children:[e.jsx(G,{variant:"outline",onClick:()=>{te(!1),Rt(!1),Lt(null)},children:s("common.cancel","取消")}),e.jsx(G,{variant:"destructive",onClick:Ei,disabled:_s||!Zt||!Xs,children:_s?e.jsxs(e.Fragment,{children:[e.jsx(ya,{className:"mr-2 h-4 w-4 animate-spin"}),s("dashboard:systemLog.clearing","清理中...")]}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.confirmClear","确认清理")]})})]})]})})]})}function Cm(){const{t:s}=V();return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx("div",{className:"flex items-center",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:s("dashboard:title")})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(ns,{}),e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsx(He,{children:e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx(vm,{}),e.jsx(hm,{}),e.jsx(bm,{}),e.jsx(wm,{})]})})})]})}const Sm=Object.freeze(Object.defineProperty({__proto__:null,default:Cm},Symbol.toStringTag,{value:"Module"}));function km({className:s,items:n,...t}){const{pathname:r}=bn(),a=As(),[i,l]=m.useState(r??"/settings"),d=o=>{l(o),a(o)},{t:u}=V("settings");return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-1 md:hidden",children:e.jsxs(J,{value:i,onValueChange:d,children:[e.jsx(W,{className:"h-12 sm:w-48",children:e.jsx(Q,{placeholder:"Theme"})}),e.jsx(Y,{children:n.map(o=>e.jsx($,{value:o.href,children:e.jsxs("div",{className:"flex gap-x-4 px-2 py-1",children:[e.jsx("span",{className:"scale-125",children:o.icon}),e.jsx("span",{className:"text-md",children:u(o.title)})]})},o.href))})]})}),e.jsx("div",{className:"hidden w-full overflow-x-auto bg-background px-1 py-2 md:block",children:e.jsx("nav",{className:b("flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1",s),...t,children:n.map(o=>e.jsxs(Ys,{to:o.href,className:b(Tt({variant:"ghost"}),r===o.href?"bg-muted hover:bg-muted":"hover:bg-transparent hover:underline","justify-start"),children:[e.jsx("span",{className:"mr-2",children:o.icon}),u(o.title)]},o.href))})})]})}const Tm=[{title:"site.title",key:"site",icon:e.jsx(kc,{size:18}),href:"/config/system",description:"site.description"},{title:"safe.title",key:"safe",icon:e.jsx(Ur,{size:18}),href:"/config/system/safe",description:"safe.description"},{title:"subscribe.title",key:"subscribe",icon:e.jsx(Kr,{size:18}),href:"/config/system/subscribe",description:"subscribe.description"},{title:"invite.title",key:"invite",icon:e.jsx(Tc,{size:18}),href:"/config/system/invite",description:"invite.description"},{title:"server.title",key:"server",icon:e.jsx(Hr,{size:18}),href:"/config/system/server",description:"server.description"},{title:"email.title",key:"email",icon:e.jsx(Dc,{size:18}),href:"/config/system/email",description:"email.description"},{title:"telegram.title",key:"telegram",icon:e.jsx(Pc,{size:18}),href:"/config/system/telegram",description:"telegram.description"},{title:"app.title",key:"app",icon:e.jsx(qr,{size:18}),href:"/config/system/app",description:"app.description"},{title:"subscribe_template.title",key:"subscribe_template",icon:e.jsx(Lc,{size:18}),href:"/config/system/subscribe-template",description:"subscribe_template.description"}];function Dm(){const{t:s}=V("settings");return e.jsxs(ze,{fadedBelow:!0,fixedHeight:!0,children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:s("title")}),e.jsx("div",{className:"text-muted-foreground",children:s("description")})]}),e.jsx(Te,{className:"my-6"}),e.jsxs("div",{className:"flex flex-1 flex-col space-y-8 overflow-auto lg:flex-row lg:space-x-12 lg:space-y-0",children:[e.jsx("aside",{className:"sticky top-0 lg:w-1/5",children:e.jsx(km,{items:Tm})}),e.jsx("div",{className:"flex-1 w-full p-1 pr-4",children:e.jsx("div",{className:"pb-16",children:e.jsx(yn,{})})})]})]})]})}const Pm=Object.freeze(Object.defineProperty({__proto__:null,default:Dm},Symbol.toStringTag,{value:"Module"})),Z=m.forwardRef(({className:s,...n},t)=>e.jsx(dl,{className:b("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm 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",s),...n,ref:t,children:e.jsx(Rc,{className:b("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Z.displayName=dl.displayName;const Ds=m.forwardRef(({className:s,...n},t)=>e.jsx("textarea",{className:b("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...n}));Ds.displayName="Textarea";const Lm=x.object({logo:x.string().nullable().default(""),force_https:x.number().nullable().default(0),stop_register:x.number().nullable().default(0),app_name:x.string().nullable().default(""),app_description:x.string().nullable().default(""),app_url:x.string().nullable().default(""),subscribe_url:x.string().nullable().default(""),try_out_plan_id:x.number().nullable().default(0),try_out_hour:x.coerce.number().nullable().default(0),tos_url:x.string().nullable().default(""),currency:x.string().nullable().default(""),currency_symbol:x.string().nullable().default("")});function Rm(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),{data:a}=ne({queryKey:["settings","site"],queryFn:()=>he.getSettings("site")}),{data:i}=ne({queryKey:["plans"],queryFn:()=>gs.getList()}),l=we({resolver:Ce(Lm),defaultValues:{},mode:"onBlur"}),{mutateAsync:d}=Ts({mutationFn:he.saveSettings,onSuccess:c=>{c.data&&A.success(s("common.autoSaved"))}});m.useEffect(()=>{if(a?.data?.site){const c=a?.data?.site;Object.entries(c).forEach(([h,k])=>{l.setValue(h,k)}),r.current=c}},[a]);const u=m.useCallback(ke.debounce(async c=>{if(!ke.isEqual(c,r.current)){t(!0);try{const h=Object.entries(c).reduce((k,[C,S])=>(k[C]=S===null?"":S,k),{});await d(h),r.current=c}finally{t(!1)}}},1e3),[d]),o=m.useCallback(c=>{u(c)},[u]);return m.useEffect(()=>{const c=l.watch(h=>{o(h)});return()=>c.unsubscribe()},[l.watch,o]),e.jsx(Se,{...l,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:l.control,name:"app_name",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteName.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.siteName.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.siteName.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"app_description",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteDescription.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.siteDescription.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.siteDescription.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"app_url",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteUrl.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.siteUrl.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.siteUrl.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"force_https",render:({field:c})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("site.form.forceHttps.label")}),e.jsx(O,{children:s("site.form.forceHttps.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:!!c.value,onCheckedChange:h=>{c.onChange(Number(h)),o(l.getValues())}})})]})}),e.jsx(v,{control:l.control,name:"logo",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.logo.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.logo.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.logo.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"subscribe_url",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.subscribeUrl.label")}),e.jsx(y,{children:e.jsx(Ds,{placeholder:s("site.form.subscribeUrl.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.subscribeUrl.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"tos_url",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.tosUrl.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.tosUrl.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.tosUrl.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"stop_register",render:({field:c})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("site.form.stopRegister.label")}),e.jsx(O,{children:s("site.form.stopRegister.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:!!c.value,onCheckedChange:h=>{c.onChange(Number(h)),o(l.getValues())}})})]})}),e.jsx(v,{control:l.control,name:"try_out_plan_id",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.tryOut.label")}),e.jsx(y,{children:e.jsxs(J,{value:c.value?.toString(),onValueChange:h=>{c.onChange(Number(h)),o(l.getValues())},children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("site.form.tryOut.placeholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("site.form.tryOut.placeholder")}),i?.data?.map(h=>e.jsx($,{value:h.id.toString(),children:h.name},h.id.toString()))]})]})}),e.jsx(O,{children:s("site.form.tryOut.description")}),e.jsx(E,{})]})}),!!l.watch("try_out_plan_id")&&e.jsx(v,{control:l.control,name:"try_out_hour",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"",children:s("site.form.tryOut.duration.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.tryOut.duration.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.tryOut.duration.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"currency",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.currency.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.currency.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.currency.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"currency_symbol",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.currencySymbol.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.currencySymbol.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.currencySymbol.description")}),e.jsx(E,{})]})}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("site.form.saving")})]})})}function Em(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("site.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("site.description")})]}),e.jsx(Te,{}),e.jsx(Rm,{})]})}const Fm=Object.freeze(Object.defineProperty({__proto__:null,default:Em},Symbol.toStringTag,{value:"Module"})),Im=x.object({email_verify:x.boolean().nullable(),safe_mode_enable:x.boolean().nullable(),secure_path:x.string().nullable(),email_whitelist_enable:x.boolean().nullable(),email_whitelist_suffix:x.array(x.string().nullable()).nullable(),email_gmail_limit_enable:x.boolean().nullable(),recaptcha_enable:x.boolean().nullable(),recaptcha_key:x.string().nullable(),recaptcha_site_key:x.string().nullable(),register_limit_by_ip_enable:x.boolean().nullable(),register_limit_count:x.coerce.string().transform(s=>s===""?null:s).nullable(),register_limit_expire:x.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_enable:x.boolean().nullable(),password_limit_count:x.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_expire:x.coerce.string().transform(s=>s===""?null:s).nullable()}),Vm={email_verify:!1,safe_mode_enable:!1,secure_path:"",email_whitelist_enable:!1,email_whitelist_suffix:[],email_gmail_limit_enable:!1,recaptcha_enable:!1,recaptcha_key:"",recaptcha_site_key:"",register_limit_by_ip_enable:!1,register_limit_count:"",register_limit_expire:"",password_limit_enable:!1,password_limit_count:"",password_limit_expire:""};function Mm(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(Im),defaultValues:Vm,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","safe"],queryFn:()=>he.getSettings("safe")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:o=>{o.data&&A.success(s("common.autoSaved"))}});m.useEffect(()=>{if(i?.data.safe){const o=i.data.safe;Object.entries(o).forEach(([c,h])=>{typeof h=="number"?a.setValue(c,String(h)):a.setValue(c,h)}),r.current=o}},[i]);const d=m.useCallback(ke.debounce(async o=>{if(!ke.isEqual(o,r.current)){t(!0);try{await l(o),r.current=o}finally{t(!1)}}},1e3),[l]),u=m.useCallback(o=>{d(o)},[d]);return m.useEffect(()=>{const o=a.watch(c=>{u(c)});return()=>o.unsubscribe()},[a.watch,u]),e.jsx(Se,{...a,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:a.control,name:"email_verify",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailVerify.label")}),e.jsx(O,{children:s("safe.form.emailVerify.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"email_gmail_limit_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.gmailLimit.label")}),e.jsx(O,{children:s("safe.form.gmailLimit.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"safe_mode_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.safeMode.label")}),e.jsx(O,{children:s("safe.form.safeMode.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"secure_path",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.securePath.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.securePath.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.securePath.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"email_whitelist_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailWhitelist.label")}),e.jsx(O,{children:s("safe.form.emailWhitelist.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("email_whitelist_enable")&&e.jsx(v,{control:a.control,name:"email_whitelist_suffix",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailWhitelist.suffixes.label")}),e.jsx(y,{children:e.jsx(Ds,{placeholder:s("safe.form.emailWhitelist.suffixes.placeholder"),...o,value:(o.value||[]).join(` +Line: ${Mi}`}return JSON.stringify(B,null,2)}catch{return _.context}})()})})]})]}),e.jsx(Le,{children:e.jsx(Gs,{asChild:!0,children:e.jsx(G,{variant:"outline",children:s("common.close","关闭")})})})]})}),e.jsx(ge,{open:ee,onOpenChange:te,children:e.jsxs(ue,{className:"max-w-2xl",children:[e.jsx(be,{children:e.jsxs(fe,{className:"flex items-center gap-2",children:[e.jsx(ds,{className:"h-5 w-5 text-destructive"}),s("dashboard:systemLog.clearLogs","清理日志")]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"clearDays",children:s("dashboard:systemLog.clearDays","清理天数")}),e.jsx(P,{id:"clearDays",type:"number",min:"1",max:"365",value:q,onChange:B=>F(parseInt(B.target.value)||30),placeholder:"30"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearDaysDesc","清理多少天前的日志 (1-365天)")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"clearLevel",children:s("dashboard:systemLog.clearLevel","日志级别")}),e.jsxs(J,{value:X,onValueChange:Ns,children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx($,{value:"all",children:s("dashboard:systemLog.tabs.all","全部")}),e.jsx($,{value:"info",children:s("dashboard:systemLog.tabs.info","信息")}),e.jsx($,{value:"warning",children:s("dashboard:systemLog.tabs.warning","警告")}),e.jsx($,{value:"error",children:s("dashboard:systemLog.tabs.error","错误")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"clearLimit",children:s("dashboard:systemLog.clearLimit","单次限制")}),e.jsx(P,{id:"clearLimit",type:"number",min:"100",max:"10000",value:De,onChange:B=>ie(parseInt(B.target.value)||1e3),placeholder:"1000"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearLimitDesc","单次清理数量限制 (100-10000条)")})]})]}),e.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-900 dark:bg-amber-950/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Tn,{className:"h-5 w-5 text-amber-600"}),e.jsx("span",{className:"font-medium text-amber-800 dark:text-amber-200",children:s("dashboard:systemLog.clearPreview","清理预览")})]}),e.jsxs(G,{variant:"outline",size:"sm",onClick:Ri,disabled:_s,children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.getStats","获取统计")]})]}),Zt&&Xs&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.cutoffDate","截止日期")}),e.jsx("p",{className:"font-mono text-sm",children:Xs.cutoff_date})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.totalLogs","总日志数")}),e.jsx("p",{className:"font-mono text-sm font-medium",children:Xs.total_logs.toLocaleString()})]})]}),e.jsxs("div",{className:"rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ht,{className:"h-4 w-4 text-red-600"}),e.jsxs("span",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:[s("dashboard:systemLog.willClear","将要清理"),":",e.jsx("span",{className:"ml-1 font-bold",children:Xs.logs_to_clear.toLocaleString()}),s("dashboard:systemLog.logsUnit"," 条日志")]})]}),e.jsx("p",{className:"mt-1 text-xs text-red-600 dark:text-red-300",children:s("dashboard:systemLog.clearWarning","此操作不可撤销,请谨慎操作!")})]})]})]})]}),e.jsxs(Le,{children:[e.jsx(G,{variant:"outline",onClick:()=>{te(!1),Rt(!1),Lt(null)},children:s("common.cancel","取消")}),e.jsx(G,{variant:"destructive",onClick:Ei,disabled:_s||!Zt||!Xs,children:_s?e.jsxs(e.Fragment,{children:[e.jsx(ya,{className:"mr-2 h-4 w-4 animate-spin"}),s("dashboard:systemLog.clearing","清理中...")]}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.confirmClear","确认清理")]})})]})]})})]})}function km(){const{t:s}=V();return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx("div",{className:"flex items-center",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:s("dashboard:title")})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(ns,{}),e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsx(He,{children:e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx(ym,{}),e.jsx(fm,{}),e.jsx(Nm,{}),e.jsx(Sm,{})]})})})]})}const Tm=Object.freeze(Object.defineProperty({__proto__:null,default:km},Symbol.toStringTag,{value:"Module"}));function Dm({className:s,items:n,...t}){const{pathname:r}=yn(),a=As(),[i,l]=m.useState(r??"/settings"),d=o=>{l(o),a(o)},{t:u}=V("settings");return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-1 md:hidden",children:e.jsxs(J,{value:i,onValueChange:d,children:[e.jsx(W,{className:"h-12 sm:w-48",children:e.jsx(Q,{placeholder:"Theme"})}),e.jsx(Y,{children:n.map(o=>e.jsx($,{value:o.href,children:e.jsxs("div",{className:"flex gap-x-4 px-2 py-1",children:[e.jsx("span",{className:"scale-125",children:o.icon}),e.jsx("span",{className:"text-md",children:u(o.title)})]})},o.href))})]})}),e.jsx("div",{className:"hidden w-full overflow-x-auto bg-background px-1 py-2 md:block",children:e.jsx("nav",{className:b("flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1",s),...t,children:n.map(o=>e.jsxs(Ys,{to:o.href,className:b(Tt({variant:"ghost"}),r===o.href?"bg-muted hover:bg-muted":"hover:bg-transparent hover:underline","justify-start"),children:[e.jsx("span",{className:"mr-2",children:o.icon}),u(o.title)]},o.href))})})]})}const Pm=[{title:"site.title",key:"site",icon:e.jsx(kc,{size:18}),href:"/config/system",description:"site.description"},{title:"safe.title",key:"safe",icon:e.jsx(Kr,{size:18}),href:"/config/system/safe",description:"safe.description"},{title:"subscribe.title",key:"subscribe",icon:e.jsx(Br,{size:18}),href:"/config/system/subscribe",description:"subscribe.description"},{title:"invite.title",key:"invite",icon:e.jsx(Tc,{size:18}),href:"/config/system/invite",description:"invite.description"},{title:"server.title",key:"server",icon:e.jsx(Ur,{size:18}),href:"/config/system/server",description:"server.description"},{title:"email.title",key:"email",icon:e.jsx(Dc,{size:18}),href:"/config/system/email",description:"email.description"},{title:"telegram.title",key:"telegram",icon:e.jsx(Pc,{size:18}),href:"/config/system/telegram",description:"telegram.description"},{title:"app.title",key:"app",icon:e.jsx(Hr,{size:18}),href:"/config/system/app",description:"app.description"},{title:"subscribe_template.title",key:"subscribe_template",icon:e.jsx(Lc,{size:18}),href:"/config/system/subscribe-template",description:"subscribe_template.description"}];function Lm(){const{t:s}=V("settings");return e.jsxs(ze,{fadedBelow:!0,fixedHeight:!0,children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:s("title")}),e.jsx("div",{className:"text-muted-foreground",children:s("description")})]}),e.jsx(Te,{className:"my-6"}),e.jsxs("div",{className:"flex flex-1 flex-col space-y-8 overflow-auto lg:flex-row lg:space-x-12 lg:space-y-0",children:[e.jsx("aside",{className:"sticky top-0 lg:w-1/5",children:e.jsx(Dm,{items:Pm})}),e.jsx("div",{className:"flex-1 w-full p-1 pr-4",children:e.jsx("div",{className:"pb-16",children:e.jsx(Nn,{})})})]})]})]})}const Rm=Object.freeze(Object.defineProperty({__proto__:null,default:Lm},Symbol.toStringTag,{value:"Module"})),Z=m.forwardRef(({className:s,...n},t)=>e.jsx(ml,{className:b("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm 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",s),...n,ref:t,children:e.jsx(Rc,{className:b("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Z.displayName=ml.displayName;const Ds=m.forwardRef(({className:s,...n},t)=>e.jsx("textarea",{className:b("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...n}));Ds.displayName="Textarea";const Em=x.object({logo:x.string().nullable().default(""),force_https:x.number().nullable().default(0),stop_register:x.number().nullable().default(0),app_name:x.string().nullable().default(""),app_description:x.string().nullable().default(""),app_url:x.string().nullable().default(""),subscribe_url:x.string().nullable().default(""),try_out_plan_id:x.number().nullable().default(0),try_out_hour:x.coerce.number().nullable().default(0),tos_url:x.string().nullable().default(""),currency:x.string().nullable().default(""),currency_symbol:x.string().nullable().default("")});function Fm(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),{data:a}=ne({queryKey:["settings","site"],queryFn:()=>he.getSettings("site")}),{data:i}=ne({queryKey:["plans"],queryFn:()=>gs.getList()}),l=we({resolver:Ce(Em),defaultValues:{},mode:"onBlur"}),{mutateAsync:d}=Ts({mutationFn:he.saveSettings,onSuccess:c=>{c.data&&A.success(s("common.autoSaved"))}});m.useEffect(()=>{if(a?.data?.site){const c=a?.data?.site;Object.entries(c).forEach(([h,k])=>{l.setValue(h,k)}),r.current=c}},[a]);const u=m.useCallback(ke.debounce(async c=>{if(!ke.isEqual(c,r.current)){t(!0);try{const h=Object.entries(c).reduce((k,[C,S])=>(k[C]=S===null?"":S,k),{});await d(h),r.current=c}finally{t(!1)}}},1e3),[d]),o=m.useCallback(c=>{u(c)},[u]);return m.useEffect(()=>{const c=l.watch(h=>{o(h)});return()=>c.unsubscribe()},[l.watch,o]),e.jsx(Se,{...l,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:l.control,name:"app_name",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteName.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.siteName.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.siteName.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"app_description",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteDescription.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.siteDescription.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.siteDescription.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"app_url",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteUrl.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.siteUrl.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.siteUrl.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"force_https",render:({field:c})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("site.form.forceHttps.label")}),e.jsx(O,{children:s("site.form.forceHttps.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:!!c.value,onCheckedChange:h=>{c.onChange(Number(h)),o(l.getValues())}})})]})}),e.jsx(v,{control:l.control,name:"logo",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.logo.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.logo.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.logo.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"subscribe_url",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.subscribeUrl.label")}),e.jsx(y,{children:e.jsx(Ds,{placeholder:s("site.form.subscribeUrl.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.subscribeUrl.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"tos_url",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.tosUrl.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.tosUrl.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.tosUrl.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"stop_register",render:({field:c})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("site.form.stopRegister.label")}),e.jsx(O,{children:s("site.form.stopRegister.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:!!c.value,onCheckedChange:h=>{c.onChange(Number(h)),o(l.getValues())}})})]})}),e.jsx(v,{control:l.control,name:"try_out_plan_id",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.tryOut.label")}),e.jsx(y,{children:e.jsxs(J,{value:c.value?.toString(),onValueChange:h=>{c.onChange(Number(h)),o(l.getValues())},children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("site.form.tryOut.placeholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("site.form.tryOut.placeholder")}),i?.data?.map(h=>e.jsx($,{value:h.id.toString(),children:h.name},h.id.toString()))]})]})}),e.jsx(O,{children:s("site.form.tryOut.description")}),e.jsx(E,{})]})}),!!l.watch("try_out_plan_id")&&e.jsx(v,{control:l.control,name:"try_out_hour",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"",children:s("site.form.tryOut.duration.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.tryOut.duration.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.tryOut.duration.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"currency",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.currency.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.currency.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.currency.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:l.control,name:"currency_symbol",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("site.form.currencySymbol.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("site.form.currencySymbol.placeholder"),...c,value:c.value||"",onChange:h=>{c.onChange(h),o(l.getValues())}})}),e.jsx(O,{children:s("site.form.currencySymbol.description")}),e.jsx(E,{})]})}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("site.form.saving")})]})})}function Im(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("site.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("site.description")})]}),e.jsx(Te,{}),e.jsx(Fm,{})]})}const Vm=Object.freeze(Object.defineProperty({__proto__:null,default:Im},Symbol.toStringTag,{value:"Module"})),Mm=x.object({email_verify:x.boolean().nullable(),safe_mode_enable:x.boolean().nullable(),secure_path:x.string().nullable(),email_whitelist_enable:x.boolean().nullable(),email_whitelist_suffix:x.array(x.string().nullable()).nullable(),email_gmail_limit_enable:x.boolean().nullable(),recaptcha_enable:x.boolean().nullable(),recaptcha_key:x.string().nullable(),recaptcha_site_key:x.string().nullable(),register_limit_by_ip_enable:x.boolean().nullable(),register_limit_count:x.coerce.string().transform(s=>s===""?null:s).nullable(),register_limit_expire:x.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_enable:x.boolean().nullable(),password_limit_count:x.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_expire:x.coerce.string().transform(s=>s===""?null:s).nullable()}),Om={email_verify:!1,safe_mode_enable:!1,secure_path:"",email_whitelist_enable:!1,email_whitelist_suffix:[],email_gmail_limit_enable:!1,recaptcha_enable:!1,recaptcha_key:"",recaptcha_site_key:"",register_limit_by_ip_enable:!1,register_limit_count:"",register_limit_expire:"",password_limit_enable:!1,password_limit_count:"",password_limit_expire:""};function zm(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(Mm),defaultValues:Om,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","safe"],queryFn:()=>he.getSettings("safe")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:o=>{o.data&&A.success(s("common.autoSaved"))}});m.useEffect(()=>{if(i?.data.safe){const o=i.data.safe;Object.entries(o).forEach(([c,h])=>{typeof h=="number"?a.setValue(c,String(h)):a.setValue(c,h)}),r.current=o}},[i]);const d=m.useCallback(ke.debounce(async o=>{if(!ke.isEqual(o,r.current)){t(!0);try{await l(o),r.current=o}finally{t(!1)}}},1e3),[l]),u=m.useCallback(o=>{d(o)},[d]);return m.useEffect(()=>{const o=a.watch(c=>{u(c)});return()=>o.unsubscribe()},[a.watch,u]),e.jsx(Se,{...a,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:a.control,name:"email_verify",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailVerify.label")}),e.jsx(O,{children:s("safe.form.emailVerify.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"email_gmail_limit_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.gmailLimit.label")}),e.jsx(O,{children:s("safe.form.gmailLimit.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"safe_mode_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.safeMode.label")}),e.jsx(O,{children:s("safe.form.safeMode.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"secure_path",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.securePath.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.securePath.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.securePath.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"email_whitelist_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailWhitelist.label")}),e.jsx(O,{children:s("safe.form.emailWhitelist.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("email_whitelist_enable")&&e.jsx(v,{control:a.control,name:"email_whitelist_suffix",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailWhitelist.suffixes.label")}),e.jsx(y,{children:e.jsx(Ds,{placeholder:s("safe.form.emailWhitelist.suffixes.placeholder"),...o,value:(o.value||[]).join(` `),onChange:c=>{const h=c.target.value.split(` -`).filter(Boolean);o.onChange(h),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.emailWhitelist.suffixes.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"recaptcha_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.enable.label")}),e.jsx(O,{children:s("safe.form.recaptcha.enable.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("recaptcha_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"recaptcha_site_key",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.siteKey.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.recaptcha.siteKey.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.recaptcha.siteKey.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"recaptcha_key",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.key.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.recaptcha.key.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.recaptcha.key.description")}),e.jsx(E,{})]})})]}),e.jsx(v,{control:a.control,name:"register_limit_by_ip_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.enable.label")}),e.jsx(O,{children:s("safe.form.registerLimit.enable.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("register_limit_by_ip_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"register_limit_count",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.count.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.registerLimit.count.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.registerLimit.count.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"register_limit_expire",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.expire.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.registerLimit.expire.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.registerLimit.expire.description")}),e.jsx(E,{})]})})]}),e.jsx(v,{control:a.control,name:"password_limit_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.enable.label")}),e.jsx(O,{children:s("safe.form.passwordLimit.enable.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("password_limit_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"password_limit_count",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.count.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.passwordLimit.count.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.passwordLimit.count.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"password_limit_expire",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.expire.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.passwordLimit.expire.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.passwordLimit.expire.description")}),e.jsx(E,{})]})})]}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("safe.form.saving")})]})})}function Om(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("safe.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("safe.description")})]}),e.jsx(Te,{}),e.jsx(Mm,{})]})}const zm=Object.freeze(Object.defineProperty({__proto__:null,default:Om},Symbol.toStringTag,{value:"Module"})),$m=x.object({plan_change_enable:x.boolean().nullable().default(!1),reset_traffic_method:x.coerce.number().nullable().default(0),surplus_enable:x.boolean().nullable().default(!1),new_order_event_id:x.coerce.number().nullable().default(0),renew_order_event_id:x.coerce.number().nullable().default(0),change_order_event_id:x.coerce.number().nullable().default(0),show_info_to_server_enable:x.boolean().nullable().default(!1),show_protocol_to_server_enable:x.boolean().nullable().default(!1),default_remind_expire:x.boolean().nullable().default(!1),default_remind_traffic:x.boolean().nullable().default(!1),subscribe_path:x.string().nullable().default("s")}),Am={plan_change_enable:!1,reset_traffic_method:0,surplus_enable:!1,new_order_event_id:0,renew_order_event_id:0,change_order_event_id:0,show_info_to_server_enable:!1,show_protocol_to_server_enable:!1,default_remind_expire:!1,default_remind_traffic:!1,subscribe_path:"s"};function qm(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce($m),defaultValues:Am,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","subscribe"],queryFn:()=>he.getSettings("subscribe")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:o=>{o.data&&A.success(s("common.autoSaved"))}});m.useEffect(()=>{if(i?.data?.subscribe){const o=i?.data?.subscribe;Object.entries(o).forEach(([c,h])=>{a.setValue(c,h)}),r.current=o}},[i]);const d=m.useCallback(ke.debounce(async o=>{if(!ke.isEqual(o,r.current)){t(!0);try{await l(o),r.current=o}finally{t(!1)}}},1e3),[l]),u=m.useCallback(o=>{d(o)},[d]);return m.useEffect(()=>{const o=a.watch(c=>{u(c)});return()=>o.unsubscribe()},[a.watch,u]),e.jsx(Se,{...a,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:a.control,name:"plan_change_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.plan_change_enable.title")}),e.jsx(O,{children:s("subscribe.plan_change_enable.description")}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"reset_traffic_method",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.reset_traffic_method.title")}),e.jsxs(J,{onValueChange:o.onChange,value:o.value?.toString()||"0",children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择重置方式"})})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("subscribe.reset_traffic_method.options.monthly_first")}),e.jsx($,{value:"1",children:s("subscribe.reset_traffic_method.options.monthly_reset")}),e.jsx($,{value:"2",children:s("subscribe.reset_traffic_method.options.no_reset")}),e.jsx($,{value:"3",children:s("subscribe.reset_traffic_method.options.yearly_first")}),e.jsx($,{value:"4",children:s("subscribe.reset_traffic_method.options.yearly_reset")})]})]}),e.jsx(O,{children:s("subscribe.reset_traffic_method.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"surplus_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.surplus_enable.title")}),e.jsx(O,{children:s("subscribe.surplus_enable.description")}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"new_order_event_id",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.new_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(J,{onValueChange:o.onChange,value:o.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("subscribe.new_order_event.options.no_action")}),e.jsx($,{value:"1",children:s("subscribe.new_order_event.options.reset_traffic")})]})]})})}),e.jsx(O,{children:s("subscribe.new_order_event.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"renew_order_event_id",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.renew_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(J,{onValueChange:o.onChange,value:o.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("subscribe.renew_order_event.options.no_action")}),e.jsx($,{value:"1",children:s("subscribe.renew_order_event.options.reset_traffic")})]})]})})}),e.jsx(O,{children:s("subscribe.renew_order_event.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"change_order_event_id",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.change_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(J,{onValueChange:o.onChange,value:o.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("subscribe.change_order_event.options.no_action")}),e.jsx($,{value:"1",children:s("subscribe.change_order_event.options.reset_traffic")})]})]})})}),e.jsx(O,{children:s("subscribe.change_order_event.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"subscribe_path",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.subscribe_path.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:"subscribe",...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[s("subscribe.subscribe_path.description"),e.jsx("br",{}),s("subscribe.subscribe_path.current_format",{path:o.value||"s"})]}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"show_info_to_server_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("subscribe.show_info_to_server.title")}),e.jsx(O,{children:s("subscribe.show_info_to_server.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"show_protocol_to_server_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("subscribe.show_protocol_to_server.title")}),e.jsx(O,{children:s("subscribe.show_protocol_to_server.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function Hm(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("subscribe.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("subscribe.description")})]}),e.jsx(Te,{}),e.jsx(qm,{})]})}const Um=Object.freeze(Object.defineProperty({__proto__:null,default:Hm},Symbol.toStringTag,{value:"Module"})),Km=x.object({invite_force:x.boolean().default(!1),invite_commission:x.coerce.string().default("0"),invite_gen_limit:x.coerce.string().default("0"),invite_never_expire:x.boolean().default(!1),commission_first_time_enable:x.boolean().default(!1),commission_auto_check_enable:x.boolean().default(!1),commission_withdraw_limit:x.coerce.string().default("0"),commission_withdraw_method:x.array(x.string()).default(["支付宝","USDT","Paypal"]),withdraw_close_enable:x.boolean().default(!1),commission_distribution_enable:x.boolean().default(!1),commission_distribution_l1:x.coerce.number().default(0),commission_distribution_l2:x.coerce.number().default(0),commission_distribution_l3:x.coerce.number().default(0)}),Bm={invite_force:!1,invite_commission:"0",invite_gen_limit:"0",invite_never_expire:!1,commission_first_time_enable:!1,commission_auto_check_enable:!1,commission_withdraw_limit:"0",commission_withdraw_method:["支付宝","USDT","Paypal"],withdraw_close_enable:!1,commission_distribution_enable:!1,commission_distribution_l1:0,commission_distribution_l2:0,commission_distribution_l3:0};function Gm(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(Km),defaultValues:Bm,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","invite"],queryFn:()=>he.getSettings("invite")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:o=>{o.data&&A.success(s("common.autoSaved"))}});m.useEffect(()=>{if(i?.data?.invite){const o=i?.data?.invite;Object.entries(o).forEach(([c,h])=>{typeof h=="number"?a.setValue(c,String(h)):a.setValue(c,h)}),r.current=o}},[i]);const d=m.useCallback(ke.debounce(async o=>{if(!ke.isEqual(o,r.current)){t(!0);try{await l(o),r.current=o}finally{t(!1)}}},1e3),[l]),u=m.useCallback(o=>{d(o)},[d]);return m.useEffect(()=>{const o=a.watch(c=>{u(c)});return()=>o.unsubscribe()},[a.watch,u]),e.jsx(Se,{...a,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:a.control,name:"invite_force",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.invite_force.title")}),e.jsx(O,{children:s("invite.invite_force.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"invite_commission",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("invite.invite_commission.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("invite.invite_commission.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("invite.invite_commission.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"invite_gen_limit",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("invite.invite_gen_limit.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("invite.invite_gen_limit.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("invite.invite_gen_limit.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"invite_never_expire",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.invite_never_expire.title")}),e.jsx(O,{children:s("invite.invite_never_expire.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"commission_first_time_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_first_time.title")}),e.jsx(O,{children:s("invite.commission_first_time.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"commission_auto_check_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_auto_check.title")}),e.jsx(O,{children:s("invite.commission_auto_check.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"commission_withdraw_limit",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("invite.commission_withdraw_limit.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("invite.commission_withdraw_limit.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("invite.commission_withdraw_limit.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"commission_withdraw_method",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("invite.commission_withdraw_method.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("invite.commission_withdraw_method.placeholder"),...o,value:Array.isArray(o.value)?o.value.join(","):"",onChange:c=>{const h=c.target.value.split(",").filter(Boolean);o.onChange(h),u(a.getValues())}})}),e.jsx(O,{children:s("invite.commission_withdraw_method.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"withdraw_close_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.withdraw_close.title")}),e.jsx(O,{children:s("invite.withdraw_close.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"commission_distribution_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_distribution.title")}),e.jsx(O,{children:s("invite.commission_distribution.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("commission_distribution_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"commission_distribution_l1",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:s("invite.commission_distribution.l1")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...o,value:o.value||"",onChange:c=>{const h=c.target.value?Number(c.target.value):0;o.onChange(h),u(a.getValues())}})}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"commission_distribution_l2",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:s("invite.commission_distribution.l2")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...o,value:o.value||"",onChange:c=>{const h=c.target.value?Number(c.target.value):0;o.onChange(h),u(a.getValues())}})}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"commission_distribution_l3",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:s("invite.commission_distribution.l3")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...o,value:o.value||"",onChange:c=>{const h=c.target.value?Number(c.target.value):0;o.onChange(h),u(a.getValues())}})}),e.jsx(E,{})]})})]}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("invite.saving")})]})})}function Wm(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("invite.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("invite.description")})]}),e.jsx(Te,{}),e.jsx(Gm,{})]})}const Ym=Object.freeze(Object.defineProperty({__proto__:null,default:Wm},Symbol.toStringTag,{value:"Module"})),Jm=x.object({frontend_theme:x.string().nullable(),frontend_theme_sidebar:x.string().nullable(),frontend_theme_header:x.string().nullable(),frontend_theme_color:x.string().nullable(),frontend_background_url:x.string().url().nullable()}),Qm={frontend_theme:"",frontend_theme_sidebar:"",frontend_theme_header:"",frontend_theme_color:"",frontend_background_url:""};function Xm(){const{data:s}=ne({queryKey:["settings","frontend"],queryFn:()=>he.getSettings("frontend")}),n=we({resolver:Ce(Jm),defaultValues:Qm,mode:"onChange"});m.useEffect(()=>{if(s?.data?.frontend){const r=s?.data?.frontend;Object.entries(r).forEach(([a,i])=>{n.setValue(a,i)})}},[s]);function t(r){he.saveSettings(r).then(({data:a})=>{a&&A.success("更新成功")})}return e.jsx(Se,{...n,children:e.jsxs("form",{onSubmit:n.handleSubmit(t),className:"space-y-8",children:[e.jsx(v,{control:n.control,name:"frontend_theme_sidebar",render:({field:r})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:"边栏风格"}),e.jsx(O,{children:"边栏风格"})]}),e.jsx(y,{children:e.jsx(Z,{checked:r.value,onCheckedChange:r.onChange})})]})}),e.jsx(v,{control:n.control,name:"frontend_theme_header",render:({field:r})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:"头部风格"}),e.jsx(O,{children:"边栏风格"})]}),e.jsx(y,{children:e.jsx(Z,{checked:r.value,onCheckedChange:r.onChange})})]})}),e.jsx(v,{control:n.control,name:"frontend_theme_color",render:({field:r})=>e.jsxs(p,{children:[e.jsx(j,{children:"主题色"}),e.jsxs("div",{className:"relative w-max",children:[e.jsx(y,{children:e.jsxs("select",{className:b(Tt({variant:"outline"}),"w-[200px] appearance-none font-normal"),...r,children:[e.jsx("option",{value:"default",children:"默认"}),e.jsx("option",{value:"black",children:"黑色"}),e.jsx("option",{value:"blackblue",children:"暗蓝色"}),e.jsx("option",{value:"green",children:"奶绿色"})]})}),e.jsx(Sn,{className:"absolute right-3 top-2.5 h-4 w-4 opacity-50"})]}),e.jsx(O,{children:"主题色"}),e.jsx(E,{})]})}),e.jsx(v,{control:n.control,name:"frontend_background_url",render:({field:r})=>e.jsxs(p,{children:[e.jsx(j,{children:"背景"}),e.jsx(y,{children:e.jsx(P,{placeholder:"请输入图片地址",...r})}),e.jsx(O,{children:"将会在后台登录页面进行展示。"}),e.jsx(E,{})]})}),e.jsx(L,{type:"submit",children:"保存设置"})]})})}function Zm(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"个性化设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"自定义系统界面外观,包括主题风格、布局、颜色方案、背景图等个性化选项。"})]}),e.jsx(Te,{}),e.jsx(Xm,{})]})}const eu=Object.freeze(Object.defineProperty({__proto__:null,default:Zm},Symbol.toStringTag,{value:"Module"})),su=x.object({server_pull_interval:x.coerce.number().nullable(),server_push_interval:x.coerce.number().nullable(),server_token:x.string().nullable(),device_limit_mode:x.coerce.number().nullable()}),tu={server_pull_interval:0,server_push_interval:0,server_token:"",device_limit_mode:0};function au(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(su),defaultValues:tu,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","server"],queryFn:()=>he.getSettings("server")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:c=>{c.data&&A.success(s("common.AutoSaved"))}});m.useEffect(()=>{if(i?.data.server){const c=i.data.server;Object.entries(c).forEach(([h,k])=>{a.setValue(h,k)}),r.current=c}},[i]);const d=m.useCallback(ke.debounce(async c=>{if(!ke.isEqual(c,r.current)){t(!0);try{await l(c),r.current=c}finally{t(!1)}}},1e3),[l]),u=m.useCallback(c=>{d(c)},[d]);m.useEffect(()=>{const c=a.watch(h=>{u(h)});return()=>c.unsubscribe()},[a.watch,u]);const o=()=>{const c=Math.floor(Math.random()*17)+16,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let k="";for(let C=0;Ce.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("server.server_token.title")}),e.jsx(y,{children:e.jsxs("div",{className:"relative",children:[e.jsx(P,{placeholder:s("server.server_token.placeholder"),...c,value:c.value||"",className:"pr-10"}),e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(G,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2",onClick:h=>{h.preventDefault(),o()},children:e.jsx(Ec,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"})})}),e.jsx(ce,{children:e.jsx("p",{children:s("server.server_token.generate_tooltip")})})]})})]})}),e.jsx(O,{children:s("server.server_token.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"server_pull_interval",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("server.server_pull_interval.title")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("server.server_pull_interval.placeholder"),...c,value:c.value||"",onChange:h=>{const k=h.target.value?Number(h.target.value):null;c.onChange(k)}})}),e.jsx(O,{children:s("server.server_pull_interval.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"server_push_interval",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("server.server_push_interval.title")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("server.server_push_interval.placeholder"),...c,value:c.value||"",onChange:h=>{const k=h.target.value?Number(h.target.value):null;c.onChange(k)}})}),e.jsx(O,{children:s("server.server_push_interval.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"device_limit_mode",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("server.device_limit_mode.title")}),e.jsxs(J,{onValueChange:c.onChange,value:c.value?.toString()||"0",children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:s("server.device_limit_mode.placeholder")})})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("server.device_limit_mode.strict")}),e.jsx($,{value:"1",children:s("server.device_limit_mode.relaxed")})]})]}),e.jsx(O,{children:s("server.device_limit_mode.description")}),e.jsx(E,{})]})}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("server.saving")})]})})}function nu(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("server.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("server.description")})]}),e.jsx(Te,{}),e.jsx(au,{})]})}const ru=Object.freeze(Object.defineProperty({__proto__:null,default:nu},Symbol.toStringTag,{value:"Module"}));function lu({open:s,onOpenChange:n,result:t}){const r=!t.error;return e.jsx(ge,{open:s,onOpenChange:n,children:e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[r?e.jsx(ol,{className:"h-5 w-5 text-green-500"}):e.jsx(cl,{className:"h-5 w-5 text-destructive"}),e.jsx(fe,{children:r?"邮件发送成功":"邮件发送失败"})]}),e.jsx(Ve,{children:r?"测试邮件已成功发送,请检查收件箱":"发送测试邮件时遇到错误"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"发送详情"}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2 text-sm",children:[e.jsx("div",{className:"text-muted-foreground",children:"收件地址"}),e.jsx("div",{children:t.email}),e.jsx("div",{className:"text-muted-foreground",children:"邮件主题"}),e.jsx("div",{children:t.subject}),e.jsx("div",{className:"text-muted-foreground",children:"模板名称"}),e.jsx("div",{children:t.template_name})]})]}),t.error&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium text-destructive",children:"错误信息"}),e.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive break-all",children:t.error})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"配置信息"}),e.jsx(lt,{className:"h-[200px] rounded-md border p-4",children:e.jsx("div",{className:"grid gap-2 text-sm",children:e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2",children:[e.jsx("div",{className:"text-muted-foreground",children:"驱动"}),e.jsx("div",{children:t.config.driver}),e.jsx("div",{className:"text-muted-foreground",children:"服务器"}),e.jsx("div",{children:t.config.host}),e.jsx("div",{className:"text-muted-foreground",children:"端口"}),e.jsx("div",{children:t.config.port}),e.jsx("div",{className:"text-muted-foreground",children:"加密方式"}),e.jsx("div",{children:t.config.encryption||"无"}),e.jsx("div",{className:"text-muted-foreground",children:"发件人"}),e.jsx("div",{children:t.config.from.address?`${t.config.from.address}${t.config.from.name?` (${t.config.from.name})`:""}`:"未设置"}),e.jsx("div",{className:"text-muted-foreground",children:"用户名"}),e.jsx("div",{children:t.config.username||"未设置"})]})})})]})]})]})})}const iu=x.object({email_template:x.string().nullable().default("classic"),email_host:x.string().nullable().default(""),email_port:x.coerce.number().nullable().default(465),email_username:x.string().nullable().default(""),email_password:x.string().nullable().default(""),email_encryption:x.string().nullable().default(""),email_from_address:x.string().email().nullable().default(""),remind_mail_enable:x.boolean().nullable().default(!1)});function ou(){const{t:s}=V("settings"),[n,t]=m.useState(null),[r,a]=m.useState(!1),i=m.useRef(null),[l,d]=m.useState(!1),u=we({resolver:Ce(iu),defaultValues:{},mode:"onBlur"}),{data:o}=ne({queryKey:["settings","email"],queryFn:()=>he.getSettings("email")}),{data:c}=ne({queryKey:["emailTemplate"],queryFn:()=>he.getEmailTemplate()}),{mutateAsync:h}=Ts({mutationFn:he.saveSettings,onSuccess:N=>{N.data&&A.success(s("common.autoSaved"))}}),{mutate:k,isPending:C}=Ts({mutationFn:he.sendTestMail,onMutate:()=>{t(null),a(!1)},onSuccess:N=>{t(N.data),a(!0),N.data.error?A.error(s("email.test.error")):A.success(s("email.test.success"))}});m.useEffect(()=>{if(o?.data.email){const N=o.data.email;Object.entries(N).forEach(([_,T])=>{u.setValue(_,T)}),i.current=N}},[o]);const S=m.useCallback(ke.debounce(async N=>{if(!ke.isEqual(N,i.current)){d(!0);try{await h(N),i.current=N}finally{d(!1)}}},1e3),[h]),f=m.useCallback(N=>{S(N)},[S]);return m.useEffect(()=>{const N=u.watch(_=>{f(_)});return()=>N.unsubscribe()},[u.watch,f]),e.jsxs(e.Fragment,{children:[e.jsx(Se,{...u,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:u.control,name:"email_host",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_host.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(O,{children:s("email.email_host.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_port",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_port.title")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("common.placeholder"),...N,value:N.value||"",onChange:_=>{const T=_.target.value?Number(_.target.value):null;N.onChange(T)}})}),e.jsx(O,{children:s("email.email_port.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_encryption",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_encryption.title")}),e.jsxs(J,{onValueChange:_=>{const T=_==="none"?"":_;N.onChange(T)},value:N.value===""||N.value===null||N.value===void 0?"none":N.value,children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择加密方式"})})}),e.jsxs(Y,{children:[e.jsx($,{value:"none",children:s("email.email_encryption.none")}),e.jsx($,{value:"ssl",children:s("email.email_encryption.ssl")}),e.jsx($,{value:"tls",children:s("email.email_encryption.tls")})]})]}),e.jsx(O,{children:s("email.email_encryption.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_username",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_username.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(O,{children:s("email.email_username.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_password",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_password.title")}),e.jsx(y,{children:e.jsx(P,{type:"password",placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(O,{children:s("email.email_password.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_from_address",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_from.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(O,{children:s("email.email_from.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_template",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_template.title")}),e.jsxs(J,{onValueChange:_=>{N.onChange(_),f(u.getValues())},value:N.value||void 0,children:[e.jsx(y,{children:e.jsx(W,{className:"w-[200px]",children:e.jsx(Q,{placeholder:s("email.email_template.placeholder")})})}),e.jsx(Y,{children:c?.data?.map(_=>e.jsx($,{value:_,children:_},_))})]}),e.jsx(O,{children:s("email.email_template.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"remind_mail_enable",render:({field:N})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("email.remind_mail.title")}),e.jsx(O,{children:s("email.remind_mail.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:N.value||!1,onCheckedChange:_=>{N.onChange(_),f(u.getValues())}})})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(L,{onClick:()=>k(),loading:C,disabled:C,children:s(C?"email.test.sending":"email.test.title")})})]})}),l&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("saving")}),n&&e.jsx(lu,{open:r,onOpenChange:a,result:n})]})}function cu(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("email.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("email.description")})]}),e.jsx(Te,{}),e.jsx(ou,{})]})}const du=Object.freeze(Object.defineProperty({__proto__:null,default:cu},Symbol.toStringTag,{value:"Module"})),mu=x.object({telegram_bot_enable:x.boolean().nullable(),telegram_bot_token:x.string().nullable(),telegram_discuss_link:x.string().nullable()}),uu={telegram_bot_enable:!1,telegram_bot_token:"",telegram_discuss_link:""};function xu(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(mu),defaultValues:uu,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","telegram"],queryFn:()=>he.getSettings("telegram")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:h=>{h.data&&A.success(s("common.autoSaved"))}}),{mutate:d,isPending:u}=Ts({mutationFn:he.setTelegramWebhook,onSuccess:h=>{h.data&&A.success(s("telegram.webhook.success"))}});m.useEffect(()=>{if(i?.data.telegram){const h=i.data.telegram;Object.entries(h).forEach(([k,C])=>{a.setValue(k,C)}),r.current=h}},[i]);const o=m.useCallback(ke.debounce(async h=>{if(!ke.isEqual(h,r.current)){t(!0);try{await l(h),r.current=h}finally{t(!1)}}},1e3),[l]),c=m.useCallback(h=>{o(h)},[o]);return m.useEffect(()=>{const h=a.watch(k=>{c(k)});return()=>h.unsubscribe()},[a.watch,c]),e.jsx(Se,{...a,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:a.control,name:"telegram_bot_token",render:({field:h})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("telegram.bot_token.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("telegram.bot_token.placeholder"),...h,value:h.value||""})}),e.jsx(O,{children:s("telegram.bot_token.description")}),e.jsx(E,{})]})}),a.watch("telegram_bot_token")&&e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("telegram.webhook.title")}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(L,{loading:u,disabled:u,onClick:()=>d(),children:s(u?"telegram.webhook.setting":"telegram.webhook.button")}),n&&e.jsx("span",{className:"text-sm text-muted-foreground",children:s("common.saving")})]}),e.jsx(O,{children:s("telegram.webhook.description")}),e.jsx(E,{})]}),e.jsx(v,{control:a.control,name:"telegram_bot_enable",render:({field:h})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("telegram.bot_enable.title")}),e.jsx(O,{children:s("telegram.bot_enable.description")}),e.jsx(y,{children:e.jsx(Z,{checked:h.value||!1,onCheckedChange:k=>{h.onChange(k),c(a.getValues())}})}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"telegram_discuss_link",render:({field:h})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("telegram.discuss_link.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("telegram.discuss_link.placeholder"),...h,value:h.value||""})}),e.jsx(O,{children:s("telegram.discuss_link.description")}),e.jsx(E,{})]})}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function hu(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("telegram.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("telegram.description")})]}),e.jsx(Te,{}),e.jsx(xu,{})]})}const gu=Object.freeze(Object.defineProperty({__proto__:null,default:hu},Symbol.toStringTag,{value:"Module"})),fu=x.object({windows_version:x.string().nullable(),windows_download_url:x.string().nullable(),macos_version:x.string().nullable(),macos_download_url:x.string().nullable(),android_version:x.string().nullable(),android_download_url:x.string().nullable()}),pu={windows_version:"",windows_download_url:"",macos_version:"",macos_download_url:"",android_version:"",android_download_url:""};function ju(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(fu),defaultValues:pu,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","app"],queryFn:()=>he.getSettings("app")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:o=>{o.data&&A.success(s("app.save_success"))}});m.useEffect(()=>{if(i?.data.app){const o=i.data.app;Object.entries(o).forEach(([c,h])=>{a.setValue(c,h)}),r.current=o}},[i]);const d=m.useCallback(ke.debounce(async o=>{if(!ke.isEqual(o,r.current)){t(!0);try{await l(o),r.current=o}finally{t(!1)}}},1e3),[l]),u=m.useCallback(o=>{d(o)},[d]);return m.useEffect(()=>{const o=a.watch(c=>{u(c)});return()=>o.unsubscribe()},[a.watch,u]),e.jsx(Se,{...a,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:a.control,name:"windows_version",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.windows.version.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.windows.version.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"windows_download_url",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.windows.download.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.windows.download.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"macos_version",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.macos.version.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.macos.version.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"macos_download_url",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.macos.download.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.macos.download.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"android_version",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.android.version.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.android.version.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"android_download_url",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.android.download.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.android.download.description")}),e.jsx(E,{})]})}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function vu(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("app.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("app.description")})]}),e.jsx(Te,{}),e.jsx(ju,{})]})}const bu=Object.freeze(Object.defineProperty({__proto__:null,default:vu},Symbol.toStringTag,{value:"Module"})),yu=s=>x.object({id:x.number().nullable(),name:x.string().min(2,s("form.validation.name.min")).max(30,s("form.validation.name.max")),icon:x.string().optional().nullable(),notify_domain:x.string().refine(t=>!t||/^https?:\/\/\S+/.test(t),s("form.validation.notify_domain.url")).optional().nullable(),handling_fee_fixed:x.coerce.number().min(0).optional().nullable(),handling_fee_percent:x.coerce.number().min(0).max(100).optional().nullable(),payment:x.string().min(1,s("form.validation.payment.required")),config:x.record(x.string(),x.string())}),xr={id:null,name:"",icon:"",notify_domain:"",handling_fee_fixed:0,handling_fee_percent:0,payment:"",config:{}};function Wl({refetch:s,dialogTrigger:n,type:t="add",defaultFormValues:r=xr}){const{t:a}=V("payment"),[i,l]=m.useState(!1),[d,u]=m.useState(!1),[o,c]=m.useState([]),[h,k]=m.useState([]),C=yu(a),S=we({resolver:Ce(C),defaultValues:r,mode:"onChange"}),f=S.watch("payment");m.useEffect(()=>{i&&(async()=>{const{data:T}=await nt.getMethodList();c(T)})()},[i]),m.useEffect(()=>{if(!f||!i)return;(async()=>{const T={payment:f,...t==="edit"&&{id:Number(S.getValues("id"))}};nt.getMethodForm(T).then(({data:D})=>{k(D);const g=D.reduce((w,R)=>(R.field_name&&(w[R.field_name]=R.value??""),w),{});S.setValue("config",g)})})()},[f,i,S,t]);const N=async _=>{u(!0);try{(await nt.save(_)).data&&(A.success(a("form.messages.success")),S.reset(xr),s(),l(!1))}finally{u(!1)}};return e.jsxs(ge,{open:i,onOpenChange:l,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"})," ",e.jsx("div",{children:a("form.add.button")})]})}),e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsx(ve,{children:e.jsx(fe,{children:a(t==="add"?"form.add.title":"form.edit.title")})}),e.jsx(Se,{...S,children:e.jsxs("form",{onSubmit:S.handleSubmit(N),className:"space-y-4",children:[e.jsx(v,{control:S.control,name:"name",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:a("form.fields.name.placeholder"),..._})}),e.jsx(O,{children:a("form.fields.name.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:S.control,name:"icon",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.icon.label")}),e.jsx(y,{children:e.jsx(P,{..._,value:_.value||"",placeholder:a("form.fields.icon.placeholder")})}),e.jsx(O,{children:a("form.fields.icon.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:S.control,name:"notify_domain",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.notify_domain.label")}),e.jsx(y,{children:e.jsx(P,{..._,value:_.value||"",placeholder:a("form.fields.notify_domain.placeholder")})}),e.jsx(O,{children:a("form.fields.notify_domain.description")}),e.jsx(E,{})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(v,{control:S.control,name:"handling_fee_percent",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.handling_fee_percent.label")}),e.jsx(y,{children:e.jsx(P,{type:"number",..._,value:_.value||"",placeholder:a("form.fields.handling_fee_percent.placeholder")})}),e.jsx(E,{})]})}),e.jsx(v,{control:S.control,name:"handling_fee_fixed",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.handling_fee_fixed.label")}),e.jsx(y,{children:e.jsx(P,{type:"number",..._,value:_.value||"",placeholder:a("form.fields.handling_fee_fixed.placeholder")})}),e.jsx(E,{})]})})]}),e.jsx(v,{control:S.control,name:"payment",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.payment.label")}),e.jsxs(J,{onValueChange:_.onChange,defaultValue:_.value,children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:a("form.fields.payment.placeholder")})})}),e.jsx(Y,{children:o.map(T=>e.jsx($,{value:T,children:T},T))})]}),e.jsx(O,{children:a("form.fields.payment.description")}),e.jsx(E,{})]})}),h.length>0&&e.jsx("div",{className:"space-y-4",children:h.map(_=>e.jsx(v,{control:S.control,name:`config.${_.field_name}`,render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:_.label}),e.jsx(y,{children:e.jsx(P,{...T,value:T.value||""})}),e.jsx(E,{})]})},_.field_name))}),e.jsxs(Le,{children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:a("form.buttons.cancel")})}),e.jsx(L,{type:"submit",disabled:d,children:a("form.buttons.submit")})]})]})})]})]})}function z({column:s,title:n,tooltip:t,className:r}){return s.getCanSort()?e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(L,{variant:"ghost",size:"default",className:b("-ml-3 flex h-8 items-center gap-2 text-nowrap font-medium hover:bg-muted/60",r),onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:[e.jsx("span",{children:n}),t&&e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(sr,{className:"h-4 w-4 cursor-pointer text-muted-foreground"})}),e.jsx(ce,{children:t})]})}),s.getIsSorted()==="asc"?e.jsx(dn,{className:"h-4 w-4 text-foreground/70"}):s.getIsSorted()==="desc"?e.jsx(mn,{className:"h-4 w-4 text-foreground/70"}):e.jsx(Fc,{className:"h-4 w-4 text-muted-foreground/70 transition-colors hover:text-foreground/70"})]})})}):e.jsxs("div",{className:b("flex items-center space-x-1 text-nowrap py-2 font-medium text-muted-foreground",r),children:[e.jsx("span",{children:n}),t&&e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{children:e.jsx(sr,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(ce,{children:t})]})})]})}const On=Ic,Yl=Vc,Nu=Mc,Jl=m.forwardRef(({className:s,...n},t)=>e.jsx(ml,{className:b("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",s),...n,ref:t}));Jl.displayName=ml.displayName;const Oa=m.forwardRef(({className:s,...n},t)=>e.jsxs(Nu,{children:[e.jsx(Jl,{}),e.jsx(ul,{ref:t,className:b("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",s),...n})]}));Oa.displayName=ul.displayName;const za=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",s),...n});za.displayName="AlertDialogHeader";const $a=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...n});$a.displayName="AlertDialogFooter";const Aa=m.forwardRef(({className:s,...n},t)=>e.jsx(xl,{ref:t,className:b("text-lg font-semibold",s),...n}));Aa.displayName=xl.displayName;const qa=m.forwardRef(({className:s,...n},t)=>e.jsx(hl,{ref:t,className:b("text-sm text-muted-foreground",s),...n}));qa.displayName=hl.displayName;const Ha=m.forwardRef(({className:s,...n},t)=>e.jsx(gl,{ref:t,className:b(St(),s),...n}));Ha.displayName=gl.displayName;const Ua=m.forwardRef(({className:s,...n},t)=>e.jsx(fl,{ref:t,className:b(St({variant:"outline"}),"mt-2 sm:mt-0",s),...n}));Ua.displayName=fl.displayName;function ps({onConfirm:s,children:n,title:t="确认操作",description:r="确定要执行此操作吗?",cancelText:a="取消",confirmText:i="确认",variant:l="default",className:d}){return e.jsxs(On,{children:[e.jsx(Yl,{asChild:!0,children:n}),e.jsxs(Oa,{className:b("sm:max-w-[425px]",d),children:[e.jsxs(za,{children:[e.jsx(Aa,{children:t}),e.jsx(qa,{children:r})]}),e.jsxs($a,{children:[e.jsx(Ua,{asChild:!0,children:e.jsx(L,{variant:"outline",children:a})}),e.jsx(Ha,{asChild:!0,children:e.jsx(L,{variant:l,onClick:s,children:i})})]})]})]})}const Ql=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M11.29 15.29a2 2 0 0 0-.12.15a.8.8 0 0 0-.09.18a.6.6 0 0 0-.06.18a1.4 1.4 0 0 0 0 .2a.84.84 0 0 0 .08.38a.9.9 0 0 0 .54.54a.94.94 0 0 0 .76 0a.9.9 0 0 0 .54-.54A1 1 0 0 0 13 16a1 1 0 0 0-.29-.71a1 1 0 0 0-1.42 0M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8 8 0 0 1-8 8m0-13a3 3 0 0 0-2.6 1.5a1 1 0 1 0 1.73 1A1 1 0 0 1 12 9a1 1 0 0 1 0 2a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-.18A3 3 0 0 0 12 7"})}),_u=({refetch:s,isSortMode:n=!1})=>{const{t}=V("payment");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:n?"cursor-move":"opacity-0",children:e.jsx(Ea,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:r})=>e.jsx(z,{column:r,title:t("table.columns.id")}),cell:({row:r})=>e.jsx(U,{variant:"outline",children:r.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"enable",header:({column:r})=>e.jsx(z,{column:r,title:t("table.columns.enable")}),cell:({row:r})=>e.jsx(Z,{defaultChecked:r.getValue("enable"),onCheckedChange:async()=>{const{data:a}=await nt.updateStatus({id:r.original.id});a||s()}}),enableSorting:!1,size:100},{accessorKey:"name",header:({column:r})=>e.jsx(z,{column:r,title:t("table.columns.name")}),cell:({row:r})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:r.getValue("name")})}),enableSorting:!1,size:200},{accessorKey:"payment",header:({column:r})=>e.jsx(z,{column:r,title:t("table.columns.payment")}),cell:({row:r})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:r.getValue("payment")})}),enableSorting:!1,size:200},{accessorKey:"notify_url",header:({column:r})=>e.jsxs("div",{className:"flex items-center",children:[e.jsx(z,{column:r,title:t("table.columns.notify_url")}),e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{className:"ml-1",children:e.jsx(Ql,{className:"h-4 w-4"})}),e.jsx(ce,{children:t("table.columns.notify_url_tooltip")})]})})]}),cell:({row:r})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[300px] truncate font-medium",children:r.getValue("notify_url")})}),enableSorting:!1,size:3e3},{id:"actions",header:({column:r})=>e.jsx(z,{className:"justify-end",column:r,title:t("table.columns.actions")}),cell:({row:r})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(Wl,{refetch:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:t("table.actions.edit")})]}),type:"edit",defaultFormValues:r.original}),e.jsx(ps,{title:t("table.actions.delete.title"),description:t("table.actions.delete.description"),onConfirm:async()=>{const{data:a}=await nt.drop({id:r.original.id});a&&s()},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-destructive/10",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-destructive"}),e.jsx("span",{className:"sr-only",children:t("table.actions.delete.title")})]})})]}),size:100}]};function wu({table:s,refetch:n,saveOrder:t,isSortMode:r}){const{t:a}=V("payment"),i=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between",children:[r?e.jsx("p",{className:"text-sm text-muted-foreground",children:a("table.toolbar.sort.hint")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wl,{refetch:n}),e.jsx(P,{placeholder:a("table.toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:l=>s.getColumn("name")?.setFilterValue(l.target.value),className:"h-8 w-[250px]"}),i&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:[a("table.toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:r?"default":"outline",onClick:t,size:"sm",children:a(r?"table.toolbar.sort.save":"table.toolbar.sort.edit")})})]})}function Cu(){const[s,n]=m.useState([]),[t,r]=m.useState([]),[a,i]=m.useState(!1),[l,d]=m.useState([]),[u,o]=m.useState({"drag-handle":!1}),[c,h]=m.useState({pageSize:20,pageIndex:0}),{refetch:k}=ne({queryKey:["paymentList"],queryFn:async()=>{const{data:_}=await nt.getList();return d(_?.map(T=>({...T,enable:!!T.enable}))||[]),_}});m.useEffect(()=>{o({"drag-handle":a,actions:!a}),h({pageSize:a?99999:10,pageIndex:0})},[a]);const C=(_,T)=>{a&&(_.dataTransfer.setData("text/plain",T.toString()),_.currentTarget.classList.add("opacity-50"))},S=(_,T)=>{if(!a)return;_.preventDefault(),_.currentTarget.classList.remove("bg-muted");const D=parseInt(_.dataTransfer.getData("text/plain"));if(D===T)return;const g=[...l],[w]=g.splice(D,1);g.splice(T,0,w),d(g)},f=async()=>{a?nt.sort({ids:l.map(_=>_.id)}).then(()=>{k(),i(!1),A.success("排序保存成功")}):i(!0)},N=ss({data:l,columns:_u({refetch:k,isSortMode:a}),state:{sorting:t,columnFilters:s,columnVisibility:u,pagination:c},onSortingChange:r,onColumnFiltersChange:n,onColumnVisibilityChange:o,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),initialState:{columnPinning:{right:["actions"]}},pageCount:a?1:void 0});return e.jsx(xs,{table:N,toolbar:_=>e.jsx(wu,{table:_,refetch:k,saveOrder:f,isSortMode:a}),draggable:a,onDragStart:C,onDragEnd:_=>_.currentTarget.classList.remove("opacity-50"),onDragOver:_=>{_.preventDefault(),_.currentTarget.classList.add("bg-muted")},onDragLeave:_=>_.currentTarget.classList.remove("bg-muted"),onDrop:S,showPagination:!a})}function Su(){const{t:s}=V("payment");return e.jsxs(ze,{children:[e.jsxs($e,{className:"flex items-center justify-between",children:[e.jsx(ns,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{children:[e.jsx("header",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("section",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Cu,{})})]})]})}const ku=Object.freeze(Object.defineProperty({__proto__:null,default:Su},Symbol.toStringTag,{value:"Module"}));function Tu({pluginName:s,onClose:n,onSuccess:t}){const{t:r}=V("plugin"),[a,i]=m.useState(!0),[l,d]=m.useState(!1),[u,o]=m.useState(null),c=Oc({config:zc($c())}),h=we({resolver:Ce(c),defaultValues:{config:{}}});m.useEffect(()=>{(async()=>{try{const{data:f}=await Ms.getPluginConfig(s);o(f),h.reset({config:Object.fromEntries(Object.entries(f).map(([N,_])=>[N,_.value]))})}catch{A.error(r("messages.configLoadError"))}finally{i(!1)}})()},[s]);const k=async S=>{d(!0);try{await Ms.updatePluginConfig(s,S.config),A.success(r("messages.configSaveSuccess")),t()}catch{A.error(r("messages.configSaveError"))}finally{d(!1)}},C=(S,f)=>{switch(f.type){case"string":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{children:f.label||f.description}),e.jsx(y,{children:e.jsx(P,{placeholder:f.placeholder,...N})}),f.description&&f.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:f.description}),e.jsx(E,{})]})},S);case"number":case"percentage":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{children:f.label||f.description}),e.jsx(y,{children:e.jsxs("div",{className:"relative",children:[e.jsx(P,{type:"number",placeholder:f.placeholder,...N,onChange:_=>{const T=Number(_.target.value);f.type==="percentage"?N.onChange(Math.min(100,Math.max(0,T))):N.onChange(T)},className:f.type==="percentage"?"pr-8":"",min:f.type==="percentage"?0:void 0,max:f.type==="percentage"?100:void 0,step:f.type==="percentage"?1:void 0}),f.type==="percentage"&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:e.jsx(Ac,{className:"h-4 w-4 text-muted-foreground"})})]})}),f.description&&f.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:f.description}),e.jsx(E,{})]})},S);case"select":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{children:f.label||f.description}),e.jsxs(J,{onValueChange:N.onChange,defaultValue:N.value,children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:f.placeholder})})}),e.jsx(Y,{children:f.options?.map(_=>e.jsx($,{value:_.value,children:_.label},_.value))})]}),f.description&&f.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:f.description}),e.jsx(E,{})]})},S);case"boolean":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(p,{className:"flex flex-row items-center justify-between rounded-lg border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:f.label||f.description}),f.description&&f.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:f.description})]}),e.jsx(y,{children:e.jsx(Z,{checked:N.value,onCheckedChange:N.onChange})})]})},S);case"text":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{children:f.label||f.description}),e.jsx(y,{children:e.jsx(Ds,{placeholder:f.placeholder,...N})}),f.description&&f.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:f.description}),e.jsx(E,{})]})},S);default:return null}};return a?e.jsxs("div",{className:"space-y-4",children:[e.jsx(je,{className:"h-4 w-[200px]"}),e.jsx(je,{className:"h-10 w-full"}),e.jsx(je,{className:"h-4 w-[200px]"}),e.jsx(je,{className:"h-10 w-full"})]}):e.jsx(Se,{...h,children:e.jsxs("form",{onSubmit:h.handleSubmit(k),className:"space-y-4",children:[u&&Object.entries(u).map(([S,f])=>C(S,f)),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(L,{type:"button",variant:"outline",onClick:n,disabled:l,children:r("config.cancel")}),e.jsx(L,{type:"submit",loading:l,disabled:l,children:r("config.save")})]})]})})}function Du(){const{t:s}=V("plugin"),[n,t]=m.useState(null),[r,a]=m.useState(!1),[i,l]=m.useState(null),[d,u]=m.useState(""),[o,c]=m.useState("all"),[h,k]=m.useState(!1),[C,S]=m.useState(!1),[f,N]=m.useState(!1),_=m.useRef(null),{data:T,isLoading:D,refetch:g}=ne({queryKey:["pluginList"],queryFn:async()=>{const{data:F}=await Ms.getPluginList();return F}});T&&[...new Set(T.map(F=>F.category||"other"))];const w=T?.filter(F=>{const X=F.name.toLowerCase().includes(d.toLowerCase())||F.description.toLowerCase().includes(d.toLowerCase())||F.code.toLowerCase().includes(d.toLowerCase()),Ns=o==="all"||F.category===o;return X&&Ns}),R=async F=>{t(F),Ms.installPlugin(F).then(()=>{A.success(s("messages.installSuccess")),g()}).catch(X=>{A.error(X.message||s("messages.installError"))}).finally(()=>{t(null)})},H=async F=>{t(F),Ms.uninstallPlugin(F).then(()=>{A.success(s("messages.uninstallSuccess")),g()}).catch(X=>{A.error(X.message||s("messages.uninstallError"))}).finally(()=>{t(null)})},I=async(F,X)=>{t(F),(X?Ms.disablePlugin:Ms.enablePlugin)(F).then(()=>{A.success(s(X?"messages.disableSuccess":"messages.enableSuccess")),g()}).catch(De=>{A.error(De.message||s(X?"messages.disableError":"messages.enableError"))}).finally(()=>{t(null)})},K=F=>{T?.find(X=>X.code===F),l(F),a(!0)},ae=async F=>{if(!F.name.endsWith(".zip")){A.error(s("upload.error.format"));return}k(!0),Ms.uploadPlugin(F).then(()=>{A.success(s("messages.uploadSuccess")),S(!1),g()}).catch(X=>{A.error(X.message||s("messages.uploadError"))}).finally(()=>{k(!1),_.current&&(_.current.value="")})},ee=F=>{F.preventDefault(),F.stopPropagation(),F.type==="dragenter"||F.type==="dragover"?N(!0):F.type==="dragleave"&&N(!1)},te=F=>{F.preventDefault(),F.stopPropagation(),N(!1),F.dataTransfer.files&&F.dataTransfer.files[0]&&ae(F.dataTransfer.files[0])},q=async F=>{t(F),Ms.deletePlugin(F).then(()=>{A.success(s("messages.deleteSuccess")),g()}).catch(X=>{A.error(X.message||s("messages.deleteError"))}).finally(()=>{t(null)})};return e.jsxs(ze,{children:[e.jsxs($e,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(wn,{className:"h-6 w-6"}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("title")})]}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{children:[e.jsxs("div",{className:"mb-8 space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"relative max-w-sm flex-1",children:[e.jsx(Cn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(P,{placeholder:s("search.placeholder"),value:d,onChange:F=>u(F.target.value),className:"pl-9"})]}),e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs(L,{onClick:()=>S(!0),variant:"outline",className:"shrink-0",size:"sm",children:[e.jsx(wt,{className:"mr-2 h-4 w-4"}),s("upload.button")]})})]}),e.jsxs(Dt,{defaultValue:"all",className:"w-full",children:[e.jsxs(dt,{children:[e.jsx(Xe,{value:"all",children:s("tabs.all")}),e.jsx(Xe,{value:"installed",children:s("tabs.installed")}),e.jsx(Xe,{value:"available",children:s("tabs.available")})]}),e.jsx(ks,{value:"all",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:D?e.jsxs(e.Fragment,{children:[e.jsx(an,{}),e.jsx(an,{}),e.jsx(an,{})]}):w?.map(F=>e.jsx(tn,{plugin:F,onInstall:R,onUninstall:H,onToggleEnable:I,onOpenConfig:K,onDelete:q,isLoading:n===F.name},F.name))})}),e.jsx(ks,{value:"installed",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:w?.filter(F=>F.is_installed).map(F=>e.jsx(tn,{plugin:F,onInstall:R,onUninstall:H,onToggleEnable:I,onOpenConfig:K,onDelete:q,isLoading:n===F.name},F.name))})}),e.jsx(ks,{value:"available",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:w?.filter(F=>!F.is_installed).map(F=>e.jsx(tn,{plugin:F,onInstall:R,onUninstall:H,onToggleEnable:I,onOpenConfig:K,onDelete:q,isLoading:n===F.name},F.code))})})]})]}),e.jsx(ge,{open:r,onOpenChange:a,children:e.jsxs(de,{className:"sm:max-w-lg",children:[e.jsxs(ve,{children:[e.jsxs(fe,{children:[T?.find(F=>F.code===i)?.name," ",s("config.title")]}),e.jsx(Ve,{children:s("config.description")})]}),i&&e.jsx(Tu,{pluginName:i,onClose:()=>a(!1),onSuccess:()=>{a(!1),g()}})]})}),e.jsx(ge,{open:C,onOpenChange:S,children:e.jsxs(de,{className:"sm:max-w-md",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:s("upload.title")}),e.jsx(Ve,{children:s("upload.description")})]}),e.jsxs("div",{className:b("relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",f&&"border-primary/50 bg-muted/50"),onDragEnter:ee,onDragLeave:ee,onDragOver:ee,onDrop:te,children:[e.jsx("input",{type:"file",ref:_,className:"hidden",accept:".zip",onChange:F=>{const X=F.target.files?.[0];X&&ae(X)}}),h?e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("upload.uploading")})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"rounded-full border-2 border-muted-foreground/25 p-3",children:e.jsx(wt,{className:"h-6 w-6 text-muted-foreground/50"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium",children:[s("upload.dragText")," ",e.jsx("button",{type:"button",onClick:()=>_.current?.click(),className:"mx-1 text-primary hover:underline",children:s("upload.clickText")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("upload.supportText")})]})]})})]})]})})]})]})}function tn({plugin:s,onInstall:n,onUninstall:t,onToggleEnable:r,onOpenConfig:a,onDelete:i,isLoading:l}){const{t:d}=V("plugin");return e.jsxs(Re,{className:"group relative overflow-hidden transition-all hover:shadow-md",children:[e.jsxs(Fe,{children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{children:s.name}),s.is_installed&&e.jsx(U,{variant:s.is_enabled?"success":"secondary",children:s.is_enabled?d("status.enabled"):d("status.disabled")})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(wn,{className:"h-4 w-4"}),e.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:s.code})]}),e.jsxs("div",{children:["v",s.version]})]})]})}),e.jsx(Os,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"mt-2",children:s.description}),e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:e.jsxs("div",{className:"flex items-center gap-1",children:[d("author"),": ",s.author]})})]})})]}),e.jsx(Ie,{children:e.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.is_installed?e.jsxs(e.Fragment,{children:[e.jsxs(L,{variant:"outline",size:"sm",onClick:()=>a(s.code),disabled:!s.is_enabled||l,children:[e.jsx(pl,{className:"mr-2 h-4 w-4"}),d("button.config")]}),e.jsxs(L,{variant:s.is_enabled?"destructive":"default",size:"sm",onClick:()=>r(s.code,s.is_enabled),disabled:l,children:[e.jsx(qc,{className:"mr-2 h-4 w-4"}),s.is_enabled?d("button.disable"):d("button.enable")]}),e.jsx(ps,{title:d("uninstall.title"),description:d("uninstall.description"),cancelText:d("common:cancel"),confirmText:d("uninstall.button"),variant:"destructive",onConfirm:()=>t(s.code),children:e.jsxs(L,{variant:"outline",size:"sm",className:"text-muted-foreground hover:text-destructive",disabled:l,children:[e.jsx(ds,{className:"mr-2 h-4 w-4"}),d("button.uninstall")]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{onClick:()=>n(s.code),disabled:l,loading:l,children:d("button.install")}),e.jsx(ps,{title:d("delete.title"),description:d("delete.description"),cancelText:d("common:cancel"),confirmText:d("delete.button"),variant:"destructive",onConfirm:()=>i(s.code),children:e.jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",disabled:l,children:e.jsx(ds,{className:"h-4 w-4"})})})]})})})]})}function an(){return e.jsxs(Re,{children:[e.jsxs(Fe,{children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(je,{className:"h-6 w-[200px]"}),e.jsx(je,{className:"h-6 w-[80px]"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(je,{className:"h-5 w-[120px]"}),e.jsx(je,{className:"h-5 w-[60px]"})]})]})}),e.jsxs("div",{className:"space-y-2 pt-2",children:[e.jsx(je,{className:"h-4 w-[300px]"}),e.jsx(je,{className:"h-4 w-[150px]"})]})]}),e.jsx(Ie,{children:e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(je,{className:"h-9 w-[100px]"}),e.jsx(je,{className:"h-9 w-[100px]"}),e.jsx(je,{className:"h-8 w-8"})]})})]})}const Pu=Object.freeze(Object.defineProperty({__proto__:null,default:Du},Symbol.toStringTag,{value:"Module"})),Lu=(s,n)=>{let t=null;switch(s.field_type){case"input":t=e.jsx(P,{placeholder:s.placeholder,...n});break;case"textarea":t=e.jsx(Ds,{placeholder:s.placeholder,...n});break;case"select":t=e.jsx("select",{className:b(St({variant:"outline"}),"w-full appearance-none font-normal"),...n,children:s.select_options&&Object.keys(s.select_options).map(r=>e.jsx("option",{value:r,children:s.select_options?.[r]},r))});break;default:t=null;break}return t};function Ru({themeKey:s,themeInfo:n}){const{t}=V("theme"),[r,a]=m.useState(!1),[i,l]=m.useState(!1),[d,u]=m.useState(!1),o=we({defaultValues:n.configs.reduce((k,C)=>(k[C.field_name]="",k),{})}),c=async()=>{l(!0),Kt.getConfig(s).then(({data:k})=>{Object.entries(k).forEach(([C,S])=>{o.setValue(C,S)})}).finally(()=>{l(!1)})},h=async k=>{u(!0),Kt.updateConfig(s,k).then(()=>{A.success(t("config.success")),a(!1)}).finally(()=>{u(!1)})};return e.jsxs(ge,{open:r,onOpenChange:k=>{a(k),k?c():o.reset()},children:[e.jsx(as,{asChild:!0,children:e.jsx(L,{variant:"outline",children:t("card.configureTheme")})}),e.jsxs(de,{className:"max-h-[90vh] overflow-auto sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:t("config.title",{name:n.name})}),e.jsx(Ve,{children:t("config.description")})]}),i?e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(ya,{className:"h-6 w-6 animate-spin"})}):e.jsx(Se,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(h),className:"space-y-4",children:[n.configs.map(k=>e.jsx(v,{control:o.control,name:k.field_name,render:({field:C})=>e.jsxs(p,{children:[e.jsx(j,{children:k.label}),e.jsx(y,{children:Lu(k,C)}),e.jsx(E,{})]})},k.field_name)),e.jsxs(Le,{className:"mt-6 gap-2",children:[e.jsx(L,{type:"button",variant:"secondary",onClick:()=>a(!1),children:t("config.cancel")}),e.jsx(L,{type:"submit",loading:d,children:t("config.save")})]})]})})]})]})}function Eu(){const{t:s}=V("theme"),[n,t]=m.useState(null),[r,a]=m.useState(!1),[i,l]=m.useState(!1),[d,u]=m.useState(!1),[o,c]=m.useState(null),h=m.useRef(null),[k,C]=m.useState(0),{data:S,isLoading:f,refetch:N}=ne({queryKey:["themeList"],queryFn:async()=>{const{data:I}=await Kt.getList();return I}}),_=async I=>{t(I),he.updateSystemConfig({frontend_theme:I}).then(()=>{A.success("主题切换成功"),N()}).finally(()=>{t(null)})},T=async I=>{if(!I.name.endsWith(".zip")){A.error(s("upload.error.format"));return}a(!0),Kt.upload(I).then(()=>{A.success("主题上传成功"),l(!1),N()}).finally(()=>{a(!1),h.current&&(h.current.value="")})},D=I=>{I.preventDefault(),I.stopPropagation(),I.type==="dragenter"||I.type==="dragover"?u(!0):I.type==="dragleave"&&u(!1)},g=I=>{I.preventDefault(),I.stopPropagation(),u(!1),I.dataTransfer.files&&I.dataTransfer.files[0]&&T(I.dataTransfer.files[0])},w=()=>{o&&C(I=>I===0?o.images.length-1:I-1)},R=()=>{o&&C(I=>I===o.images.length-1?0:I+1)},H=(I,K)=>{C(0),c({name:I,images:K})};return e.jsxs(ze,{children:[e.jsxs($e,{className:"flex items-center justify-between",children:[e.jsx(ns,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("div",{className:"mb-2",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-muted-foreground",children:s("description")}),e.jsxs(L,{onClick:()=>l(!0),variant:"outline",className:"ml-4 shrink-0",size:"sm",children:[e.jsx(wt,{className:"mr-2 h-4 w-4"}),s("upload.button")]})]})]}),e.jsx("section",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3",children:f?e.jsxs(e.Fragment,{children:[e.jsx(hr,{}),e.jsx(hr,{})]}):S?.themes&&Object.entries(S.themes).map(([I,K])=>e.jsx(Re,{className:"group relative overflow-hidden transition-all hover:shadow-md",style:{backgroundImage:K.background_url?`url(${K.background_url})`:"none",backgroundSize:"cover",backgroundPosition:"center"},children:e.jsxs("div",{className:b("relative z-10 h-full transition-colors",K.background_url?"group-hover:from-background/98 bg-gradient-to-t from-background/95 via-background/80 to-background/60 backdrop-blur-[1px] group-hover:via-background/90 group-hover:to-background/70":"bg-background"),children:[!!K.can_delete&&e.jsx("div",{className:"absolute right-2 top-2",children:e.jsx(ps,{title:s("card.delete.title"),description:s("card.delete.description"),confirmText:s("card.delete.button"),variant:"destructive",onConfirm:async()=>{if(I===S?.active){A.error(s("card.delete.error.active"));return}t(I),Kt.drop(I).then(()=>{A.success("主题删除成功"),N()}).finally(()=>{t(null)})},children:e.jsx(L,{disabled:n===I,loading:n===I,variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",children:e.jsx(ds,{className:"h-4 w-4"})})})}),e.jsxs(Fe,{children:[e.jsx(Ge,{children:K.name}),e.jsx(Os,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{children:K.description}),K.version&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("card.version",{version:K.version})})]})})]}),e.jsxs(Ie,{className:"flex items-center justify-end space-x-3",children:[K.images&&Array.isArray(K.images)&&K.images.length>0&&e.jsx(L,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>H(K.name,K.images),children:e.jsx(Hc,{className:"h-4 w-4"})}),e.jsx(Ru,{themeKey:I,themeInfo:K}),e.jsx(L,{onClick:()=>_(I),disabled:n===I||I===S.active,loading:n===I,variant:I===S.active?"secondary":"default",children:I===S.active?s("card.currentTheme"):s("card.activateTheme")})]})]})},I))}),e.jsx(ge,{open:i,onOpenChange:l,children:e.jsxs(de,{className:"sm:max-w-md",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:s("upload.title")}),e.jsx(Ve,{children:s("upload.description")})]}),e.jsxs("div",{className:b("relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",d&&"border-primary/50 bg-muted/50"),onDragEnter:D,onDragLeave:D,onDragOver:D,onDrop:g,children:[e.jsx("input",{type:"file",ref:h,className:"hidden",accept:".zip",onChange:I=>{const K=I.target.files?.[0];K&&T(K)}}),r?e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("upload.uploading")})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"rounded-full border-2 border-muted-foreground/25 p-3",children:e.jsx(wt,{className:"h-6 w-6 text-muted-foreground/50"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium",children:[s("upload.dragText")," ",e.jsx("button",{type:"button",onClick:()=>h.current?.click(),className:"mx-1 text-primary hover:underline",children:s("upload.clickText")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("upload.supportText")})]})]})})]})]})}),e.jsx(ge,{open:!!o,onOpenChange:I=>{I||(c(null),C(0))},children:e.jsxs(de,{className:"max-w-4xl",children:[e.jsxs(ve,{children:[e.jsxs(fe,{children:[o?.name," ",s("preview.title")]}),e.jsx(Ve,{className:"text-center",children:o&&s("preview.imageCount",{current:k+1,total:o.images.length})})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"aspect-[16/9] overflow-hidden rounded-lg border bg-muted",children:o?.images[k]&&e.jsx("img",{src:o.images[k],alt:`${o.name} 预览图 ${k+1}`,className:"h-full w-full object-contain"})}),o&&o.images.length>1&&e.jsxs(e.Fragment,{children:[e.jsx(L,{variant:"outline",size:"icon",className:"absolute left-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:w,children:e.jsx(Uc,{className:"h-4 w-4"})}),e.jsx(L,{variant:"outline",size:"icon",className:"absolute right-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:R,children:e.jsx(Kc,{className:"h-4 w-4"})})]})]}),o&&o.images.length>1&&e.jsx("div",{className:"mt-4 flex gap-2 overflow-x-auto pb-2",children:o.images.map((I,K)=>e.jsx("button",{onClick:()=>C(K),className:b("relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border-2",k===K?"border-primary":"border-transparent"),children:e.jsx("img",{src:I,alt:`缩略图 ${K+1}`,className:"h-full w-full object-cover"})},K))})]})})]})]})}function hr(){return e.jsxs(Re,{children:[e.jsxs(Fe,{children:[e.jsx(je,{className:"h-6 w-[200px]"}),e.jsx(je,{className:"h-4 w-[300px]"})]}),e.jsxs(Ie,{className:"flex items-center justify-end space-x-3",children:[e.jsx(je,{className:"h-10 w-[100px]"}),e.jsx(je,{className:"h-10 w-[100px]"})]})]})}const Fu=Object.freeze(Object.defineProperty({__proto__:null,default:Eu},Symbol.toStringTag,{value:"Module"})),zn=m.forwardRef(({className:s,value:n,onChange:t,...r},a)=>{const[i,l]=m.useState("");m.useEffect(()=>{if(i.includes(",")){const u=new Set([...n,...i.split(",").map(o=>o.trim())]);t(Array.from(u)),l("")}},[i,t,n]);const d=()=>{if(i){const u=new Set([...n,i]);t(Array.from(u)),l("")}};return e.jsxs("div",{className:b(" has-[:focus-visible]:outline-none has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-neutral-950 dark:has-[:focus-visible]:ring-neutral-300 flex w-full flex-wrap gap-2 rounded-md border border-input shadow-sm px-3 py-2 text-sm ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",s),children:[n.map(u=>e.jsxs(U,{variant:"secondary",children:[u,e.jsx(G,{variant:"ghost",size:"icon",className:"ml-2 h-3 w-3",onClick:()=>{t(n.filter(o=>o!==u))},children:e.jsx(hn,{className:"w-3"})})]},u)),e.jsx("input",{className:"flex-1 outline-none placeholder:text-muted-foreground bg-transparent",value:i,onChange:u=>l(u.target.value),onKeyDown:u=>{u.key==="Enter"||u.key===","?(u.preventDefault(),d()):u.key==="Backspace"&&i.length===0&&n.length>0&&(u.preventDefault(),t(n.slice(0,-1)))},...r,ref:a})]})});zn.displayName="InputTags";const Iu=x.object({id:x.number().nullable(),title:x.string().min(1).max(250),content:x.string().min(1),show:x.boolean(),tags:x.array(x.string()),img_url:x.string().nullable()}),Vu={id:null,show:!1,tags:[],img_url:"",title:"",content:""};function Xl({refetch:s,dialogTrigger:n,type:t="add",defaultFormValues:r=Vu}){const{t:a}=V("notice"),[i,l]=m.useState(!1),d=we({resolver:Ce(Iu),defaultValues:r,mode:"onChange",shouldFocusError:!0}),u=new Tn({html:!0});return e.jsx(Se,{...d,children:e.jsxs(ge,{onOpenChange:l,open:i,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"})," ",e.jsx("div",{children:a("form.add.button")})]})}),e.jsxs(de,{className:"sm:max-w-[1025px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:a(t==="add"?"form.add.title":"form.edit.title")}),e.jsx(Ve,{})]}),e.jsx(v,{control:d.control,name:"title",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.title.label")}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(P,{placeholder:a("form.fields.title.placeholder"),...o})})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"content",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.content.label")}),e.jsx(y,{children:e.jsx(Dn,{style:{height:"500px"},value:o.value,renderHTML:c=>u.render(c),onChange:({text:c})=>{o.onChange(c)}})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"img_url",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.img_url.label")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(P,{type:"text",placeholder:a("form.fields.img_url.placeholder"),...o,value:o.value||""})})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"show",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.show.label")}),e.jsx("div",{className:"relative py-2",children:e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:o.onChange})})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"tags",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.tags.label")}),e.jsx(y,{children:e.jsx(zn,{value:o.value,onChange:o.onChange,placeholder:a("form.fields.tags.placeholder"),className:"w-full"})}),e.jsx(E,{})]})}),e.jsxs(Le,{children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:a("form.buttons.cancel")})}),e.jsx(L,{type:"submit",onClick:o=>{o.preventDefault(),d.handleSubmit(async c=>{Qt.save(c).then(({data:h})=>{h&&(A.success(a("form.buttons.success")),s(),l(!1))})})()},children:a("form.buttons.submit")})]})]})]})})}function Mu({table:s,refetch:n,saveOrder:t,isSortMode:r}){const{t:a}=V("notice"),i=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between space-x-2 ",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[!r&&e.jsx(Xl,{refetch:n}),!r&&e.jsx(P,{placeholder:a("table.toolbar.search"),value:s.getColumn("title")?.getFilterValue()??"",onChange:l=>s.getColumn("title")?.setFilterValue(l.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),i&&!r&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-9 px-2 lg:px-3",children:[a("table.toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(L,{variant:r?"default":"outline",onClick:t,className:"h-8",size:"sm",children:a(r?"table.toolbar.sort.save":"table.toolbar.sort.edit")})})]})}const Ou=s=>{const{t:n}=V("notice");return[{id:"drag-handle",header:"",cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(Bc,{className:"h-4 w-4 cursor-move text-muted-foreground"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.id")}),cell:({row:t})=>e.jsx(U,{variant:"outline",className:"font-mono",children:t.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.show")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(Z,{defaultChecked:t.getValue("show"),onCheckedChange:async()=>{const{data:r}=await Qt.updateStatus(t.original.id);r||s()}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.title")}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[500px] items-center",children:e.jsx("span",{className:"truncate font-medium",children:t.getValue("title")})}),enableSorting:!1,size:6e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:n("table.columns.actions")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(Xl,{refetch:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("table.actions.edit")})]}),type:"edit",defaultFormValues:t.original}),e.jsx(ps,{title:n("table.actions.delete.title"),description:n("table.actions.delete.description"),onConfirm:async()=>{Qt.drop(t.original.id).then(()=>{A.success(n("table.actions.delete.success")),s()})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:n("table.actions.delete.title")})]})})]}),size:100}]};function zu(){const[s,n]=m.useState({}),[t,r]=m.useState({}),[a,i]=m.useState([]),[l,d]=m.useState([]),[u,o]=m.useState(!1),[c,h]=m.useState({}),[k,C]=m.useState({pageSize:50,pageIndex:0}),[S,f]=m.useState([]),{refetch:N}=ne({queryKey:["notices"],queryFn:async()=>{const{data:w}=await Qt.getList();return f(w),w}});m.useEffect(()=>{r({"drag-handle":u,content:!u,created_at:!u,actions:!u}),C({pageSize:u?99999:50,pageIndex:0})},[u]);const _=(w,R)=>{u&&(w.dataTransfer.setData("text/plain",R.toString()),w.currentTarget.classList.add("opacity-50"))},T=(w,R)=>{if(!u)return;w.preventDefault(),w.currentTarget.classList.remove("bg-muted");const H=parseInt(w.dataTransfer.getData("text/plain"));if(H===R)return;const I=[...S],[K]=I.splice(H,1);I.splice(R,0,K),f(I)},D=async()=>{if(!u){o(!0);return}Qt.sort(S.map(w=>w.id)).then(()=>{A.success("排序保存成功"),o(!1),N()}).finally(()=>{o(!1)})},g=ss({data:S??[],columns:Ou(N),state:{sorting:l,columnVisibility:t,rowSelection:s,columnFilters:a,columnSizing:c,pagination:k},enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:i,onColumnVisibilityChange:r,onColumnSizingChange:h,onPaginationChange:C,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx("div",{className:"space-y-4",children:e.jsx(xs,{table:g,toolbar:w=>e.jsx(Mu,{table:w,refetch:N,saveOrder:D,isSortMode:u}),draggable:u,onDragStart:_,onDragEnd:w=>w.currentTarget.classList.remove("opacity-50"),onDragOver:w=>{w.preventDefault(),w.currentTarget.classList.add("bg-muted")},onDragLeave:w=>w.currentTarget.classList.remove("bg-muted"),onDrop:T,showPagination:!u})})}function $u(){const{t:s}=V("notice");return e.jsxs(ze,{children:[e.jsxs($e,{className:"flex items-center justify-between",children:[e.jsx(ns,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(zu,{})})]})]})}const Au=Object.freeze(Object.defineProperty({__proto__:null,default:$u},Symbol.toStringTag,{value:"Module"})),qu=x.object({id:x.number().nullable(),language:x.string().max(250),category:x.string().max(250),title:x.string().min(1).max(250),body:x.string().min(1),show:x.boolean()}),Hu={id:null,language:"zh-CN",category:"",title:"",body:"",show:!1};function Zl({refreshData:s,dialogTrigger:n,type:t="add",defaultFormValues:r=Hu}){const{t:a}=V("knowledge"),[i,l]=m.useState(!1),d=we({resolver:Ce(qu),defaultValues:r,mode:"onChange",shouldFocusError:!0}),u=new Tn({html:!0});return m.useEffect(()=>{i&&r.id&&Ct.getInfo(r.id).then(({data:o})=>{d.reset(o)})},[r.id,d,i]),e.jsxs(ge,{onOpenChange:l,open:i,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"})," ",e.jsx("div",{children:a("form.add")})]})}),e.jsxs(de,{className:"sm:max-w-[1025px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:a(t==="add"?"form.add":"form.edit")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...d,children:[e.jsx(v,{control:d.control,name:"title",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.title")}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(P,{placeholder:a("form.titlePlaceholder"),...o})})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"category",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.category")}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(P,{placeholder:a("form.categoryPlaceholder"),...o})})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"language",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.language")}),e.jsx(y,{children:e.jsxs(J,{value:o.value,onValueChange:o.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("form.languagePlaceholder")})}),e.jsx(Y,{children:[{value:"en-US"},{value:"ja-JP"},{value:"ko-KR"},{value:"vi-VN"},{value:"zh-CN"},{value:"zh-TW"}].map(c=>e.jsx($,{value:c.value,className:"cursor-pointer",children:a(`languages.${c.value}`)},c.value))})]})})]})}),e.jsx(v,{control:d.control,name:"body",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.content")}),e.jsx(y,{children:e.jsx(Dn,{style:{height:"500px"},value:o.value,renderHTML:c=>u.render(c),onChange:({text:c})=>{o.onChange(c)}})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"show",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.show")}),e.jsx("div",{className:"relative py-2",children:e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:o.onChange})})}),e.jsx(E,{})]})}),e.jsxs(Le,{children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:a("form.cancel")})}),e.jsx(L,{type:"submit",onClick:()=>{d.handleSubmit(o=>{Ct.save(o).then(({data:c})=>{c&&(d.reset(),A.success(a("messages.operationSuccess")),l(!1),s())})})()},children:a("form.submit")})]})]})]})]})}function Uu({column:s,title:n,options:t}){const r=s?.getFacetedUniqueValues(),a=new Set(s?.getFilterValue());return e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Fa,{className:"mr-2 h-4 w-4"}),n,a?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:a.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:a.size>2?e.jsxs(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[a.size," selected"]}):t.filter(i=>a.has(i.value)).map(i=>e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:i.label},i.value))})]})]})}),e.jsx(Ze,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Js,{children:[e.jsx(ut,{placeholder:n}),e.jsxs(Qs,{children:[e.jsx(xt,{children:"No results found."}),e.jsx(fs,{children:t.map(i=>{const l=a.has(i.value);return e.jsxs(We,{onSelect:()=>{l?a.delete(i.value):a.add(i.value);const d=Array.from(a);s?.setFilterValue(d.length?d:void 0)},children:[e.jsx("div",{className:b("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",l?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ot,{className:b("h-4 w-4")})}),i.icon&&e.jsx(i.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:i.label}),r?.get(i.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:r.get(i.value)})]},i.value)})}),a.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(fs,{children:e.jsx(We,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}function Ku({table:s,refetch:n,saveOrder:t,isSortMode:r}){const a=s.getState().columnFilters.length>0,{t:i}=V("knowledge");return e.jsxs("div",{className:"flex items-center justify-between",children:[r?e.jsx("p",{className:"text-sm text-muted-foreground",children:i("toolbar.sortModeHint")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Zl,{refreshData:n}),e.jsx(P,{placeholder:i("toolbar.searchPlaceholder"),value:s.getColumn("title")?.getFilterValue()??"",onChange:l=>s.getColumn("title")?.setFilterValue(l.target.value),className:"h-8 w-[250px]"}),s.getColumn("category")&&e.jsx(Uu,{column:s.getColumn("category"),title:i("columns.category"),options:Array.from(new Set(s.getCoreRowModel().rows.map(l=>l.getValue("category")))).map(l=>({label:l,value:l}))}),a&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:[i("toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:r?"default":"outline",onClick:t,size:"sm",children:i(r?"toolbar.saveSort":"toolbar.editSort")})})]})}const Bu=({refetch:s,isSortMode:n=!1})=>{const{t}=V("knowledge");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:n?"cursor-move":"opacity-0",children:e.jsx(Ea,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:r})=>e.jsx(z,{column:r,title:t("columns.id")}),cell:({row:r})=>e.jsx(U,{variant:"outline",className:"justify-center",children:r.getValue("id")}),enableSorting:!0,size:70},{accessorKey:"show",header:({column:r})=>e.jsx(z,{column:r,title:t("columns.status")}),cell:({row:r})=>e.jsx("div",{className:"flex items-center",children:e.jsx(Z,{defaultChecked:r.getValue("show"),onCheckedChange:async()=>{Ct.updateStatus({id:r.original.id}).then(({data:a})=>{a||s()})}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:r})=>e.jsx(z,{column:r,title:t("columns.title")}),cell:({row:r})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"line-clamp-2 font-medium",children:r.getValue("title")})}),enableSorting:!0,size:600},{accessorKey:"category",header:({column:r})=>e.jsx(z,{column:r,title:t("columns.category")}),cell:({row:r})=>e.jsx(U,{variant:"secondary",className:"max-w-[180px] truncate",children:r.getValue("category")}),enableSorting:!0,size:1800},{id:"actions",header:({column:r})=>e.jsx(z,{className:"justify-end",column:r,title:t("columns.actions")}),cell:({row:r})=>e.jsxs("div",{className:"flex items-center justify-end space-x-1",children:[e.jsx(Zl,{refreshData:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:t("form.edit")})]}),type:"edit",defaultFormValues:r.original}),e.jsx(ps,{title:t("messages.deleteConfirm"),description:t("messages.deleteDescription"),confirmText:t("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{Ct.drop({id:r.original.id}).then(({data:a})=>{a&&(A.success(t("messages.operationSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:t("messages.deleteButton")})]})})]}),size:100}]};function Gu(){const[s,n]=m.useState([]),[t,r]=m.useState([]),[a,i]=m.useState(!1),[l,d]=m.useState([]),[u,o]=m.useState({"drag-handle":!1}),[c,h]=m.useState({pageSize:20,pageIndex:0}),{refetch:k,isLoading:C,data:S}=ne({queryKey:["knowledge"],queryFn:async()=>{const{data:D}=await Ct.getList();return d(D||[]),D}});m.useEffect(()=>{o({"drag-handle":a,actions:!a}),h({pageSize:a?99999:10,pageIndex:0})},[a]);const f=(D,g)=>{a&&(D.dataTransfer.setData("text/plain",g.toString()),D.currentTarget.classList.add("opacity-50"))},N=(D,g)=>{if(!a)return;D.preventDefault(),D.currentTarget.classList.remove("bg-muted");const w=parseInt(D.dataTransfer.getData("text/plain"));if(w===g)return;const R=[...l],[H]=R.splice(w,1);R.splice(g,0,H),d(R)},_=async()=>{a?Ct.sort({ids:l.map(D=>D.id)}).then(()=>{k(),i(!1),A.success("排序保存成功")}):i(!0)},T=ss({data:l,columns:Bu({refetch:k,isSortMode:a}),state:{sorting:t,columnFilters:s,columnVisibility:u,pagination:c},onSortingChange:r,onColumnFiltersChange:n,onColumnVisibilityChange:o,onPaginationChange:h,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(xs,{table:T,toolbar:D=>e.jsx(Ku,{table:D,refetch:k,saveOrder:_,isSortMode:a}),draggable:a,onDragStart:f,onDragEnd:D=>D.currentTarget.classList.remove("opacity-50"),onDragOver:D=>{D.preventDefault(),D.currentTarget.classList.add("bg-muted")},onDragLeave:D=>D.currentTarget.classList.remove("bg-muted"),onDrop:N,showPagination:!a})}function Wu(){const{t:s}=V("knowledge");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight mb-2",children:s("title")}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Gu,{})})]})]})}const Yu=Object.freeze(Object.defineProperty({__proto__:null,default:Wu},Symbol.toStringTag,{value:"Module"}));function Ju(s,n){const[t,r]=m.useState(s);return m.useEffect(()=>{const a=setTimeout(()=>r(s),n);return()=>{clearTimeout(a)}},[s,n]),t}function nn(s,n){if(s.length===0)return{};if(!n)return{"":s};const t={};return s.forEach(r=>{const a=r[n]||"";t[a]||(t[a]=[]),t[a].push(r)}),t}function Qu(s,n){const t=JSON.parse(JSON.stringify(s));for(const[r,a]of Object.entries(t))t[r]=a.filter(i=>!n.find(l=>l.value===i.value));return t}function Xu(s,n){for(const[,t]of Object.entries(s))if(t.some(r=>n.find(a=>a.value===r.value)))return!0;return!1}const ei=m.forwardRef(({className:s,...n},t)=>Gc(a=>a.filtered.count===0)?e.jsx("div",{ref:t,className:b("py-6 text-center text-sm",s),"cmdk-empty":"",role:"presentation",...n}):null);ei.displayName="CommandEmpty";const kt=m.forwardRef(({value:s,onChange:n,placeholder:t,defaultOptions:r=[],options:a,delay:i,onSearch:l,loadingIndicator:d,emptyIndicator:u,maxSelected:o=Number.MAX_SAFE_INTEGER,onMaxSelected:c,hidePlaceholderWhenSelected:h,disabled:k,groupBy:C,className:S,badgeClassName:f,selectFirstItem:N=!0,creatable:_=!1,triggerSearchOnFocus:T=!1,commandProps:D,inputProps:g,hideClearAllButton:w=!1},R)=>{const H=m.useRef(null),[I,K]=m.useState(!1),ae=m.useRef(!1),[ee,te]=m.useState(!1),[q,F]=m.useState(s||[]),[X,Ns]=m.useState(nn(r,C)),[De,ie]=m.useState(""),_s=Ju(De,i||500);m.useImperativeHandle(R,()=>({selectedValue:[...q],input:H.current,focus:()=>H.current?.focus()}),[q]);const Fs=m.useCallback(se=>{const pe=q.filter(re=>re.value!==se.value);F(pe),n?.(pe)},[n,q]),Xs=m.useCallback(se=>{const pe=H.current;pe&&((se.key==="Delete"||se.key==="Backspace")&&pe.value===""&&q.length>0&&(q[q.length-1].fixed||Fs(q[q.length-1])),se.key==="Escape"&&pe.blur())},[Fs,q]);m.useEffect(()=>{s&&F(s)},[s]),m.useEffect(()=>{if(!a||l)return;const se=nn(a||[],C);JSON.stringify(se)!==JSON.stringify(X)&&Ns(se)},[r,a,C,l,X]),m.useEffect(()=>{const se=async()=>{te(!0);const re=await l?.(_s);Ns(nn(re||[],C)),te(!1)};(async()=>{!l||!I||(T&&await se(),_s&&await se())})()},[_s,C,I,T]);const Lt=()=>{if(!_||Xu(X,[{value:De,label:De}])||q.find(pe=>pe.value===De))return;const se=e.jsx(We,{value:De,className:"cursor-pointer",onMouseDown:pe=>{pe.preventDefault(),pe.stopPropagation()},onSelect:pe=>{if(q.length>=o){c?.(q.length);return}ie("");const re=[...q,{value:pe,label:pe}];F(re),n?.(re)},children:`Create "${De}"`});if(!l&&De.length>0||l&&_s.length>0&&!ee)return se},Zt=m.useCallback(()=>{if(u)return l&&!_&&Object.keys(X).length===0?e.jsx(We,{value:"-",disabled:!0,children:u}):e.jsx(ei,{children:u})},[_,u,l,X]),Rt=m.useMemo(()=>Qu(X,q),[X,q]),qs=m.useCallback(()=>{if(D?.filter)return D.filter;if(_)return(se,pe)=>se.toLowerCase().includes(pe.toLowerCase())?1:-1},[_,D?.filter]),Ja=m.useCallback(()=>{const se=q.filter(pe=>pe.fixed);F(se),n?.(se)},[n,q]);return e.jsxs(Js,{...D,onKeyDown:se=>{Xs(se),D?.onKeyDown?.(se)},className:b("h-auto overflow-visible bg-transparent",D?.className),shouldFilter:D?.shouldFilter!==void 0?D.shouldFilter:!l,filter:qs(),children:[e.jsx("div",{className:b("rounded-md border border-input text-sm ring-offset-background focus-within:ring-1 focus-within:ring-ring ",{"px-3 py-2":q.length!==0,"cursor-text":!k&&q.length!==0},S),onClick:()=>{k||H.current?.focus()},children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[q.map(se=>e.jsxs(U,{className:b("data-[disabled]:bg-muted-foreground data-[disabled]:text-muted data-[disabled]:hover:bg-muted-foreground","data-[fixed]:bg-muted-foreground data-[fixed]:text-muted data-[fixed]:hover:bg-muted-foreground",f),"data-fixed":se.fixed,"data-disabled":k||void 0,children:[se.label,e.jsx("button",{className:b("ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",(k||se.fixed)&&"hidden"),onKeyDown:pe=>{pe.key==="Enter"&&Fs(se)},onMouseDown:pe=>{pe.preventDefault(),pe.stopPropagation()},onClick:()=>Fs(se),children:e.jsx(hn,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},se.value)),e.jsx(es.Input,{...g,ref:H,value:De,disabled:k,onValueChange:se=>{ie(se),g?.onValueChange?.(se)},onBlur:se=>{ae.current===!1&&K(!1),g?.onBlur?.(se)},onFocus:se=>{K(!0),T&&l?.(_s),g?.onFocus?.(se)},placeholder:h&&q.length!==0?"":t,className:b("flex-1 bg-transparent outline-none placeholder:text-muted-foreground",{"w-full":h,"px-3 py-2":q.length===0,"ml-1":q.length!==0},g?.className)}),e.jsx("button",{type:"button",onClick:Ja,className:b((w||k||q.length<1||q.filter(se=>se.fixed).length===q.length)&&"hidden"),children:e.jsx(hn,{})})]})}),e.jsx("div",{className:"relative",children:I&&e.jsx(Qs,{className:"absolute top-1 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",onMouseLeave:()=>{ae.current=!1},onMouseEnter:()=>{ae.current=!0},onMouseUp:()=>{H.current?.focus()},children:ee?e.jsx(e.Fragment,{children:d}):e.jsxs(e.Fragment,{children:[Zt(),Lt(),!N&&e.jsx(We,{value:"-",className:"hidden"}),Object.entries(Rt).map(([se,pe])=>e.jsx(fs,{heading:se,className:"h-full overflow-auto",children:e.jsx(e.Fragment,{children:pe.map(re=>e.jsx(We,{value:re.value,disabled:re.disable,onMouseDown:Zs=>{Zs.preventDefault(),Zs.stopPropagation()},onSelect:()=>{if(q.length>=o){c?.(q.length);return}ie("");const Zs=[...q,re];F(Zs),n?.(Zs)},className:b("cursor-pointer",re.disable&&"cursor-default text-muted-foreground"),children:re.label},re.value))})},se))]})})})]})});kt.displayName="MultipleSelector";const Zu=s=>x.object({id:x.number().optional(),name:x.string().min(2,s("messages.nameValidation.min")).max(50,s("messages.nameValidation.max")).regex(/^[a-zA-Z0-9\u4e00-\u9fa5_-]+$/,s("messages.nameValidation.pattern"))});function Ka({refetch:s,dialogTrigger:n,defaultValues:t={name:""},type:r="add"}){const{t:a}=V("group"),i=we({resolver:Ce(Zu(a)),defaultValues:t,mode:"onChange"}),[l,d]=m.useState(!1),[u,o]=m.useState(!1),c=async h=>{o(!0),mt.save(h).then(()=>{A.success(a(r==="edit"?"messages.updateSuccess":"messages.createSuccess")),s&&s(),i.reset(),d(!1)}).finally(()=>{o(!1)})};return e.jsxs(ge,{open:l,onOpenChange:d,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("span",{children:a("form.add")})]})}),e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:a(r==="edit"?"form.edit":"form.create")}),e.jsx(Ve,{children:a(r==="edit"?"form.editDescription":"form.createDescription")})]}),e.jsx(Se,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(c),className:"space-y-4",children:[e.jsx(v,{control:i.control,name:"name",render:({field:h})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.name")}),e.jsx(y,{children:e.jsx(P,{placeholder:a("form.namePlaceholder"),...h,className:"w-full"})}),e.jsx(O,{children:a("form.nameDescription")}),e.jsx(E,{})]})}),e.jsxs(Le,{className:"gap-2",children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:a("form.cancel")})}),e.jsxs(L,{type:"submit",disabled:u||!i.formState.isValid,children:[u&&e.jsx(ya,{className:"mr-2 h-4 w-4 animate-spin"}),a(r==="edit"?"form.update":"form.create")]})]})]})})]})]})}const si=m.createContext(void 0);function ex({children:s,refetch:n}){const[t,r]=m.useState(!1),[a,i]=m.useState(null),[l,d]=m.useState(oe.Shadowsocks);return e.jsx(si.Provider,{value:{isOpen:t,setIsOpen:r,editingServer:a,setEditingServer:i,serverType:l,setServerType:d,refetch:n},children:s})}function ti(){const s=m.useContext(si);if(s===void 0)throw new Error("useServerEdit must be used within a ServerEditProvider");return s}function rn({dialogTrigger:s,value:n,setValue:t,templateType:r}){const{t:a}=V("server");m.useEffect(()=>{console.log(n)},[n]);const[i,l]=m.useState(!1),[d,u]=m.useState(()=>{if(!n||Object.keys(n).length===0)return"";try{return JSON.stringify(n,null,2)}catch{return""}}),[o,c]=m.useState(null),h=_=>{if(!_)return null;try{const T=JSON.parse(_);return typeof T!="object"||T===null?a("network_settings.validation.must_be_object"):null}catch{return a("network_settings.validation.invalid_json")}},k={tcp:{label:"TCP",content:{acceptProxyProtocol:!1,header:{type:"none"}}},"tcp-http":{label:"TCP + HTTP",content:{acceptProxyProtocol:!1,header:{type:"http",request:{version:"1.1",method:"GET",path:["/"],headers:{Host:["www.example.com"]}},response:{version:"1.1",status:"200",reason:"OK"}}}},grpc:{label:"gRPC",content:{serviceName:"GunService"}},ws:{label:"WebSocket",content:{path:"/",headers:{Host:"v2ray.com"}}},httpupgrade:{label:"HttpUpgrade",content:{acceptProxyProtocol:!1,path:"/",host:"xray.com",headers:{key:"value"}}},xhttp:{label:"XHTTP",content:{host:"example.com",path:"/yourpath",mode:"auto",extra:{headers:{},xPaddingBytes:"100-1000",noGRPCHeader:!1,noSSEHeader:!1,scMaxEachPostBytes:1e6,scMinPostsIntervalMs:30,scMaxBufferedPosts:30,xmux:{maxConcurrency:"16-32",maxConnections:0,cMaxReuseTimes:"64-128",cMaxLifetimeMs:0,hMaxRequestTimes:"800-900",hKeepAlivePeriod:0},downloadSettings:{address:"",port:443,network:"xhttp",security:"tls",tlsSettings:{},xhttpSettings:{path:"/yourpath"},sockopt:{}}}}}},C=()=>{switch(r){case"tcp":return["tcp","tcp-http"];case"grpc":return["grpc"];case"ws":return["ws"];case"httpupgrade":return["httpupgrade"];case"xhttp":return["xhttp"];default:return[]}},S=()=>{const _=h(d||"");if(_){A.error(_);return}try{if(!d){t(null),l(!1);return}t(JSON.parse(d)),l(!1)}catch{A.error(a("network_settings.errors.save_failed"))}},f=_=>{u(_),c(h(_))},N=_=>{const T=k[_];if(T){const D=JSON.stringify(T.content,null,2);u(D),c(null)}};return m.useEffect(()=>{i&&console.log(n)},[i,n]),m.useEffect(()=>{i&&n&&Object.keys(n).length>0&&u(JSON.stringify(n,null,2))},[i,n]),e.jsxs(ge,{open:i,onOpenChange:_=>{!_&&i&&S(),l(_)},children:[e.jsx(as,{asChild:!0,children:s??e.jsx(G,{variant:"link",children:a("network_settings.edit_protocol")})}),e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsx(ve,{children:e.jsx(fe,{children:a("network_settings.edit_protocol_config")})}),e.jsxs("div",{className:"space-y-4",children:[C().length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:C().map(_=>e.jsx(G,{variant:"outline",size:"sm",onClick:()=>N(_),children:a("network_settings.use_template",{template:k[_].label})},_))}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ds,{className:`min-h-[200px] font-mono text-sm ${o?"border-red-500 focus-visible:ring-red-500":""}`,value:d,placeholder:C().length>0?a("network_settings.json_config_placeholder_with_template"):a("network_settings.json_config_placeholder"),onChange:_=>f(_.target.value)}),o&&e.jsx("p",{className:"text-sm text-red-500",children:o})]})]}),e.jsxs(Le,{className:"gap-2",children:[e.jsx(G,{variant:"outline",onClick:()=>l(!1),children:a("common.cancel")}),e.jsx(G,{onClick:S,disabled:!!o,children:a("common.confirm")})]})]})]})}function _g(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const sx={},tx=Object.freeze(Object.defineProperty({__proto__:null,default:sx},Symbol.toStringTag,{value:"Module"})),wg=cd(tx),gr=s=>s.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),ax=()=>{try{const s=Wc.box.keyPair(),n=gr(tr.encodeBase64(s.secretKey)),t=gr(tr.encodeBase64(s.publicKey));return{privateKey:n,publicKey:t}}catch(s){throw console.error("Error generating x25519 key pair:",s),s}},nx=()=>{try{return ax()}catch(s){throw console.error("Error generating key pair:",s),s}},rx=s=>{const n=new Uint8Array(Math.ceil(s/2));return window.crypto.getRandomValues(n),Array.from(n).map(t=>t.toString(16).padStart(2,"0")).join("").substring(0,s)},lx=()=>{const s=Math.floor(Math.random()*8)*2+2;return rx(s)},ix=x.object({cipher:x.string().default("aes-128-gcm"),plugin:x.string().optional().default(""),plugin_opts:x.string().optional().default(""),client_fingerprint:x.string().optional().default("chrome")}),ox=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({})}),cx=x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({})}),dx=x.object({version:x.coerce.number().default(2),alpn:x.string().default("h2"),obfs:x.object({open:x.coerce.boolean().default(!1),type:x.string().default("salamander"),password:x.string().default("")}).default({}),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),bandwidth:x.object({up:x.string().default(""),down:x.string().default("")}).default({}),hop_interval:x.number().optional(),port_range:x.string().optional()}),mx=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),reality_settings:x.object({server_port:x.coerce.number().default(443),server_name:x.string().default(""),allow_insecure:x.boolean().default(!1),public_key:x.string().default(""),private_key:x.string().default(""),short_id:x.string().default("")}).default({}),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({}),flow:x.string().default("")}),ux=x.object({version:x.coerce.number().default(5),congestion_control:x.string().default("bbr"),alpn:x.array(x.string()).default(["h3"]),udp_relay_mode:x.string().default("native"),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),xx=x.object({}),hx=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),gx=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),fx=x.object({transport:x.string().default("tcp"),multiplexing:x.string().default("MULTIPLEXING_LOW")}),px=x.object({padding_scheme:x.array(x.string()).optional().default([]),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),Ee={shadowsocks:{schema:ix,ciphers:["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"],plugins:[{value:"none",label:"None"},{value:"obfs",label:"Simple Obfs"},{value:"v2ray-plugin",label:"V2Ray Plugin"}],clientFingerprints:[{value:"chrome",label:"Chrome"},{value:"firefox",label:"Firefox"},{value:"safari",label:"Safari"},{value:"ios",label:"iOS"}]},vmess:{schema:ox,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},trojan:{schema:cx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},hysteria:{schema:dx,versions:["1","2"],alpnOptions:["hysteria","http/1.1","h2","h3"]},vless:{schema:mx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"},{value:"kcp",label:"mKCP"},{value:"httpupgrade",label:"HttpUpgrade"},{value:"xhttp",label:"XHTTP"}],flowOptions:["none","xtls-rprx-direct","xtls-rprx-splice","xtls-rprx-vision"]},tuic:{schema:ux,versions:["5","4"],congestionControls:["bbr","cubic","new_reno"],alpnOptions:[{value:"h3",label:"HTTP/3"},{value:"h2",label:"HTTP/2"},{value:"http/1.1",label:"HTTP/1.1"}],udpRelayModes:[{value:"native",label:"Native"},{value:"quic",label:"QUIC"}]},socks:{schema:xx},naive:{schema:gx},http:{schema:hx},mieru:{schema:fx,transportOptions:[{value:"tcp",label:"TCP"},{value:"udp",label:"UDP"}],multiplexingOptions:[{value:"MULTIPLEXING_OFF",label:"Off"},{value:"MULTIPLEXING_LOW",label:"Low"},{value:"MULTIPLEXING_MIDDLE",label:"Middle"},{value:"MULTIPLEXING_HIGH",label:"High"}]},anytls:{schema:px,defaultPaddingScheme:["stop=8","0=30-30","1=100-400","2=400-500,c,500-1000,c,500-1000,c,500-1000,c,500-1000","3=9-9,500-1000","4=500-1000","5=500-1000","6=500-1000","7=500-1000"]}},jx=({serverType:s,value:n,onChange:t})=>{const{t:r}=V("server"),a=s?Ee[s]:null,i=a?.schema||x.record(x.any()),l=s?i.parse({}):{},d=we({resolver:Ce(i),defaultValues:l,mode:"onChange"});if(m.useEffect(()=>{if(!n||Object.keys(n).length===0){if(s){const g=i.parse({});d.reset(g)}}else d.reset(n)},[s,n,t,d,i]),m.useEffect(()=>{const g=d.watch(w=>{t(w)});return()=>g.unsubscribe()},[d,t]),!s||!a)return null;const D={shadowsocks:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"cipher",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.shadowsocks.cipher.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.shadowsocks.cipher.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.shadowsocks.ciphers.map(w=>e.jsx($,{value:w,children:w},w))})})]})})]})}),e.jsx(v,{control:d.control,name:"plugin",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.shadowsocks.plugin.label","插件")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:w=>g.onChange(w==="none"?"":w),value:g.value===""?"none":g.value||"none",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.shadowsocks.plugin.placeholder","选择插件")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.shadowsocks.plugins.map(w=>e.jsx($,{value:w.value,children:w.label},w.value))})})]})}),e.jsx(O,{children:g.value&&g.value!=="none"&&g.value!==""&&e.jsxs(e.Fragment,{children:[g.value==="obfs"&&r("dynamic_form.shadowsocks.plugin.obfs_hint","提示:配置格式如 obfs=http;obfs-host=www.bing.com;path=/"),g.value==="v2ray-plugin"&&r("dynamic_form.shadowsocks.plugin.v2ray_hint","提示:WebSocket模式格式为 mode=websocket;host=mydomain.me;path=/;tls=true,QUIC模式格式为 mode=quic;host=mydomain.me")]})})]})}),d.watch("plugin")&&d.watch("plugin")!=="none"&&d.watch("plugin")!==""&&e.jsx(v,{control:d.control,name:"plugin_opts",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.shadowsocks.plugin_opts.label","插件选项")}),e.jsx(O,{children:r("dynamic_form.shadowsocks.plugin_opts.description","按照 key=value;key2=value2 格式输入插件选项")}),e.jsx(y,{children:e.jsx(P,{type:"text",placeholder:r("dynamic_form.shadowsocks.plugin_opts.placeholder","例如: mode=tls;host=bing.com"),...g})})]})}),(d.watch("plugin")==="shadow-tls"||d.watch("plugin")==="restls")&&e.jsx(v,{control:d.control,name:"client_fingerprint",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.shadowsocks.client_fingerprint","客户端指纹")}),e.jsx(y,{children:e.jsxs(J,{value:g.value||"chrome",onValueChange:g.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.shadowsocks.client_fingerprint_placeholder","选择客户端指纹")})}),e.jsx(Y,{children:Ee.shadowsocks.clientFingerprints.map(w=>e.jsx($,{value:w.value,children:w.label},w.value))})]})}),e.jsx(O,{children:r("dynamic_form.shadowsocks.client_fingerprint_description","客户端伪装指纹,用于降低被识别风险")})]})})]}),vmess:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"tls",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vmess.tls.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value?.toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.vmess.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:r("dynamic_form.vmess.tls.disabled")}),e.jsx($,{value:"1",children:r("dynamic_form.vmess.tls.enabled")})]})]})})]})}),d.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls_settings.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.vmess.tls_settings.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.vmess.tls_settings.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls_settings.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vmess.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]}),e.jsx(v,{control:d.control,name:"network",render:({field:g})=>e.jsxs(p,{children:[e.jsxs(j,{children:[r("dynamic_form.vmess.network.label"),e.jsx(rn,{value:d.watch("network_settings"),setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")})]}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.vmess.network.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.vmess.networkOptions.map(w=>e.jsx($,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})})]}),trojan:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.trojan.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.trojan.server_name.placeholder"),...g,value:g.value||""})})]})}),e.jsx(v,{control:d.control,name:"allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.trojan.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value||!1,onCheckedChange:g.onChange})})})]})})]}),e.jsx(v,{control:d.control,name:"network",render:({field:g})=>e.jsxs(p,{children:[e.jsxs(j,{children:[r("dynamic_form.trojan.network.label"),e.jsx(rn,{value:d.watch("network_settings")||{},setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")||"tcp"})]}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value||"tcp",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.trojan.network.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.trojan.networkOptions.map(w=>e.jsx($,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})})]}),hysteria:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"version",render:({field:g})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:r("dynamic_form.hysteria.version.label")}),e.jsx(y,{children:e.jsxs(J,{value:(g.value||2).toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.hysteria.version.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.hysteria.versions.map(w=>e.jsxs($,{value:w,className:"cursor-pointer",children:["V",w]},w))})})]})})]})}),d.watch("version")==1&&e.jsx(v,{control:d.control,name:"alpn",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.hysteria.alpn.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value||"h2",onValueChange:g.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.hysteria.alpn.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.hysteria.alpnOptions.map(w=>e.jsx($,{value:w,children:w},w))})})]})})]})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"obfs.open",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.hysteria.obfs.label")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value||!1,onCheckedChange:g.onChange})})})]})}),!!d.watch("obfs.open")&&e.jsxs(e.Fragment,{children:[d.watch("version")=="2"&&e.jsx(v,{control:d.control,name:"obfs.type",render:({field:g})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:r("dynamic_form.hysteria.obfs.type.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value||"salamander",onValueChange:g.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.hysteria.obfs.type.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:e.jsx($,{value:"salamander",children:r("dynamic_form.hysteria.obfs.type.salamander")})})})]})})]})}),e.jsx(v,{control:d.control,name:"obfs.password",render:({field:g})=>e.jsxs(p,{className:d.watch("version")==2?"w-full":"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.hysteria.obfs.password.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.hysteria.obfs.password.placeholder"),...g,value:g.value||"",className:"pr-9"})}),e.jsx(G,{type:"button",variant:"ghost",size:"icon",onClick:()=>{const w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",R=Array.from(crypto.getRandomValues(new Uint8Array(16))).map(H=>w[H%w.length]).join("");d.setValue("obfs.password",R),A.success(r("dynamic_form.hysteria.obfs.password.generate_success"))},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(Be,{icon:"ion:refresh-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})]})]})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.hysteria.tls.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.hysteria.tls.server_name.placeholder"),...g,value:g.value||""})})]})}),e.jsx(v,{control:d.control,name:"tls.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.hysteria.tls.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value||!1,onCheckedChange:g.onChange})})})]})})]}),e.jsx(v,{control:d.control,name:"bandwidth.up",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.hysteria.bandwidth.up.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:r("dynamic_form.hysteria.bandwidth.up.placeholder")+(d.watch("version")==2?r("dynamic_form.hysteria.bandwidth.up.bbr_tip"):""),className:"rounded-br-none rounded-tr-none",...g,value:g.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:r("dynamic_form.hysteria.bandwidth.up.suffix")})})]})]})}),e.jsx(v,{control:d.control,name:"bandwidth.down",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.hysteria.bandwidth.down.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:r("dynamic_form.hysteria.bandwidth.down.placeholder")+(d.watch("version")==2?r("dynamic_form.hysteria.bandwidth.down.bbr_tip"):""),className:"rounded-br-none rounded-tr-none",...g,value:g.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:r("dynamic_form.hysteria.bandwidth.down.suffix")})})]})]})}),e.jsx(e.Fragment,{children:e.jsx(v,{control:d.control,name:"hop_interval",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.hysteria.hop_interval.label","Hop 间隔 (秒)")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:r("dynamic_form.hysteria.hop_interval.placeholder","例如: 30"),...g,value:g.value||"",onChange:w=>{const R=w.target.value?parseInt(w.target.value):void 0;g.onChange(R)}})}),e.jsx(O,{children:r("dynamic_form.hysteria.hop_interval.description","Hop 间隔时间,单位为秒")})]})})})]}),vless:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"tls",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.tls.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value?.toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.vless.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:r("dynamic_form.vless.tls.none")}),e.jsx($,{value:"1",children:r("dynamic_form.vless.tls.tls")}),e.jsx($,{value:"2",children:r("dynamic_form.vless.tls.reality")})]})]})})]})}),d.watch("tls")=="1"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls_settings.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.vless.tls_settings.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.vless.tls_settings.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls_settings.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]}),d.watch("tls")==2&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"reality_settings.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.vless.reality_settings.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"reality_settings.server_port",render:({field:g})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.server_port.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.vless.reality_settings.server_port.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"reality_settings.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]}),e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(v,{control:d.control,name:"reality_settings.private_key",render:({field:g})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.private_key.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{children:e.jsx(P,{...g,className:"pr-9"})}),e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(G,{type:"button",variant:"ghost",size:"icon",onClick:()=>{try{const w=nx();d.setValue("reality_settings.private_key",w.privateKey),d.setValue("reality_settings.public_key",w.publicKey),A.success(r("dynamic_form.vless.reality_settings.key_pair.success"))}catch{A.error(r("dynamic_form.vless.reality_settings.key_pair.error"))}},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(Be,{icon:"ion:key-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})}),e.jsx(Na,{children:e.jsx(ce,{children:e.jsx("p",{children:r("dynamic_form.vless.reality_settings.key_pair.generate")})})})]})]})]})})}),e.jsx(v,{control:d.control,name:"reality_settings.public_key",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.public_key.label")}),e.jsx(y,{children:e.jsx(P,{...g})})]})}),e.jsx(v,{control:d.control,name:"reality_settings.short_id",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.short_id.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{children:e.jsx(P,{...g,className:"pr-9",placeholder:r("dynamic_form.vless.reality_settings.short_id.placeholder")})}),e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(G,{type:"button",variant:"ghost",size:"icon",onClick:()=>{const w=lx();d.setValue("reality_settings.short_id",w),A.success(r("dynamic_form.vless.reality_settings.short_id.success"))},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(Be,{icon:"ion:refresh-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})}),e.jsx(Na,{children:e.jsx(ce,{children:e.jsx("p",{children:r("dynamic_form.vless.reality_settings.short_id.generate")})})})]})]}),e.jsx(O,{className:"text-xs text-muted-foreground",children:r("dynamic_form.vless.reality_settings.short_id.description")})]})})]}),e.jsx(v,{control:d.control,name:"network",render:({field:g})=>e.jsxs(p,{children:[e.jsxs(j,{children:[r("dynamic_form.vless.network.label"),e.jsx(rn,{value:d.watch("network_settings"),setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")})]}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.vless.network.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.vless.networkOptions.map(w=>e.jsx($,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})}),e.jsx(v,{control:d.control,name:"flow",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.flow.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:w=>g.onChange(w==="none"?null:w),value:g.value||"none",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.vless.flow.placeholder")})}),e.jsx(Y,{children:Ee.vless.flowOptions.map(w=>e.jsx($,{value:w,children:w},w))})]})})]})})]}),tuic:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"version",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.tuic.version.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value?.toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.tuic.version.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.tuic.versions.map(w=>e.jsxs($,{value:w,children:["V",w]},w))})})]})})]})}),e.jsx(v,{control:d.control,name:"congestion_control",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.tuic.congestion_control.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.tuic.congestion_control.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.tuic.congestionControls.map(w=>e.jsx($,{value:w,children:w.toUpperCase()},w))})})]})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.tuic.tls.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.tuic.tls.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.tuic.tls.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]}),e.jsx(v,{control:d.control,name:"alpn",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.tuic.tls.alpn.label")}),e.jsx(y,{children:e.jsx(kt,{options:Ee.tuic.alpnOptions,onChange:w=>g.onChange(w.map(R=>R.value)),value:Ee.tuic.alpnOptions.filter(w=>g.value?.includes(w.value)),placeholder:r("dynamic_form.tuic.tls.alpn.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:r("dynamic_form.tuic.tls.alpn.empty")})})})]})}),e.jsx(v,{control:d.control,name:"udp_relay_mode",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.tuic.udp_relay_mode.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.tuic.udp_relay_mode.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.tuic.udpRelayModes.map(w=>e.jsx($,{value:w.value,children:w.label},w.value))})})]})})]})})]}),socks:()=>e.jsx(e.Fragment,{}),naive:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"tls",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.naive.tls.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value?.toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.naive.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:r("dynamic_form.naive.tls.disabled")}),e.jsx($,{value:"1",children:r("dynamic_form.naive.tls.enabled")})]})]})})]})}),d.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls_settings.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.naive.tls_settings.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.naive.tls_settings.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls_settings.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.naive.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]})]}),http:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"tls",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.http.tls.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value?.toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.http.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:r("dynamic_form.http.tls.disabled")}),e.jsx($,{value:"1",children:r("dynamic_form.http.tls.enabled")})]})]})})]})}),d.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls_settings.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.http.tls_settings.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.http.tls_settings.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls_settings.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.http.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]})]}),mieru:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"transport",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.mieru.transport.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.mieru.transport.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.mieru.transportOptions.map(w=>e.jsx($,{value:w.value,children:w.label},w.value))})})]})})]})}),e.jsx(v,{control:d.control,name:"multiplexing",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.mieru.multiplexing.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.mieru.multiplexing.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.mieru.multiplexingOptions.map(w=>e.jsx($,{value:w.value,children:w.label},w.value))})})]})})]})})]}),anytls:()=>e.jsx(e.Fragment,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:d.control,name:"padding_scheme",render:({field:g})=>e.jsxs(p,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(j,{children:r("dynamic_form.anytls.padding_scheme.label","AnyTLS 填充方案")}),e.jsx(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{d.setValue("padding_scheme",Ee.anytls.defaultPaddingScheme),A.success(r("dynamic_form.anytls.padding_scheme.default_success","已设置默认填充方案"))},className:"h-7 px-2",children:r("dynamic_form.anytls.padding_scheme.use_default","使用默认方案")})]}),e.jsx(O,{children:r("dynamic_form.anytls.padding_scheme.description","每行一个填充规则,格式如: stop=8, 0=30-30")}),e.jsx(y,{children:e.jsx("textarea",{className:"flex min-h-[100px] 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",placeholder:r("dynamic_form.anytls.padding_scheme.placeholder",`例如: +`).filter(Boolean);o.onChange(h),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.emailWhitelist.suffixes.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"recaptcha_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.enable.label")}),e.jsx(O,{children:s("safe.form.recaptcha.enable.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("recaptcha_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"recaptcha_site_key",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.siteKey.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.recaptcha.siteKey.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.recaptcha.siteKey.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"recaptcha_key",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.key.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.recaptcha.key.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.recaptcha.key.description")}),e.jsx(E,{})]})})]}),e.jsx(v,{control:a.control,name:"register_limit_by_ip_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.enable.label")}),e.jsx(O,{children:s("safe.form.registerLimit.enable.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("register_limit_by_ip_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"register_limit_count",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.count.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.registerLimit.count.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.registerLimit.count.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"register_limit_expire",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.expire.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.registerLimit.expire.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.registerLimit.expire.description")}),e.jsx(E,{})]})})]}),e.jsx(v,{control:a.control,name:"password_limit_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.enable.label")}),e.jsx(O,{children:s("safe.form.passwordLimit.enable.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("password_limit_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"password_limit_count",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.count.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.passwordLimit.count.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.passwordLimit.count.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"password_limit_expire",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.expire.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.passwordLimit.expire.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.passwordLimit.expire.description")}),e.jsx(E,{})]})})]}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("safe.form.saving")})]})})}function $m(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("safe.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("safe.description")})]}),e.jsx(Te,{}),e.jsx(zm,{})]})}const Am=Object.freeze(Object.defineProperty({__proto__:null,default:$m},Symbol.toStringTag,{value:"Module"})),qm=x.object({plan_change_enable:x.boolean().nullable().default(!1),reset_traffic_method:x.coerce.number().nullable().default(0),surplus_enable:x.boolean().nullable().default(!1),new_order_event_id:x.coerce.number().nullable().default(0),renew_order_event_id:x.coerce.number().nullable().default(0),change_order_event_id:x.coerce.number().nullable().default(0),show_info_to_server_enable:x.boolean().nullable().default(!1),show_protocol_to_server_enable:x.boolean().nullable().default(!1),default_remind_expire:x.boolean().nullable().default(!1),default_remind_traffic:x.boolean().nullable().default(!1),subscribe_path:x.string().nullable().default("s")}),Hm={plan_change_enable:!1,reset_traffic_method:0,surplus_enable:!1,new_order_event_id:0,renew_order_event_id:0,change_order_event_id:0,show_info_to_server_enable:!1,show_protocol_to_server_enable:!1,default_remind_expire:!1,default_remind_traffic:!1,subscribe_path:"s"};function Um(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(qm),defaultValues:Hm,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","subscribe"],queryFn:()=>he.getSettings("subscribe")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:o=>{o.data&&A.success(s("common.autoSaved"))}});m.useEffect(()=>{if(i?.data?.subscribe){const o=i?.data?.subscribe;Object.entries(o).forEach(([c,h])=>{a.setValue(c,h)}),r.current=o}},[i]);const d=m.useCallback(ke.debounce(async o=>{if(!ke.isEqual(o,r.current)){t(!0);try{await l(o),r.current=o}finally{t(!1)}}},1e3),[l]),u=m.useCallback(o=>{d(o)},[d]);return m.useEffect(()=>{const o=a.watch(c=>{u(c)});return()=>o.unsubscribe()},[a.watch,u]),e.jsx(Se,{...a,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:a.control,name:"plan_change_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.plan_change_enable.title")}),e.jsx(O,{children:s("subscribe.plan_change_enable.description")}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"reset_traffic_method",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.reset_traffic_method.title")}),e.jsxs(J,{onValueChange:o.onChange,value:o.value?.toString()||"0",children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择重置方式"})})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("subscribe.reset_traffic_method.options.monthly_first")}),e.jsx($,{value:"1",children:s("subscribe.reset_traffic_method.options.monthly_reset")}),e.jsx($,{value:"2",children:s("subscribe.reset_traffic_method.options.no_reset")}),e.jsx($,{value:"3",children:s("subscribe.reset_traffic_method.options.yearly_first")}),e.jsx($,{value:"4",children:s("subscribe.reset_traffic_method.options.yearly_reset")})]})]}),e.jsx(O,{children:s("subscribe.reset_traffic_method.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"surplus_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.surplus_enable.title")}),e.jsx(O,{children:s("subscribe.surplus_enable.description")}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"new_order_event_id",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.new_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(J,{onValueChange:o.onChange,value:o.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("subscribe.new_order_event.options.no_action")}),e.jsx($,{value:"1",children:s("subscribe.new_order_event.options.reset_traffic")})]})]})})}),e.jsx(O,{children:s("subscribe.new_order_event.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"renew_order_event_id",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.renew_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(J,{onValueChange:o.onChange,value:o.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("subscribe.renew_order_event.options.no_action")}),e.jsx($,{value:"1",children:s("subscribe.renew_order_event.options.reset_traffic")})]})]})})}),e.jsx(O,{children:s("subscribe.renew_order_event.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"change_order_event_id",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.change_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(J,{onValueChange:o.onChange,value:o.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("subscribe.change_order_event.options.no_action")}),e.jsx($,{value:"1",children:s("subscribe.change_order_event.options.reset_traffic")})]})]})})}),e.jsx(O,{children:s("subscribe.change_order_event.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"subscribe_path",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.subscribe_path.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:"subscribe",...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[s("subscribe.subscribe_path.description"),e.jsx("br",{}),s("subscribe.subscribe_path.current_format",{path:o.value||"s"})]}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"show_info_to_server_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("subscribe.show_info_to_server.title")}),e.jsx(O,{children:s("subscribe.show_info_to_server.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"show_protocol_to_server_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("subscribe.show_protocol_to_server.title")}),e.jsx(O,{children:s("subscribe.show_protocol_to_server.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function Km(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("subscribe.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("subscribe.description")})]}),e.jsx(Te,{}),e.jsx(Um,{})]})}const Bm=Object.freeze(Object.defineProperty({__proto__:null,default:Km},Symbol.toStringTag,{value:"Module"})),Gm=x.object({invite_force:x.boolean().default(!1),invite_commission:x.coerce.string().default("0"),invite_gen_limit:x.coerce.string().default("0"),invite_never_expire:x.boolean().default(!1),commission_first_time_enable:x.boolean().default(!1),commission_auto_check_enable:x.boolean().default(!1),commission_withdraw_limit:x.coerce.string().default("0"),commission_withdraw_method:x.array(x.string()).default(["支付宝","USDT","Paypal"]),withdraw_close_enable:x.boolean().default(!1),commission_distribution_enable:x.boolean().default(!1),commission_distribution_l1:x.coerce.number().default(0),commission_distribution_l2:x.coerce.number().default(0),commission_distribution_l3:x.coerce.number().default(0)}),Wm={invite_force:!1,invite_commission:"0",invite_gen_limit:"0",invite_never_expire:!1,commission_first_time_enable:!1,commission_auto_check_enable:!1,commission_withdraw_limit:"0",commission_withdraw_method:["支付宝","USDT","Paypal"],withdraw_close_enable:!1,commission_distribution_enable:!1,commission_distribution_l1:0,commission_distribution_l2:0,commission_distribution_l3:0};function Ym(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(Gm),defaultValues:Wm,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","invite"],queryFn:()=>he.getSettings("invite")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:o=>{o.data&&A.success(s("common.autoSaved"))}});m.useEffect(()=>{if(i?.data?.invite){const o=i?.data?.invite;Object.entries(o).forEach(([c,h])=>{typeof h=="number"?a.setValue(c,String(h)):a.setValue(c,h)}),r.current=o}},[i]);const d=m.useCallback(ke.debounce(async o=>{if(!ke.isEqual(o,r.current)){t(!0);try{await l(o),r.current=o}finally{t(!1)}}},1e3),[l]),u=m.useCallback(o=>{d(o)},[d]);return m.useEffect(()=>{const o=a.watch(c=>{u(c)});return()=>o.unsubscribe()},[a.watch,u]),e.jsx(Se,{...a,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:a.control,name:"invite_force",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.invite_force.title")}),e.jsx(O,{children:s("invite.invite_force.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"invite_commission",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("invite.invite_commission.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("invite.invite_commission.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("invite.invite_commission.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"invite_gen_limit",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("invite.invite_gen_limit.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("invite.invite_gen_limit.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("invite.invite_gen_limit.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"invite_never_expire",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.invite_never_expire.title")}),e.jsx(O,{children:s("invite.invite_never_expire.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"commission_first_time_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_first_time.title")}),e.jsx(O,{children:s("invite.commission_first_time.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"commission_auto_check_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_auto_check.title")}),e.jsx(O,{children:s("invite.commission_auto_check.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"commission_withdraw_limit",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("invite.commission_withdraw_limit.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("invite.commission_withdraw_limit.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("invite.commission_withdraw_limit.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"commission_withdraw_method",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("invite.commission_withdraw_method.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("invite.commission_withdraw_method.placeholder"),...o,value:Array.isArray(o.value)?o.value.join(","):"",onChange:c=>{const h=c.target.value.split(",").filter(Boolean);o.onChange(h),u(a.getValues())}})}),e.jsx(O,{children:s("invite.commission_withdraw_method.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"withdraw_close_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.withdraw_close.title")}),e.jsx(O,{children:s("invite.withdraw_close.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),e.jsx(v,{control:a.control,name:"commission_distribution_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_distribution.title")}),e.jsx(O,{children:s("invite.commission_distribution.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("commission_distribution_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"commission_distribution_l1",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:s("invite.commission_distribution.l1")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...o,value:o.value||"",onChange:c=>{const h=c.target.value?Number(c.target.value):0;o.onChange(h),u(a.getValues())}})}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"commission_distribution_l2",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:s("invite.commission_distribution.l2")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...o,value:o.value||"",onChange:c=>{const h=c.target.value?Number(c.target.value):0;o.onChange(h),u(a.getValues())}})}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"commission_distribution_l3",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:s("invite.commission_distribution.l3")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...o,value:o.value||"",onChange:c=>{const h=c.target.value?Number(c.target.value):0;o.onChange(h),u(a.getValues())}})}),e.jsx(E,{})]})})]}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("invite.saving")})]})})}function Jm(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("invite.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("invite.description")})]}),e.jsx(Te,{}),e.jsx(Ym,{})]})}const Qm=Object.freeze(Object.defineProperty({__proto__:null,default:Jm},Symbol.toStringTag,{value:"Module"})),Xm=x.object({frontend_theme:x.string().nullable(),frontend_theme_sidebar:x.string().nullable(),frontend_theme_header:x.string().nullable(),frontend_theme_color:x.string().nullable(),frontend_background_url:x.string().url().nullable()}),Zm={frontend_theme:"",frontend_theme_sidebar:"",frontend_theme_header:"",frontend_theme_color:"",frontend_background_url:""};function eu(){const{data:s}=ne({queryKey:["settings","frontend"],queryFn:()=>he.getSettings("frontend")}),n=we({resolver:Ce(Xm),defaultValues:Zm,mode:"onChange"});m.useEffect(()=>{if(s?.data?.frontend){const r=s?.data?.frontend;Object.entries(r).forEach(([a,i])=>{n.setValue(a,i)})}},[s]);function t(r){he.saveSettings(r).then(({data:a})=>{a&&A.success("更新成功")})}return e.jsx(Se,{...n,children:e.jsxs("form",{onSubmit:n.handleSubmit(t),className:"space-y-8",children:[e.jsx(v,{control:n.control,name:"frontend_theme_sidebar",render:({field:r})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:"边栏风格"}),e.jsx(O,{children:"边栏风格"})]}),e.jsx(y,{children:e.jsx(Z,{checked:r.value,onCheckedChange:r.onChange})})]})}),e.jsx(v,{control:n.control,name:"frontend_theme_header",render:({field:r})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:"头部风格"}),e.jsx(O,{children:"边栏风格"})]}),e.jsx(y,{children:e.jsx(Z,{checked:r.value,onCheckedChange:r.onChange})})]})}),e.jsx(v,{control:n.control,name:"frontend_theme_color",render:({field:r})=>e.jsxs(p,{children:[e.jsx(j,{children:"主题色"}),e.jsxs("div",{className:"relative w-max",children:[e.jsx(y,{children:e.jsxs("select",{className:b(Tt({variant:"outline"}),"w-[200px] appearance-none font-normal"),...r,children:[e.jsx("option",{value:"default",children:"默认"}),e.jsx("option",{value:"black",children:"黑色"}),e.jsx("option",{value:"blackblue",children:"暗蓝色"}),e.jsx("option",{value:"green",children:"奶绿色"})]})}),e.jsx(kn,{className:"absolute right-3 top-2.5 h-4 w-4 opacity-50"})]}),e.jsx(O,{children:"主题色"}),e.jsx(E,{})]})}),e.jsx(v,{control:n.control,name:"frontend_background_url",render:({field:r})=>e.jsxs(p,{children:[e.jsx(j,{children:"背景"}),e.jsx(y,{children:e.jsx(P,{placeholder:"请输入图片地址",...r})}),e.jsx(O,{children:"将会在后台登录页面进行展示。"}),e.jsx(E,{})]})}),e.jsx(L,{type:"submit",children:"保存设置"})]})})}function su(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"个性化设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"自定义系统界面外观,包括主题风格、布局、颜色方案、背景图等个性化选项。"})]}),e.jsx(Te,{}),e.jsx(eu,{})]})}const tu=Object.freeze(Object.defineProperty({__proto__:null,default:su},Symbol.toStringTag,{value:"Module"})),au=x.object({server_pull_interval:x.coerce.number().nullable(),server_push_interval:x.coerce.number().nullable(),server_token:x.string().nullable(),device_limit_mode:x.coerce.number().nullable()}),nu={server_pull_interval:0,server_push_interval:0,server_token:"",device_limit_mode:0};function ru(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(au),defaultValues:nu,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","server"],queryFn:()=>he.getSettings("server")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:c=>{c.data&&A.success(s("common.AutoSaved"))}});m.useEffect(()=>{if(i?.data.server){const c=i.data.server;Object.entries(c).forEach(([h,k])=>{a.setValue(h,k)}),r.current=c}},[i]);const d=m.useCallback(ke.debounce(async c=>{if(!ke.isEqual(c,r.current)){t(!0);try{await l(c),r.current=c}finally{t(!1)}}},1e3),[l]),u=m.useCallback(c=>{d(c)},[d]);m.useEffect(()=>{const c=a.watch(h=>{u(h)});return()=>c.unsubscribe()},[a.watch,u]);const o=()=>{const c=Math.floor(Math.random()*17)+16,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let k="";for(let C=0;Ce.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("server.server_token.title")}),e.jsx(y,{children:e.jsxs("div",{className:"relative",children:[e.jsx(P,{placeholder:s("server.server_token.placeholder"),...c,value:c.value||"",className:"pr-10"}),e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(G,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2",onClick:h=>{h.preventDefault(),o()},children:e.jsx(Ec,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"})})}),e.jsx(oe,{children:e.jsx("p",{children:s("server.server_token.generate_tooltip")})})]})})]})}),e.jsx(O,{children:s("server.server_token.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"server_pull_interval",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("server.server_pull_interval.title")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("server.server_pull_interval.placeholder"),...c,value:c.value||"",onChange:h=>{const k=h.target.value?Number(h.target.value):null;c.onChange(k)}})}),e.jsx(O,{children:s("server.server_pull_interval.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"server_push_interval",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("server.server_push_interval.title")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("server.server_push_interval.placeholder"),...c,value:c.value||"",onChange:h=>{const k=h.target.value?Number(h.target.value):null;c.onChange(k)}})}),e.jsx(O,{children:s("server.server_push_interval.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"device_limit_mode",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("server.device_limit_mode.title")}),e.jsxs(J,{onValueChange:c.onChange,value:c.value?.toString()||"0",children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:s("server.device_limit_mode.placeholder")})})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("server.device_limit_mode.strict")}),e.jsx($,{value:"1",children:s("server.device_limit_mode.relaxed")})]})]}),e.jsx(O,{children:s("server.device_limit_mode.description")}),e.jsx(E,{})]})}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("server.saving")})]})})}function lu(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("server.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("server.description")})]}),e.jsx(Te,{}),e.jsx(ru,{})]})}const iu=Object.freeze(Object.defineProperty({__proto__:null,default:lu},Symbol.toStringTag,{value:"Module"}));function ou({open:s,onOpenChange:n,result:t}){const r=!t.error;return e.jsx(ge,{open:s,onOpenChange:n,children:e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(be,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[r?e.jsx(cl,{className:"h-5 w-5 text-green-500"}):e.jsx(dl,{className:"h-5 w-5 text-destructive"}),e.jsx(fe,{children:r?"邮件发送成功":"邮件发送失败"})]}),e.jsx(Ve,{children:r?"测试邮件已成功发送,请检查收件箱":"发送测试邮件时遇到错误"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"发送详情"}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2 text-sm",children:[e.jsx("div",{className:"text-muted-foreground",children:"收件地址"}),e.jsx("div",{children:t.email}),e.jsx("div",{className:"text-muted-foreground",children:"邮件主题"}),e.jsx("div",{children:t.subject}),e.jsx("div",{className:"text-muted-foreground",children:"模板名称"}),e.jsx("div",{children:t.template_name})]})]}),t.error&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium text-destructive",children:"错误信息"}),e.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive break-all",children:t.error})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"配置信息"}),e.jsx(lt,{className:"h-[200px] rounded-md border p-4",children:e.jsx("div",{className:"grid gap-2 text-sm",children:e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2",children:[e.jsx("div",{className:"text-muted-foreground",children:"驱动"}),e.jsx("div",{children:t.config.driver}),e.jsx("div",{className:"text-muted-foreground",children:"服务器"}),e.jsx("div",{children:t.config.host}),e.jsx("div",{className:"text-muted-foreground",children:"端口"}),e.jsx("div",{children:t.config.port}),e.jsx("div",{className:"text-muted-foreground",children:"加密方式"}),e.jsx("div",{children:t.config.encryption||"无"}),e.jsx("div",{className:"text-muted-foreground",children:"发件人"}),e.jsx("div",{children:t.config.from.address?`${t.config.from.address}${t.config.from.name?` (${t.config.from.name})`:""}`:"未设置"}),e.jsx("div",{className:"text-muted-foreground",children:"用户名"}),e.jsx("div",{children:t.config.username||"未设置"})]})})})]})]})]})})}const cu=x.object({email_template:x.string().nullable().default("classic"),email_host:x.string().nullable().default(""),email_port:x.coerce.number().nullable().default(465),email_username:x.string().nullable().default(""),email_password:x.string().nullable().default(""),email_encryption:x.string().nullable().default(""),email_from_address:x.string().email().nullable().default(""),remind_mail_enable:x.boolean().nullable().default(!1)});function du(){const{t:s}=V("settings"),[n,t]=m.useState(null),[r,a]=m.useState(!1),i=m.useRef(null),[l,d]=m.useState(!1),u=we({resolver:Ce(cu),defaultValues:{},mode:"onBlur"}),{data:o}=ne({queryKey:["settings","email"],queryFn:()=>he.getSettings("email")}),{data:c}=ne({queryKey:["emailTemplate"],queryFn:()=>he.getEmailTemplate()}),{mutateAsync:h}=Ts({mutationFn:he.saveSettings,onSuccess:N=>{N.data&&A.success(s("common.autoSaved"))}}),{mutate:k,isPending:C}=Ts({mutationFn:he.sendTestMail,onMutate:()=>{t(null),a(!1)},onSuccess:N=>{t(N.data),a(!0),N.data.error?A.error(s("email.test.error")):A.success(s("email.test.success"))}});m.useEffect(()=>{if(o?.data.email){const N=o.data.email;Object.entries(N).forEach(([_,T])=>{u.setValue(_,T)}),i.current=N}},[o]);const S=m.useCallback(ke.debounce(async N=>{if(!ke.isEqual(N,i.current)){d(!0);try{await h(N),i.current=N}finally{d(!1)}}},1e3),[h]),f=m.useCallback(N=>{S(N)},[S]);return m.useEffect(()=>{const N=u.watch(_=>{f(_)});return()=>N.unsubscribe()},[u.watch,f]),e.jsxs(e.Fragment,{children:[e.jsx(Se,{...u,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:u.control,name:"email_host",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_host.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(O,{children:s("email.email_host.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_port",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_port.title")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:s("common.placeholder"),...N,value:N.value||"",onChange:_=>{const T=_.target.value?Number(_.target.value):null;N.onChange(T)}})}),e.jsx(O,{children:s("email.email_port.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_encryption",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_encryption.title")}),e.jsxs(J,{onValueChange:_=>{const T=_==="none"?"":_;N.onChange(T)},value:N.value===""||N.value===null||N.value===void 0?"none":N.value,children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择加密方式"})})}),e.jsxs(Y,{children:[e.jsx($,{value:"none",children:s("email.email_encryption.none")}),e.jsx($,{value:"ssl",children:s("email.email_encryption.ssl")}),e.jsx($,{value:"tls",children:s("email.email_encryption.tls")})]})]}),e.jsx(O,{children:s("email.email_encryption.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_username",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_username.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(O,{children:s("email.email_username.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_password",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_password.title")}),e.jsx(y,{children:e.jsx(P,{type:"password",placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(O,{children:s("email.email_password.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_from_address",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_from.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(O,{children:s("email.email_from.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"email_template",render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("email.email_template.title")}),e.jsxs(J,{onValueChange:_=>{N.onChange(_),f(u.getValues())},value:N.value||void 0,children:[e.jsx(y,{children:e.jsx(W,{className:"w-[200px]",children:e.jsx(Q,{placeholder:s("email.email_template.placeholder")})})}),e.jsx(Y,{children:c?.data?.map(_=>e.jsx($,{value:_,children:_},_))})]}),e.jsx(O,{children:s("email.email_template.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"remind_mail_enable",render:({field:N})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("email.remind_mail.title")}),e.jsx(O,{children:s("email.remind_mail.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:N.value||!1,onCheckedChange:_=>{N.onChange(_),f(u.getValues())}})})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(L,{onClick:()=>k(),loading:C,disabled:C,children:s(C?"email.test.sending":"email.test.title")})})]})}),l&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("saving")}),n&&e.jsx(ou,{open:r,onOpenChange:a,result:n})]})}function mu(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("email.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("email.description")})]}),e.jsx(Te,{}),e.jsx(du,{})]})}const uu=Object.freeze(Object.defineProperty({__proto__:null,default:mu},Symbol.toStringTag,{value:"Module"})),xu=x.object({telegram_bot_enable:x.boolean().nullable(),telegram_bot_token:x.string().nullable(),telegram_discuss_link:x.string().nullable()}),hu={telegram_bot_enable:!1,telegram_bot_token:"",telegram_discuss_link:""};function gu(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(xu),defaultValues:hu,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","telegram"],queryFn:()=>he.getSettings("telegram")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:h=>{h.data&&A.success(s("common.autoSaved"))}}),{mutate:d,isPending:u}=Ts({mutationFn:he.setTelegramWebhook,onSuccess:h=>{h.data&&A.success(s("telegram.webhook.success"))}});m.useEffect(()=>{if(i?.data.telegram){const h=i.data.telegram;Object.entries(h).forEach(([k,C])=>{a.setValue(k,C)}),r.current=h}},[i]);const o=m.useCallback(ke.debounce(async h=>{if(!ke.isEqual(h,r.current)){t(!0);try{await l(h),r.current=h}finally{t(!1)}}},1e3),[l]),c=m.useCallback(h=>{o(h)},[o]);return m.useEffect(()=>{const h=a.watch(k=>{c(k)});return()=>h.unsubscribe()},[a.watch,c]),e.jsx(Se,{...a,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:a.control,name:"telegram_bot_token",render:({field:h})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("telegram.bot_token.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("telegram.bot_token.placeholder"),...h,value:h.value||""})}),e.jsx(O,{children:s("telegram.bot_token.description")}),e.jsx(E,{})]})}),a.watch("telegram_bot_token")&&e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("telegram.webhook.title")}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(L,{loading:u,disabled:u,onClick:()=>d(),children:s(u?"telegram.webhook.setting":"telegram.webhook.button")}),n&&e.jsx("span",{className:"text-sm text-muted-foreground",children:s("common.saving")})]}),e.jsx(O,{children:s("telegram.webhook.description")}),e.jsx(E,{})]}),e.jsx(v,{control:a.control,name:"telegram_bot_enable",render:({field:h})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("telegram.bot_enable.title")}),e.jsx(O,{children:s("telegram.bot_enable.description")}),e.jsx(y,{children:e.jsx(Z,{checked:h.value||!1,onCheckedChange:k=>{h.onChange(k),c(a.getValues())}})}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"telegram_discuss_link",render:({field:h})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("telegram.discuss_link.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("telegram.discuss_link.placeholder"),...h,value:h.value||""})}),e.jsx(O,{children:s("telegram.discuss_link.description")}),e.jsx(E,{})]})}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function fu(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("telegram.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("telegram.description")})]}),e.jsx(Te,{}),e.jsx(gu,{})]})}const pu=Object.freeze(Object.defineProperty({__proto__:null,default:fu},Symbol.toStringTag,{value:"Module"})),ju=x.object({windows_version:x.string().nullable(),windows_download_url:x.string().nullable(),macos_version:x.string().nullable(),macos_download_url:x.string().nullable(),android_version:x.string().nullable(),android_download_url:x.string().nullable()}),vu={windows_version:"",windows_download_url:"",macos_version:"",macos_download_url:"",android_version:"",android_download_url:""};function bu(){const{t:s}=V("settings"),[n,t]=m.useState(!1),r=m.useRef(null),a=we({resolver:Ce(ju),defaultValues:vu,mode:"onBlur"}),{data:i}=ne({queryKey:["settings","app"],queryFn:()=>he.getSettings("app")}),{mutateAsync:l}=Ts({mutationFn:he.saveSettings,onSuccess:o=>{o.data&&A.success(s("app.save_success"))}});m.useEffect(()=>{if(i?.data.app){const o=i.data.app;Object.entries(o).forEach(([c,h])=>{a.setValue(c,h)}),r.current=o}},[i]);const d=m.useCallback(ke.debounce(async o=>{if(!ke.isEqual(o,r.current)){t(!0);try{await l(o),r.current=o}finally{t(!1)}}},1e3),[l]),u=m.useCallback(o=>{d(o)},[d]);return m.useEffect(()=>{const o=a.watch(c=>{u(c)});return()=>o.unsubscribe()},[a.watch,u]),e.jsx(Se,{...a,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:a.control,name:"windows_version",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.windows.version.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.windows.version.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"windows_download_url",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.windows.download.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.windows.download.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"macos_version",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.macos.version.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.macos.version.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"macos_download_url",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.macos.download.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.macos.download.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"android_version",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.android.version.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.android.version.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"android_download_url",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("app.android.download.title")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("common.placeholder"),...o,value:o.value||""})}),e.jsx(O,{children:s("app.android.download.description")}),e.jsx(E,{})]})}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function yu(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("app.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("app.description")})]}),e.jsx(Te,{}),e.jsx(bu,{})]})}const Nu=Object.freeze(Object.defineProperty({__proto__:null,default:yu},Symbol.toStringTag,{value:"Module"})),_u=s=>x.object({id:x.number().nullable(),name:x.string().min(2,s("form.validation.name.min")).max(30,s("form.validation.name.max")),icon:x.string().optional().nullable(),notify_domain:x.string().refine(t=>!t||/^https?:\/\/\S+/.test(t),s("form.validation.notify_domain.url")).optional().nullable(),handling_fee_fixed:x.coerce.number().min(0).optional().nullable(),handling_fee_percent:x.coerce.number().min(0).max(100).optional().nullable(),payment:x.string().min(1,s("form.validation.payment.required")),config:x.record(x.string(),x.string())}),hr={id:null,name:"",icon:"",notify_domain:"",handling_fee_fixed:0,handling_fee_percent:0,payment:"",config:{}};function Wl({refetch:s,dialogTrigger:n,type:t="add",defaultFormValues:r=hr}){const{t:a}=V("payment"),[i,l]=m.useState(!1),[d,u]=m.useState(!1),[o,c]=m.useState([]),[h,k]=m.useState([]),C=_u(a),S=we({resolver:Ce(C),defaultValues:r,mode:"onChange"}),f=S.watch("payment");m.useEffect(()=>{i&&(async()=>{const{data:T}=await nt.getMethodList();c(T)})()},[i]),m.useEffect(()=>{if(!f||!i)return;(async()=>{const T={payment:f,...t==="edit"&&{id:Number(S.getValues("id"))}};nt.getMethodForm(T).then(({data:D})=>{k(D);const g=D.reduce((w,R)=>(R.field_name&&(w[R.field_name]=R.value??""),w),{});S.setValue("config",g)})})()},[f,i,S,t]);const N=async _=>{u(!0);try{(await nt.save(_)).data&&(A.success(a("form.messages.success")),S.reset(hr),s(),l(!1))}finally{u(!1)}};return e.jsxs(ge,{open:i,onOpenChange:l,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"})," ",e.jsx("div",{children:a("form.add.button")})]})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsx(be,{children:e.jsx(fe,{children:a(t==="add"?"form.add.title":"form.edit.title")})}),e.jsx(Se,{...S,children:e.jsxs("form",{onSubmit:S.handleSubmit(N),className:"space-y-4",children:[e.jsx(v,{control:S.control,name:"name",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:a("form.fields.name.placeholder"),..._})}),e.jsx(O,{children:a("form.fields.name.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:S.control,name:"icon",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.icon.label")}),e.jsx(y,{children:e.jsx(P,{..._,value:_.value||"",placeholder:a("form.fields.icon.placeholder")})}),e.jsx(O,{children:a("form.fields.icon.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:S.control,name:"notify_domain",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.notify_domain.label")}),e.jsx(y,{children:e.jsx(P,{..._,value:_.value||"",placeholder:a("form.fields.notify_domain.placeholder")})}),e.jsx(O,{children:a("form.fields.notify_domain.description")}),e.jsx(E,{})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(v,{control:S.control,name:"handling_fee_percent",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.handling_fee_percent.label")}),e.jsx(y,{children:e.jsx(P,{type:"number",..._,value:_.value||"",placeholder:a("form.fields.handling_fee_percent.placeholder")})}),e.jsx(E,{})]})}),e.jsx(v,{control:S.control,name:"handling_fee_fixed",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.handling_fee_fixed.label")}),e.jsx(y,{children:e.jsx(P,{type:"number",..._,value:_.value||"",placeholder:a("form.fields.handling_fee_fixed.placeholder")})}),e.jsx(E,{})]})})]}),e.jsx(v,{control:S.control,name:"payment",render:({field:_})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.payment.label")}),e.jsxs(J,{onValueChange:_.onChange,defaultValue:_.value,children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:a("form.fields.payment.placeholder")})})}),e.jsx(Y,{children:o.map(T=>e.jsx($,{value:T,children:T},T))})]}),e.jsx(O,{children:a("form.fields.payment.description")}),e.jsx(E,{})]})}),h.length>0&&e.jsx("div",{className:"space-y-4",children:h.map(_=>e.jsx(v,{control:S.control,name:`config.${_.field_name}`,render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:_.label}),e.jsx(y,{children:e.jsx(P,{...T,value:T.value||""})}),e.jsx(E,{})]})},_.field_name))}),e.jsxs(Le,{children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:a("form.buttons.cancel")})}),e.jsx(L,{type:"submit",disabled:d,children:a("form.buttons.submit")})]})]})})]})]})}function z({column:s,title:n,tooltip:t,className:r}){return s.getCanSort()?e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(L,{variant:"ghost",size:"default",className:b("-ml-3 flex h-8 items-center gap-2 text-nowrap font-medium hover:bg-muted/60",r),onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:[e.jsx("span",{children:n}),t&&e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(tr,{className:"h-4 w-4 cursor-pointer text-muted-foreground"})}),e.jsx(oe,{children:t})]})}),s.getIsSorted()==="asc"?e.jsx(mn,{className:"h-4 w-4 text-foreground/70"}):s.getIsSorted()==="desc"?e.jsx(un,{className:"h-4 w-4 text-foreground/70"}):e.jsx(Fc,{className:"h-4 w-4 text-muted-foreground/70 transition-colors hover:text-foreground/70"})]})})}):e.jsxs("div",{className:b("flex items-center space-x-1 text-nowrap py-2 font-medium text-muted-foreground",r),children:[e.jsx("span",{children:n}),t&&e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{children:e.jsx(tr,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(oe,{children:t})]})})]})}const zn=Ic,Yl=Vc,wu=Mc,Jl=m.forwardRef(({className:s,...n},t)=>e.jsx(ul,{className:b("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",s),...n,ref:t}));Jl.displayName=ul.displayName;const za=m.forwardRef(({className:s,...n},t)=>e.jsxs(wu,{children:[e.jsx(Jl,{}),e.jsx(xl,{ref:t,className:b("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",s),...n})]}));za.displayName=xl.displayName;const $a=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",s),...n});$a.displayName="AlertDialogHeader";const Aa=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...n});Aa.displayName="AlertDialogFooter";const qa=m.forwardRef(({className:s,...n},t)=>e.jsx(hl,{ref:t,className:b("text-lg font-semibold",s),...n}));qa.displayName=hl.displayName;const Ha=m.forwardRef(({className:s,...n},t)=>e.jsx(gl,{ref:t,className:b("text-sm text-muted-foreground",s),...n}));Ha.displayName=gl.displayName;const Ua=m.forwardRef(({className:s,...n},t)=>e.jsx(fl,{ref:t,className:b(St(),s),...n}));Ua.displayName=fl.displayName;const Ka=m.forwardRef(({className:s,...n},t)=>e.jsx(pl,{ref:t,className:b(St({variant:"outline"}),"mt-2 sm:mt-0",s),...n}));Ka.displayName=pl.displayName;function ps({onConfirm:s,children:n,title:t="确认操作",description:r="确定要执行此操作吗?",cancelText:a="取消",confirmText:i="确认",variant:l="default",className:d}){return e.jsxs(zn,{children:[e.jsx(Yl,{asChild:!0,children:n}),e.jsxs(za,{className:b("sm:max-w-[425px]",d),children:[e.jsxs($a,{children:[e.jsx(qa,{children:t}),e.jsx(Ha,{children:r})]}),e.jsxs(Aa,{children:[e.jsx(Ka,{asChild:!0,children:e.jsx(L,{variant:"outline",children:a})}),e.jsx(Ua,{asChild:!0,children:e.jsx(L,{variant:l,onClick:s,children:i})})]})]})]})}const Ql=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M11.29 15.29a2 2 0 0 0-.12.15a.8.8 0 0 0-.09.18a.6.6 0 0 0-.06.18a1.4 1.4 0 0 0 0 .2a.84.84 0 0 0 .08.38a.9.9 0 0 0 .54.54a.94.94 0 0 0 .76 0a.9.9 0 0 0 .54-.54A1 1 0 0 0 13 16a1 1 0 0 0-.29-.71a1 1 0 0 0-1.42 0M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8 8 0 0 1-8 8m0-13a3 3 0 0 0-2.6 1.5a1 1 0 1 0 1.73 1A1 1 0 0 1 12 9a1 1 0 0 1 0 2a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-.18A3 3 0 0 0 12 7"})}),Cu=({refetch:s,isSortMode:n=!1})=>{const{t}=V("payment");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:n?"cursor-move":"opacity-0",children:e.jsx(Fa,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:r})=>e.jsx(z,{column:r,title:t("table.columns.id")}),cell:({row:r})=>e.jsx(U,{variant:"outline",children:r.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"enable",header:({column:r})=>e.jsx(z,{column:r,title:t("table.columns.enable")}),cell:({row:r})=>e.jsx(Z,{defaultChecked:r.getValue("enable"),onCheckedChange:async()=>{const{data:a}=await nt.updateStatus({id:r.original.id});a||s()}}),enableSorting:!1,size:100},{accessorKey:"name",header:({column:r})=>e.jsx(z,{column:r,title:t("table.columns.name")}),cell:({row:r})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:r.getValue("name")})}),enableSorting:!1,size:200},{accessorKey:"payment",header:({column:r})=>e.jsx(z,{column:r,title:t("table.columns.payment")}),cell:({row:r})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:r.getValue("payment")})}),enableSorting:!1,size:200},{accessorKey:"notify_url",header:({column:r})=>e.jsxs("div",{className:"flex items-center",children:[e.jsx(z,{column:r,title:t("table.columns.notify_url")}),e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{className:"ml-1",children:e.jsx(Ql,{className:"h-4 w-4"})}),e.jsx(oe,{children:t("table.columns.notify_url_tooltip")})]})})]}),cell:({row:r})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[300px] truncate font-medium",children:r.getValue("notify_url")})}),enableSorting:!1,size:3e3},{id:"actions",header:({column:r})=>e.jsx(z,{className:"justify-end",column:r,title:t("table.columns.actions")}),cell:({row:r})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(Wl,{refetch:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:t("table.actions.edit")})]}),type:"edit",defaultFormValues:r.original}),e.jsx(ps,{title:t("table.actions.delete.title"),description:t("table.actions.delete.description"),onConfirm:async()=>{const{data:a}=await nt.drop({id:r.original.id});a&&s()},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-destructive/10",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-destructive"}),e.jsx("span",{className:"sr-only",children:t("table.actions.delete.title")})]})})]}),size:100}]};function Su({table:s,refetch:n,saveOrder:t,isSortMode:r}){const{t:a}=V("payment"),i=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between",children:[r?e.jsx("p",{className:"text-sm text-muted-foreground",children:a("table.toolbar.sort.hint")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wl,{refetch:n}),e.jsx(P,{placeholder:a("table.toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:l=>s.getColumn("name")?.setFilterValue(l.target.value),className:"h-8 w-[250px]"}),i&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:[a("table.toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:r?"default":"outline",onClick:t,size:"sm",children:a(r?"table.toolbar.sort.save":"table.toolbar.sort.edit")})})]})}function ku(){const[s,n]=m.useState([]),[t,r]=m.useState([]),[a,i]=m.useState(!1),[l,d]=m.useState([]),[u,o]=m.useState({"drag-handle":!1}),[c,h]=m.useState({pageSize:20,pageIndex:0}),{refetch:k}=ne({queryKey:["paymentList"],queryFn:async()=>{const{data:_}=await nt.getList();return d(_?.map(T=>({...T,enable:!!T.enable}))||[]),_}});m.useEffect(()=>{o({"drag-handle":a,actions:!a}),h({pageSize:a?99999:10,pageIndex:0})},[a]);const C=(_,T)=>{a&&(_.dataTransfer.setData("text/plain",T.toString()),_.currentTarget.classList.add("opacity-50"))},S=(_,T)=>{if(!a)return;_.preventDefault(),_.currentTarget.classList.remove("bg-muted");const D=parseInt(_.dataTransfer.getData("text/plain"));if(D===T)return;const g=[...l],[w]=g.splice(D,1);g.splice(T,0,w),d(g)},f=async()=>{a?nt.sort({ids:l.map(_=>_.id)}).then(()=>{k(),i(!1),A.success("排序保存成功")}):i(!0)},N=ss({data:l,columns:Cu({refetch:k,isSortMode:a}),state:{sorting:t,columnFilters:s,columnVisibility:u,pagination:c},onSortingChange:r,onColumnFiltersChange:n,onColumnVisibilityChange:o,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),initialState:{columnPinning:{right:["actions"]}},pageCount:a?1:void 0});return e.jsx(xs,{table:N,toolbar:_=>e.jsx(Su,{table:_,refetch:k,saveOrder:f,isSortMode:a}),draggable:a,onDragStart:C,onDragEnd:_=>_.currentTarget.classList.remove("opacity-50"),onDragOver:_=>{_.preventDefault(),_.currentTarget.classList.add("bg-muted")},onDragLeave:_=>_.currentTarget.classList.remove("bg-muted"),onDrop:S,showPagination:!a})}function Tu(){const{t:s}=V("payment");return e.jsxs(ze,{children:[e.jsxs($e,{className:"flex items-center justify-between",children:[e.jsx(ns,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{children:[e.jsx("header",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("section",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(ku,{})})]})]})}const Du=Object.freeze(Object.defineProperty({__proto__:null,default:Tu},Symbol.toStringTag,{value:"Module"}));function Pu({pluginName:s,onClose:n,onSuccess:t}){const{t:r}=V("plugin"),[a,i]=m.useState(!0),[l,d]=m.useState(!1),[u,o]=m.useState(null),c=Oc({config:zc($c())}),h=we({resolver:Ce(c),defaultValues:{config:{}}});m.useEffect(()=>{(async()=>{try{const{data:f}=await Ms.getPluginConfig(s);o(f),h.reset({config:Object.fromEntries(Object.entries(f).map(([N,_])=>[N,_.value]))})}catch{A.error(r("messages.configLoadError"))}finally{i(!1)}})()},[s]);const k=async S=>{d(!0);try{await Ms.updatePluginConfig(s,S.config),A.success(r("messages.configSaveSuccess")),t()}catch{A.error(r("messages.configSaveError"))}finally{d(!1)}},C=(S,f)=>{switch(f.type){case"string":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{children:f.label||f.description}),e.jsx(y,{children:e.jsx(P,{placeholder:f.placeholder,...N})}),f.description&&f.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:f.description}),e.jsx(E,{})]})},S);case"number":case"percentage":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{children:f.label||f.description}),e.jsx(y,{children:e.jsxs("div",{className:"relative",children:[e.jsx(P,{type:"number",placeholder:f.placeholder,...N,onChange:_=>{const T=Number(_.target.value);f.type==="percentage"?N.onChange(Math.min(100,Math.max(0,T))):N.onChange(T)},className:f.type==="percentage"?"pr-8":"",min:f.type==="percentage"?0:void 0,max:f.type==="percentage"?100:void 0,step:f.type==="percentage"?1:void 0}),f.type==="percentage"&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:e.jsx(Ac,{className:"h-4 w-4 text-muted-foreground"})})]})}),f.description&&f.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:f.description}),e.jsx(E,{})]})},S);case"select":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{children:f.label||f.description}),e.jsxs(J,{onValueChange:N.onChange,defaultValue:N.value,children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:f.placeholder})})}),e.jsx(Y,{children:f.options?.map(_=>e.jsx($,{value:_.value,children:_.label},_.value))})]}),f.description&&f.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:f.description}),e.jsx(E,{})]})},S);case"boolean":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(p,{className:"flex flex-row items-center justify-between rounded-lg border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:f.label||f.description}),f.description&&f.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:f.description})]}),e.jsx(y,{children:e.jsx(Z,{checked:N.value,onCheckedChange:N.onChange})})]})},S);case"text":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(p,{children:[e.jsx(j,{children:f.label||f.description}),e.jsx(y,{children:e.jsx(Ds,{placeholder:f.placeholder,...N})}),f.description&&f.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:f.description}),e.jsx(E,{})]})},S);default:return null}};return a?e.jsxs("div",{className:"space-y-4",children:[e.jsx(ve,{className:"h-4 w-[200px]"}),e.jsx(ve,{className:"h-10 w-full"}),e.jsx(ve,{className:"h-4 w-[200px]"}),e.jsx(ve,{className:"h-10 w-full"})]}):e.jsx(Se,{...h,children:e.jsxs("form",{onSubmit:h.handleSubmit(k),className:"space-y-4",children:[u&&Object.entries(u).map(([S,f])=>C(S,f)),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(L,{type:"button",variant:"outline",onClick:n,disabled:l,children:r("config.cancel")}),e.jsx(L,{type:"submit",loading:l,disabled:l,children:r("config.save")})]})]})})}function Lu(){const{t:s}=V("plugin"),[n,t]=m.useState(null),[r,a]=m.useState(!1),[i,l]=m.useState(null),[d,u]=m.useState(""),[o,c]=m.useState("all"),[h,k]=m.useState(!1),[C,S]=m.useState(!1),[f,N]=m.useState(!1),_=m.useRef(null),{data:T,isLoading:D,refetch:g}=ne({queryKey:["pluginList"],queryFn:async()=>{const{data:F}=await Ms.getPluginList();return F}});T&&[...new Set(T.map(F=>F.category||"other"))];const w=T?.filter(F=>{const X=F.name.toLowerCase().includes(d.toLowerCase())||F.description.toLowerCase().includes(d.toLowerCase())||F.code.toLowerCase().includes(d.toLowerCase()),Ns=o==="all"||F.category===o;return X&&Ns}),R=async F=>{t(F),Ms.installPlugin(F).then(()=>{A.success(s("messages.installSuccess")),g()}).catch(X=>{A.error(X.message||s("messages.installError"))}).finally(()=>{t(null)})},H=async F=>{t(F),Ms.uninstallPlugin(F).then(()=>{A.success(s("messages.uninstallSuccess")),g()}).catch(X=>{A.error(X.message||s("messages.uninstallError"))}).finally(()=>{t(null)})},I=async(F,X)=>{t(F),(X?Ms.disablePlugin:Ms.enablePlugin)(F).then(()=>{A.success(s(X?"messages.disableSuccess":"messages.enableSuccess")),g()}).catch(De=>{A.error(De.message||s(X?"messages.disableError":"messages.enableError"))}).finally(()=>{t(null)})},K=F=>{T?.find(X=>X.code===F),l(F),a(!0)},ae=async F=>{if(!F.name.endsWith(".zip")){A.error(s("upload.error.format"));return}k(!0),Ms.uploadPlugin(F).then(()=>{A.success(s("messages.uploadSuccess")),S(!1),g()}).catch(X=>{A.error(X.message||s("messages.uploadError"))}).finally(()=>{k(!1),_.current&&(_.current.value="")})},ee=F=>{F.preventDefault(),F.stopPropagation(),F.type==="dragenter"||F.type==="dragover"?N(!0):F.type==="dragleave"&&N(!1)},te=F=>{F.preventDefault(),F.stopPropagation(),N(!1),F.dataTransfer.files&&F.dataTransfer.files[0]&&ae(F.dataTransfer.files[0])},q=async F=>{t(F),Ms.deletePlugin(F).then(()=>{A.success(s("messages.deleteSuccess")),g()}).catch(X=>{A.error(X.message||s("messages.deleteError"))}).finally(()=>{t(null)})};return e.jsxs(ze,{children:[e.jsxs($e,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Cn,{className:"h-6 w-6"}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("title")})]}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{children:[e.jsxs("div",{className:"mb-8 space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"relative max-w-sm flex-1",children:[e.jsx(Sn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(P,{placeholder:s("search.placeholder"),value:d,onChange:F=>u(F.target.value),className:"pl-9"})]}),e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs(L,{onClick:()=>S(!0),variant:"outline",className:"shrink-0",size:"sm",children:[e.jsx(wt,{className:"mr-2 h-4 w-4"}),s("upload.button")]})})]}),e.jsxs(Dt,{defaultValue:"all",className:"w-full",children:[e.jsxs(dt,{children:[e.jsx(Xe,{value:"all",children:s("tabs.all")}),e.jsx(Xe,{value:"installed",children:s("tabs.installed")}),e.jsx(Xe,{value:"available",children:s("tabs.available")})]}),e.jsx(ks,{value:"all",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:D?e.jsxs(e.Fragment,{children:[e.jsx(nn,{}),e.jsx(nn,{}),e.jsx(nn,{})]}):w?.map(F=>e.jsx(an,{plugin:F,onInstall:R,onUninstall:H,onToggleEnable:I,onOpenConfig:K,onDelete:q,isLoading:n===F.name},F.name))})}),e.jsx(ks,{value:"installed",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:w?.filter(F=>F.is_installed).map(F=>e.jsx(an,{plugin:F,onInstall:R,onUninstall:H,onToggleEnable:I,onOpenConfig:K,onDelete:q,isLoading:n===F.name},F.name))})}),e.jsx(ks,{value:"available",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:w?.filter(F=>!F.is_installed).map(F=>e.jsx(an,{plugin:F,onInstall:R,onUninstall:H,onToggleEnable:I,onOpenConfig:K,onDelete:q,isLoading:n===F.name},F.code))})})]})]}),e.jsx(ge,{open:r,onOpenChange:a,children:e.jsxs(ue,{className:"sm:max-w-lg",children:[e.jsxs(be,{children:[e.jsxs(fe,{children:[T?.find(F=>F.code===i)?.name," ",s("config.title")]}),e.jsx(Ve,{children:s("config.description")})]}),i&&e.jsx(Pu,{pluginName:i,onClose:()=>a(!1),onSuccess:()=>{a(!1),g()}})]})}),e.jsx(ge,{open:C,onOpenChange:S,children:e.jsxs(ue,{className:"sm:max-w-md",children:[e.jsxs(be,{children:[e.jsx(fe,{children:s("upload.title")}),e.jsx(Ve,{children:s("upload.description")})]}),e.jsxs("div",{className:b("relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",f&&"border-primary/50 bg-muted/50"),onDragEnter:ee,onDragLeave:ee,onDragOver:ee,onDrop:te,children:[e.jsx("input",{type:"file",ref:_,className:"hidden",accept:".zip",onChange:F=>{const X=F.target.files?.[0];X&&ae(X)}}),h?e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("upload.uploading")})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"rounded-full border-2 border-muted-foreground/25 p-3",children:e.jsx(wt,{className:"h-6 w-6 text-muted-foreground/50"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium",children:[s("upload.dragText")," ",e.jsx("button",{type:"button",onClick:()=>_.current?.click(),className:"mx-1 text-primary hover:underline",children:s("upload.clickText")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("upload.supportText")})]})]})})]})]})})]})]})}function an({plugin:s,onInstall:n,onUninstall:t,onToggleEnable:r,onOpenConfig:a,onDelete:i,isLoading:l}){const{t:d}=V("plugin");return e.jsxs(Re,{className:"group relative overflow-hidden transition-all hover:shadow-md",children:[e.jsxs(Fe,{children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{children:s.name}),s.is_installed&&e.jsx(U,{variant:s.is_enabled?"success":"secondary",children:s.is_enabled?d("status.enabled"):d("status.disabled")})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Cn,{className:"h-4 w-4"}),e.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:s.code})]}),e.jsxs("div",{children:["v",s.version]})]})]})}),e.jsx(Os,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"mt-2",children:s.description}),e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:e.jsxs("div",{className:"flex items-center gap-1",children:[d("author"),": ",s.author]})})]})})]}),e.jsx(Ie,{children:e.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.is_installed?e.jsxs(e.Fragment,{children:[e.jsxs(L,{variant:"outline",size:"sm",onClick:()=>a(s.code),disabled:!s.is_enabled||l,children:[e.jsx(Na,{className:"mr-2 h-4 w-4"}),d("button.config")]}),e.jsxs(L,{variant:s.is_enabled?"destructive":"default",size:"sm",onClick:()=>r(s.code,s.is_enabled),disabled:l,children:[e.jsx(qc,{className:"mr-2 h-4 w-4"}),s.is_enabled?d("button.disable"):d("button.enable")]}),e.jsx(ps,{title:d("uninstall.title"),description:d("uninstall.description"),cancelText:d("common:cancel"),confirmText:d("uninstall.button"),variant:"destructive",onConfirm:()=>t(s.code),children:e.jsxs(L,{variant:"outline",size:"sm",className:"text-muted-foreground hover:text-destructive",disabled:l,children:[e.jsx(ds,{className:"mr-2 h-4 w-4"}),d("button.uninstall")]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{onClick:()=>n(s.code),disabled:l,loading:l,children:d("button.install")}),e.jsx(ps,{title:d("delete.title"),description:d("delete.description"),cancelText:d("common:cancel"),confirmText:d("delete.button"),variant:"destructive",onConfirm:()=>i(s.code),children:e.jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",disabled:l,children:e.jsx(ds,{className:"h-4 w-4"})})})]})})})]})}function nn(){return e.jsxs(Re,{children:[e.jsxs(Fe,{children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"h-6 w-[200px]"}),e.jsx(ve,{className:"h-6 w-[80px]"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(ve,{className:"h-5 w-[120px]"}),e.jsx(ve,{className:"h-5 w-[60px]"})]})]})}),e.jsxs("div",{className:"space-y-2 pt-2",children:[e.jsx(ve,{className:"h-4 w-[300px]"}),e.jsx(ve,{className:"h-4 w-[150px]"})]})]}),e.jsx(Ie,{children:e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(ve,{className:"h-9 w-[100px]"}),e.jsx(ve,{className:"h-9 w-[100px]"}),e.jsx(ve,{className:"h-8 w-8"})]})})]})}const Ru=Object.freeze(Object.defineProperty({__proto__:null,default:Lu},Symbol.toStringTag,{value:"Module"})),Eu=(s,n)=>{let t=null;switch(s.field_type){case"input":t=e.jsx(P,{placeholder:s.placeholder,...n});break;case"textarea":t=e.jsx(Ds,{placeholder:s.placeholder,...n});break;case"select":t=e.jsx("select",{className:b(St({variant:"outline"}),"w-full appearance-none font-normal"),...n,children:s.select_options&&Object.keys(s.select_options).map(r=>e.jsx("option",{value:r,children:s.select_options?.[r]},r))});break;default:t=null;break}return t};function Fu({themeKey:s,themeInfo:n}){const{t}=V("theme"),[r,a]=m.useState(!1),[i,l]=m.useState(!1),[d,u]=m.useState(!1),o=we({defaultValues:n.configs.reduce((k,C)=>(k[C.field_name]="",k),{})}),c=async()=>{l(!0),Kt.getConfig(s).then(({data:k})=>{Object.entries(k).forEach(([C,S])=>{o.setValue(C,S)})}).finally(()=>{l(!1)})},h=async k=>{u(!0),Kt.updateConfig(s,k).then(()=>{A.success(t("config.success")),a(!1)}).finally(()=>{u(!1)})};return e.jsxs(ge,{open:r,onOpenChange:k=>{a(k),k?c():o.reset()},children:[e.jsx(as,{asChild:!0,children:e.jsx(L,{variant:"outline",children:t("card.configureTheme")})}),e.jsxs(ue,{className:"max-h-[90vh] overflow-auto sm:max-w-[425px]",children:[e.jsxs(be,{children:[e.jsx(fe,{children:t("config.title",{name:n.name})}),e.jsx(Ve,{children:t("config.description")})]}),i?e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(ya,{className:"h-6 w-6 animate-spin"})}):e.jsx(Se,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(h),className:"space-y-4",children:[n.configs.map(k=>e.jsx(v,{control:o.control,name:k.field_name,render:({field:C})=>e.jsxs(p,{children:[e.jsx(j,{children:k.label}),e.jsx(y,{children:Eu(k,C)}),e.jsx(E,{})]})},k.field_name)),e.jsxs(Le,{className:"mt-6 gap-2",children:[e.jsx(L,{type:"button",variant:"secondary",onClick:()=>a(!1),children:t("config.cancel")}),e.jsx(L,{type:"submit",loading:d,children:t("config.save")})]})]})})]})]})}function Iu(){const{t:s}=V("theme"),[n,t]=m.useState(null),[r,a]=m.useState(!1),[i,l]=m.useState(!1),[d,u]=m.useState(!1),[o,c]=m.useState(null),h=m.useRef(null),[k,C]=m.useState(0),{data:S,isLoading:f,refetch:N}=ne({queryKey:["themeList"],queryFn:async()=>{const{data:I}=await Kt.getList();return I}}),_=async I=>{t(I),he.updateSystemConfig({frontend_theme:I}).then(()=>{A.success("主题切换成功"),N()}).finally(()=>{t(null)})},T=async I=>{if(!I.name.endsWith(".zip")){A.error(s("upload.error.format"));return}a(!0),Kt.upload(I).then(()=>{A.success("主题上传成功"),l(!1),N()}).finally(()=>{a(!1),h.current&&(h.current.value="")})},D=I=>{I.preventDefault(),I.stopPropagation(),I.type==="dragenter"||I.type==="dragover"?u(!0):I.type==="dragleave"&&u(!1)},g=I=>{I.preventDefault(),I.stopPropagation(),u(!1),I.dataTransfer.files&&I.dataTransfer.files[0]&&T(I.dataTransfer.files[0])},w=()=>{o&&C(I=>I===0?o.images.length-1:I-1)},R=()=>{o&&C(I=>I===o.images.length-1?0:I+1)},H=(I,K)=>{C(0),c({name:I,images:K})};return e.jsxs(ze,{children:[e.jsxs($e,{className:"flex items-center justify-between",children:[e.jsx(ns,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("div",{className:"mb-2",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-muted-foreground",children:s("description")}),e.jsxs(L,{onClick:()=>l(!0),variant:"outline",className:"ml-4 shrink-0",size:"sm",children:[e.jsx(wt,{className:"mr-2 h-4 w-4"}),s("upload.button")]})]})]}),e.jsx("section",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3",children:f?e.jsxs(e.Fragment,{children:[e.jsx(gr,{}),e.jsx(gr,{})]}):S?.themes&&Object.entries(S.themes).map(([I,K])=>e.jsx(Re,{className:"group relative overflow-hidden transition-all hover:shadow-md",style:{backgroundImage:K.background_url?`url(${K.background_url})`:"none",backgroundSize:"cover",backgroundPosition:"center"},children:e.jsxs("div",{className:b("relative z-10 h-full transition-colors",K.background_url?"group-hover:from-background/98 bg-gradient-to-t from-background/95 via-background/80 to-background/60 backdrop-blur-[1px] group-hover:via-background/90 group-hover:to-background/70":"bg-background"),children:[!!K.can_delete&&e.jsx("div",{className:"absolute right-2 top-2",children:e.jsx(ps,{title:s("card.delete.title"),description:s("card.delete.description"),confirmText:s("card.delete.button"),variant:"destructive",onConfirm:async()=>{if(I===S?.active){A.error(s("card.delete.error.active"));return}t(I),Kt.drop(I).then(()=>{A.success("主题删除成功"),N()}).finally(()=>{t(null)})},children:e.jsx(L,{disabled:n===I,loading:n===I,variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",children:e.jsx(ds,{className:"h-4 w-4"})})})}),e.jsxs(Fe,{children:[e.jsx(Ge,{children:K.name}),e.jsx(Os,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{children:K.description}),K.version&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("card.version",{version:K.version})})]})})]}),e.jsxs(Ie,{className:"flex items-center justify-end space-x-3",children:[K.images&&Array.isArray(K.images)&&K.images.length>0&&e.jsx(L,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>H(K.name,K.images),children:e.jsx(Hc,{className:"h-4 w-4"})}),e.jsx(Fu,{themeKey:I,themeInfo:K}),e.jsx(L,{onClick:()=>_(I),disabled:n===I||I===S.active,loading:n===I,variant:I===S.active?"secondary":"default",children:I===S.active?s("card.currentTheme"):s("card.activateTheme")})]})]})},I))}),e.jsx(ge,{open:i,onOpenChange:l,children:e.jsxs(ue,{className:"sm:max-w-md",children:[e.jsxs(be,{children:[e.jsx(fe,{children:s("upload.title")}),e.jsx(Ve,{children:s("upload.description")})]}),e.jsxs("div",{className:b("relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",d&&"border-primary/50 bg-muted/50"),onDragEnter:D,onDragLeave:D,onDragOver:D,onDrop:g,children:[e.jsx("input",{type:"file",ref:h,className:"hidden",accept:".zip",onChange:I=>{const K=I.target.files?.[0];K&&T(K)}}),r?e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("upload.uploading")})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"rounded-full border-2 border-muted-foreground/25 p-3",children:e.jsx(wt,{className:"h-6 w-6 text-muted-foreground/50"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium",children:[s("upload.dragText")," ",e.jsx("button",{type:"button",onClick:()=>h.current?.click(),className:"mx-1 text-primary hover:underline",children:s("upload.clickText")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("upload.supportText")})]})]})})]})]})}),e.jsx(ge,{open:!!o,onOpenChange:I=>{I||(c(null),C(0))},children:e.jsxs(ue,{className:"max-w-4xl",children:[e.jsxs(be,{children:[e.jsxs(fe,{children:[o?.name," ",s("preview.title")]}),e.jsx(Ve,{className:"text-center",children:o&&s("preview.imageCount",{current:k+1,total:o.images.length})})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"aspect-[16/9] overflow-hidden rounded-lg border bg-muted",children:o?.images[k]&&e.jsx("img",{src:o.images[k],alt:`${o.name} 预览图 ${k+1}`,className:"h-full w-full object-contain"})}),o&&o.images.length>1&&e.jsxs(e.Fragment,{children:[e.jsx(L,{variant:"outline",size:"icon",className:"absolute left-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:w,children:e.jsx(Uc,{className:"h-4 w-4"})}),e.jsx(L,{variant:"outline",size:"icon",className:"absolute right-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:R,children:e.jsx(Kc,{className:"h-4 w-4"})})]})]}),o&&o.images.length>1&&e.jsx("div",{className:"mt-4 flex gap-2 overflow-x-auto pb-2",children:o.images.map((I,K)=>e.jsx("button",{onClick:()=>C(K),className:b("relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border-2",k===K?"border-primary":"border-transparent"),children:e.jsx("img",{src:I,alt:`缩略图 ${K+1}`,className:"h-full w-full object-cover"})},K))})]})})]})]})}function gr(){return e.jsxs(Re,{children:[e.jsxs(Fe,{children:[e.jsx(ve,{className:"h-6 w-[200px]"}),e.jsx(ve,{className:"h-4 w-[300px]"})]}),e.jsxs(Ie,{className:"flex items-center justify-end space-x-3",children:[e.jsx(ve,{className:"h-10 w-[100px]"}),e.jsx(ve,{className:"h-10 w-[100px]"})]})]})}const Vu=Object.freeze(Object.defineProperty({__proto__:null,default:Iu},Symbol.toStringTag,{value:"Module"})),$n=m.forwardRef(({className:s,value:n,onChange:t,...r},a)=>{const[i,l]=m.useState("");m.useEffect(()=>{if(i.includes(",")){const u=new Set([...n,...i.split(",").map(o=>o.trim())]);t(Array.from(u)),l("")}},[i,t,n]);const d=()=>{if(i){const u=new Set([...n,i]);t(Array.from(u)),l("")}};return e.jsxs("div",{className:b(" has-[:focus-visible]:outline-none has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-neutral-950 dark:has-[:focus-visible]:ring-neutral-300 flex w-full flex-wrap gap-2 rounded-md border border-input shadow-sm px-3 py-2 text-sm ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",s),children:[n.map(u=>e.jsxs(U,{variant:"secondary",children:[u,e.jsx(G,{variant:"ghost",size:"icon",className:"ml-2 h-3 w-3",onClick:()=>{t(n.filter(o=>o!==u))},children:e.jsx(gn,{className:"w-3"})})]},u)),e.jsx("input",{className:"flex-1 outline-none placeholder:text-muted-foreground bg-transparent",value:i,onChange:u=>l(u.target.value),onKeyDown:u=>{u.key==="Enter"||u.key===","?(u.preventDefault(),d()):u.key==="Backspace"&&i.length===0&&n.length>0&&(u.preventDefault(),t(n.slice(0,-1)))},...r,ref:a})]})});$n.displayName="InputTags";const Mu=x.object({id:x.number().nullable(),title:x.string().min(1).max(250),content:x.string().min(1),show:x.boolean(),tags:x.array(x.string()),img_url:x.string().nullable()}),Ou={id:null,show:!1,tags:[],img_url:"",title:"",content:""};function Xl({refetch:s,dialogTrigger:n,type:t="add",defaultFormValues:r=Ou}){const{t:a}=V("notice"),[i,l]=m.useState(!1),d=we({resolver:Ce(Mu),defaultValues:r,mode:"onChange",shouldFocusError:!0}),u=new Dn({html:!0});return e.jsx(Se,{...d,children:e.jsxs(ge,{onOpenChange:l,open:i,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"})," ",e.jsx("div",{children:a("form.add.button")})]})}),e.jsxs(ue,{className:"sm:max-w-[1025px]",children:[e.jsxs(be,{children:[e.jsx(fe,{children:a(t==="add"?"form.add.title":"form.edit.title")}),e.jsx(Ve,{})]}),e.jsx(v,{control:d.control,name:"title",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.title.label")}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(P,{placeholder:a("form.fields.title.placeholder"),...o})})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"content",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.content.label")}),e.jsx(y,{children:e.jsx(Pn,{style:{height:"500px"},value:o.value,renderHTML:c=>u.render(c),onChange:({text:c})=>{o.onChange(c)}})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"img_url",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.img_url.label")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(P,{type:"text",placeholder:a("form.fields.img_url.placeholder"),...o,value:o.value||""})})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"show",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.show.label")}),e.jsx("div",{className:"relative py-2",children:e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:o.onChange})})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"tags",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.fields.tags.label")}),e.jsx(y,{children:e.jsx($n,{value:o.value,onChange:o.onChange,placeholder:a("form.fields.tags.placeholder"),className:"w-full"})}),e.jsx(E,{})]})}),e.jsxs(Le,{children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:a("form.buttons.cancel")})}),e.jsx(L,{type:"submit",onClick:o=>{o.preventDefault(),d.handleSubmit(async c=>{Qt.save(c).then(({data:h})=>{h&&(A.success(a("form.buttons.success")),s(),l(!1))})})()},children:a("form.buttons.submit")})]})]})]})})}function zu({table:s,refetch:n,saveOrder:t,isSortMode:r}){const{t:a}=V("notice"),i=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between space-x-2 ",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[!r&&e.jsx(Xl,{refetch:n}),!r&&e.jsx(P,{placeholder:a("table.toolbar.search"),value:s.getColumn("title")?.getFilterValue()??"",onChange:l=>s.getColumn("title")?.setFilterValue(l.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),i&&!r&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-9 px-2 lg:px-3",children:[a("table.toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(L,{variant:r?"default":"outline",onClick:t,className:"h-8",size:"sm",children:a(r?"table.toolbar.sort.save":"table.toolbar.sort.edit")})})]})}const $u=s=>{const{t:n}=V("notice");return[{id:"drag-handle",header:"",cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(Bc,{className:"h-4 w-4 cursor-move text-muted-foreground"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.id")}),cell:({row:t})=>e.jsx(U,{variant:"outline",className:"font-mono",children:t.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.show")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(Z,{defaultChecked:t.getValue("show"),onCheckedChange:async()=>{const{data:r}=await Qt.updateStatus(t.original.id);r||s()}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.title")}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[500px] items-center",children:e.jsx("span",{className:"truncate font-medium",children:t.getValue("title")})}),enableSorting:!1,size:6e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:n("table.columns.actions")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(Xl,{refetch:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("table.actions.edit")})]}),type:"edit",defaultFormValues:t.original}),e.jsx(ps,{title:n("table.actions.delete.title"),description:n("table.actions.delete.description"),onConfirm:async()=>{Qt.drop(t.original.id).then(()=>{A.success(n("table.actions.delete.success")),s()})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:n("table.actions.delete.title")})]})})]}),size:100}]};function Au(){const[s,n]=m.useState({}),[t,r]=m.useState({}),[a,i]=m.useState([]),[l,d]=m.useState([]),[u,o]=m.useState(!1),[c,h]=m.useState({}),[k,C]=m.useState({pageSize:50,pageIndex:0}),[S,f]=m.useState([]),{refetch:N}=ne({queryKey:["notices"],queryFn:async()=>{const{data:w}=await Qt.getList();return f(w),w}});m.useEffect(()=>{r({"drag-handle":u,content:!u,created_at:!u,actions:!u}),C({pageSize:u?99999:50,pageIndex:0})},[u]);const _=(w,R)=>{u&&(w.dataTransfer.setData("text/plain",R.toString()),w.currentTarget.classList.add("opacity-50"))},T=(w,R)=>{if(!u)return;w.preventDefault(),w.currentTarget.classList.remove("bg-muted");const H=parseInt(w.dataTransfer.getData("text/plain"));if(H===R)return;const I=[...S],[K]=I.splice(H,1);I.splice(R,0,K),f(I)},D=async()=>{if(!u){o(!0);return}Qt.sort(S.map(w=>w.id)).then(()=>{A.success("排序保存成功"),o(!1),N()}).finally(()=>{o(!1)})},g=ss({data:S??[],columns:$u(N),state:{sorting:l,columnVisibility:t,rowSelection:s,columnFilters:a,columnSizing:c,pagination:k},enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:i,onColumnVisibilityChange:r,onColumnSizingChange:h,onPaginationChange:C,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx("div",{className:"space-y-4",children:e.jsx(xs,{table:g,toolbar:w=>e.jsx(zu,{table:w,refetch:N,saveOrder:D,isSortMode:u}),draggable:u,onDragStart:_,onDragEnd:w=>w.currentTarget.classList.remove("opacity-50"),onDragOver:w=>{w.preventDefault(),w.currentTarget.classList.add("bg-muted")},onDragLeave:w=>w.currentTarget.classList.remove("bg-muted"),onDrop:T,showPagination:!u})})}function qu(){const{t:s}=V("notice");return e.jsxs(ze,{children:[e.jsxs($e,{className:"flex items-center justify-between",children:[e.jsx(ns,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Au,{})})]})]})}const Hu=Object.freeze(Object.defineProperty({__proto__:null,default:qu},Symbol.toStringTag,{value:"Module"})),Uu=x.object({id:x.number().nullable(),language:x.string().max(250),category:x.string().max(250),title:x.string().min(1).max(250),body:x.string().min(1),show:x.boolean()}),Ku={id:null,language:"zh-CN",category:"",title:"",body:"",show:!1};function Zl({refreshData:s,dialogTrigger:n,type:t="add",defaultFormValues:r=Ku}){const{t:a}=V("knowledge"),[i,l]=m.useState(!1),d=we({resolver:Ce(Uu),defaultValues:r,mode:"onChange",shouldFocusError:!0}),u=new Dn({html:!0});return m.useEffect(()=>{i&&r.id&&Ct.getInfo(r.id).then(({data:o})=>{d.reset(o)})},[r.id,d,i]),e.jsxs(ge,{onOpenChange:l,open:i,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"})," ",e.jsx("div",{children:a("form.add")})]})}),e.jsxs(ue,{className:"sm:max-w-[1025px]",children:[e.jsxs(be,{children:[e.jsx(fe,{children:a(t==="add"?"form.add":"form.edit")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...d,children:[e.jsx(v,{control:d.control,name:"title",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.title")}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(P,{placeholder:a("form.titlePlaceholder"),...o})})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"category",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.category")}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(P,{placeholder:a("form.categoryPlaceholder"),...o})})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"language",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.language")}),e.jsx(y,{children:e.jsxs(J,{value:o.value,onValueChange:o.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("form.languagePlaceholder")})}),e.jsx(Y,{children:[{value:"en-US"},{value:"ja-JP"},{value:"ko-KR"},{value:"vi-VN"},{value:"zh-CN"},{value:"zh-TW"}].map(c=>e.jsx($,{value:c.value,className:"cursor-pointer",children:a(`languages.${c.value}`)},c.value))})]})})]})}),e.jsx(v,{control:d.control,name:"body",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.content")}),e.jsx(y,{children:e.jsx(Pn,{style:{height:"500px"},value:o.value,renderHTML:c=>u.render(c),onChange:({text:c})=>{o.onChange(c)}})}),e.jsx(E,{})]})}),e.jsx(v,{control:d.control,name:"show",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.show")}),e.jsx("div",{className:"relative py-2",children:e.jsx(y,{children:e.jsx(Z,{checked:o.value,onCheckedChange:o.onChange})})}),e.jsx(E,{})]})}),e.jsxs(Le,{children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:a("form.cancel")})}),e.jsx(L,{type:"submit",onClick:()=>{d.handleSubmit(o=>{Ct.save(o).then(({data:c})=>{c&&(d.reset(),A.success(a("messages.operationSuccess")),l(!1),s())})})()},children:a("form.submit")})]})]})]})]})}function Bu({column:s,title:n,options:t}){const r=s?.getFacetedUniqueValues(),a=new Set(s?.getFilterValue());return e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Ia,{className:"mr-2 h-4 w-4"}),n,a?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:a.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:a.size>2?e.jsxs(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[a.size," selected"]}):t.filter(i=>a.has(i.value)).map(i=>e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:i.label},i.value))})]})]})}),e.jsx(Ze,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Js,{children:[e.jsx(ut,{placeholder:n}),e.jsxs(Qs,{children:[e.jsx(xt,{children:"No results found."}),e.jsx(fs,{children:t.map(i=>{const l=a.has(i.value);return e.jsxs(We,{onSelect:()=>{l?a.delete(i.value):a.add(i.value);const d=Array.from(a);s?.setFilterValue(d.length?d:void 0)},children:[e.jsx("div",{className:b("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",l?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ot,{className:b("h-4 w-4")})}),i.icon&&e.jsx(i.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:i.label}),r?.get(i.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:r.get(i.value)})]},i.value)})}),a.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(fs,{children:e.jsx(We,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}function Gu({table:s,refetch:n,saveOrder:t,isSortMode:r}){const a=s.getState().columnFilters.length>0,{t:i}=V("knowledge");return e.jsxs("div",{className:"flex items-center justify-between",children:[r?e.jsx("p",{className:"text-sm text-muted-foreground",children:i("toolbar.sortModeHint")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Zl,{refreshData:n}),e.jsx(P,{placeholder:i("toolbar.searchPlaceholder"),value:s.getColumn("title")?.getFilterValue()??"",onChange:l=>s.getColumn("title")?.setFilterValue(l.target.value),className:"h-8 w-[250px]"}),s.getColumn("category")&&e.jsx(Bu,{column:s.getColumn("category"),title:i("columns.category"),options:Array.from(new Set(s.getCoreRowModel().rows.map(l=>l.getValue("category")))).map(l=>({label:l,value:l}))}),a&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:[i("toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:r?"default":"outline",onClick:t,size:"sm",children:i(r?"toolbar.saveSort":"toolbar.editSort")})})]})}const Wu=({refetch:s,isSortMode:n=!1})=>{const{t}=V("knowledge");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:n?"cursor-move":"opacity-0",children:e.jsx(Fa,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:r})=>e.jsx(z,{column:r,title:t("columns.id")}),cell:({row:r})=>e.jsx(U,{variant:"outline",className:"justify-center",children:r.getValue("id")}),enableSorting:!0,size:70},{accessorKey:"show",header:({column:r})=>e.jsx(z,{column:r,title:t("columns.status")}),cell:({row:r})=>e.jsx("div",{className:"flex items-center",children:e.jsx(Z,{defaultChecked:r.getValue("show"),onCheckedChange:async()=>{Ct.updateStatus({id:r.original.id}).then(({data:a})=>{a||s()})}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:r})=>e.jsx(z,{column:r,title:t("columns.title")}),cell:({row:r})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"line-clamp-2 font-medium",children:r.getValue("title")})}),enableSorting:!0,size:600},{accessorKey:"category",header:({column:r})=>e.jsx(z,{column:r,title:t("columns.category")}),cell:({row:r})=>e.jsx(U,{variant:"secondary",className:"max-w-[180px] truncate",children:r.getValue("category")}),enableSorting:!0,size:1800},{id:"actions",header:({column:r})=>e.jsx(z,{className:"justify-end",column:r,title:t("columns.actions")}),cell:({row:r})=>e.jsxs("div",{className:"flex items-center justify-end space-x-1",children:[e.jsx(Zl,{refreshData:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:t("form.edit")})]}),type:"edit",defaultFormValues:r.original}),e.jsx(ps,{title:t("messages.deleteConfirm"),description:t("messages.deleteDescription"),confirmText:t("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{Ct.drop({id:r.original.id}).then(({data:a})=>{a&&(A.success(t("messages.operationSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:t("messages.deleteButton")})]})})]}),size:100}]};function Yu(){const[s,n]=m.useState([]),[t,r]=m.useState([]),[a,i]=m.useState(!1),[l,d]=m.useState([]),[u,o]=m.useState({"drag-handle":!1}),[c,h]=m.useState({pageSize:20,pageIndex:0}),{refetch:k,isLoading:C,data:S}=ne({queryKey:["knowledge"],queryFn:async()=>{const{data:D}=await Ct.getList();return d(D||[]),D}});m.useEffect(()=>{o({"drag-handle":a,actions:!a}),h({pageSize:a?99999:10,pageIndex:0})},[a]);const f=(D,g)=>{a&&(D.dataTransfer.setData("text/plain",g.toString()),D.currentTarget.classList.add("opacity-50"))},N=(D,g)=>{if(!a)return;D.preventDefault(),D.currentTarget.classList.remove("bg-muted");const w=parseInt(D.dataTransfer.getData("text/plain"));if(w===g)return;const R=[...l],[H]=R.splice(w,1);R.splice(g,0,H),d(R)},_=async()=>{a?Ct.sort({ids:l.map(D=>D.id)}).then(()=>{k(),i(!1),A.success("排序保存成功")}):i(!0)},T=ss({data:l,columns:Wu({refetch:k,isSortMode:a}),state:{sorting:t,columnFilters:s,columnVisibility:u,pagination:c},onSortingChange:r,onColumnFiltersChange:n,onColumnVisibilityChange:o,onPaginationChange:h,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(xs,{table:T,toolbar:D=>e.jsx(Gu,{table:D,refetch:k,saveOrder:_,isSortMode:a}),draggable:a,onDragStart:f,onDragEnd:D=>D.currentTarget.classList.remove("opacity-50"),onDragOver:D=>{D.preventDefault(),D.currentTarget.classList.add("bg-muted")},onDragLeave:D=>D.currentTarget.classList.remove("bg-muted"),onDrop:N,showPagination:!a})}function Ju(){const{t:s}=V("knowledge");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight mb-2",children:s("title")}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Yu,{})})]})]})}const Qu=Object.freeze(Object.defineProperty({__proto__:null,default:Ju},Symbol.toStringTag,{value:"Module"}));function Xu(s,n){const[t,r]=m.useState(s);return m.useEffect(()=>{const a=setTimeout(()=>r(s),n);return()=>{clearTimeout(a)}},[s,n]),t}function rn(s,n){if(s.length===0)return{};if(!n)return{"":s};const t={};return s.forEach(r=>{const a=r[n]||"";t[a]||(t[a]=[]),t[a].push(r)}),t}function Zu(s,n){const t=JSON.parse(JSON.stringify(s));for(const[r,a]of Object.entries(t))t[r]=a.filter(i=>!n.find(l=>l.value===i.value));return t}function ex(s,n){for(const[,t]of Object.entries(s))if(t.some(r=>n.find(a=>a.value===r.value)))return!0;return!1}const ei=m.forwardRef(({className:s,...n},t)=>Gc(a=>a.filtered.count===0)?e.jsx("div",{ref:t,className:b("py-6 text-center text-sm",s),"cmdk-empty":"",role:"presentation",...n}):null);ei.displayName="CommandEmpty";const kt=m.forwardRef(({value:s,onChange:n,placeholder:t,defaultOptions:r=[],options:a,delay:i,onSearch:l,loadingIndicator:d,emptyIndicator:u,maxSelected:o=Number.MAX_SAFE_INTEGER,onMaxSelected:c,hidePlaceholderWhenSelected:h,disabled:k,groupBy:C,className:S,badgeClassName:f,selectFirstItem:N=!0,creatable:_=!1,triggerSearchOnFocus:T=!1,commandProps:D,inputProps:g,hideClearAllButton:w=!1},R)=>{const H=m.useRef(null),[I,K]=m.useState(!1),ae=m.useRef(!1),[ee,te]=m.useState(!1),[q,F]=m.useState(s||[]),[X,Ns]=m.useState(rn(r,C)),[De,ie]=m.useState(""),_s=Xu(De,i||500);m.useImperativeHandle(R,()=>({selectedValue:[...q],input:H.current,focus:()=>H.current?.focus()}),[q]);const Fs=m.useCallback(se=>{const je=q.filter(re=>re.value!==se.value);F(je),n?.(je)},[n,q]),Xs=m.useCallback(se=>{const je=H.current;je&&((se.key==="Delete"||se.key==="Backspace")&&je.value===""&&q.length>0&&(q[q.length-1].fixed||Fs(q[q.length-1])),se.key==="Escape"&&je.blur())},[Fs,q]);m.useEffect(()=>{s&&F(s)},[s]),m.useEffect(()=>{if(!a||l)return;const se=rn(a||[],C);JSON.stringify(se)!==JSON.stringify(X)&&Ns(se)},[r,a,C,l,X]),m.useEffect(()=>{const se=async()=>{te(!0);const re=await l?.(_s);Ns(rn(re||[],C)),te(!1)};(async()=>{!l||!I||(T&&await se(),_s&&await se())})()},[_s,C,I,T]);const Lt=()=>{if(!_||ex(X,[{value:De,label:De}])||q.find(je=>je.value===De))return;const se=e.jsx(We,{value:De,className:"cursor-pointer",onMouseDown:je=>{je.preventDefault(),je.stopPropagation()},onSelect:je=>{if(q.length>=o){c?.(q.length);return}ie("");const re=[...q,{value:je,label:je}];F(re),n?.(re)},children:`Create "${De}"`});if(!l&&De.length>0||l&&_s.length>0&&!ee)return se},Zt=m.useCallback(()=>{if(u)return l&&!_&&Object.keys(X).length===0?e.jsx(We,{value:"-",disabled:!0,children:u}):e.jsx(ei,{children:u})},[_,u,l,X]),Rt=m.useMemo(()=>Zu(X,q),[X,q]),qs=m.useCallback(()=>{if(D?.filter)return D.filter;if(_)return(se,je)=>se.toLowerCase().includes(je.toLowerCase())?1:-1},[_,D?.filter]),Qa=m.useCallback(()=>{const se=q.filter(je=>je.fixed);F(se),n?.(se)},[n,q]);return e.jsxs(Js,{...D,onKeyDown:se=>{Xs(se),D?.onKeyDown?.(se)},className:b("h-auto overflow-visible bg-transparent",D?.className),shouldFilter:D?.shouldFilter!==void 0?D.shouldFilter:!l,filter:qs(),children:[e.jsx("div",{className:b("rounded-md border border-input text-sm ring-offset-background focus-within:ring-1 focus-within:ring-ring ",{"px-3 py-2":q.length!==0,"cursor-text":!k&&q.length!==0},S),onClick:()=>{k||H.current?.focus()},children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[q.map(se=>e.jsxs(U,{className:b("data-[disabled]:bg-muted-foreground data-[disabled]:text-muted data-[disabled]:hover:bg-muted-foreground","data-[fixed]:bg-muted-foreground data-[fixed]:text-muted data-[fixed]:hover:bg-muted-foreground",f),"data-fixed":se.fixed,"data-disabled":k||void 0,children:[se.label,e.jsx("button",{className:b("ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",(k||se.fixed)&&"hidden"),onKeyDown:je=>{je.key==="Enter"&&Fs(se)},onMouseDown:je=>{je.preventDefault(),je.stopPropagation()},onClick:()=>Fs(se),children:e.jsx(gn,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},se.value)),e.jsx(es.Input,{...g,ref:H,value:De,disabled:k,onValueChange:se=>{ie(se),g?.onValueChange?.(se)},onBlur:se=>{ae.current===!1&&K(!1),g?.onBlur?.(se)},onFocus:se=>{K(!0),T&&l?.(_s),g?.onFocus?.(se)},placeholder:h&&q.length!==0?"":t,className:b("flex-1 bg-transparent outline-none placeholder:text-muted-foreground",{"w-full":h,"px-3 py-2":q.length===0,"ml-1":q.length!==0},g?.className)}),e.jsx("button",{type:"button",onClick:Qa,className:b((w||k||q.length<1||q.filter(se=>se.fixed).length===q.length)&&"hidden"),children:e.jsx(gn,{})})]})}),e.jsx("div",{className:"relative",children:I&&e.jsx(Qs,{className:"absolute top-1 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",onMouseLeave:()=>{ae.current=!1},onMouseEnter:()=>{ae.current=!0},onMouseUp:()=>{H.current?.focus()},children:ee?e.jsx(e.Fragment,{children:d}):e.jsxs(e.Fragment,{children:[Zt(),Lt(),!N&&e.jsx(We,{value:"-",className:"hidden"}),Object.entries(Rt).map(([se,je])=>e.jsx(fs,{heading:se,className:"h-full overflow-auto",children:e.jsx(e.Fragment,{children:je.map(re=>e.jsx(We,{value:re.value,disabled:re.disable,onMouseDown:Zs=>{Zs.preventDefault(),Zs.stopPropagation()},onSelect:()=>{if(q.length>=o){c?.(q.length);return}ie("");const Zs=[...q,re];F(Zs),n?.(Zs)},className:b("cursor-pointer",re.disable&&"cursor-default text-muted-foreground"),children:re.label},re.value))})},se))]})})})]})});kt.displayName="MultipleSelector";const sx=s=>x.object({id:x.number().optional(),name:x.string().min(2,s("messages.nameValidation.min")).max(50,s("messages.nameValidation.max")).regex(/^[a-zA-Z0-9\u4e00-\u9fa5_-]+$/,s("messages.nameValidation.pattern"))});function Ba({refetch:s,dialogTrigger:n,defaultValues:t={name:""},type:r="add"}){const{t:a}=V("group"),i=we({resolver:Ce(sx(a)),defaultValues:t,mode:"onChange"}),[l,d]=m.useState(!1),[u,o]=m.useState(!1),c=async h=>{o(!0),mt.save(h).then(()=>{A.success(a(r==="edit"?"messages.updateSuccess":"messages.createSuccess")),s&&s(),i.reset(),d(!1)}).finally(()=>{o(!1)})};return e.jsxs(ge,{open:l,onOpenChange:d,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("span",{children:a("form.add")})]})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(be,{children:[e.jsx(fe,{children:a(r==="edit"?"form.edit":"form.create")}),e.jsx(Ve,{children:a(r==="edit"?"form.editDescription":"form.createDescription")})]}),e.jsx(Se,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(c),className:"space-y-4",children:[e.jsx(v,{control:i.control,name:"name",render:({field:h})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.name")}),e.jsx(y,{children:e.jsx(P,{placeholder:a("form.namePlaceholder"),...h,className:"w-full"})}),e.jsx(O,{children:a("form.nameDescription")}),e.jsx(E,{})]})}),e.jsxs(Le,{className:"gap-2",children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:a("form.cancel")})}),e.jsxs(L,{type:"submit",disabled:u||!i.formState.isValid,children:[u&&e.jsx(ya,{className:"mr-2 h-4 w-4 animate-spin"}),a(r==="edit"?"form.update":"form.create")]})]})]})})]})]})}const si=m.createContext(void 0);function tx({children:s,refetch:n}){const[t,r]=m.useState(!1),[a,i]=m.useState(null),[l,d]=m.useState(ce.Shadowsocks);return e.jsx(si.Provider,{value:{isOpen:t,setIsOpen:r,editingServer:a,setEditingServer:i,serverType:l,setServerType:d,refetch:n},children:s})}function ti(){const s=m.useContext(si);if(s===void 0)throw new Error("useServerEdit must be used within a ServerEditProvider");return s}function ln({dialogTrigger:s,value:n,setValue:t,templateType:r}){const{t:a}=V("server");m.useEffect(()=>{console.log(n)},[n]);const[i,l]=m.useState(!1),[d,u]=m.useState(()=>{if(!n||Object.keys(n).length===0)return"";try{return JSON.stringify(n,null,2)}catch{return""}}),[o,c]=m.useState(null),h=_=>{if(!_)return null;try{const T=JSON.parse(_);return typeof T!="object"||T===null?a("network_settings.validation.must_be_object"):null}catch{return a("network_settings.validation.invalid_json")}},k={tcp:{label:"TCP",content:{acceptProxyProtocol:!1,header:{type:"none"}}},"tcp-http":{label:"TCP + HTTP",content:{acceptProxyProtocol:!1,header:{type:"http",request:{version:"1.1",method:"GET",path:["/"],headers:{Host:["www.example.com"]}},response:{version:"1.1",status:"200",reason:"OK"}}}},grpc:{label:"gRPC",content:{serviceName:"GunService"}},ws:{label:"WebSocket",content:{path:"/",headers:{Host:"v2ray.com"}}},httpupgrade:{label:"HttpUpgrade",content:{acceptProxyProtocol:!1,path:"/",host:"xray.com",headers:{key:"value"}}},xhttp:{label:"XHTTP",content:{host:"example.com",path:"/yourpath",mode:"auto",extra:{headers:{},xPaddingBytes:"100-1000",noGRPCHeader:!1,noSSEHeader:!1,scMaxEachPostBytes:1e6,scMinPostsIntervalMs:30,scMaxBufferedPosts:30,xmux:{maxConcurrency:"16-32",maxConnections:0,cMaxReuseTimes:"64-128",cMaxLifetimeMs:0,hMaxRequestTimes:"800-900",hKeepAlivePeriod:0},downloadSettings:{address:"",port:443,network:"xhttp",security:"tls",tlsSettings:{},xhttpSettings:{path:"/yourpath"},sockopt:{}}}}}},C=()=>{switch(r){case"tcp":return["tcp","tcp-http"];case"grpc":return["grpc"];case"ws":return["ws"];case"httpupgrade":return["httpupgrade"];case"xhttp":return["xhttp"];default:return[]}},S=()=>{const _=h(d||"");if(_){A.error(_);return}try{if(!d){t(null),l(!1);return}t(JSON.parse(d)),l(!1)}catch{A.error(a("network_settings.errors.save_failed"))}},f=_=>{u(_),c(h(_))},N=_=>{const T=k[_];if(T){const D=JSON.stringify(T.content,null,2);u(D),c(null)}};return m.useEffect(()=>{i&&console.log(n)},[i,n]),m.useEffect(()=>{i&&n&&Object.keys(n).length>0&&u(JSON.stringify(n,null,2))},[i,n]),e.jsxs(ge,{open:i,onOpenChange:_=>{!_&&i&&S(),l(_)},children:[e.jsx(as,{asChild:!0,children:s??e.jsx(G,{variant:"link",children:a("network_settings.edit_protocol")})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsx(be,{children:e.jsx(fe,{children:a("network_settings.edit_protocol_config")})}),e.jsxs("div",{className:"space-y-4",children:[C().length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:C().map(_=>e.jsx(G,{variant:"outline",size:"sm",onClick:()=>N(_),children:a("network_settings.use_template",{template:k[_].label})},_))}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ds,{className:`min-h-[200px] font-mono text-sm ${o?"border-red-500 focus-visible:ring-red-500":""}`,value:d,placeholder:C().length>0?a("network_settings.json_config_placeholder_with_template"):a("network_settings.json_config_placeholder"),onChange:_=>f(_.target.value)}),o&&e.jsx("p",{className:"text-sm text-red-500",children:o})]})]}),e.jsxs(Le,{className:"gap-2",children:[e.jsx(G,{variant:"outline",onClick:()=>l(!1),children:a("common.cancel")}),e.jsx(G,{onClick:S,disabled:!!o,children:a("common.confirm")})]})]})]})}function Cg(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const ax={},nx=Object.freeze(Object.defineProperty({__proto__:null,default:ax},Symbol.toStringTag,{value:"Module"})),Sg=md(nx),fr=s=>s.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),rx=()=>{try{const s=Wc.box.keyPair(),n=fr(ar.encodeBase64(s.secretKey)),t=fr(ar.encodeBase64(s.publicKey));return{privateKey:n,publicKey:t}}catch(s){throw console.error("Error generating x25519 key pair:",s),s}},lx=()=>{try{return rx()}catch(s){throw console.error("Error generating key pair:",s),s}},ix=s=>{const n=new Uint8Array(Math.ceil(s/2));return window.crypto.getRandomValues(n),Array.from(n).map(t=>t.toString(16).padStart(2,"0")).join("").substring(0,s)},ox=()=>{const s=Math.floor(Math.random()*8)*2+2;return ix(s)},cx=x.object({cipher:x.string().default("aes-128-gcm"),plugin:x.string().optional().default(""),plugin_opts:x.string().optional().default(""),client_fingerprint:x.string().optional().default("chrome")}),dx=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({})}),mx=x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({})}),ux=x.object({version:x.coerce.number().default(2),alpn:x.string().default("h2"),obfs:x.object({open:x.coerce.boolean().default(!1),type:x.string().default("salamander"),password:x.string().default("")}).default({}),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),bandwidth:x.object({up:x.string().default(""),down:x.string().default("")}).default({}),hop_interval:x.number().optional(),port_range:x.string().optional()}),xx=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),reality_settings:x.object({server_port:x.coerce.number().default(443),server_name:x.string().default(""),allow_insecure:x.boolean().default(!1),public_key:x.string().default(""),private_key:x.string().default(""),short_id:x.string().default("")}).default({}),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({}),flow:x.string().default("")}),hx=x.object({version:x.coerce.number().default(5),congestion_control:x.string().default("bbr"),alpn:x.array(x.string()).default(["h3"]),udp_relay_mode:x.string().default("native"),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),gx=x.object({}),fx=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),px=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),jx=x.object({transport:x.string().default("tcp"),multiplexing:x.string().default("MULTIPLEXING_LOW")}),vx=x.object({padding_scheme:x.array(x.string()).optional().default([]),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),Ee={shadowsocks:{schema:cx,ciphers:["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"],plugins:[{value:"none",label:"None"},{value:"obfs",label:"Simple Obfs"},{value:"v2ray-plugin",label:"V2Ray Plugin"}],clientFingerprints:[{value:"chrome",label:"Chrome"},{value:"firefox",label:"Firefox"},{value:"safari",label:"Safari"},{value:"ios",label:"iOS"}]},vmess:{schema:dx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},trojan:{schema:mx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},hysteria:{schema:ux,versions:["1","2"],alpnOptions:["hysteria","http/1.1","h2","h3"]},vless:{schema:xx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"},{value:"kcp",label:"mKCP"},{value:"httpupgrade",label:"HttpUpgrade"},{value:"xhttp",label:"XHTTP"}],flowOptions:["none","xtls-rprx-direct","xtls-rprx-splice","xtls-rprx-vision"]},tuic:{schema:hx,versions:["5","4"],congestionControls:["bbr","cubic","new_reno"],alpnOptions:[{value:"h3",label:"HTTP/3"},{value:"h2",label:"HTTP/2"},{value:"http/1.1",label:"HTTP/1.1"}],udpRelayModes:[{value:"native",label:"Native"},{value:"quic",label:"QUIC"}]},socks:{schema:gx},naive:{schema:px},http:{schema:fx},mieru:{schema:jx,transportOptions:[{value:"tcp",label:"TCP"},{value:"udp",label:"UDP"}],multiplexingOptions:[{value:"MULTIPLEXING_OFF",label:"Off"},{value:"MULTIPLEXING_LOW",label:"Low"},{value:"MULTIPLEXING_MIDDLE",label:"Middle"},{value:"MULTIPLEXING_HIGH",label:"High"}]},anytls:{schema:vx,defaultPaddingScheme:["stop=8","0=30-30","1=100-400","2=400-500,c,500-1000,c,500-1000,c,500-1000,c,500-1000","3=9-9,500-1000","4=500-1000","5=500-1000","6=500-1000","7=500-1000"]}},bx=({serverType:s,value:n,onChange:t})=>{const{t:r}=V("server"),a=s?Ee[s]:null,i=a?.schema||x.record(x.any()),l=s?i.parse({}):{},d=we({resolver:Ce(i),defaultValues:l,mode:"onChange"});if(m.useEffect(()=>{if(!n||Object.keys(n).length===0){if(s){const g=i.parse({});d.reset(g)}}else d.reset(n)},[s,n,t,d,i]),m.useEffect(()=>{const g=d.watch(w=>{t(w)});return()=>g.unsubscribe()},[d,t]),!s||!a)return null;const D={shadowsocks:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"cipher",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.shadowsocks.cipher.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.shadowsocks.cipher.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.shadowsocks.ciphers.map(w=>e.jsx($,{value:w,children:w},w))})})]})})]})}),e.jsx(v,{control:d.control,name:"plugin",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.shadowsocks.plugin.label","插件")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:w=>g.onChange(w==="none"?"":w),value:g.value===""?"none":g.value||"none",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.shadowsocks.plugin.placeholder","选择插件")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.shadowsocks.plugins.map(w=>e.jsx($,{value:w.value,children:w.label},w.value))})})]})}),e.jsx(O,{children:g.value&&g.value!=="none"&&g.value!==""&&e.jsxs(e.Fragment,{children:[g.value==="obfs"&&r("dynamic_form.shadowsocks.plugin.obfs_hint","提示:配置格式如 obfs=http;obfs-host=www.bing.com;path=/"),g.value==="v2ray-plugin"&&r("dynamic_form.shadowsocks.plugin.v2ray_hint","提示:WebSocket模式格式为 mode=websocket;host=mydomain.me;path=/;tls=true,QUIC模式格式为 mode=quic;host=mydomain.me")]})})]})}),d.watch("plugin")&&d.watch("plugin")!=="none"&&d.watch("plugin")!==""&&e.jsx(v,{control:d.control,name:"plugin_opts",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.shadowsocks.plugin_opts.label","插件选项")}),e.jsx(O,{children:r("dynamic_form.shadowsocks.plugin_opts.description","按照 key=value;key2=value2 格式输入插件选项")}),e.jsx(y,{children:e.jsx(P,{type:"text",placeholder:r("dynamic_form.shadowsocks.plugin_opts.placeholder","例如: mode=tls;host=bing.com"),...g})})]})}),(d.watch("plugin")==="shadow-tls"||d.watch("plugin")==="restls")&&e.jsx(v,{control:d.control,name:"client_fingerprint",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.shadowsocks.client_fingerprint","客户端指纹")}),e.jsx(y,{children:e.jsxs(J,{value:g.value||"chrome",onValueChange:g.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.shadowsocks.client_fingerprint_placeholder","选择客户端指纹")})}),e.jsx(Y,{children:Ee.shadowsocks.clientFingerprints.map(w=>e.jsx($,{value:w.value,children:w.label},w.value))})]})}),e.jsx(O,{children:r("dynamic_form.shadowsocks.client_fingerprint_description","客户端伪装指纹,用于降低被识别风险")})]})})]}),vmess:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"tls",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vmess.tls.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value?.toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.vmess.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:r("dynamic_form.vmess.tls.disabled")}),e.jsx($,{value:"1",children:r("dynamic_form.vmess.tls.enabled")})]})]})})]})}),d.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls_settings.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.vmess.tls_settings.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.vmess.tls_settings.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls_settings.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vmess.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]}),e.jsx(v,{control:d.control,name:"network",render:({field:g})=>e.jsxs(p,{children:[e.jsxs(j,{children:[r("dynamic_form.vmess.network.label"),e.jsx(ln,{value:d.watch("network_settings"),setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")})]}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.vmess.network.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.vmess.networkOptions.map(w=>e.jsx($,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})})]}),trojan:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.trojan.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.trojan.server_name.placeholder"),...g,value:g.value||""})})]})}),e.jsx(v,{control:d.control,name:"allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.trojan.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value||!1,onCheckedChange:g.onChange})})})]})})]}),e.jsx(v,{control:d.control,name:"network",render:({field:g})=>e.jsxs(p,{children:[e.jsxs(j,{children:[r("dynamic_form.trojan.network.label"),e.jsx(ln,{value:d.watch("network_settings")||{},setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")||"tcp"})]}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value||"tcp",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.trojan.network.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.trojan.networkOptions.map(w=>e.jsx($,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})})]}),hysteria:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"version",render:({field:g})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:r("dynamic_form.hysteria.version.label")}),e.jsx(y,{children:e.jsxs(J,{value:(g.value||2).toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.hysteria.version.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.hysteria.versions.map(w=>e.jsxs($,{value:w,className:"cursor-pointer",children:["V",w]},w))})})]})})]})}),d.watch("version")==1&&e.jsx(v,{control:d.control,name:"alpn",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.hysteria.alpn.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value||"h2",onValueChange:g.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.hysteria.alpn.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.hysteria.alpnOptions.map(w=>e.jsx($,{value:w,children:w},w))})})]})})]})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"obfs.open",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.hysteria.obfs.label")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value||!1,onCheckedChange:g.onChange})})})]})}),!!d.watch("obfs.open")&&e.jsxs(e.Fragment,{children:[d.watch("version")=="2"&&e.jsx(v,{control:d.control,name:"obfs.type",render:({field:g})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:r("dynamic_form.hysteria.obfs.type.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value||"salamander",onValueChange:g.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.hysteria.obfs.type.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:e.jsx($,{value:"salamander",children:r("dynamic_form.hysteria.obfs.type.salamander")})})})]})})]})}),e.jsx(v,{control:d.control,name:"obfs.password",render:({field:g})=>e.jsxs(p,{className:d.watch("version")==2?"w-full":"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.hysteria.obfs.password.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.hysteria.obfs.password.placeholder"),...g,value:g.value||"",className:"pr-9"})}),e.jsx(G,{type:"button",variant:"ghost",size:"icon",onClick:()=>{const w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",R=Array.from(crypto.getRandomValues(new Uint8Array(16))).map(H=>w[H%w.length]).join("");d.setValue("obfs.password",R),A.success(r("dynamic_form.hysteria.obfs.password.generate_success"))},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(Be,{icon:"ion:refresh-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})]})]})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.hysteria.tls.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.hysteria.tls.server_name.placeholder"),...g,value:g.value||""})})]})}),e.jsx(v,{control:d.control,name:"tls.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.hysteria.tls.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value||!1,onCheckedChange:g.onChange})})})]})})]}),e.jsx(v,{control:d.control,name:"bandwidth.up",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.hysteria.bandwidth.up.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:r("dynamic_form.hysteria.bandwidth.up.placeholder")+(d.watch("version")==2?r("dynamic_form.hysteria.bandwidth.up.bbr_tip"):""),className:"rounded-br-none rounded-tr-none",...g,value:g.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:r("dynamic_form.hysteria.bandwidth.up.suffix")})})]})]})}),e.jsx(v,{control:d.control,name:"bandwidth.down",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.hysteria.bandwidth.down.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:r("dynamic_form.hysteria.bandwidth.down.placeholder")+(d.watch("version")==2?r("dynamic_form.hysteria.bandwidth.down.bbr_tip"):""),className:"rounded-br-none rounded-tr-none",...g,value:g.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:r("dynamic_form.hysteria.bandwidth.down.suffix")})})]})]})}),e.jsx(e.Fragment,{children:e.jsx(v,{control:d.control,name:"hop_interval",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.hysteria.hop_interval.label","Hop 间隔 (秒)")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:r("dynamic_form.hysteria.hop_interval.placeholder","例如: 30"),...g,value:g.value||"",onChange:w=>{const R=w.target.value?parseInt(w.target.value):void 0;g.onChange(R)}})}),e.jsx(O,{children:r("dynamic_form.hysteria.hop_interval.description","Hop 间隔时间,单位为秒")})]})})})]}),vless:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"tls",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.tls.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value?.toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.vless.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:r("dynamic_form.vless.tls.none")}),e.jsx($,{value:"1",children:r("dynamic_form.vless.tls.tls")}),e.jsx($,{value:"2",children:r("dynamic_form.vless.tls.reality")})]})]})})]})}),d.watch("tls")=="1"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls_settings.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.vless.tls_settings.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.vless.tls_settings.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls_settings.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]}),d.watch("tls")==2&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"reality_settings.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.vless.reality_settings.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"reality_settings.server_port",render:({field:g})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.server_port.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.vless.reality_settings.server_port.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"reality_settings.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]}),e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(v,{control:d.control,name:"reality_settings.private_key",render:({field:g})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.private_key.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{children:e.jsx(P,{...g,className:"pr-9"})}),e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(G,{type:"button",variant:"ghost",size:"icon",onClick:()=>{try{const w=lx();d.setValue("reality_settings.private_key",w.privateKey),d.setValue("reality_settings.public_key",w.publicKey),A.success(r("dynamic_form.vless.reality_settings.key_pair.success"))}catch{A.error(r("dynamic_form.vless.reality_settings.key_pair.error"))}},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(Be,{icon:"ion:key-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})}),e.jsx(_a,{children:e.jsx(oe,{children:e.jsx("p",{children:r("dynamic_form.vless.reality_settings.key_pair.generate")})})})]})]})]})})}),e.jsx(v,{control:d.control,name:"reality_settings.public_key",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.public_key.label")}),e.jsx(y,{children:e.jsx(P,{...g})})]})}),e.jsx(v,{control:d.control,name:"reality_settings.short_id",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.reality_settings.short_id.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{children:e.jsx(P,{...g,className:"pr-9",placeholder:r("dynamic_form.vless.reality_settings.short_id.placeholder")})}),e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(G,{type:"button",variant:"ghost",size:"icon",onClick:()=>{const w=ox();d.setValue("reality_settings.short_id",w),A.success(r("dynamic_form.vless.reality_settings.short_id.success"))},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(Be,{icon:"ion:refresh-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})}),e.jsx(_a,{children:e.jsx(oe,{children:e.jsx("p",{children:r("dynamic_form.vless.reality_settings.short_id.generate")})})})]})]}),e.jsx(O,{className:"text-xs text-muted-foreground",children:r("dynamic_form.vless.reality_settings.short_id.description")})]})})]}),e.jsx(v,{control:d.control,name:"network",render:({field:g})=>e.jsxs(p,{children:[e.jsxs(j,{children:[r("dynamic_form.vless.network.label"),e.jsx(ln,{value:d.watch("network_settings"),setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")})]}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.vless.network.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.vless.networkOptions.map(w=>e.jsx($,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})}),e.jsx(v,{control:d.control,name:"flow",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.vless.flow.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:w=>g.onChange(w==="none"?null:w),value:g.value||"none",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.vless.flow.placeholder")})}),e.jsx(Y,{children:Ee.vless.flowOptions.map(w=>e.jsx($,{value:w,children:w},w))})]})})]})})]}),tuic:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"version",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.tuic.version.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value?.toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.tuic.version.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.tuic.versions.map(w=>e.jsxs($,{value:w,children:["V",w]},w))})})]})})]})}),e.jsx(v,{control:d.control,name:"congestion_control",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.tuic.congestion_control.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.tuic.congestion_control.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.tuic.congestionControls.map(w=>e.jsx($,{value:w,children:w.toUpperCase()},w))})})]})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.tuic.tls.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.tuic.tls.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.tuic.tls.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]}),e.jsx(v,{control:d.control,name:"alpn",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.tuic.tls.alpn.label")}),e.jsx(y,{children:e.jsx(kt,{options:Ee.tuic.alpnOptions,onChange:w=>g.onChange(w.map(R=>R.value)),value:Ee.tuic.alpnOptions.filter(w=>g.value?.includes(w.value)),placeholder:r("dynamic_form.tuic.tls.alpn.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:r("dynamic_form.tuic.tls.alpn.empty")})})})]})}),e.jsx(v,{control:d.control,name:"udp_relay_mode",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.tuic.udp_relay_mode.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.tuic.udp_relay_mode.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.tuic.udpRelayModes.map(w=>e.jsx($,{value:w.value,children:w.label},w.value))})})]})})]})})]}),socks:()=>e.jsx(e.Fragment,{}),naive:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"tls",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.naive.tls.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value?.toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.naive.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:r("dynamic_form.naive.tls.disabled")}),e.jsx($,{value:"1",children:r("dynamic_form.naive.tls.enabled")})]})]})})]})}),d.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls_settings.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.naive.tls_settings.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.naive.tls_settings.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls_settings.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.naive.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]})]}),http:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"tls",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.http.tls.label")}),e.jsx(y,{children:e.jsxs(J,{value:g.value?.toString(),onValueChange:w=>g.onChange(Number(w)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.http.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:r("dynamic_form.http.tls.disabled")}),e.jsx($,{value:"1",children:r("dynamic_form.http.tls.enabled")})]})]})})]})}),d.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls_settings.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.http.tls_settings.server_name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.http.tls_settings.server_name.placeholder"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls_settings.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.http.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]})]}),mieru:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:d.control,name:"transport",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.mieru.transport.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.mieru.transport.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.mieru.transportOptions.map(w=>e.jsx($,{value:w.value,children:w.label},w.value))})})]})})]})}),e.jsx(v,{control:d.control,name:"multiplexing",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.mieru.multiplexing.label")}),e.jsx(y,{children:e.jsxs(J,{onValueChange:g.onChange,value:g.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dynamic_form.mieru.multiplexing.placeholder")})}),e.jsx(Y,{children:e.jsx(rs,{children:Ee.mieru.multiplexingOptions.map(w=>e.jsx($,{value:w.value,children:w.label},w.value))})})]})})]})})]}),anytls:()=>e.jsx(e.Fragment,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:d.control,name:"padding_scheme",render:({field:g})=>e.jsxs(p,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(j,{children:r("dynamic_form.anytls.padding_scheme.label","AnyTLS 填充方案")}),e.jsx(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{d.setValue("padding_scheme",Ee.anytls.defaultPaddingScheme),A.success(r("dynamic_form.anytls.padding_scheme.default_success","已设置默认填充方案"))},className:"h-7 px-2",children:r("dynamic_form.anytls.padding_scheme.use_default","使用默认方案")})]}),e.jsx(O,{children:r("dynamic_form.anytls.padding_scheme.description","每行一个填充规则,格式如: stop=8, 0=30-30")}),e.jsx(y,{children:e.jsx("textarea",{className:"flex min-h-[100px] 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",placeholder:r("dynamic_form.anytls.padding_scheme.placeholder",`例如: stop=8 0=30-30 1=100-400 2=400-500,c,500-1000`),...g,value:Array.isArray(g.value)?g.value.join(` `):"",onChange:w=>{const H=w.target.value.split(` -`).filter(I=>I.trim()!=="");g.onChange(H)}})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.anytls.tls.server_name.label","SNI")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.anytls.tls.server_name.placeholder","服务器名称"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.anytls.tls.allow_insecure","允许不安全连接")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]})]})})};return e.jsx(be,{children:D[s]?.()})};function vx(){const{t:s}=V("server"),n=x.object({id:x.number().optional().nullable(),specific_key:x.string().optional().nullable(),code:x.string().optional(),show:x.boolean().optional().nullable(),name:x.string().min(1,s("form.name.error")),rate:x.string().min(1,s("form.rate.error")).refine(R=>!isNaN(parseFloat(R))&&isFinite(Number(R)),{message:s("form.rate.error_numeric")}).refine(R=>parseFloat(R)>=0,{message:s("form.rate.error_gte_zero")}),tags:x.array(x.string()).default([]),excludes:x.array(x.string()).default([]),ips:x.array(x.string()).default([]),group_ids:x.array(x.string()).default([]),host:x.string().min(1,s("form.host.error")),port:x.string().min(1,s("form.port.error")),server_port:x.string().min(1,s("form.server_port.error")),parent_id:x.string().default("0").nullable(),route_ids:x.array(x.string()).default([]),protocol_settings:x.record(x.any()).default({}).nullable()}),t={id:null,specific_key:null,code:"",show:!1,name:"",rate:"1",tags:[],excludes:[],ips:[],group_ids:[],host:"",port:"",server_port:"",parent_id:"0",route_ids:[],protocol_settings:null},{isOpen:r,setIsOpen:a,editingServer:i,setEditingServer:l,serverType:d,setServerType:u,refetch:o}=ti(),[c,h]=m.useState([]),[k,C]=m.useState([]),[S,f]=m.useState([]),N=we({resolver:Ce(n),defaultValues:t,mode:"onChange"});m.useEffect(()=>{_()},[r]),m.useEffect(()=>{i?.type&&i.type!==d&&u(i.type)},[i,d,u]),m.useEffect(()=>{i?i.type===d&&N.reset({...t,...i}):N.reset({...t,protocol_settings:Ee[d].schema.parse({})})},[i,N,d]);const _=async()=>{if(!r)return;const[R,H,I]=await Promise.all([mt.getList(),Va.getList(),at.getList()]);h(R.data?.map(K=>({label:K.name,value:K.id.toString()}))||[]),C(H.data?.map(K=>({label:K.remarks,value:K.id.toString()}))||[]),f(I.data||[])},T=m.useMemo(()=>S?.filter(R=>(R.parent_id===0||R.parent_id===null)&&R.type===d&&R.id!==N.watch("id")),[d,S,N]),D=()=>e.jsxs(zs,{children:[e.jsx($s,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:s("form.add_node")})]})}),e.jsx(Ls,{align:"start",children:e.jsx(Kd,{children:js.map(({type:R,label:H})=>e.jsx(_e,{onClick:()=>{u(R),a(!0)},className:"cursor-pointer",children:e.jsx(U,{variant:"outline",className:"text-white",style:{background:is[R]},children:H})},R))})})]}),g=()=>{a(!1),l(null),N.reset(t)},w=async()=>{const R=N.getValues();(await at.save({...R,type:d})).data&&(g(),A.success(s("form.success")),o())};return e.jsxs(ge,{open:r,onOpenChange:g,children:[D(),e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:s(i?"form.edit_node":"form.new_node")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...N,children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:N.control,name:"name",render:({field:R})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:s("form.name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("form.name.placeholder"),...R})}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"rate",render:({field:R})=>e.jsxs(p,{className:"flex-[1]",children:[e.jsx(j,{children:s("form.rate.label")}),e.jsx("div",{className:"relative flex",children:e.jsx(y,{children:e.jsx(P,{type:"number",min:"0",step:"0.1",...R})})}),e.jsx(E,{})]})})]}),e.jsx(v,{control:N.control,name:"code",render:({field:R})=>e.jsxs(p,{children:[e.jsxs(j,{children:[s("form.code.label"),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:s("form.code.optional")})]}),e.jsx(y,{children:e.jsx(P,{placeholder:s("form.code.placeholder"),...R,value:R.value||""})}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"tags",render:({field:R})=>e.jsxs(p,{children:[e.jsx(j,{children:s("form.tags.label")}),e.jsx(y,{children:e.jsx(zn,{value:R.value,onChange:R.onChange,placeholder:s("form.tags.placeholder"),className:"w-full"})}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"group_ids",render:({field:R})=>e.jsxs(p,{children:[e.jsxs(j,{className:"flex items-center justify-between",children:[s("form.groups.label"),e.jsx(Ka,{dialogTrigger:e.jsx(L,{variant:"link",children:s("form.groups.add")}),refetch:_})]}),e.jsx(y,{children:e.jsx(kt,{options:c,onChange:H=>R.onChange(H.map(I=>I.value)),value:c?.filter(H=>R.value.includes(H.value)),placeholder:s("form.groups.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:s("form.groups.empty")})})}),e.jsx(E,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:N.control,name:"host",render:({field:R})=>e.jsxs(p,{children:[e.jsx(j,{children:s("form.host.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("form.host.placeholder"),...R})}),e.jsx(E,{})]})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(v,{control:N.control,name:"port",render:({field:R})=>e.jsxs(p,{className:"flex-1",children:[e.jsxs(j,{className:"flex items-center gap-1.5",children:[s("form.port.label"),e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(Be,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(Na,{children:e.jsx(ce,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:s("form.port.tooltip")})})})]})})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(y,{children:e.jsx(P,{placeholder:s("form.port.placeholder"),...R})}),e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0 text-muted-foreground/50 hover:text-muted-foreground",onClick:()=>{const H=R.value;H&&N.setValue("server_port",H)},children:e.jsx(Be,{icon:"tabler:arrows-right",className:"size-3"})})}),e.jsx(ce,{side:"right",children:e.jsx("p",{children:s("form.port.sync")})})]})})]}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"server_port",render:({field:R})=>e.jsxs(p,{className:"flex-1",children:[e.jsxs(j,{className:"flex items-center gap-1.5",children:[s("form.server_port.label"),e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(Be,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(Na,{children:e.jsx(ce,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:s("form.server_port.tooltip")})})})]})})]}),e.jsx(y,{children:e.jsx(P,{placeholder:s("form.server_port.placeholder"),...R})}),e.jsx(E,{})]})})]})]}),r&&e.jsx(jx,{serverType:d,value:N.watch("protocol_settings"),onChange:R=>N.setValue("protocol_settings",R,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),e.jsx(v,{control:N.control,name:"parent_id",render:({field:R})=>e.jsxs(p,{children:[e.jsx(j,{children:s("form.parent.label")}),e.jsxs(J,{onValueChange:R.onChange,value:R.value?.toString()||"0",children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:s("form.parent.placeholder")})})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("form.parent.none")}),T?.map(H=>e.jsx($,{value:H.id.toString(),className:"cursor-pointer",children:H.name},H.id))]})]}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"route_ids",render:({field:R})=>e.jsxs(p,{children:[e.jsx(j,{children:s("form.route.label")}),e.jsx(y,{children:e.jsx(kt,{options:k,onChange:H=>R.onChange(H.map(I=>I.value)),value:k?.filter(H=>R.value.includes(H.value)),placeholder:s("form.route.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:s("form.route.empty")})})}),e.jsx(E,{})]})})]}),e.jsxs(Le,{className:"mt-6 flex flex-col sm:flex-row gap-2 sm:gap-0",children:[e.jsx(L,{type:"button",variant:"outline",onClick:g,className:"w-full sm:w-auto",children:s("form.cancel")}),e.jsx(L,{type:"submit",onClick:w,className:"w-full sm:w-auto",children:s("form.submit")})]})]})]})]})}function fr({column:s,title:n,options:t}){const r=s?.getFacetedUniqueValues(),a=new Set(s?.getFilterValue());return e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Fa,{className:"mr-2 h-4 w-4"}),n,a?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:a.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:a.size>2?e.jsxs(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[a.size," selected"]}):t.filter(i=>a.has(i.value)).map(i=>e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:i.label},i.value))})]})]})}),e.jsx(Ze,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Js,{children:[e.jsx(ut,{placeholder:n}),e.jsxs(Qs,{children:[e.jsx(xt,{children:"No results found."}),e.jsx(fs,{children:t.map(i=>{const l=a.has(i.value);return e.jsxs(We,{onSelect:()=>{l?a.delete(i.value):a.add(i.value);const d=Array.from(a);s?.setFilterValue(d.length?d:void 0)},className:"cursor-pointer",children:[e.jsx("div",{className:b("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",l?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ot,{className:b("h-4 w-4")})}),i.icon&&e.jsx(i.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${i.color}`}),e.jsx("span",{children:i.label}),r?.get(i.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:r.get(i.value)})]},i.value)})}),a.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(fs,{children:e.jsx(We,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center cursor-pointer",children:"Clear filters"})})]})]})]})})]})}const bx=[{value:oe.Shadowsocks,label:js.find(s=>s.type===oe.Shadowsocks)?.label,color:is[oe.Shadowsocks]},{value:oe.Vmess,label:js.find(s=>s.type===oe.Vmess)?.label,color:is[oe.Vmess]},{value:oe.Trojan,label:js.find(s=>s.type===oe.Trojan)?.label,color:is[oe.Trojan]},{value:oe.Hysteria,label:js.find(s=>s.type===oe.Hysteria)?.label,color:is[oe.Hysteria]},{value:oe.Vless,label:js.find(s=>s.type===oe.Vless)?.label,color:is[oe.Vless]},{value:oe.Tuic,label:js.find(s=>s.type===oe.Tuic)?.label,color:is[oe.Tuic]},{value:oe.Socks,label:js.find(s=>s.type===oe.Socks)?.label,color:is[oe.Socks]},{value:oe.Naive,label:js.find(s=>s.type===oe.Naive)?.label,color:is[oe.Naive]},{value:oe.Http,label:js.find(s=>s.type===oe.Http)?.label,color:is[oe.Http]},{value:oe.Mieru,label:js.find(s=>s.type===oe.Mieru)?.label,color:is[oe.Mieru]}];function yx({table:s,saveOrder:n,isSortMode:t,groups:r}){const a=s.getState().columnFilters.length>0,{t:i}=V("server");return e.jsxs("div",{className:"flex items-center justify-between ",children:[e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[!t&&e.jsxs(e.Fragment,{children:[e.jsx(vx,{}),e.jsx(P,{placeholder:i("toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:l=>s.getColumn("name")?.setFilterValue(l.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs("div",{className:"flex gap-x-2",children:[s.getColumn("type")&&e.jsx(fr,{column:s.getColumn("type"),title:i("toolbar.type"),options:bx}),s.getColumn("group_ids")&&e.jsx(fr,{column:s.getColumn("group_ids"),title:i("columns.groups.title"),options:r.map(l=>({label:l.name,value:l.id.toString()}))})]}),a&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[i("toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]}),t&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:i("toolbar.sort.tip")})})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:t?"default":"outline",onClick:n,size:"sm",children:i(t?"toolbar.sort.save":"toolbar.sort.edit")})})]})}const Ta=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M15.71 12.71a6 6 0 1 0-7.42 0a10 10 0 0 0-6.22 8.18a1 1 0 0 0 2 .22a8 8 0 0 1 15.9 0a1 1 0 0 0 1 .89h.11a1 1 0 0 0 .88-1.1a10 10 0 0 0-6.25-8.19M12 12a4 4 0 1 1 4-4a4 4 0 0 1-4 4"})}),da={0:"bg-destructive/80 shadow-sm shadow-destructive/50",1:"bg-yellow-500/80 shadow-sm shadow-yellow-500/50",2:"bg-emerald-500/80 shadow-sm shadow-emerald-500/50"},Me=(s,n)=>n>0?Math.round(s/n*100):0,Nx=s=>{const{t:n}=V("server");return[{id:"drag-handle",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.sort")}),cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(Ea,{className:"size-4 cursor-move text-muted-foreground transition-colors hover:text-primary","aria-hidden":"true"})}),size:50},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.nodeId")}),cell:({row:t})=>{const r=t.getValue("id"),a=t.original.code;return e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsxs("div",{className:"group/id flex items-center space-x-2",children:[e.jsxs(U,{variant:"outline",className:b("border-2 font-medium transition-all duration-200 hover:opacity-80","flex items-center gap-1.5"),style:{borderColor:is[t.original.type]},children:[e.jsx(jl,{className:"size-3"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"flex items-center gap-0.5",children:a??r}),t.original.parent?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-muted-foreground/30",children:"→"}),e.jsx("span",{children:t.original.parent?.code||t.original.parent?.id})]}):""]})]}),e.jsx(L,{variant:"ghost",size:"icon",className:"size-5 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:text-muted-foreground group-hover/id:opacity-100",onClick:i=>{i.stopPropagation(),wa(a||r.toString()).then(()=>{A.success(n("common:copy.success"))})},children:e.jsx(ar,{className:"size-3"})})]})}),e.jsxs(ce,{side:"top",className:"flex flex-col gap-1 p-3",children:[e.jsxs("p",{className:"font-medium",children:[js.find(i=>i.type===t.original.type)?.label,t.original.parent?" (子节点)":""]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a?"点击括号内容或复制按钮可复制节点代码":"点击复制按钮可复制节点ID"})]})]})})},size:50,enableSorting:!0},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.show")}),cell:({row:t})=>{const[r,a]=m.useState(!!t.getValue("show"));return e.jsx(Z,{checked:r,onCheckedChange:async i=>{a(i),at.update({id:t.original.id,type:t.original.type,show:i?1:0}).catch(()=>{a(!i),s()})},style:{backgroundColor:r?is[t.original.type]:void 0}})},size:50,enableSorting:!1},{accessorKey:"name",header:({column:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(z,{column:t,title:n("columns.node"),tooltip:e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-2",children:[e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:b("h-2.5 w-2.5 rounded-full",da[0])}),e.jsx("span",{className:"text-sm font-medium",children:n("columns.status.0")})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:b("h-2.5 w-2.5 rounded-full",da[1])}),e.jsx("span",{className:"text-sm font-medium",children:n("columns.status.1")})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:b("h-2.5 w-2.5 rounded-full",da[2])}),e.jsx("span",{className:"text-sm font-medium",children:n("columns.status.2")})]})]})})}),cell:({row:t})=>e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{children:e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:b("size-2.5 flex-shrink-0 rounded-full transition-all duration-200",da[t.original.available_status])}),e.jsx("span",{className:"text-left font-medium transition-colors hover:text-primary",children:t.getValue("name")})]})}),e.jsx(ce,{children:e.jsxs("div",{className:" space-y-3",children:[e.jsx("p",{className:"font-medium",children:n(`columns.status.${t.original.available_status}`)}),t.original.load_status&&e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"mb-3 text-sm font-medium",children:n("columns.loadStatus.details")}),e.jsxs("div",{className:"space-y-3 text-xs",children:[e.jsx("div",{children:e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[n("columns.loadStatus.cpu"),":"]}),e.jsxs("div",{className:"ml-2 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:b("h-full transition-all duration-300",t.original.load_status.cpu>=90?"bg-destructive":t.original.load_status.cpu>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Math.min(100,t.original.load_status.cpu)}%`}})}),e.jsxs("span",{className:b("min-w-[3rem] text-right font-semibold",t.original.load_status.cpu>=90?"text-destructive":t.original.load_status.cpu>=70?"text-yellow-600":"text-emerald-600"),children:[Math.round(t.original.load_status.cpu),"%"]})]})]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[n("columns.loadStatus.memory"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:b("h-full transition-all duration-300",Me(t.original.load_status.mem.used,t.original.load_status.mem.total)>=90?"bg-destructive":Me(t.original.load_status.mem.used,t.original.load_status.mem.total)>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Me(t.original.load_status.mem.used,t.original.load_status.mem.total)}%`}})}),e.jsxs("span",{className:b("min-w-[3rem] text-right font-semibold",Me(t.original.load_status.mem.used,t.original.load_status.mem.total)>=90?"text-destructive":Me(t.original.load_status.mem.used,t.original.load_status.mem.total)>=70?"text-yellow-600":"text-emerald-600"),children:[Me(t.original.load_status.mem.used,t.original.load_status.mem.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.mem.used)," ","/"," ",Oe(t.original.load_status.mem.total)]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[n("columns.loadStatus.swap"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:b("h-full transition-all duration-300",Me(t.original.load_status.swap.used,t.original.load_status.swap.total)>=80?"bg-destructive":Me(t.original.load_status.swap.used,t.original.load_status.swap.total)>=50?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Me(t.original.load_status.swap.used,t.original.load_status.swap.total)}%`}})}),e.jsxs("span",{className:b("min-w-[3rem] text-right font-semibold",Me(t.original.load_status.swap.used,t.original.load_status.swap.total)>=80?"text-destructive":Me(t.original.load_status.swap.used,t.original.load_status.swap.total)>=50?"text-yellow-600":"text-emerald-600"),children:[Me(t.original.load_status.swap.used,t.original.load_status.swap.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.swap.used)," ","/"," ",Oe(t.original.load_status.swap.total)]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[n("columns.loadStatus.disk"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:b("h-full transition-all duration-300",Me(t.original.load_status.disk.used,t.original.load_status.disk.total)>=90?"bg-destructive":Me(t.original.load_status.disk.used,t.original.load_status.disk.total)>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Me(t.original.load_status.disk.used,t.original.load_status.disk.total)}%`}})}),e.jsxs("span",{className:b("min-w-[3rem] text-right font-semibold",Me(t.original.load_status.disk.used,t.original.load_status.disk.total)>=90?"text-destructive":Me(t.original.load_status.disk.used,t.original.load_status.disk.total)>=70?"text-yellow-600":"text-emerald-600"),children:[Me(t.original.load_status.disk.used,t.original.load_status.disk.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.disk.used)," ","/"," ",Oe(t.original.load_status.disk.total)]})]})]})]})]})})]})}),enableSorting:!1,size:200},{accessorKey:"host",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.address")}),cell:({row:t})=>{const r=`${t.original.host}:${t.original.port}`,a=t.original.port!==t.original.server_port;return e.jsxs("div",{className:"group relative flex min-w-0 items-start",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1 gap-y-0.5 pr-7",children:[e.jsx("div",{className:"flex items-center ",children:e.jsxs("span",{className:"font-mono text-sm font-medium text-foreground/90",children:[t.original.host,":",t.original.port]})}),a&&e.jsxs("span",{className:"whitespace-nowrap text-[0.7rem] tracking-tight text-muted-foreground/40",children:["(",n("columns.internalPort")," ",t.original.server_port,")"]})]}),e.jsx("div",{className:"absolute right-0 top-0",children:e.jsx(be,{delayDuration:0,children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(L,{variant:"ghost",size:"icon",className:"size-6 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:bg-muted/50 hover:text-muted-foreground group-hover:opacity-100",onClick:i=>{i.stopPropagation(),wa(r).then(()=>{A.success(n("common:copy.success"))})},children:e.jsx(ar,{className:"size-3"})})}),e.jsx(ce,{side:"top",sideOffset:10,children:n("columns.copyAddress")})]})})})]})},enableSorting:!1,enableHiding:!0},{accessorKey:"online",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.onlineUsers.title"),tooltip:n("columns.onlineUsers.tooltip")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(Ta,{className:"size-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("online")})]}),size:80,enableSorting:!0,enableHiding:!0},{accessorKey:"rate",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.rate.title"),tooltip:n("columns.rate.tooltip")}),cell:({row:t})=>e.jsxs(U,{variant:"secondary",className:"font-medium",children:[t.getValue("rate")," x"]}),size:80,enableSorting:!1,enableHiding:!0},{accessorKey:"group_ids",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.groups.title"),tooltip:n("columns.groups.tooltip")}),cell:({row:t})=>{const r=t.original.groups||[];return e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r.map((a,i)=>e.jsx(U,{variant:"secondary",className:b("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:a.name},i)),r.length===0&&e.jsx("span",{className:"text-sm text-muted-foreground",children:n("columns.groups.empty")})]})},enableSorting:!1,filterFn:(t,r,a)=>{const i=t.getValue(r);return i?a.some(l=>i.includes(l)):!1}},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.type")}),cell:({row:t})=>{const r=t.getValue("type");return e.jsx(U,{variant:"outline",className:"border-2 font-medium transition-colors",style:{borderColor:is[r]},children:r})},enableSorting:!1,enableHiding:!0,enableColumnFilter:!1,size:8e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:n("columns.actions")}),cell:({row:t})=>{const{setIsOpen:r,setEditingServer:a,setServerType:i}=ti();return e.jsx("div",{className:"flex justify-center",children:e.jsxs(zs,{modal:!1,children:[e.jsx($s,{asChild:!0,children:e.jsx(L,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted","aria-label":n("columns.actions"),children:e.jsx(_a,{className:"size-4"})})}),e.jsxs(Ls,{align:"end",className:"w-40",children:[e.jsx(_e,{className:"cursor-pointer",onClick:()=>{i(t.original.type),a(t.original),r(!0)},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(Yc,{className:"mr-2 size-4"}),n("columns.actions_dropdown.edit")]})}),e.jsxs(_e,{className:"cursor-pointer",onClick:async()=>{at.copy({id:t.original.id}).then(({data:l})=>{l&&(A.success(n("columns.actions_dropdown.copy_success")),s())})},children:[e.jsx(Jc,{className:"mr-2 size-4"}),n("columns.actions_dropdown.copy")]}),e.jsx(rt,{}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onSelect:l=>l.preventDefault(),children:e.jsx(ps,{title:n("columns.actions_dropdown.delete.title"),description:n("columns.actions_dropdown.delete.description"),confirmText:n("columns.actions_dropdown.delete.confirm"),variant:"destructive",onConfirm:async()=>{at.drop({id:t.original.id}).then(({data:l})=>{l&&(A.success(n("columns.actions_dropdown.delete_success")),s())})},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(ds,{className:"mr-2 size-4"}),n("columns.actions_dropdown.delete.confirm")]})})})]})]})})},size:50}]};function _x(){const[s,n]=m.useState({}),[t,r]=m.useState({"drag-handle":!1}),[a,i]=m.useState([]),[l,d]=m.useState({pageSize:500,pageIndex:0}),[u,o]=m.useState([]),[c,h]=m.useState(!1),[k,C]=m.useState({}),[S,f]=m.useState([]),{refetch:N}=ne({queryKey:["nodeList"],queryFn:async()=>{const{data:R}=await at.getList();return f(R),R}}),{data:_}=ne({queryKey:["groups"],queryFn:async()=>{const{data:R}=await mt.getList();return R}});m.useEffect(()=>{r({"drag-handle":c,show:!c,host:!c,online:!c,rate:!c,groups:!c,type:!1,actions:!c}),C({name:c?2e3:200}),d({pageSize:c?99999:500,pageIndex:0})},[c]);const T=(R,H)=>{c&&(R.dataTransfer.setData("text/plain",H.toString()),R.currentTarget.classList.add("opacity-50"))},D=(R,H)=>{if(!c)return;R.preventDefault(),R.currentTarget.classList.remove("bg-muted");const I=parseInt(R.dataTransfer.getData("text/plain"));if(I===H)return;const K=[...S],[ae]=K.splice(I,1);K.splice(H,0,ae),f(K)},g=async()=>{if(!c){h(!0);return}const R=S?.map((H,I)=>({id:H.id,order:I+1}));at.sort(R).then(()=>{A.success("排序保存成功"),h(!1),N()}).finally(()=>{h(!1)})},w=ss({data:S||[],columns:Nx(N),state:{sorting:u,columnVisibility:t,rowSelection:s,columnFilters:a,columnSizing:k,pagination:l},enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:o,onColumnFiltersChange:i,onColumnVisibilityChange:r,onColumnSizingChange:C,onPaginationChange:d,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(ex,{refetch:N,children:e.jsx("div",{className:"space-y-4",children:e.jsx(xs,{table:w,toolbar:R=>e.jsx(yx,{table:R,refetch:N,saveOrder:g,isSortMode:c,groups:_||[]}),draggable:c,onDragStart:T,onDragEnd:R=>R.currentTarget.classList.remove("opacity-50"),onDragOver:R=>{R.preventDefault(),R.currentTarget.classList.add("bg-muted")},onDragLeave:R=>R.currentTarget.classList.remove("bg-muted"),onDrop:D,showPagination:!c})})})}function wx(){const{t:s}=V("server");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("manage.title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("manage.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(_x,{})})]})]})}const Cx=Object.freeze(Object.defineProperty({__proto__:null,default:wx},Symbol.toStringTag,{value:"Module"}));function Sx({table:s,refetch:n}){const t=s.getState().columnFilters.length>0,{t:r}=V("group");return e.jsx("div",{className:"flex items-center justify-between space-x-4",children:e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsx(Ka,{refetch:n}),e.jsx(P,{placeholder:r("toolbar.searchPlaceholder"),value:s.getColumn("name")?.getFilterValue()??"",onChange:a=>s.getColumn("name")?.setFilterValue(a.target.value),className:b("h-8 w-[150px] lg:w-[250px]",t&&"border-primary/50 ring-primary/20")}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]})})}const kx=s=>{const{t:n}=V("group");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.id")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(U,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium",children:t.getValue("name")})})},{accessorKey:"users_count",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.usersCount")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(Ta,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("users_count")})]}),enableSorting:!0},{accessorKey:"server_count",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.serverCount")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(jl,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("server_count")})]}),enableSorting:!0,size:8e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:n("columns.actions")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(Ka,{defaultValues:t.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("form.edit")})]})}),e.jsx(ps,{title:n("messages.deleteConfirm"),description:n("messages.deleteDescription"),confirmText:n("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{mt.drop({id:t.original.id}).then(({data:r})=>{r&&(A.success(n("messages.updateSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:n("messages.deleteButton")})]})})]})}]};function Tx(){const[s,n]=m.useState({}),[t,r]=m.useState({}),[a,i]=m.useState([]),[l,d]=m.useState([]),{data:u,refetch:o,isLoading:c}=ne({queryKey:["serverGroupList"],queryFn:async()=>{const{data:k}=await mt.getList();return k}}),h=ss({data:u||[],columns:kx(o),state:{sorting:l,columnVisibility:t,rowSelection:s,columnFilters:a},enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:i,onColumnVisibilityChange:r,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(xs,{table:h,toolbar:k=>e.jsx(Sx,{table:k,refetch:o}),isLoading:c})}function Dx(){const{t:s}=V("group");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Tx,{})})]})]})}const Px=Object.freeze(Object.defineProperty({__proto__:null,default:Dx},Symbol.toStringTag,{value:"Module"})),Lx=s=>x.object({remarks:x.string().min(1,s("form.validation.remarks")),match:x.array(x.string()),action:x.enum(["block","dns"]),action_value:x.string().optional()});function ai({refetch:s,dialogTrigger:n,defaultValues:t={remarks:"",match:[],action:"block",action_value:""},type:r="create"}){const{t:a}=V("route"),i=we({resolver:Ce(Lx(a)),defaultValues:t,mode:"onChange"}),[l,d]=m.useState(!1);return e.jsxs(ge,{open:l,onOpenChange:d,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"})," ",e.jsx("div",{children:a("form.add")})]})}),e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:a(r==="edit"?"form.edit":"form.create")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...i,children:[e.jsx(v,{control:i.control,name:"remarks",render:({field:u})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:a("form.remarks")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(P,{type:"text",placeholder:a("form.remarksPlaceholder"),...u})})}),e.jsx(E,{})]})}),e.jsx(v,{control:i.control,name:"match",render:({field:u})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:a("form.match")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(Ds,{className:"min-h-[120px]",placeholder:a("form.matchPlaceholder"),value:Array.isArray(u.value)?u.value.join(` +`).filter(I=>I.trim()!=="");g.onChange(H)}})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.anytls.tls.server_name.label","SNI")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dynamic_form.anytls.tls.server_name.placeholder","服务器名称"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls.allow_insecure",render:({field:g})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dynamic_form.anytls.tls.allow_insecure","允许不安全连接")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]})]})})};return e.jsx(pe,{children:D[s]?.()})};function yx(){const{t:s}=V("server"),n=x.object({id:x.number().optional().nullable(),specific_key:x.string().optional().nullable(),code:x.string().optional(),show:x.boolean().optional().nullable(),name:x.string().min(1,s("form.name.error")),rate:x.string().min(1,s("form.rate.error")).refine(R=>!isNaN(parseFloat(R))&&isFinite(Number(R)),{message:s("form.rate.error_numeric")}).refine(R=>parseFloat(R)>=0,{message:s("form.rate.error_gte_zero")}),tags:x.array(x.string()).default([]),excludes:x.array(x.string()).default([]),ips:x.array(x.string()).default([]),group_ids:x.array(x.string()).default([]),host:x.string().min(1,s("form.host.error")),port:x.string().min(1,s("form.port.error")),server_port:x.string().min(1,s("form.server_port.error")),parent_id:x.string().default("0").nullable(),route_ids:x.array(x.string()).default([]),protocol_settings:x.record(x.any()).default({}).nullable()}),t={id:null,specific_key:null,code:"",show:!1,name:"",rate:"1",tags:[],excludes:[],ips:[],group_ids:[],host:"",port:"",server_port:"",parent_id:"0",route_ids:[],protocol_settings:null},{isOpen:r,setIsOpen:a,editingServer:i,setEditingServer:l,serverType:d,setServerType:u,refetch:o}=ti(),[c,h]=m.useState([]),[k,C]=m.useState([]),[S,f]=m.useState([]),N=we({resolver:Ce(n),defaultValues:t,mode:"onChange"});m.useEffect(()=>{_()},[r]),m.useEffect(()=>{i?.type&&i.type!==d&&u(i.type)},[i,d,u]),m.useEffect(()=>{i?i.type===d&&N.reset({...t,...i}):N.reset({...t,protocol_settings:Ee[d].schema.parse({})})},[i,N,d]);const _=async()=>{if(!r)return;const[R,H,I]=await Promise.all([mt.getList(),Ma.getList(),at.getList()]);h(R.data?.map(K=>({label:K.name,value:K.id.toString()}))||[]),C(H.data?.map(K=>({label:K.remarks,value:K.id.toString()}))||[]),f(I.data||[])},T=m.useMemo(()=>S?.filter(R=>(R.parent_id===0||R.parent_id===null)&&R.type===d&&R.id!==N.watch("id")),[d,S,N]),D=()=>e.jsxs(zs,{children:[e.jsx($s,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:s("form.add_node")})]})}),e.jsx(Ls,{align:"start",children:e.jsx(Gd,{children:js.map(({type:R,label:H})=>e.jsx(_e,{onClick:()=>{u(R),a(!0)},className:"cursor-pointer",children:e.jsx(U,{variant:"outline",className:"text-white",style:{background:is[R]},children:H})},R))})})]}),g=()=>{a(!1),l(null),N.reset(t)},w=async()=>{const R=N.getValues();(await at.save({...R,type:d})).data&&(g(),A.success(s("form.success")),o())};return e.jsxs(ge,{open:r,onOpenChange:g,children:[D(),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(be,{children:[e.jsx(fe,{children:s(i?"form.edit_node":"form.new_node")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...N,children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:N.control,name:"name",render:({field:R})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:s("form.name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("form.name.placeholder"),...R})}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"rate",render:({field:R})=>e.jsxs(p,{className:"flex-[1]",children:[e.jsx(j,{children:s("form.rate.label")}),e.jsx("div",{className:"relative flex",children:e.jsx(y,{children:e.jsx(P,{type:"number",min:"0",step:"0.1",...R})})}),e.jsx(E,{})]})})]}),e.jsx(v,{control:N.control,name:"code",render:({field:R})=>e.jsxs(p,{children:[e.jsxs(j,{children:[s("form.code.label"),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:s("form.code.optional")})]}),e.jsx(y,{children:e.jsx(P,{placeholder:s("form.code.placeholder"),...R,value:R.value||""})}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"tags",render:({field:R})=>e.jsxs(p,{children:[e.jsx(j,{children:s("form.tags.label")}),e.jsx(y,{children:e.jsx($n,{value:R.value,onChange:R.onChange,placeholder:s("form.tags.placeholder"),className:"w-full"})}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"group_ids",render:({field:R})=>e.jsxs(p,{children:[e.jsxs(j,{className:"flex items-center justify-between",children:[s("form.groups.label"),e.jsx(Ba,{dialogTrigger:e.jsx(L,{variant:"link",children:s("form.groups.add")}),refetch:_})]}),e.jsx(y,{children:e.jsx(kt,{options:c,onChange:H=>R.onChange(H.map(I=>I.value)),value:c?.filter(H=>R.value.includes(H.value)),placeholder:s("form.groups.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:s("form.groups.empty")})})}),e.jsx(E,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:N.control,name:"host",render:({field:R})=>e.jsxs(p,{children:[e.jsx(j,{children:s("form.host.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("form.host.placeholder"),...R})}),e.jsx(E,{})]})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(v,{control:N.control,name:"port",render:({field:R})=>e.jsxs(p,{className:"flex-1",children:[e.jsxs(j,{className:"flex items-center gap-1.5",children:[s("form.port.label"),e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(Be,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(_a,{children:e.jsx(oe,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:s("form.port.tooltip")})})})]})})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(y,{children:e.jsx(P,{placeholder:s("form.port.placeholder"),...R})}),e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0 text-muted-foreground/50 hover:text-muted-foreground",onClick:()=>{const H=R.value;H&&N.setValue("server_port",H)},children:e.jsx(Be,{icon:"tabler:arrows-right",className:"size-3"})})}),e.jsx(oe,{side:"right",children:e.jsx("p",{children:s("form.port.sync")})})]})})]}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"server_port",render:({field:R})=>e.jsxs(p,{className:"flex-1",children:[e.jsxs(j,{className:"flex items-center gap-1.5",children:[s("form.server_port.label"),e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(Be,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(_a,{children:e.jsx(oe,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:s("form.server_port.tooltip")})})})]})})]}),e.jsx(y,{children:e.jsx(P,{placeholder:s("form.server_port.placeholder"),...R})}),e.jsx(E,{})]})})]})]}),r&&e.jsx(bx,{serverType:d,value:N.watch("protocol_settings"),onChange:R=>N.setValue("protocol_settings",R,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),e.jsx(v,{control:N.control,name:"parent_id",render:({field:R})=>e.jsxs(p,{children:[e.jsx(j,{children:s("form.parent.label")}),e.jsxs(J,{onValueChange:R.onChange,value:R.value?.toString()||"0",children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:s("form.parent.placeholder")})})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("form.parent.none")}),T?.map(H=>e.jsx($,{value:H.id.toString(),className:"cursor-pointer",children:H.name},H.id))]})]}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"route_ids",render:({field:R})=>e.jsxs(p,{children:[e.jsx(j,{children:s("form.route.label")}),e.jsx(y,{children:e.jsx(kt,{options:k,onChange:H=>R.onChange(H.map(I=>I.value)),value:k?.filter(H=>R.value.includes(H.value)),placeholder:s("form.route.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:s("form.route.empty")})})}),e.jsx(E,{})]})})]}),e.jsxs(Le,{className:"mt-6 flex flex-col sm:flex-row gap-2 sm:gap-0",children:[e.jsx(L,{type:"button",variant:"outline",onClick:g,className:"w-full sm:w-auto",children:s("form.cancel")}),e.jsx(L,{type:"submit",onClick:w,className:"w-full sm:w-auto",children:s("form.submit")})]})]})]})]})}function pr({column:s,title:n,options:t}){const r=s?.getFacetedUniqueValues(),a=new Set(s?.getFilterValue());return e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Ia,{className:"mr-2 h-4 w-4"}),n,a?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:a.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:a.size>2?e.jsxs(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[a.size," selected"]}):t.filter(i=>a.has(i.value)).map(i=>e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:i.label},i.value))})]})]})}),e.jsx(Ze,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Js,{children:[e.jsx(ut,{placeholder:n}),e.jsxs(Qs,{children:[e.jsx(xt,{children:"No results found."}),e.jsx(fs,{children:t.map(i=>{const l=a.has(i.value);return e.jsxs(We,{onSelect:()=>{l?a.delete(i.value):a.add(i.value);const d=Array.from(a);s?.setFilterValue(d.length?d:void 0)},className:"cursor-pointer",children:[e.jsx("div",{className:b("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",l?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ot,{className:b("h-4 w-4")})}),i.icon&&e.jsx(i.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${i.color}`}),e.jsx("span",{children:i.label}),r?.get(i.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:r.get(i.value)})]},i.value)})}),a.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(fs,{children:e.jsx(We,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center cursor-pointer",children:"Clear filters"})})]})]})]})})]})}const Nx=[{value:ce.Shadowsocks,label:js.find(s=>s.type===ce.Shadowsocks)?.label,color:is[ce.Shadowsocks]},{value:ce.Vmess,label:js.find(s=>s.type===ce.Vmess)?.label,color:is[ce.Vmess]},{value:ce.Trojan,label:js.find(s=>s.type===ce.Trojan)?.label,color:is[ce.Trojan]},{value:ce.Hysteria,label:js.find(s=>s.type===ce.Hysteria)?.label,color:is[ce.Hysteria]},{value:ce.Vless,label:js.find(s=>s.type===ce.Vless)?.label,color:is[ce.Vless]},{value:ce.Tuic,label:js.find(s=>s.type===ce.Tuic)?.label,color:is[ce.Tuic]},{value:ce.Socks,label:js.find(s=>s.type===ce.Socks)?.label,color:is[ce.Socks]},{value:ce.Naive,label:js.find(s=>s.type===ce.Naive)?.label,color:is[ce.Naive]},{value:ce.Http,label:js.find(s=>s.type===ce.Http)?.label,color:is[ce.Http]},{value:ce.Mieru,label:js.find(s=>s.type===ce.Mieru)?.label,color:is[ce.Mieru]}];function _x({table:s,saveOrder:n,isSortMode:t,groups:r}){const a=s.getState().columnFilters.length>0,{t:i}=V("server");return e.jsxs("div",{className:"flex items-center justify-between ",children:[e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[!t&&e.jsxs(e.Fragment,{children:[e.jsx(yx,{}),e.jsx(P,{placeholder:i("toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:l=>s.getColumn("name")?.setFilterValue(l.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs("div",{className:"flex gap-x-2",children:[s.getColumn("type")&&e.jsx(pr,{column:s.getColumn("type"),title:i("toolbar.type"),options:Nx}),s.getColumn("group_ids")&&e.jsx(pr,{column:s.getColumn("group_ids"),title:i("columns.groups.title"),options:r.map(l=>({label:l.name,value:l.id.toString()}))})]}),a&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[i("toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]}),t&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:i("toolbar.sort.tip")})})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:t?"default":"outline",onClick:n,size:"sm",children:i(t?"toolbar.sort.save":"toolbar.sort.edit")})})]})}const Da=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M15.71 12.71a6 6 0 1 0-7.42 0a10 10 0 0 0-6.22 8.18a1 1 0 0 0 2 .22a8 8 0 0 1 15.9 0a1 1 0 0 0 1 .89h.11a1 1 0 0 0 .88-1.1a10 10 0 0 0-6.25-8.19M12 12a4 4 0 1 1 4-4a4 4 0 0 1-4 4"})}),da={0:"bg-destructive/80 shadow-sm shadow-destructive/50",1:"bg-yellow-500/80 shadow-sm shadow-yellow-500/50",2:"bg-emerald-500/80 shadow-sm shadow-emerald-500/50"},Me=(s,n)=>n>0?Math.round(s/n*100):0,wx=s=>{const{t:n}=V("server");return[{id:"drag-handle",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.sort")}),cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(Fa,{className:"size-4 cursor-move text-muted-foreground transition-colors hover:text-primary","aria-hidden":"true"})}),size:50},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.nodeId")}),cell:({row:t})=>{const r=t.getValue("id"),a=t.original.code;return e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"group/id flex items-center space-x-2",children:[e.jsxs(U,{variant:"outline",className:b("border-2 font-medium transition-all duration-200 hover:opacity-80","flex items-center gap-1.5"),style:{borderColor:is[t.original.type]},children:[e.jsx(jl,{className:"size-3"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"flex items-center gap-0.5",children:a??r}),t.original.parent?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-muted-foreground/30",children:"→"}),e.jsx("span",{children:t.original.parent?.code||t.original.parent?.id})]}):""]})]}),e.jsx(L,{variant:"ghost",size:"icon",className:"size-5 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:text-muted-foreground group-hover/id:opacity-100",onClick:i=>{i.stopPropagation(),Ca(a||r.toString()).then(()=>{A.success(n("common:copy.success"))})},children:e.jsx(nr,{className:"size-3"})})]})}),e.jsxs(oe,{side:"top",className:"flex flex-col gap-1 p-3",children:[e.jsxs("p",{className:"font-medium",children:[js.find(i=>i.type===t.original.type)?.label,t.original.parent?" (子节点)":""]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a?"点击括号内容或复制按钮可复制节点代码":"点击复制按钮可复制节点ID"})]})]})})},size:50,enableSorting:!0},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.show")}),cell:({row:t})=>{const[r,a]=m.useState(!!t.getValue("show"));return e.jsx(Z,{checked:r,onCheckedChange:async i=>{a(i),at.update({id:t.original.id,type:t.original.type,show:i?1:0}).catch(()=>{a(!i),s()})},style:{backgroundColor:r?is[t.original.type]:void 0}})},size:50,enableSorting:!1},{accessorKey:"name",header:({column:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(z,{column:t,title:n("columns.node"),tooltip:e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-2",children:[e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:b("h-2.5 w-2.5 rounded-full",da[0])}),e.jsx("span",{className:"text-sm font-medium",children:n("columns.status.0")})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:b("h-2.5 w-2.5 rounded-full",da[1])}),e.jsx("span",{className:"text-sm font-medium",children:n("columns.status.1")})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:b("h-2.5 w-2.5 rounded-full",da[2])}),e.jsx("span",{className:"text-sm font-medium",children:n("columns.status.2")})]})]})})}),cell:({row:t})=>e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{children:e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:b("size-2.5 flex-shrink-0 rounded-full transition-all duration-200",da[t.original.available_status])}),e.jsx("span",{className:"text-left font-medium transition-colors hover:text-primary",children:t.getValue("name")})]})}),e.jsx(oe,{children:e.jsxs("div",{className:" space-y-3",children:[e.jsx("p",{className:"font-medium",children:n(`columns.status.${t.original.available_status}`)}),t.original.load_status&&e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"mb-3 text-sm font-medium",children:n("columns.loadStatus.details")}),e.jsxs("div",{className:"space-y-3 text-xs",children:[e.jsx("div",{children:e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[n("columns.loadStatus.cpu"),":"]}),e.jsxs("div",{className:"ml-2 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:b("h-full transition-all duration-300",t.original.load_status.cpu>=90?"bg-destructive":t.original.load_status.cpu>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Math.min(100,t.original.load_status.cpu)}%`}})}),e.jsxs("span",{className:b("min-w-[3rem] text-right font-semibold",t.original.load_status.cpu>=90?"text-destructive":t.original.load_status.cpu>=70?"text-yellow-600":"text-emerald-600"),children:[Math.round(t.original.load_status.cpu),"%"]})]})]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[n("columns.loadStatus.memory"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:b("h-full transition-all duration-300",Me(t.original.load_status.mem.used,t.original.load_status.mem.total)>=90?"bg-destructive":Me(t.original.load_status.mem.used,t.original.load_status.mem.total)>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Me(t.original.load_status.mem.used,t.original.load_status.mem.total)}%`}})}),e.jsxs("span",{className:b("min-w-[3rem] text-right font-semibold",Me(t.original.load_status.mem.used,t.original.load_status.mem.total)>=90?"text-destructive":Me(t.original.load_status.mem.used,t.original.load_status.mem.total)>=70?"text-yellow-600":"text-emerald-600"),children:[Me(t.original.load_status.mem.used,t.original.load_status.mem.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.mem.used)," ","/"," ",Oe(t.original.load_status.mem.total)]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[n("columns.loadStatus.swap"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:b("h-full transition-all duration-300",Me(t.original.load_status.swap.used,t.original.load_status.swap.total)>=80?"bg-destructive":Me(t.original.load_status.swap.used,t.original.load_status.swap.total)>=50?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Me(t.original.load_status.swap.used,t.original.load_status.swap.total)}%`}})}),e.jsxs("span",{className:b("min-w-[3rem] text-right font-semibold",Me(t.original.load_status.swap.used,t.original.load_status.swap.total)>=80?"text-destructive":Me(t.original.load_status.swap.used,t.original.load_status.swap.total)>=50?"text-yellow-600":"text-emerald-600"),children:[Me(t.original.load_status.swap.used,t.original.load_status.swap.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.swap.used)," ","/"," ",Oe(t.original.load_status.swap.total)]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[n("columns.loadStatus.disk"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:b("h-full transition-all duration-300",Me(t.original.load_status.disk.used,t.original.load_status.disk.total)>=90?"bg-destructive":Me(t.original.load_status.disk.used,t.original.load_status.disk.total)>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Me(t.original.load_status.disk.used,t.original.load_status.disk.total)}%`}})}),e.jsxs("span",{className:b("min-w-[3rem] text-right font-semibold",Me(t.original.load_status.disk.used,t.original.load_status.disk.total)>=90?"text-destructive":Me(t.original.load_status.disk.used,t.original.load_status.disk.total)>=70?"text-yellow-600":"text-emerald-600"),children:[Me(t.original.load_status.disk.used,t.original.load_status.disk.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.disk.used)," ","/"," ",Oe(t.original.load_status.disk.total)]})]})]})]})]})})]})}),enableSorting:!1,size:200},{accessorKey:"host",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.address")}),cell:({row:t})=>{const r=`${t.original.host}:${t.original.port}`,a=t.original.port!==t.original.server_port;return e.jsxs("div",{className:"group relative flex min-w-0 items-start",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1 gap-y-0.5 pr-7",children:[e.jsx("div",{className:"flex items-center ",children:e.jsxs("span",{className:"font-mono text-sm font-medium text-foreground/90",children:[t.original.host,":",t.original.port]})}),a&&e.jsxs("span",{className:"whitespace-nowrap text-[0.7rem] tracking-tight text-muted-foreground/40",children:["(",n("columns.internalPort")," ",t.original.server_port,")"]})]}),e.jsx("div",{className:"absolute right-0 top-0",children:e.jsx(pe,{delayDuration:0,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(L,{variant:"ghost",size:"icon",className:"size-6 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:bg-muted/50 hover:text-muted-foreground group-hover:opacity-100",onClick:i=>{i.stopPropagation(),Ca(r).then(()=>{A.success(n("common:copy.success"))})},children:e.jsx(nr,{className:"size-3"})})}),e.jsx(oe,{side:"top",sideOffset:10,children:n("columns.copyAddress")})]})})})]})},enableSorting:!1,enableHiding:!0},{accessorKey:"online",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.onlineUsers.title"),tooltip:n("columns.onlineUsers.tooltip")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(Da,{className:"size-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("online")})]}),size:80,enableSorting:!0,enableHiding:!0},{accessorKey:"rate",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.rate.title"),tooltip:n("columns.rate.tooltip")}),cell:({row:t})=>e.jsxs(U,{variant:"secondary",className:"font-medium",children:[t.getValue("rate")," x"]}),size:80,enableSorting:!1,enableHiding:!0},{accessorKey:"group_ids",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.groups.title"),tooltip:n("columns.groups.tooltip")}),cell:({row:t})=>{const r=t.original.groups||[];return e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r.map((a,i)=>e.jsx(U,{variant:"secondary",className:b("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:a.name},i)),r.length===0&&e.jsx("span",{className:"text-sm text-muted-foreground",children:n("columns.groups.empty")})]})},enableSorting:!1,filterFn:(t,r,a)=>{const i=t.getValue(r);return i?a.some(l=>i.includes(l)):!1}},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.type")}),cell:({row:t})=>{const r=t.getValue("type");return e.jsx(U,{variant:"outline",className:"border-2 font-medium transition-colors",style:{borderColor:is[r]},children:r})},enableSorting:!1,enableHiding:!0,enableColumnFilter:!1,size:8e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:n("columns.actions")}),cell:({row:t})=>{const{setIsOpen:r,setEditingServer:a,setServerType:i}=ti();return e.jsx("div",{className:"flex justify-center",children:e.jsxs(zs,{modal:!1,children:[e.jsx($s,{asChild:!0,children:e.jsx(L,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted","aria-label":n("columns.actions"),children:e.jsx(wa,{className:"size-4"})})}),e.jsxs(Ls,{align:"end",className:"w-40",children:[e.jsx(_e,{className:"cursor-pointer",onClick:()=>{i(t.original.type),a(t.original),r(!0)},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(Yc,{className:"mr-2 size-4"}),n("columns.actions_dropdown.edit")]})}),e.jsxs(_e,{className:"cursor-pointer",onClick:async()=>{at.copy({id:t.original.id}).then(({data:l})=>{l&&(A.success(n("columns.actions_dropdown.copy_success")),s())})},children:[e.jsx(Jc,{className:"mr-2 size-4"}),n("columns.actions_dropdown.copy")]}),e.jsx(rt,{}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onSelect:l=>l.preventDefault(),children:e.jsx(ps,{title:n("columns.actions_dropdown.delete.title"),description:n("columns.actions_dropdown.delete.description"),confirmText:n("columns.actions_dropdown.delete.confirm"),variant:"destructive",onConfirm:async()=>{at.drop({id:t.original.id}).then(({data:l})=>{l&&(A.success(n("columns.actions_dropdown.delete_success")),s())})},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(ds,{className:"mr-2 size-4"}),n("columns.actions_dropdown.delete.confirm")]})})})]})]})})},size:50}]};function Cx(){const[s,n]=m.useState({}),[t,r]=m.useState({"drag-handle":!1}),[a,i]=m.useState([]),[l,d]=m.useState({pageSize:500,pageIndex:0}),[u,o]=m.useState([]),[c,h]=m.useState(!1),[k,C]=m.useState({}),[S,f]=m.useState([]),{refetch:N}=ne({queryKey:["nodeList"],queryFn:async()=>{const{data:R}=await at.getList();return f(R),R}}),{data:_}=ne({queryKey:["groups"],queryFn:async()=>{const{data:R}=await mt.getList();return R}});m.useEffect(()=>{r({"drag-handle":c,show:!c,host:!c,online:!c,rate:!c,groups:!c,type:!1,actions:!c}),C({name:c?2e3:200}),d({pageSize:c?99999:500,pageIndex:0})},[c]);const T=(R,H)=>{c&&(R.dataTransfer.setData("text/plain",H.toString()),R.currentTarget.classList.add("opacity-50"))},D=(R,H)=>{if(!c)return;R.preventDefault(),R.currentTarget.classList.remove("bg-muted");const I=parseInt(R.dataTransfer.getData("text/plain"));if(I===H)return;const K=[...S],[ae]=K.splice(I,1);K.splice(H,0,ae),f(K)},g=async()=>{if(!c){h(!0);return}const R=S?.map((H,I)=>({id:H.id,order:I+1}));at.sort(R).then(()=>{A.success("排序保存成功"),h(!1),N()}).finally(()=>{h(!1)})},w=ss({data:S||[],columns:wx(N),state:{sorting:u,columnVisibility:t,rowSelection:s,columnFilters:a,columnSizing:k,pagination:l},enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:o,onColumnFiltersChange:i,onColumnVisibilityChange:r,onColumnSizingChange:C,onPaginationChange:d,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(tx,{refetch:N,children:e.jsx("div",{className:"space-y-4",children:e.jsx(xs,{table:w,toolbar:R=>e.jsx(_x,{table:R,refetch:N,saveOrder:g,isSortMode:c,groups:_||[]}),draggable:c,onDragStart:T,onDragEnd:R=>R.currentTarget.classList.remove("opacity-50"),onDragOver:R=>{R.preventDefault(),R.currentTarget.classList.add("bg-muted")},onDragLeave:R=>R.currentTarget.classList.remove("bg-muted"),onDrop:D,showPagination:!c})})})}function Sx(){const{t:s}=V("server");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("manage.title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("manage.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Cx,{})})]})]})}const kx=Object.freeze(Object.defineProperty({__proto__:null,default:Sx},Symbol.toStringTag,{value:"Module"}));function Tx({table:s,refetch:n}){const t=s.getState().columnFilters.length>0,{t:r}=V("group");return e.jsx("div",{className:"flex items-center justify-between space-x-4",children:e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsx(Ba,{refetch:n}),e.jsx(P,{placeholder:r("toolbar.searchPlaceholder"),value:s.getColumn("name")?.getFilterValue()??"",onChange:a=>s.getColumn("name")?.setFilterValue(a.target.value),className:b("h-8 w-[150px] lg:w-[250px]",t&&"border-primary/50 ring-primary/20")}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]})})}const Dx=s=>{const{t:n}=V("group");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.id")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(U,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium",children:t.getValue("name")})})},{accessorKey:"users_count",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.usersCount")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(Da,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("users_count")})]}),enableSorting:!0},{accessorKey:"server_count",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.serverCount")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(jl,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("server_count")})]}),enableSorting:!0,size:8e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:n("columns.actions")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(Ba,{defaultValues:t.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("form.edit")})]})}),e.jsx(ps,{title:n("messages.deleteConfirm"),description:n("messages.deleteDescription"),confirmText:n("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{mt.drop({id:t.original.id}).then(({data:r})=>{r&&(A.success(n("messages.updateSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:n("messages.deleteButton")})]})})]})}]};function Px(){const[s,n]=m.useState({}),[t,r]=m.useState({}),[a,i]=m.useState([]),[l,d]=m.useState([]),{data:u,refetch:o,isLoading:c}=ne({queryKey:["serverGroupList"],queryFn:async()=>{const{data:k}=await mt.getList();return k}}),h=ss({data:u||[],columns:Dx(o),state:{sorting:l,columnVisibility:t,rowSelection:s,columnFilters:a},enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:i,onColumnVisibilityChange:r,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(xs,{table:h,toolbar:k=>e.jsx(Tx,{table:k,refetch:o}),isLoading:c})}function Lx(){const{t:s}=V("group");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Px,{})})]})]})}const Rx=Object.freeze(Object.defineProperty({__proto__:null,default:Lx},Symbol.toStringTag,{value:"Module"})),Ex=s=>x.object({remarks:x.string().min(1,s("form.validation.remarks")),match:x.array(x.string()),action:x.enum(["block","dns"]),action_value:x.string().optional()});function ai({refetch:s,dialogTrigger:n,defaultValues:t={remarks:"",match:[],action:"block",action_value:""},type:r="create"}){const{t:a}=V("route"),i=we({resolver:Ce(Ex(a)),defaultValues:t,mode:"onChange"}),[l,d]=m.useState(!1);return e.jsxs(ge,{open:l,onOpenChange:d,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"})," ",e.jsx("div",{children:a("form.add")})]})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(be,{children:[e.jsx(fe,{children:a(r==="edit"?"form.edit":"form.create")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...i,children:[e.jsx(v,{control:i.control,name:"remarks",render:({field:u})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:a("form.remarks")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(P,{type:"text",placeholder:a("form.remarksPlaceholder"),...u})})}),e.jsx(E,{})]})}),e.jsx(v,{control:i.control,name:"match",render:({field:u})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:a("form.match")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(Ds,{className:"min-h-[120px]",placeholder:a("form.matchPlaceholder"),value:Array.isArray(u.value)?u.value.join(` `):"",onChange:o=>{const c=o.target.value.split(` -`);u.onChange(c)}})})}),e.jsx(E,{})]})}),e.jsx(v,{control:i.control,name:"action",render:({field:u})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.action")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsxs(J,{onValueChange:u.onChange,defaultValue:u.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("form.actionPlaceholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"block",children:a("actions.block")}),e.jsx($,{value:"dns",children:a("actions.dns")})]})]})})}),e.jsx(E,{})]})}),i.watch("action")==="dns"&&e.jsx(v,{control:i.control,name:"action_value",render:({field:u})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.dns")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(P,{type:"text",placeholder:a("form.dnsPlaceholder"),...u})})})]})}),e.jsxs(Le,{children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{variant:"outline",children:a("form.cancel")})}),e.jsx(L,{type:"submit",onClick:()=>{const u=i.getValues(),o={...u,match:Array.isArray(u.match)?u.match.filter(c=>c.trim()!==""):[]};Va.save(o).then(({data:c})=>{c&&(d(!1),s&&s(),A.success(a(r==="edit"?"messages.updateSuccess":"messages.createSuccess")),i.reset())})},children:a("form.submit")})]})]})]})]})}function Rx({table:s,refetch:n}){const t=s.getState().columnFilters.length>0,{t:r}=V("route");return e.jsx("div",{className:"flex items-center justify-between ",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[e.jsx(ai,{refetch:n}),e.jsx(P,{placeholder:r("toolbar.searchPlaceholder"),value:s.getColumn("remarks")?.getFilterValue()??"",onChange:a=>s.getColumn("remarks")?.setFilterValue(a.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]})})}function Ex({columns:s,data:n,refetch:t}){const[r,a]=m.useState({}),[i,l]=m.useState({}),[d,u]=m.useState([]),[o,c]=m.useState([]),h=ss({data:n,columns:s,state:{sorting:o,columnVisibility:i,rowSelection:r,columnFilters:d},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:u,onColumnVisibilityChange:l,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(xs,{table:h,toolbar:k=>e.jsx(Rx,{table:k,refetch:t})})}const Fx=s=>{const{t:n}=V("route"),t={block:{icon:Qc,variant:"destructive",className:"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-800"},dns:{icon:Xc,variant:"secondary",className:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800"}};return[{accessorKey:"id",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.id")}),cell:({row:r})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(U,{variant:"outline",children:r.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"remarks",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.remarks")}),cell:({row:r})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:r.original.remarks})}),enableHiding:!1,enableSorting:!1},{accessorKey:"action_value",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.action_value.title")}),cell:({row:r})=>{const a=r.original.action,i=r.original.action_value,l=r.original.match?.length||0;return e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("span",{className:"text-sm font-medium",children:a==="dns"&&i?n("columns.action_value.dns",{value:i}):a==="block"?e.jsx("span",{className:"text-destructive",children:n("columns.action_value.block")}):n("columns.action_value.direct")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n("columns.matchRules",{count:l})})]})},enableHiding:!1,enableSorting:!1,size:300},{accessorKey:"action",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.action")}),cell:({row:r})=>{const a=r.getValue("action"),i=t[a]?.icon;return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(U,{variant:t[a]?.variant||"default",className:b("flex items-center gap-1.5 px-3 py-1 capitalize",t[a]?.className),children:[i&&e.jsx(i,{className:"h-3.5 w-3.5"}),n(`actions.${a}`)]})})},enableSorting:!1,size:9e3},{id:"actions",header:()=>e.jsx("div",{className:"text-right",children:n("columns.actions")}),cell:({row:r})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(ai,{defaultValues:r.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("form.edit")})]})}),e.jsx(ps,{title:n("messages.deleteConfirm"),description:n("messages.deleteDescription"),confirmText:n("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{Va.drop({id:r.original.id}).then(({data:a})=>{a&&(A.success(n("messages.deleteSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:n("messages.deleteButton")})]})})]})}]};function Ix(){const{t:s}=V("route"),[n,t]=m.useState([]);function r(){Va.getList().then(({data:a})=>{t(a)})}return m.useEffect(()=>{r()},[]),e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Ex,{data:n,columns:Fx(r),refetch:r})})]})]})}const Vx=Object.freeze(Object.defineProperty({__proto__:null,default:Ix},Symbol.toStringTag,{value:"Module"})),ni=m.createContext(void 0);function Mx({children:s,refreshData:n}){const[t,r]=m.useState(!1),[a,i]=m.useState(null);return e.jsx(ni.Provider,{value:{isOpen:t,setIsOpen:r,editingPlan:a,setEditingPlan:i,refreshData:n},children:s})}function $n(){const s=m.useContext(ni);if(s===void 0)throw new Error("usePlanEdit must be used within a PlanEditProvider");return s}function Ox({table:s,saveOrder:n,isSortMode:t}){const{setIsOpen:r}=$n(),{t:a}=V("subscribe");return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsxs(L,{variant:"outline",className:"space-x-2",size:"sm",onClick:()=>r(!0),children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:a("plan.add")})]}),e.jsx(P,{placeholder:a("plan.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:i=>s.getColumn("name")?.setFilterValue(i.target.value),className:"h-8 w-[150px] lg:w-[250px]"})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:t?"default":"outline",onClick:n,size:"sm",children:a(t?"plan.sort.save":"plan.sort.edit")})})]})}const pr={monthly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},quarterly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},half_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},two_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},three_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},onetime:{color:"text-slate-700",bgColor:"bg-slate-100/80"},reset_traffic:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},zx=s=>{const{t:n}=V("subscribe");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:"cursor-move",children:e.jsx(Ea,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.id")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(U,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.show")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("show"),onCheckedChange:r=>{gs.update({id:t.original.id,show:r}).then(({data:a})=>{!a&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"sell",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.sell")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("sell"),onCheckedChange:r=>{gs.update({id:t.original.id,sell:r}).then(({data:a})=>{!a&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"renew",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.renew"),tooltip:n("plan.columns.renew_tooltip")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("renew"),onCheckedChange:r=>{gs.update({id:t.original.id,renew:r}).then(({data:a})=>{!a&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:t.getValue("name")})}),enableSorting:!1,enableHiding:!1,size:900},{accessorKey:"users_count",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.stats")}),cell:({row:t})=>{const r=t.getValue("users_count")||0,a=t.original.active_users_count||0,i=r>0?Math.round(a/r*100):0;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 rounded-md bg-slate-50 px-2 py-1 hover:bg-slate-100 transition-colors cursor-help",children:[e.jsx(ja,{className:"h-3.5 w-3.5 text-slate-500"}),e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r})]})}),e.jsx(ce,{side:"top",className:"max-w-xs",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"总用户数"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"所有使用该套餐的用户(包括已过期)"})]})})]})}),e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 rounded-md bg-green-50 px-2 py-1 hover:bg-green-100 transition-colors cursor-help",children:[e.jsx(Zc,{className:"h-3.5 w-3.5 text-green-600"}),e.jsx("span",{className:"text-sm font-medium text-green-700",children:a})]})}),e.jsx(ce,{side:"top",className:"max-w-xs",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"有效期内用户"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"当前仍在有效期内的活跃用户"}),r>0&&e.jsxs("p",{className:"text-xs font-medium text-green-600",children:["活跃率:",i,"%"]})]})})]})})]})},enableSorting:!0,size:120},{accessorKey:"group",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.group")}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[600px] flex-wrap items-center gap-1.5 text-nowrap",children:e.jsx(U,{variant:"secondary",className:b("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:t.getValue("group")?.name})}),enableSorting:!1,enableHiding:!1},{accessorKey:"prices",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.price")}),cell:({row:t})=>{const r=t.getValue("prices"),a=[{period:n("plan.columns.price_period.monthly"),key:"monthly",unit:n("plan.columns.price_period.unit.month")},{period:n("plan.columns.price_period.quarterly"),key:"quarterly",unit:n("plan.columns.price_period.unit.quarter")},{period:n("plan.columns.price_period.half_yearly"),key:"half_yearly",unit:n("plan.columns.price_period.unit.half_year")},{period:n("plan.columns.price_period.yearly"),key:"yearly",unit:n("plan.columns.price_period.unit.year")},{period:n("plan.columns.price_period.two_yearly"),key:"two_yearly",unit:n("plan.columns.price_period.unit.two_year")},{period:n("plan.columns.price_period.three_yearly"),key:"three_yearly",unit:n("plan.columns.price_period.unit.three_year")},{period:n("plan.columns.price_period.onetime"),key:"onetime",unit:""},{period:n("plan.columns.price_period.reset_traffic"),key:"reset_traffic",unit:n("plan.columns.price_period.unit.times")}];return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:a.map(({period:i,key:l,unit:d})=>r[l]!=null&&e.jsxs(U,{variant:"secondary",className:b("px-2 py-0.5 font-medium transition-colors text-nowrap",pr[l].color,pr[l].bgColor,"border border-border/50","hover:bg-slate-200/80"),children:[i," ¥",r[l],d]},l))})},enableSorting:!1,size:9e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:n("plan.columns.actions")}),cell:({row:t})=>{const{setIsOpen:r,setEditingPlan:a}=$n();return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",onClick:()=>{a(t.original),r(!0)},children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("plan.columns.edit")})]}),e.jsx(ps,{title:n("plan.columns.delete_confirm.title"),description:n("plan.columns.delete_confirm.description"),confirmText:n("plan.columns.delete"),variant:"destructive",onConfirm:async()=>{gs.drop({id:t.original.id}).then(({data:i})=>{i&&(A.success(n("plan.columns.delete_confirm.success")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:n("plan.columns.delete")})]})})]})}}]},$x=x.object({id:x.number().nullable(),group_id:x.union([x.number(),x.string()]).nullable().optional(),name:x.string().min(1).max(250),content:x.string().nullable().optional(),transfer_enable:x.union([x.number().min(0),x.string().min(1)]),prices:x.object({monthly:x.union([x.number(),x.string()]).nullable().optional(),quarterly:x.union([x.number(),x.string()]).nullable().optional(),half_yearly:x.union([x.number(),x.string()]).nullable().optional(),yearly:x.union([x.number(),x.string()]).nullable().optional(),two_yearly:x.union([x.number(),x.string()]).nullable().optional(),three_yearly:x.union([x.number(),x.string()]).nullable().optional(),onetime:x.union([x.number(),x.string()]).nullable().optional(),reset_traffic:x.union([x.number(),x.string()]).nullable().optional()}).default({}),speed_limit:x.union([x.number(),x.string()]).nullable().optional(),capacity_limit:x.union([x.number(),x.string()]).nullable().optional(),device_limit:x.union([x.number(),x.string()]).nullable().optional(),force_update:x.boolean().optional(),reset_traffic_method:x.number().nullable(),users_count:x.number().optional(),active_users_count:x.number().optional(),group:x.object({id:x.number(),name:x.string()}).optional()}),An=m.forwardRef(({className:s,...n},t)=>e.jsx(vl,{ref:t,className:b("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...n,children:e.jsx(ed,{className:b("flex items-center justify-center text-current"),children:e.jsx(ot,{className:"h-4 w-4"})})}));An.displayName=vl.displayName;const ma={id:null,group_id:null,name:"",content:"",transfer_enable:"",prices:{monthly:"",quarterly:"",half_yearly:"",yearly:"",two_yearly:"",three_yearly:"",onetime:"",reset_traffic:""},speed_limit:"",capacity_limit:"",device_limit:"",force_update:!1,reset_traffic_method:null},ua={monthly:{label:"月付",months:1,discount:1},quarterly:{label:"季付",months:3,discount:.95},half_yearly:{label:"半年付",months:6,discount:.9},yearly:{label:"年付",months:12,discount:.85},two_yearly:{label:"两年付",months:24,discount:.8},three_yearly:{label:"三年付",months:36,discount:.75},onetime:{label:"流量包",months:1,discount:1},reset_traffic:{label:"重置包",months:1,discount:1}},Ax=[{value:null,label:"follow_system"},{value:0,label:"monthly_first"},{value:1,label:"monthly_reset"},{value:2,label:"no_reset"},{value:3,label:"yearly_first"},{value:4,label:"yearly_reset"}];function qx(){const{isOpen:s,setIsOpen:n,editingPlan:t,setEditingPlan:r,refreshData:a}=$n(),[i,l]=m.useState(!1),{t:d}=V("subscribe"),u=we({resolver:Ce($x),defaultValues:{...ma,...t||{}},mode:"onChange"});m.useEffect(()=>{t?u.reset({...ma,...t}):u.reset(ma)},[t,u]);const o=new Tn({html:!0}),[c,h]=m.useState();async function k(){mt.getList().then(({data:f})=>{h(f)})}m.useEffect(()=>{s&&k()},[s]);const C=f=>{if(isNaN(f))return;const N=Object.entries(ua).reduce((_,[T,D])=>{const g=f*D.months*D.discount;return{..._,[T]:g.toFixed(2)}},{});u.setValue("prices",N,{shouldDirty:!0})},S=()=>{n(!1),r(null),u.reset(ma)};return e.jsx(ge,{open:s,onOpenChange:S,children:e.jsxs(de,{children:[e.jsxs(ve,{children:[e.jsx(fe,{children:d(t?"plan.form.edit_title":"plan.form.add_title")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...u,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:u.control,name:"name",render:({field:f})=>e.jsxs(p,{children:[e.jsx(j,{children:d("plan.form.name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:d("plan.form.name.placeholder"),...f})}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"group_id",render:({field:f})=>e.jsxs(p,{children:[e.jsxs(j,{className:"flex items-center justify-between",children:[d("plan.form.group.label"),e.jsx(Ka,{dialogTrigger:e.jsx(L,{variant:"link",children:d("plan.form.group.add")}),refetch:k})]}),e.jsxs(J,{value:f.value?.toString()??"",onValueChange:N=>f.onChange(N?Number(N):null),children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:d("plan.form.group.placeholder")})})}),e.jsx(Y,{children:c?.map(N=>e.jsx($,{value:N.id.toString(),children:N.name},N.id))})]}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"transfer_enable",render:({field:f})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:d("plan.form.transfer.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",min:0,placeholder:d("plan.form.transfer.placeholder"),className:"rounded-r-none",...f})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.transfer.unit")})]}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"speed_limit",render:({field:f})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:d("plan.form.speed.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",min:0,placeholder:d("plan.form.speed.placeholder"),className:"rounded-r-none",...f,value:f.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.speed.unit")})]}),e.jsx(E,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"}),e.jsx("h3",{className:"mx-4 text-sm font-medium text-gray-500 dark:text-gray-400",children:d("plan.form.price.title")}),e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(P,{type:"number",placeholder:d("plan.form.price.base_price"),className:"h-7 w-32 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500",onChange:f=>{const N=parseFloat(f.target.value);C(N)}})]}),e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>{const f=Object.keys(ua).reduce((N,_)=>({...N,[_]:""}),{});u.setValue("prices",f,{shouldDirty:!0})},children:d("plan.form.price.clear.button")})}),e.jsx(ce,{side:"top",align:"end",children:e.jsx("p",{className:"text-xs",children:d("plan.form.price.clear.tooltip")})})]})})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3",children:Object.entries(ua).filter(([f])=>!["onetime","reset_traffic"].includes(f)).map(([f,N])=>e.jsx("div",{className:"group relative rounded-md bg-card p-2 ring-1 ring-gray-200 transition-all hover:ring-primary dark:ring-gray-800",children:e.jsx(v,{control:u.control,name:`prices.${f}`,render:({field:_})=>e.jsxs(p,{children:[e.jsxs(j,{className:"text-xs font-medium text-muted-foreground",children:[d(`plan.columns.price_period.${f}`),e.jsxs("span",{className:"ml-1 text-[10px] text-gray-400",children:["(",N.months===1?d("plan.form.price.period.monthly"):d("plan.form.price.period.months",{count:N.months}),")"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:"0.00",min:0,..._,value:_.value??"",onChange:T=>_.onChange(T.target.value),className:"h-7 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500"})})]})]})})},f))}),e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:Object.entries(ua).filter(([f])=>["onetime","reset_traffic"].includes(f)).map(([f,N])=>e.jsx("div",{className:"rounded-md border border-dashed border-gray-200 bg-muted/30 p-3 dark:border-gray-700",children:e.jsx(v,{control:u.control,name:`prices.${f}`,render:({field:_})=>e.jsx(p,{children:e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"space-y-0",children:[e.jsx(j,{className:"text-xs font-medium",children:d(`plan.columns.price_period.${f}`)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:d(f==="onetime"?"plan.form.price.onetime_desc":"plan.form.price.reset_desc")})]}),e.jsxs("div",{className:"relative w-full md:w-32",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:"0.00",min:0,..._,className:"h-7 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500"})})]})]})})})},f))})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(v,{control:u.control,name:"device_limit",render:({field:f})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:d("plan.form.device.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",min:0,placeholder:d("plan.form.device.placeholder"),className:"rounded-r-none",...f,value:f.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.device.unit")})]}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"capacity_limit",render:({field:f})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:d("plan.form.capacity.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",min:0,placeholder:d("plan.form.capacity.placeholder"),className:"rounded-r-none",...f,value:f.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.capacity.unit")})]}),e.jsx(E,{})]})})]}),e.jsx(v,{control:u.control,name:"reset_traffic_method",render:({field:f})=>e.jsxs(p,{children:[e.jsx(j,{children:d("plan.form.reset_method.label")}),e.jsxs(J,{value:f.value?.toString()??"null",onValueChange:N=>f.onChange(N=="null"?null:Number(N)),children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:d("plan.form.reset_method.placeholder")})})}),e.jsx(Y,{children:Ax.map(N=>e.jsx($,{value:N.value?.toString()??"null",children:d(`plan.form.reset_method.options.${N.label}`)},N.value))})]}),e.jsx(O,{className:"text-xs",children:d("plan.form.reset_method.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"content",render:({field:f})=>{const[N,_]=m.useState(!1);return e.jsxs(p,{className:"space-y-2",children:[e.jsxs(j,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[d("plan.form.content.label"),e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(L,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>_(!N),children:N?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-4 w-4",children:[e.jsx("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z"}),e.jsx("path",{fillRule:"evenodd",d:"M.664 10.59a1.651 1.651 0 010-1.186A10.004 10.004 0 0110 3c4.257 0 7.893 2.66 9.336 6.41.147.381.146.804 0 1.186A10.004 10.004 0 0110 17c-4.257 0-7.893-2.66-9.336-6.41zM14 10a4 4 0 11-8 0 4 4 0 018 0z",clipRule:"evenodd"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-4 w-4",children:[e.jsx("path",{fillRule:"evenodd",d:"M3.28 2.22a.75.75 0 00-1.06 1.06l14.5 14.5a.75.75 0 101.06-1.06l-1.745-1.745a10.029 10.029 0 003.3-4.38 1.651 1.651 0 000-1.185A10.004 10.004 0 009.999 3a9.956 9.956 0 00-4.744 1.194L3.28 2.22zM7.752 6.69l1.092 1.092a2.5 2.5 0 013.374 3.373l1.091 1.092a4 4 0 00-5.557-5.557z",clipRule:"evenodd"}),e.jsx("path",{d:"M10.748 13.93l2.523 2.523a9.987 9.987 0 01-3.27.547c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 010-1.186A10.007 10.007 0 012.839 6.02L6.07 9.252a4 4 0 004.678 4.678z"})]})})}),e.jsx(ce,{side:"top",children:e.jsx("p",{className:"text-xs",children:d(N?"plan.form.content.preview_button.hide":"plan.form.content.preview_button.show")})})]})})]}),e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",onClick:()=>{f.onChange(d("plan.form.content.template.content"))},children:d("plan.form.content.template.button")})}),e.jsx(ce,{side:"left",align:"center",children:e.jsx("p",{className:"text-xs",children:d("plan.form.content.template.tooltip")})})]})})]}),e.jsxs("div",{className:`grid gap-4 ${N?"grid-cols-1 lg:grid-cols-2":"grid-cols-1"}`,children:[e.jsx("div",{className:"space-y-2",children:e.jsx(y,{children:e.jsx(Dn,{style:{height:"400px"},value:f.value||"",renderHTML:T=>o.render(T),onChange:({text:T})=>f.onChange(T),config:{view:{menu:!0,md:!0,html:!1},canView:{menu:!0,md:!0,html:!1,fullScreen:!1,hideMenu:!1}},placeholder:d("plan.form.content.placeholder"),className:"rounded-md border"})})}),N&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:d("plan.form.content.preview")}),e.jsx("div",{className:"prose prose-sm dark:prose-invert h-[400px] max-w-none overflow-y-auto rounded-md border p-4",children:e.jsx("div",{dangerouslySetInnerHTML:{__html:o.render(f.value||"")}})})]})]}),e.jsx(O,{className:"text-xs",children:d("plan.form.content.description")}),e.jsx(E,{})]})}})]}),e.jsx(Le,{className:"mt-6",children:e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsx("div",{className:"flex-shrink-0",children:t&&e.jsx(v,{control:u.control,name:"force_update",render:({field:f})=>e.jsxs(p,{className:"flex flex-row items-center space-x-2 space-y-0",children:[e.jsx(y,{children:e.jsx(An,{checked:f.value,onCheckedChange:f.onChange})}),e.jsx("div",{className:"",children:e.jsx(j,{className:"text-sm",children:d("plan.form.force_update.label")})})]})})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(L,{type:"button",variant:"outline",onClick:S,children:d("plan.form.submit.cancel")}),e.jsx(L,{type:"submit",disabled:i,onClick:()=>{u.handleSubmit(async f=>{l(!0),gs.save(f).then(({data:N})=>{N&&(A.success(d(t?"plan.form.submit.success.update":"plan.form.submit.success.add")),S(),a())}).finally(()=>{l(!1)})})()},children:d(i?"plan.form.submit.submitting":"plan.form.submit.submit")})]})]})})]})]})})}function Hx(){const[s,n]=m.useState({}),[t,r]=m.useState({"drag-handle":!1}),[a,i]=m.useState([]),[l,d]=m.useState([]),[u,o]=m.useState(!1),[c,h]=m.useState({pageSize:20,pageIndex:0}),[k,C]=m.useState([]),{refetch:S}=ne({queryKey:["planList"],queryFn:async()=>{const{data:D}=await gs.getList();return C(D),D}});m.useEffect(()=>{r({"drag-handle":u}),h({pageSize:u?99999:10,pageIndex:0})},[u]);const f=(D,g)=>{u&&(D.dataTransfer.setData("text/plain",g.toString()),D.currentTarget.classList.add("opacity-50"))},N=(D,g)=>{if(!u)return;D.preventDefault(),D.currentTarget.classList.remove("bg-muted");const w=parseInt(D.dataTransfer.getData("text/plain"));if(w===g)return;const R=[...k],[H]=R.splice(w,1);R.splice(g,0,H),C(R)},_=async()=>{if(!u){o(!0);return}const D=k?.map(g=>g.id);gs.sort(D).then(()=>{A.success("排序保存成功"),o(!1),S()}).finally(()=>{o(!1)})},T=ss({data:k||[],columns:zx(S),state:{sorting:l,columnVisibility:t,rowSelection:s,columnFilters:a,pagination:c},enableRowSelection:!0,onPaginationChange:h,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:i,onColumnVisibilityChange:r,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}},pageCount:u?1:void 0});return e.jsx(Mx,{refreshData:S,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(xs,{table:T,toolbar:D=>e.jsx(Ox,{table:D,refetch:S,saveOrder:_,isSortMode:u}),draggable:u,onDragStart:f,onDragEnd:D=>D.currentTarget.classList.remove("opacity-50"),onDragOver:D=>{D.preventDefault(),D.currentTarget.classList.add("bg-muted")},onDragLeave:D=>D.currentTarget.classList.remove("bg-muted"),onDrop:N,showPagination:!u}),e.jsx(qx,{})]})})}function Ux(){const{t:s}=V("subscribe");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("plan.title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("plan.page.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Hx,{})})]})]})}const Kx=Object.freeze(Object.defineProperty({__proto__:null,default:Ux},Symbol.toStringTag,{value:"Module"})),vt=[{value:le.PENDING,label:Vt[le.PENDING],icon:sd,color:Mt[le.PENDING]},{value:le.PROCESSING,label:Vt[le.PROCESSING],icon:bl,color:Mt[le.PROCESSING]},{value:le.COMPLETED,label:Vt[le.COMPLETED],icon:gn,color:Mt[le.COMPLETED]},{value:le.CANCELLED,label:Vt[le.CANCELLED],icon:yl,color:Mt[le.CANCELLED]},{value:le.DISCOUNTED,label:Vt[le.DISCOUNTED],icon:gn,color:Mt[le.DISCOUNTED]}],At=[{value:Ne.PENDING,label:ia[Ne.PENDING],icon:td,color:oa[Ne.PENDING]},{value:Ne.PROCESSING,label:ia[Ne.PROCESSING],icon:bl,color:oa[Ne.PROCESSING]},{value:Ne.VALID,label:ia[Ne.VALID],icon:gn,color:oa[Ne.VALID]},{value:Ne.INVALID,label:ia[Ne.INVALID],icon:yl,color:oa[Ne.INVALID]}];function xa({column:s,title:n,options:t}){const r=s?.getFacetedUniqueValues(),a=s?.getFilterValue(),i=Array.isArray(a)?new Set(a):a!==void 0?new Set([a]):new Set;return e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Fa,{className:"mr-2 h-4 w-4"}),n,i?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:i.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:i.size>2?e.jsxs(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[i.size," selected"]}):t.filter(l=>i.has(l.value)).map(l=>e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:l.label},l.value))})]})]})}),e.jsx(Ze,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Js,{children:[e.jsx(ut,{placeholder:n}),e.jsxs(Qs,{children:[e.jsx(xt,{children:"No results found."}),e.jsx(fs,{children:t.map(l=>{const d=i.has(l.value);return e.jsxs(We,{onSelect:()=>{const u=new Set(i);d?u.delete(l.value):u.add(l.value);const o=Array.from(u);s?.setFilterValue(o.length?o:void 0)},children:[e.jsx("div",{className:b("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",d?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ot,{className:b("h-4 w-4")})}),l.icon&&e.jsx(l.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${l.color}`}),e.jsx("span",{children:l.label}),r?.get(l.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:r.get(l.value)})]},l.value)})}),i.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(fs,{children:e.jsx(We,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const Bx=x.object({email:x.string().min(1),plan_id:x.number(),period:x.string(),total_amount:x.number()}),Gx={email:"",plan_id:0,total_amount:0,period:""};function ri({refetch:s,trigger:n,defaultValues:t}){const{t:r}=V("order"),[a,i]=m.useState(!1),l=we({resolver:Ce(Bx),defaultValues:{...Gx,...t},mode:"onChange"}),[d,u]=m.useState([]);return m.useEffect(()=>{a&&gs.getList().then(({data:o})=>{u(o)})},[a]),e.jsxs(ge,{open:a,onOpenChange:i,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:r("dialog.addOrder")})]})}),e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:r("dialog.assignOrder")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...l,children:[e.jsx(v,{control:l.control,name:"email",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dialog.fields.userEmail")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dialog.placeholders.email"),...o})})]})}),e.jsx(v,{control:l.control,name:"plan_id",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dialog.fields.subscriptionPlan")}),e.jsx(y,{children:e.jsxs(J,{value:o.value?o.value?.toString():void 0,onValueChange:c=>o.onChange(parseInt(c)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dialog.placeholders.plan")})}),e.jsx(Y,{children:d.map(c=>e.jsx($,{value:c.id.toString(),children:c.name},c.id))})]})})]})}),e.jsx(v,{control:l.control,name:"period",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dialog.fields.orderPeriod")}),e.jsx(y,{children:e.jsxs(J,{value:o.value,onValueChange:o.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dialog.placeholders.period")})}),e.jsx(Y,{children:Object.keys(pm).map(c=>e.jsx($,{value:c,children:r(`period.${c}`)},c))})]})})]})}),e.jsx(v,{control:l.control,name:"total_amount",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dialog.fields.paymentAmount")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:r("dialog.placeholders.amount"),value:o.value/100,onChange:c=>o.onChange(parseFloat(c.currentTarget.value)*100)})}),e.jsx(E,{})]})}),e.jsxs(Le,{children:[e.jsx(L,{variant:"outline",onClick:()=>i(!1),children:r("dialog.actions.cancel")}),e.jsx(L,{type:"submit",onClick:()=>{l.handleSubmit(o=>{tt.assign(o).then(({data:c})=>{c&&(s&&s(),l.reset(),i(!1),A.success(r("dialog.messages.addSuccess")))})})()},children:r("dialog.actions.confirm")})]})]})]})]})}function Wx({table:s,refetch:n}){const{t}=V("order"),r=s.getState().columnFilters.length>0,a=Object.values(Cs).filter(u=>typeof u=="number").map(u=>({label:t(`type.${Cs[u]}`),value:u,color:u===Cs.NEW?"green-500":u===Cs.RENEWAL?"blue-500":u===Cs.UPGRADE?"purple-500":"orange-500"})),i=Object.values(qe).map(u=>({label:t(`period.${u}`),value:u,color:u===qe.MONTH_PRICE?"slate-500":u===qe.QUARTER_PRICE?"cyan-500":u===qe.HALF_YEAR_PRICE?"indigo-500":u===qe.YEAR_PRICE?"violet-500":u===qe.TWO_YEAR_PRICE?"fuchsia-500":u===qe.THREE_YEAR_PRICE?"pink-500":u===qe.ONETIME_PRICE?"rose-500":"orange-500"})),l=Object.values(le).filter(u=>typeof u=="number").map(u=>({label:t(`status.${le[u]}`),value:u,icon:u===le.PENDING?vt[0].icon:u===le.PROCESSING?vt[1].icon:u===le.COMPLETED?vt[2].icon:u===le.CANCELLED?vt[3].icon:vt[4].icon,color:u===le.PENDING?"yellow-500":u===le.PROCESSING?"blue-500":u===le.COMPLETED?"green-500":u===le.CANCELLED?"red-500":"green-500"})),d=Object.values(Ne).filter(u=>typeof u=="number").map(u=>({label:t(`commission.${Ne[u]}`),value:u,icon:u===Ne.PENDING?At[0].icon:u===Ne.PROCESSING?At[1].icon:u===Ne.VALID?At[2].icon:At[3].icon,color:u===Ne.PENDING?"yellow-500":u===Ne.PROCESSING?"blue-500":u===Ne.VALID?"green-500":"red-500"}));return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ri,{refetch:n}),e.jsx(P,{placeholder:t("search.placeholder"),value:s.getColumn("trade_no")?.getFilterValue()??"",onChange:u=>s.getColumn("trade_no")?.setFilterValue(u.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2",children:[s.getColumn("type")&&e.jsx(xa,{column:s.getColumn("type"),title:t("table.columns.type"),options:a}),s.getColumn("period")&&e.jsx(xa,{column:s.getColumn("period"),title:t("table.columns.period"),options:i}),s.getColumn("status")&&e.jsx(xa,{column:s.getColumn("status"),title:t("table.columns.status"),options:l}),s.getColumn("commission_status")&&e.jsx(xa,{column:s.getColumn("commission_status"),title:t("table.columns.commissionStatus"),options:d})]}),r&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[t("actions.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]})}function Ke({label:s,value:n,className:t,valueClassName:r}){return e.jsxs("div",{className:b("flex items-center py-1.5",t),children:[e.jsx("div",{className:"w-28 shrink-0 text-sm text-muted-foreground",children:s}),e.jsx("div",{className:b("text-sm",r),children:n||"-"})]})}function Yx({status:s}){const{t:n}=V("order"),t={[le.PENDING]:"bg-yellow-100 text-yellow-800 hover:bg-yellow-100",[le.PROCESSING]:"bg-blue-100 text-blue-800 hover:bg-blue-100",[le.CANCELLED]:"bg-red-100 text-red-800 hover:bg-red-100",[le.COMPLETED]:"bg-green-100 text-green-800 hover:bg-green-100",[le.DISCOUNTED]:"bg-gray-100 text-gray-800 hover:bg-gray-100"};return e.jsx(U,{variant:"secondary",className:b("font-medium",t[s]),children:n(`status.${le[s]}`)})}function Jx({id:s,trigger:n}){const[t,r]=m.useState(!1),[a,i]=m.useState(),{t:l}=V("order");return m.useEffect(()=>{(async()=>{if(t){const{data:u}=await tt.getInfo({id:s});i(u)}})()},[t,s]),e.jsxs(ge,{onOpenChange:r,open:t,children:[e.jsx(as,{asChild:!0,children:n}),e.jsxs(de,{className:"max-w-xl",children:[e.jsxs(ve,{className:"space-y-2",children:[e.jsx(fe,{className:"text-lg font-medium",children:l("dialog.title")}),e.jsx("div",{className:"flex items-center justify-between text-sm",children:e.jsxs("div",{className:"flex items-center space-x-6",children:[e.jsxs("div",{className:"text-muted-foreground",children:[l("table.columns.tradeNo"),":",a?.trade_no]}),!!a?.status&&e.jsx(Yx,{status:a.status})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:l("dialog.basicInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{label:l("dialog.fields.userEmail"),value:a?.user?.email?e.jsxs(Ys,{to:`/user/manage?email=${a.user.email}`,className:"group inline-flex items-center gap-1 text-primary hover:underline",children:[a.user.email,e.jsx(fn,{className:"h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100"})]}):"-"}),e.jsx(Ke,{label:l("dialog.fields.orderPeriod"),value:a&&l(`period.${a.period}`)}),e.jsx(Ke,{label:l("dialog.fields.subscriptionPlan"),value:a?.plan?.name,valueClassName:"font-medium"}),e.jsx(Ke,{label:l("dialog.fields.callbackNo"),value:a?.callback_no,valueClassName:"font-mono text-xs"})]})]}),e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:l("dialog.amountInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{label:l("dialog.fields.paymentAmount"),value:Vs(a?.total_amount||0),valueClassName:"font-medium text-primary"}),e.jsx(Te,{className:"my-2"}),e.jsx(Ke,{label:l("dialog.fields.balancePayment"),value:Vs(a?.balance_amount||0)}),e.jsx(Ke,{label:l("dialog.fields.discountAmount"),value:Vs(a?.discount_amount||0),valueClassName:"text-green-600"}),e.jsx(Ke,{label:l("dialog.fields.refundAmount"),value:Vs(a?.refund_amount||0),valueClassName:"text-red-600"}),e.jsx(Ke,{label:l("dialog.fields.deductionAmount"),value:Vs(a?.surplus_amount||0)})]})]}),e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:l("dialog.timeInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{label:l("dialog.fields.createdAt"),value:me(a?.created_at),valueClassName:"font-mono text-xs"}),e.jsx(Ke,{label:l("dialog.fields.updatedAt"),value:me(a?.updated_at),valueClassName:"font-mono text-xs"})]})]}),a?.commission_status===1&&a?.commission_balance&&e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:l("dialog.commissionInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{label:l("dialog.fields.commissionStatus"),value:e.jsx(U,{variant:"secondary",className:"bg-orange-100 font-medium text-orange-800 hover:bg-orange-100",children:l("dialog.commissionStatusActive")})}),e.jsx(Ke,{label:l("dialog.fields.commissionAmount"),value:Vs(a?.commission_balance||0),valueClassName:"font-medium text-orange-600"}),a?.actual_commission_balance&&e.jsx(Ke,{label:l("dialog.fields.actualCommissionAmount"),value:Vs(a?.actual_commission_balance||0),valueClassName:"font-medium text-orange-700"}),a?.invite_user&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{className:"my-2"}),e.jsx(Ke,{label:l("dialog.fields.inviteUser"),value:e.jsxs(Ys,{to:`/user/manage?email=${a.invite_user.email}`,className:"group inline-flex items-center gap-1 text-primary hover:underline",children:[a.invite_user.email,e.jsx(fn,{className:"h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100"})]})}),e.jsx(Ke,{label:l("dialog.fields.inviteUserId"),value:a?.invite_user?.id,valueClassName:"font-mono text-xs"})]})]})]})]})]})]})}const Qx={[Cs.NEW]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Cs.RENEWAL]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Cs.UPGRADE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Cs.RESET_FLOW]:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},Xx={[qe.MONTH_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.QUARTER_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.HALF_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.TWO_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.THREE_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.ONETIME_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.RESET_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},Zx=s=>le[s],eh=s=>Ne[s],sh=s=>Cs[s],th=s=>{const{t:n}=V("order");return[{accessorKey:"trade_no",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.tradeNo")}),cell:({row:t})=>{const r=t.original.trade_no,a=r.length>6?`${r.slice(0,3)}...${r.slice(-3)}`:r;return e.jsx("div",{className:"flex items-center",children:e.jsx(Jx,{trigger:e.jsxs(G,{variant:"ghost",size:"sm",className:"flex h-8 items-center gap-1.5 px-2 font-medium text-primary transition-colors hover:bg-primary/10 hover:text-primary/80",children:[e.jsx("span",{className:"font-mono",children:a}),e.jsx(fn,{className:"h-3.5 w-3.5 opacity-70"})]}),id:t.original.id})})},enableSorting:!1,enableHiding:!1},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.type")}),cell:({row:t})=>{const r=t.getValue("type"),a=Qx[r];return e.jsx(U,{variant:"secondary",className:b("font-medium transition-colors text-nowrap",a.color,a.bgColor,"border border-border/50","hover:bg-slate-200/80"),children:n(`type.${sh(r)}`)})},enableSorting:!1,enableHiding:!1},{accessorKey:"plan.name",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.plan")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium text-foreground/90 sm:max-w-72 md:max-w-[31rem]",children:t.original.plan?.name||"-"})}),enableSorting:!1,enableHiding:!1},{accessorKey:"period",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.period")}),cell:({row:t})=>{const r=t.getValue("period"),a=Xx[r];return e.jsx(U,{variant:"secondary",className:b("font-medium transition-colors text-nowrap",a?.color,a?.bgColor,"hover:bg-opacity-80"),children:n(`period.${r}`)})},enableSorting:!1,enableHiding:!1},{accessorKey:"total_amount",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.amount")}),cell:({row:t})=>{const r=t.getValue("total_amount"),a=typeof r=="number"?(r/100).toFixed(2):"N/A";return e.jsxs("div",{className:"flex items-center font-mono text-foreground/90",children:["¥",a]})},enableSorting:!0,enableHiding:!1},{accessorKey:"status",header:({column:t})=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(z,{column:t,title:n("table.columns.status")}),e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{children:e.jsx(Ql,{className:"h-4 w-4 text-muted-foreground/70 transition-colors hover:text-muted-foreground"})}),e.jsx(ce,{side:"top",className:"max-w-[200px] text-sm",children:n("status.tooltip")})]})})]}),cell:({row:t})=>{const r=vt.find(a=>a.value===t.getValue("status"));return r?e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[r.icon&&e.jsx(r.icon,{className:`h-4 w-4 text-${r.color}`}),e.jsx("span",{className:"text-sm font-medium",children:n(`status.${Zx(r.value)}`)})]}),r.value===le.PENDING&&e.jsxs(zs,{modal:!0,children:[e.jsx($s,{asChild:!0,children:e.jsxs(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-muted/60",children:[e.jsx(_a,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:n("actions.openMenu")})]})}),e.jsxs(Ls,{align:"end",className:"w-[140px]",children:[e.jsx(_e,{className:"cursor-pointer",onClick:async()=>{await tt.markPaid({trade_no:t.original.trade_no}),s()},children:n("actions.markAsPaid")}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onClick:async()=>{await tt.makeCancel({trade_no:t.original.trade_no}),s()},children:n("actions.cancel")})]})]})]}):null},enableSorting:!0,enableHiding:!1},{accessorKey:"commission_balance",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.commission")}),cell:({row:t})=>{const r=t.getValue("commission_balance"),a=r?(r/100).toFixed(2):"-";return e.jsx("div",{className:"flex items-center font-mono text-foreground/90",children:r?`¥${a}`:"-"})},enableSorting:!0,enableHiding:!1},{accessorKey:"commission_status",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.commissionStatus")}),cell:({row:t})=>{const r=t.original.status,a=t.original.commission_balance,i=At.find(l=>l.value===t.getValue("commission_status"));return a==0||!i?e.jsx("span",{className:"text-muted-foreground",children:"-"}):e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[i.icon&&e.jsx(i.icon,{className:`h-4 w-4 text-${i.color}`}),e.jsx("span",{className:"text-sm font-medium",children:n(`commission.${eh(i.value)}`)})]}),i.value===Ne.PENDING&&r===le.COMPLETED&&e.jsxs(zs,{modal:!0,children:[e.jsx($s,{asChild:!0,children:e.jsxs(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-muted/60",children:[e.jsx(_a,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:n("actions.openMenu")})]})}),e.jsxs(Ls,{align:"end",className:"w-[120px]",children:[e.jsx(_e,{className:"cursor-pointer",onClick:async()=>{await tt.update({trade_no:t.original.trade_no,commission_status:Ne.PROCESSING}),s()},children:n("commission.PROCESSING")}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onClick:async()=>{await tt.update({trade_no:t.original.trade_no,commission_status:Ne.INVALID}),s()},children:n("commission.INVALID")})]})]})]})},enableSorting:!0,enableHiding:!1},{accessorKey:"created_at",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.createdAt")}),cell:({row:t})=>e.jsx("div",{className:"text-nowrap font-mono text-sm text-muted-foreground",children:me(t.getValue("created_at"),"YYYY/MM/DD HH:mm:ss")}),enableSorting:!0,enableHiding:!1}]};function ah(){const[s]=Nl(),[n,t]=m.useState({}),[r,a]=m.useState({}),[i,l]=m.useState([]),[d,u]=m.useState([]),[o,c]=m.useState({pageIndex:0,pageSize:20});m.useEffect(()=>{const N=Object.entries({user_id:"string",order_id:"string",commission_status:"number",status:"number",commission_balance:"string"}).map(([_,T])=>{const D=s.get(_);return D?{id:_,value:T==="number"?parseInt(D):D}:null}).filter(Boolean);N.length>0&&l(N)},[s]);const{refetch:h,data:k,isLoading:C}=ne({queryKey:["orderList",o,i,d],queryFn:()=>tt.getList({pageSize:o.pageSize,current:o.pageIndex+1,filter:i,sort:d})}),S=ss({data:k?.data??[],columns:th(h),state:{sorting:d,columnVisibility:r,rowSelection:n,columnFilters:i,pagination:o},rowCount:k?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:t,onSortingChange:u,onColumnFiltersChange:l,onColumnVisibilityChange:a,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),onPaginationChange:c,getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(xs,{table:S,toolbar:e.jsx(Wx,{table:S,refetch:h}),showPagination:!0})}function nh(){const{t:s}=V("order");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(ah,{})})]})]})}const rh=Object.freeze(Object.defineProperty({__proto__:null,default:nh},Symbol.toStringTag,{value:"Module"}));function lh({column:s,title:n,options:t}){const r=s?.getFacetedUniqueValues(),a=new Set(s?.getFilterValue());return e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Fa,{className:"mr-2 h-4 w-4"}),n,a?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:a.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:a.size>2?e.jsxs(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[a.size," selected"]}):t.filter(i=>a.has(i.value)).map(i=>e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:i.label},i.value))})]})]})}),e.jsx(Ze,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Js,{children:[e.jsx(ut,{placeholder:n}),e.jsxs(Qs,{children:[e.jsx(xt,{children:"No results found."}),e.jsx(fs,{children:t.map(i=>{const l=a.has(i.value);return e.jsxs(We,{onSelect:()=>{l?a.delete(i.value):a.add(i.value);const d=Array.from(a);s?.setFilterValue(d.length?d:void 0)},children:[e.jsx("div",{className:b("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",l?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ot,{className:b("h-4 w-4")})}),i.icon&&e.jsx(i.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${i.color}`}),e.jsx("span",{children:i.label}),r?.get(i.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:r.get(i.value)})]},i.value)})}),a.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(fs,{children:e.jsx(We,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const ih=x.object({id:x.coerce.number().nullable().optional(),name:x.string().min(1,"请输入优惠券名称"),code:x.string().nullable(),type:x.coerce.number(),value:x.coerce.number(),started_at:x.coerce.number(),ended_at:x.coerce.number(),limit_use:x.union([x.string(),x.number()]).nullable(),limit_use_with_user:x.union([x.string(),x.number()]).nullable(),generate_count:x.coerce.number().nullable().optional(),limit_plan_ids:x.array(x.coerce.number()).default([]).nullable(),limit_period:x.array(x.nativeEnum(Gt)).default([]).nullable()}).refine(s=>s.ended_at>s.started_at,{message:"结束时间必须晚于开始时间",path:["ended_at"]}),jr={name:"",code:null,type:hs.AMOUNT,value:0,started_at:Math.floor(Date.now()/1e3),ended_at:Math.floor(Date.now()/1e3)+7*24*60*60,limit_use:null,limit_use_with_user:null,limit_plan_ids:[],limit_period:[],generate_count:null},oh=[{label:"1周",days:7},{label:"2周",days:14},{label:"1个月",days:30},{label:"3个月",days:90},{label:"6个月",days:180},{label:"1年",days:365}];function li({defaultValues:s,refetch:n,type:t="create",dialogTrigger:r=null,open:a,onOpenChange:i}){const{t:l}=V("coupon"),[d,u]=m.useState(!1),o=a??d,c=i??u,[h,k]=m.useState([]),C=we({resolver:Ce(ih),defaultValues:s||jr});m.useEffect(()=>{s&&C.reset(s)},[s,C]),m.useEffect(()=>{gs.getList().then(({data:T})=>k(T))},[]);const S=T=>{if(!T)return;const D=(g,w)=>{const R=new Date(w*1e3);return g.setHours(R.getHours(),R.getMinutes(),R.getSeconds()),Math.floor(g.getTime()/1e3)};T.from&&C.setValue("started_at",D(T.from,C.watch("started_at"))),T.to&&C.setValue("ended_at",D(T.to,C.watch("ended_at")))},f=T=>{const D=new Date,g=Math.floor(D.getTime()/1e3),w=Math.floor((D.getTime()+T*24*60*60*1e3)/1e3);C.setValue("started_at",g),C.setValue("ended_at",w)},N=async T=>{const D=await Sa.save(T);if(T.generate_count&&typeof D=="string"){const g=new Blob([D],{type:"text/csv;charset=utf-8;"}),w=document.createElement("a");w.href=window.URL.createObjectURL(g),w.download=`coupons_${new Date().getTime()}.csv`,w.click(),window.URL.revokeObjectURL(w.href)}c(!1),t==="create"&&C.reset(jr),n()},_=(T,D)=>e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:D}),e.jsx(P,{type:"datetime-local",step:"1",value:me(C.watch(T),"YYYY-MM-DDTHH:mm:ss"),onChange:g=>{const w=new Date(g.target.value);C.setValue(T,Math.floor(w.getTime()/1e3))},className:"h-8 [&::-webkit-calendar-picker-indicator]:hidden"})]});return e.jsxs(ge,{open:o,onOpenChange:c,children:[r&&e.jsx(as,{asChild:!0,children:r}),e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsx(ve,{children:e.jsx(fe,{children:l(t==="create"?"form.add":"form.edit")})}),e.jsx(Se,{...C,children:e.jsxs("form",{onSubmit:C.handleSubmit(N),className:"space-y-4",children:[e.jsx(v,{control:C.control,name:"name",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.name.label")}),e.jsx(P,{placeholder:l("form.name.placeholder"),...T}),e.jsx(E,{})]})}),t==="create"&&e.jsx(v,{control:C.control,name:"generate_count",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.generateCount.label")}),e.jsx(P,{type:"number",min:0,placeholder:l("form.generateCount.placeholder"),...T,value:T.value??"",onChange:D=>T.onChange(D.target.value===""?null:parseInt(D.target.value)),className:"h-9"}),e.jsx(O,{className:"text-xs",children:l("form.generateCount.description")}),e.jsx(E,{})]})}),(!C.watch("generate_count")||C.watch("generate_count")==null)&&e.jsx(v,{control:C.control,name:"code",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.code.label")}),e.jsx(P,{placeholder:l("form.code.placeholder"),...T,value:T.value??"",className:"h-9"}),e.jsx(O,{className:"text-xs",children:l("form.code.description")}),e.jsx(E,{})]})}),e.jsxs(p,{children:[e.jsx(j,{children:l("form.type.label")}),e.jsxs("div",{className:"flex",children:[e.jsx(v,{control:C.control,name:"type",render:({field:T})=>e.jsxs(J,{value:T.value.toString(),onValueChange:D=>{const g=T.value,w=parseInt(D);T.onChange(w);const R=C.getValues("value");R&&(g===hs.AMOUNT&&w===hs.PERCENTAGE?C.setValue("value",R/100):g===hs.PERCENTAGE&&w===hs.AMOUNT&&C.setValue("value",R*100))},children:[e.jsx(W,{className:"flex-[1.2] rounded-r-none border-r-0 focus:z-10",children:e.jsx(Q,{placeholder:l("form.type.placeholder")})}),e.jsx(Y,{children:Object.entries(jm).map(([D,g])=>e.jsx($,{value:D,children:l(`table.toolbar.types.${D}`)},D))})]})}),e.jsx(v,{control:C.control,name:"value",render:({field:T})=>{const D=T.value==null?"":C.watch("type")===hs.AMOUNT&&typeof T.value=="number"?(T.value/100).toString():T.value.toString();return e.jsx(P,{type:"number",placeholder:l("form.value.placeholder"),...T,value:D,onChange:g=>{const w=g.target.value;if(w===""){T.onChange("");return}const R=parseFloat(w);isNaN(R)||T.onChange(C.watch("type")===hs.AMOUNT?Math.round(R*100):R)},step:"any",min:0,className:"flex-[2] rounded-none border-x-0 text-left"})}}),e.jsx("div",{className:"flex min-w-[40px] items-center justify-center rounded-md rounded-l-none border border-l-0 border-input bg-muted/50 px-3 font-medium text-muted-foreground",children:e.jsx("span",{children:C.watch("type")==hs.AMOUNT?"¥":"%"})})]})]}),e.jsxs(p,{children:[e.jsx(j,{children:l("form.validity.label")}),e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:b("w-full justify-start text-left font-normal",!C.watch("started_at")&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),e.jsxs("span",{className:"truncate",children:[me(C.watch("started_at"),"YYYY-MM-DD HH:mm:ss")," ",l("form.validity.to")," ",me(C.watch("ended_at"),"YYYY-MM-DD HH:mm:ss")]})]})}),e.jsxs(Ze,{className:"w-auto p-0",align:"start",children:[e.jsxs("div",{className:"border-b border-border p-3",children:[e.jsx("div",{className:"mb-2 text-sm font-medium text-muted-foreground",children:"快速设置"}),e.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-6",children:oh.map(T=>e.jsx(L,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs",onClick:()=>f(T.days),type:"button",children:T.label},T.days))})]}),e.jsx("div",{className:"hidden border-b border-border sm:block",children:e.jsx(vs,{mode:"range",selected:{from:new Date(C.watch("started_at")*1e3),to:new Date(C.watch("ended_at")*1e3)},onSelect:S,numberOfMonths:2})}),e.jsx("div",{className:"border-b border-border sm:hidden",children:e.jsx(vs,{mode:"range",selected:{from:new Date(C.watch("started_at")*1e3),to:new Date(C.watch("ended_at")*1e3)},onSelect:S,numberOfMonths:1})}),e.jsx("div",{className:"p-3",children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center",children:[_("started_at",l("table.validity.startTime")),e.jsx("div",{className:"text-center text-sm text-muted-foreground sm:mt-6",children:l("form.validity.to")}),_("ended_at",l("table.validity.endTime"))]})})]})]}),e.jsx(E,{})]}),e.jsx(v,{control:C.control,name:"limit_use",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.limitUse.label")}),e.jsx(P,{type:"number",min:0,placeholder:l("form.limitUse.placeholder"),...T,value:T.value??"",onChange:D=>T.onChange(D.target.value===""?null:parseInt(D.target.value)),className:"h-9"}),e.jsx(O,{className:"text-xs",children:l("form.limitUse.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:C.control,name:"limit_use_with_user",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.limitUseWithUser.label")}),e.jsx(P,{type:"number",min:0,placeholder:l("form.limitUseWithUser.placeholder"),...T,value:T.value??"",onChange:D=>T.onChange(D.target.value===""?null:parseInt(D.target.value)),className:"h-9"}),e.jsx(O,{className:"text-xs",children:l("form.limitUseWithUser.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:C.control,name:"limit_period",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.limitPeriod.label")}),e.jsx(kt,{options:Object.entries(Gt).filter(([D])=>isNaN(Number(D))).map(([D,g])=>({label:l(`coupon:period.${g}`),value:D})),onChange:D=>{if(D.length===0){T.onChange([]);return}const g=D.map(w=>Gt[w.value]);T.onChange(g)},value:(T.value||[]).map(D=>({label:l(`coupon:period.${D}`),value:Object.entries(Gt).find(([g,w])=>w===D)?.[0]||""})),placeholder:l("form.limitPeriod.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:l("form.limitPeriod.empty")})}),e.jsx(O,{className:"text-xs",children:l("form.limitPeriod.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:C.control,name:"limit_plan_ids",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.limitPlan.label")}),e.jsx(kt,{options:h?.map(D=>({label:D.name,value:D.id.toString()}))||[],onChange:D=>T.onChange(D.map(g=>Number(g.value))),value:(h||[]).filter(D=>(T.value||[]).includes(D.id)).map(D=>({label:D.name,value:D.id.toString()})),placeholder:l("form.limitPlan.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:l("form.limitPlan.empty")})}),e.jsx(E,{})]})}),e.jsx(Le,{children:e.jsx(L,{type:"submit",disabled:C.formState.isSubmitting,children:C.formState.isSubmitting?l("form.submit.saving"):l("form.submit.save")})})]})})]})]})}function ch({table:s,refetch:n}){const t=s.getState().columnFilters.length>0,{t:r}=V("coupon");return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(li,{refetch:n,dialogTrigger:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:r("form.add")})]})}),e.jsx(P,{placeholder:r("table.toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:a=>s.getColumn("name")?.setFilterValue(a.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),s.getColumn("type")&&e.jsx(lh,{column:s.getColumn("type"),title:r("table.toolbar.type"),options:[{value:hs.AMOUNT,label:r(`table.toolbar.types.${hs.AMOUNT}`)},{value:hs.PERCENTAGE,label:r(`table.toolbar.types.${hs.PERCENTAGE}`)}]}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("table.toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]})}const ii=m.createContext(void 0);function dh({children:s,refetch:n}){const[t,r]=m.useState(!1),[a,i]=m.useState(null),l=u=>{i(u),r(!0)},d=()=>{r(!1),i(null)};return e.jsxs(ii.Provider,{value:{isOpen:t,currentCoupon:a,openEdit:l,closeEdit:d},children:[s,a&&e.jsx(li,{defaultValues:a,refetch:n,type:"edit",open:t,onOpenChange:r})]})}function mh(){const s=m.useContext(ii);if(s===void 0)throw new Error("useCouponEdit must be used within a CouponEditProvider");return s}const uh=s=>{const{t:n}=V("coupon");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.id")}),cell:({row:t})=>e.jsx(U,{children:t.original.id}),enableSorting:!0},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.show")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.original.show,onCheckedChange:r=>{Sa.update({id:t.original.id,show:r}).then(({data:a})=>!a&&s())}}),enableSorting:!1},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{children:t.original.name})}),enableSorting:!1,size:800},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.type")}),cell:({row:t})=>e.jsx(U,{variant:"outline",children:n(`table.toolbar.types.${t.original.type}`)}),enableSorting:!0},{accessorKey:"code",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.code")}),cell:({row:t})=>e.jsx(U,{variant:"secondary",children:t.original.code}),enableSorting:!0},{accessorKey:"limit_use",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.limitUse")}),cell:({row:t})=>e.jsx(U,{variant:"outline",children:t.original.limit_use===null?n("table.validity.unlimited"):t.original.limit_use}),enableSorting:!0},{accessorKey:"limit_use_with_user",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.limitUseWithUser")}),cell:({row:t})=>e.jsx(U,{variant:"outline",children:t.original.limit_use_with_user===null?n("table.validity.noLimit"):t.original.limit_use_with_user}),enableSorting:!0},{accessorKey:"#",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.validity")}),cell:({row:t})=>{const[r,a]=m.useState(!1),i=Date.now(),l=t.original.started_at*1e3,d=t.original.ended_at*1e3,u=i>d,o=ie.jsx(z,{className:"justify-end",column:t,title:n("table.columns.actions")}),cell:({row:t})=>{const{openEdit:r}=mh();return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",onClick:()=>r(t.original),children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("table.actions.edit")})]}),e.jsx(ps,{title:n("table.actions.deleteConfirm.title"),description:n("table.actions.deleteConfirm.description"),confirmText:n("table.actions.deleteConfirm.confirmText"),variant:"destructive",onConfirm:async()=>{Sa.drop({id:t.original.id}).then(({data:a})=>{a&&(A.success("删除成功"),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:n("table.actions.delete")})]})})]})}}]};function xh(){const[s,n]=m.useState({}),[t,r]=m.useState({}),[a,i]=m.useState([]),[l,d]=m.useState([]),[u,o]=m.useState({pageIndex:0,pageSize:20}),{refetch:c,data:h}=ne({queryKey:["couponList",u,a,l],queryFn:()=>Sa.getList({pageSize:u.pageSize,current:u.pageIndex+1,filter:a,sort:l})}),k=ss({data:h?.data??[],columns:uh(c),state:{sorting:l,columnVisibility:t,rowSelection:s,columnFilters:a,pagination:u},pageCount:Math.ceil((h?.total??0)/u.pageSize),rowCount:h?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:i,onColumnVisibilityChange:r,onPaginationChange:o,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(dh,{refetch:c,children:e.jsx("div",{className:"space-y-4",children:e.jsx(xs,{table:k,toolbar:e.jsx(ch,{table:k,refetch:c})})})})}function hh(){const{t:s}=V("coupon");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(xh,{})})]})]})}const gh=Object.freeze(Object.defineProperty({__proto__:null,default:hh},Symbol.toStringTag,{value:"Module"})),fh=1,ph=1e6;let ln=0;function jh(){return ln=(ln+1)%Number.MAX_SAFE_INTEGER,ln.toString()}const on=new Map,vr=s=>{if(on.has(s))return;const n=setTimeout(()=>{on.delete(s),Wt({type:"REMOVE_TOAST",toastId:s})},ph);on.set(s,n)},vh=(s,n)=>{switch(n.type){case"ADD_TOAST":return{...s,toasts:[n.toast,...s.toasts].slice(0,fh)};case"UPDATE_TOAST":return{...s,toasts:s.toasts.map(t=>t.id===n.toast.id?{...t,...n.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=n;return t?vr(t):s.toasts.forEach(r=>{vr(r.id)}),{...s,toasts:s.toasts.map(r=>r.id===t||t===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return n.toastId===void 0?{...s,toasts:[]}:{...s,toasts:s.toasts.filter(t=>t.id!==n.toastId)}}},fa=[];let pa={toasts:[]};function Wt(s){pa=vh(pa,s),fa.forEach(n=>{n(pa)})}function bh({...s}){const n=jh(),t=a=>Wt({type:"UPDATE_TOAST",toast:{...a,id:n}}),r=()=>Wt({type:"DISMISS_TOAST",toastId:n});return Wt({type:"ADD_TOAST",toast:{...s,id:n,open:!0,onOpenChange:a=>{a||r()}}}),{id:n,dismiss:r,update:t}}function oi(){const[s,n]=m.useState(pa);return m.useEffect(()=>(fa.push(n),()=>{const t=fa.indexOf(n);t>-1&&fa.splice(t,1)}),[s]),{...s,toast:bh,dismiss:t=>Wt({type:"DISMISS_TOAST",toastId:t})}}function yh({open:s,onOpenChange:n,table:t}){const{t:r}=V("user"),{toast:a}=oi(),[i,l]=m.useState(!1),[d,u]=m.useState(""),[o,c]=m.useState(""),h=async()=>{if(!d||!o){a({title:r("messages.error"),description:r("messages.send_mail.required_fields"),variant:"destructive"});return}try{l(!0),await Ps.sendMail({subject:d,content:o,filter:t.getState().columnFilters,sort:t.getState().sorting[0]?.id,sort_type:t.getState().sorting[0]?.desc?"DESC":"ASC"}),a({title:r("messages.success"),description:r("messages.send_mail.success")}),n(!1),u(""),c("")}catch{a({title:r("messages.error"),description:r("messages.send_mail.failed"),variant:"destructive"})}finally{l(!1)}};return e.jsx(ge,{open:s,onOpenChange:n,children:e.jsxs(de,{className:"sm:max-w-[500px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:r("send_mail.title")}),e.jsx(Ve,{children:r("send_mail.description")})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"subject",className:"text-right",children:r("send_mail.subject")}),e.jsx(P,{id:"subject",value:d,onChange:k=>u(k.target.value),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"content",className:"text-right",children:r("send_mail.content")}),e.jsx(Ds,{id:"content",value:o,onChange:k=>c(k.target.value),className:"col-span-3",rows:6})]})]}),e.jsx(Le,{children:e.jsx(G,{type:"submit",onClick:h,disabled:i,children:r(i?"send_mail.sending":"send_mail.send")})})]})})}function Nh({trigger:s}){const{t:n}=V("user"),[t,r]=m.useState(!1),[a,i]=m.useState(30),{data:l,isLoading:d}=ne({queryKey:["trafficResetStats",a],queryFn:()=>Xt.getStats({days:a}),enabled:t}),u=[{title:n("traffic_reset.stats.total_resets"),value:l?.data?.total_resets||0,icon:Ut,color:"text-blue-600",bgColor:"bg-blue-100"},{title:n("traffic_reset.stats.auto_resets"),value:l?.data?.auto_resets||0,icon:pl,color:"text-green-600",bgColor:"bg-green-100"},{title:n("traffic_reset.stats.manual_resets"),value:l?.data?.manual_resets||0,icon:Ss,color:"text-orange-600",bgColor:"bg-orange-100"},{title:n("traffic_reset.stats.cron_resets"),value:l?.data?.cron_resets||0,icon:Pn,color:"text-purple-600",bgColor:"bg-purple-100"}],o=[{value:7,label:n("traffic_reset.stats.days_options.week")},{value:30,label:n("traffic_reset.stats.days_options.month")},{value:90,label:n("traffic_reset.stats.days_options.quarter")},{value:365,label:n("traffic_reset.stats.days_options.year")}];return e.jsxs(ge,{open:t,onOpenChange:r,children:[e.jsx(as,{asChild:!0,children:s}),e.jsxs(de,{className:"max-w-2xl",children:[e.jsxs(ve,{children:[e.jsxs(fe,{className:"flex items-center gap-2",children:[e.jsx(kn,{className:"h-5 w-5"}),n("traffic_reset.stats.title")]}),e.jsx(Ve,{children:n("traffic_reset.stats.description")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-medium",children:n("traffic_reset.stats.time_range")}),e.jsxs(J,{value:a.toString(),onValueChange:c=>i(Number(c)),children:[e.jsx(W,{className:"w-[180px]",children:e.jsx(Q,{})}),e.jsx(Y,{children:o.map(c=>e.jsx($,{value:c.value.toString(),children:c.label},c.value))})]})]}),d?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Yt,{className:"h-6 w-6 animate-spin"})}):e.jsx("div",{className:"grid grid-cols-2 gap-4",children:u.map((c,h)=>e.jsxs(Re,{className:"relative overflow-hidden",children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ge,{className:"text-sm font-medium text-muted-foreground",children:c.title}),e.jsx("div",{className:`rounded-lg p-2 ${c.bgColor}`,children:e.jsx(c.icon,{className:`h-4 w-4 ${c.color}`})})]}),e.jsxs(Ie,{children:[e.jsx("div",{className:"text-2xl font-bold",children:c.value.toLocaleString()}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n("traffic_reset.stats.in_period",{days:a})})]})]},h))}),l?.data&&e.jsxs(Re,{children:[e.jsxs(Fe,{children:[e.jsx(Ge,{className:"text-lg",children:n("traffic_reset.stats.breakdown")}),e.jsx(Os,{children:n("traffic_reset.stats.breakdown_description")})]}),e.jsx(Ie,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:n("traffic_reset.stats.auto_percentage")}),e.jsxs(U,{variant:"outline",className:"border-green-200 bg-green-50 text-green-700",children:[l.data.total_resets>0?(l.data.auto_resets/l.data.total_resets*100).toFixed(1):0,"%"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:n("traffic_reset.stats.manual_percentage")}),e.jsxs(U,{variant:"outline",className:"border-orange-200 bg-orange-50 text-orange-700",children:[l.data.total_resets>0?(l.data.manual_resets/l.data.total_resets*100).toFixed(1):0,"%"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:n("traffic_reset.stats.cron_percentage")}),e.jsxs(U,{variant:"outline",className:"border-purple-200 bg-purple-50 text-purple-700",children:[l.data.total_resets>0?(l.data.cron_resets/l.data.total_resets*100).toFixed(1):0,"%"]})]})]})})]})]})]})]})}const _h=x.object({email_prefix:x.string().optional(),email_suffix:x.string().min(1),password:x.string().optional(),expired_at:x.number().optional().nullable(),plan_id:x.number().nullable(),generate_count:x.number().optional().nullable(),download_csv:x.boolean().optional()}).refine(s=>s.generate_count===null?s.email_prefix!==void 0&&s.email_prefix!=="":!0,{message:"Email prefix is required when generate_count is null",path:["email_prefix"]}),wh={email_prefix:"",email_suffix:"",password:"",expired_at:null,plan_id:null,generate_count:void 0,download_csv:!1};function Ch({refetch:s}){const{t:n}=V("user"),[t,r]=m.useState(!1),a=we({resolver:Ce(_h),defaultValues:wh,mode:"onChange"}),[i,l]=m.useState([]);return m.useEffect(()=>{t&&gs.getList().then(({data:d})=>{d&&l(d)})},[t]),e.jsxs(ge,{open:t,onOpenChange:r,children:[e.jsx(as,{asChild:!0,children:e.jsxs(G,{size:"sm",variant:"outline",className:"gap-0 space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:n("generate.button")})]})}),e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:n("generate.title")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...a,children:[e.jsxs(p,{children:[e.jsx(j,{children:n("generate.form.email")}),e.jsxs("div",{className:"flex",children:[!a.watch("generate_count")&&e.jsx(v,{control:a.control,name:"email_prefix",render:({field:d})=>e.jsx(P,{className:"flex-[5] rounded-r-none",placeholder:n("generate.form.email_prefix"),...d})}),e.jsx("div",{className:`z-[-1] border border-r-0 border-input px-3 py-1 shadow-sm ${a.watch("generate_count")?"rounded-l-md":"border-l-0"}`,children:"@"}),e.jsx(v,{control:a.control,name:"email_suffix",render:({field:d})=>e.jsx(P,{className:"flex-[4] rounded-l-none",placeholder:n("generate.form.email_domain"),...d})})]})]}),e.jsx(v,{control:a.control,name:"password",render:({field:d})=>e.jsxs(p,{children:[e.jsx(j,{children:n("generate.form.password")}),e.jsx(P,{placeholder:n("generate.form.password_placeholder"),...d}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"expired_at",render:({field:d})=>e.jsxs(p,{className:"flex flex-col",children:[e.jsx(j,{children:n("generate.form.expire_time")}),e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsx(y,{children:e.jsxs(G,{variant:"outline",className:b("w-full pl-3 text-left font-normal",!d.value&&"text-muted-foreground"),children:[d.value?me(d.value):e.jsx("span",{children:n("generate.form.expire_time_placeholder")}),e.jsx(Ss,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsxs(Ze,{className:"flex w-auto flex-col space-y-2 p-2",children:[e.jsx(nd,{asChild:!0,children:e.jsx(G,{variant:"outline",className:"w-full",onClick:()=>{d.onChange(null)},children:n("generate.form.permanent")})}),e.jsx("div",{className:"rounded-md border",children:e.jsx(vs,{mode:"single",selected:d.value?new Date(d.value*1e3):void 0,onSelect:u=>{u&&d.onChange(u?.getTime()/1e3)}})})]})]})]})}),e.jsx(v,{control:a.control,name:"plan_id",render:({field:d})=>e.jsxs(p,{children:[e.jsx(j,{children:n("generate.form.subscription")}),e.jsx(y,{children:e.jsxs(J,{value:d.value?d.value.toString():"null",onValueChange:u=>d.onChange(u==="null"?null:parseInt(u)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("generate.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx($,{value:"null",children:n("generate.form.subscription_none")}),i.map(u=>e.jsx($,{value:u.id.toString(),children:u.name},u.id))]})]})})]})}),!a.watch("email_prefix")&&e.jsx(v,{control:a.control,name:"generate_count",render:({field:d})=>e.jsxs(p,{children:[e.jsx(j,{children:n("generate.form.generate_count")}),e.jsx(P,{type:"number",placeholder:n("generate.form.generate_count_placeholder"),value:d.value||"",onChange:u=>d.onChange(u.target.value?parseInt(u.target.value):null)})]})}),a.watch("generate_count")&&e.jsx(v,{control:a.control,name:"download_csv",render:({field:d})=>e.jsxs(p,{className:"flex cursor-pointer flex-row items-center space-x-2 space-y-0",children:[e.jsx(y,{children:e.jsx(An,{checked:d.value,onCheckedChange:d.onChange})}),e.jsx(j,{children:n("generate.form.download_csv")})]})})]}),e.jsxs(Le,{children:[e.jsx(G,{variant:"outline",onClick:()=>r(!1),children:n("generate.form.cancel")}),e.jsx(G,{onClick:()=>a.handleSubmit(async d=>{if(d.download_csv){const u=await Ps.generate(d);if(u&&u instanceof Blob){const o=window.URL.createObjectURL(u),c=document.createElement("a");c.href=o,c.download=`users_${new Date().getTime()}.csv`,document.body.appendChild(c),c.click(),c.remove(),window.URL.revokeObjectURL(o),A.success(n("generate.form.success")),a.reset(),s(),r(!1)}}else{const{data:u}=await Ps.generate(d);u&&(A.success(n("generate.form.success")),a.reset(),s(),r(!1))}})(),children:n("generate.form.submit")})]})]})]})}const qn=Tr,ci=Dr,Sh=Pr,di=m.forwardRef(({className:s,...n},t)=>e.jsx(Da,{className:b("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",s),...n,ref:t}));di.displayName=Da.displayName;const kh=it("fixed overflow-y-scroll z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out",{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-md",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-md"}},defaultVariants:{side:"right"}}),Ba=m.forwardRef(({side:s="right",className:n,children:t,...r},a)=>e.jsxs(Sh,{children:[e.jsx(di,{}),e.jsxs(Pa,{ref:a,className:b(kh({side:s}),n),...r,children:[e.jsxs(Nn,{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:[e.jsx(ms,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]}),t]})]}));Ba.displayName=Pa.displayName;const Ga=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",s),...n});Ga.displayName="SheetHeader";const mi=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...n});mi.displayName="SheetFooter";const Wa=m.forwardRef(({className:s,...n},t)=>e.jsx(La,{ref:t,className:b("text-lg font-semibold text-foreground",s),...n}));Wa.displayName=La.displayName;const Ya=m.forwardRef(({className:s,...n},t)=>e.jsx(Ra,{ref:t,className:b("text-sm text-muted-foreground",s),...n}));Ya.displayName=Ra.displayName;function Th({table:s,refetch:n,permissionGroups:t=[],subscriptionPlans:r=[]}){const{t:a}=V("user"),{toast:i}=oi(),l=s.getState().columnFilters.length>0,[d,u]=m.useState([]),[o,c]=m.useState(!1),[h,k]=m.useState(!1),[C,S]=m.useState(!1),[f,N]=m.useState(!1),_=async()=>{try{const ee=await Ps.dumpCSV({filter:s.getState().columnFilters,sort:s.getState().sorting[0]?.id,sort_type:s.getState().sorting[0]?.desc?"DESC":"ASC"}),te=ee;console.log(ee);const q=new Blob([te],{type:"text/csv;charset=utf-8;"}),F=window.URL.createObjectURL(q),X=document.createElement("a");X.href=F,X.setAttribute("download",`users_${new Date().toISOString()}.csv`),document.body.appendChild(X),X.click(),X.remove(),window.URL.revokeObjectURL(F),i({title:a("messages.success"),description:a("messages.export.success")})}catch{i({title:a("messages.error"),description:a("messages.export.failed"),variant:"destructive"})}},T=async()=>{try{N(!0),await Ps.batchBan({filter:s.getState().columnFilters,sort:s.getState().sorting[0]?.id,sort_type:s.getState().sorting[0]?.desc?"DESC":"ASC"}),i({title:a("messages.success"),description:a("messages.batch_ban.success")}),n()}catch{i({title:a("messages.error"),description:a("messages.batch_ban.failed"),variant:"destructive"})}finally{N(!1),S(!1)}},D=[{label:a("filter.fields.email"),value:"email",type:"text",operators:[{label:a("filter.operators.contains"),value:"contains"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.id"),value:"id",type:"number",operators:[{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.plan_id"),value:"plan_id",type:"select",operators:[{label:a("filter.operators.eq"),value:"eq"}],useOptions:!0},{label:a("filter.fields.transfer_enable"),value:"transfer_enable",type:"number",unit:"GB",operators:[{label:a("filter.operators.gt"),value:"gt"},{label:a("filter.operators.lt"),value:"lt"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.total_used"),value:"total_used",type:"number",unit:"GB",operators:[{label:a("filter.operators.gt"),value:"gt"},{label:a("filter.operators.lt"),value:"lt"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.online_count"),value:"online_count",type:"number",operators:[{label:a("filter.operators.eq"),value:"eq"},{label:a("filter.operators.gt"),value:"gt"},{label:a("filter.operators.lt"),value:"lt"}]},{label:a("filter.fields.expired_at"),value:"expired_at",type:"date",operators:[{label:a("filter.operators.lt"),value:"lt"},{label:a("filter.operators.gt"),value:"gt"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.uuid"),value:"uuid",type:"text",operators:[{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.token"),value:"token",type:"text",operators:[{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.banned"),value:"banned",type:"select",operators:[{label:a("filter.operators.eq"),value:"eq"}],options:[{label:a("filter.status.normal"),value:"0"},{label:a("filter.status.banned"),value:"1"}]},{label:a("filter.fields.remark"),value:"remarks",type:"text",operators:[{label:a("filter.operators.contains"),value:"contains"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.inviter_email"),value:"invite_user.email",type:"text",operators:[{label:a("filter.operators.contains"),value:"contains"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.invite_user_id"),value:"invite_user_id",type:"number",operators:[{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.is_admin"),value:"is_admin",type:"boolean",operators:[{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.is_staff"),value:"is_staff",type:"boolean",operators:[{label:a("filter.operators.eq"),value:"eq"}]}],g=ee=>ee*1024*1024*1024,w=ee=>ee/(1024*1024*1024),R=()=>{u([...d,{field:"",operator:"",value:""}])},H=ee=>{u(d.filter((te,q)=>q!==ee))},I=(ee,te,q)=>{const F=[...d];if(F[ee]={...F[ee],[te]:q},te==="field"){const X=D.find(Ns=>Ns.value===q);X&&(F[ee].operator=X.operators[0].value,F[ee].value=X.type==="boolean"?!1:"")}u(F)},K=(ee,te)=>{const q=D.find(F=>F.value===ee.field);if(!q)return null;switch(q.type){case"text":return e.jsx(P,{placeholder:a("filter.sheet.value"),value:ee.value,onChange:F=>I(te,"value",F.target.value)});case"number":return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(P,{type:"number",placeholder:a("filter.sheet.value_number",{unit:q.unit}),value:q.unit==="GB"?w(ee.value||0):ee.value,onChange:F=>{const X=Number(F.target.value);I(te,"value",q.unit==="GB"?g(X):X)}}),q.unit&&e.jsx("span",{className:"text-sm text-muted-foreground",children:q.unit})]});case"date":return e.jsx(vs,{mode:"single",selected:ee.value,onSelect:F=>I(te,"value",F),className:"flex flex-1 justify-center rounded-md border"});case"select":return e.jsxs(J,{value:ee.value,onValueChange:F=>I(te,"value",F),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("filter.sheet.value")})}),e.jsx(Y,{children:q.useOptions?r.map(F=>e.jsx($,{value:F.value.toString(),children:F.label},F.value)):q.options?.map(F=>e.jsx($,{value:F.value.toString(),children:F.label},F.value))})]});case"boolean":return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Z,{checked:ee.value,onCheckedChange:F=>I(te,"value",F)}),e.jsx(Ae,{children:ee.value?a("filter.boolean.true"):a("filter.boolean.false")})]});default:return null}},ae=()=>{const ee=d.filter(te=>te.field&&te.operator&&te.value!=="").map(te=>{const q=D.find(X=>X.value===te.field);let F=te.value;return te.operator==="contains"?{id:te.field,value:F}:(q?.type==="date"&&F instanceof Date&&(F=Math.floor(F.getTime()/1e3)),q?.type==="boolean"&&(F=F?1:0),{id:te.field,value:`${te.operator}:${F}`})});s.setColumnFilters(ee),c(!1)};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[e.jsx(Ch,{refetch:n}),e.jsx(P,{placeholder:a("filter.email_search"),value:s.getColumn("email")?.getFilterValue()??"",onChange:ee=>s.getColumn("email")?.setFilterValue(ee.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs(qn,{open:o,onOpenChange:c,children:[e.jsx(ci,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(rd,{className:"mr-2 h-4 w-4"}),a("filter.advanced"),d.length>0&&e.jsx(U,{variant:"secondary",className:"ml-2 rounded-sm px-1",children:d.length})]})}),e.jsxs(Ba,{className:"w-[400px] sm:w-[540px]",children:[e.jsxs(Ga,{children:[e.jsx(Wa,{children:a("filter.sheet.title")}),e.jsx(Ya,{children:a("filter.sheet.description")})]}),e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-medium",children:a("filter.sheet.conditions")}),e.jsx(L,{variant:"outline",size:"sm",onClick:R,children:a("filter.sheet.add")})]}),e.jsx(lt,{className:"h-[calc(100vh-280px)] ",children:e.jsx("div",{className:"space-y-4",children:d.map((ee,te)=>e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ae,{children:a("filter.sheet.condition",{number:te+1})}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>H(te),children:e.jsx(ms,{className:"h-4 w-4"})})]}),e.jsxs(J,{value:ee.field,onValueChange:q=>I(te,"field",q),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("filter.sheet.field")})}),e.jsx(Y,{children:e.jsx(rs,{children:D.map(q=>e.jsx($,{value:q.value,className:"cursor-pointer",children:q.label},q.value))})})]}),ee.field&&e.jsxs(J,{value:ee.operator,onValueChange:q=>I(te,"operator",q),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("filter.sheet.operator")})}),e.jsx(Y,{children:D.find(q=>q.value===ee.field)?.operators.map(q=>e.jsx($,{value:q.value,children:q.label},q.value))})]}),ee.field&&ee.operator&&K(ee,te)]},te))})}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(L,{variant:"outline",onClick:()=>{u([]),c(!1)},children:a("filter.sheet.reset")}),e.jsx(L,{onClick:ae,children:a("filter.sheet.apply")})]})]})]})]}),l&&e.jsxs(L,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),u([])},className:"h-8 px-2 lg:px-3",children:[a("filter.sheet.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]}),e.jsxs(zs,{modal:!1,children:[e.jsx($s,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:a("actions.title")})}),e.jsxs(Ls,{children:[e.jsx(_e,{onClick:()=>k(!0),children:a("actions.send_email")}),e.jsx(_e,{onClick:_,children:a("actions.export_csv")}),e.jsx(rt,{}),e.jsx(_e,{asChild:!0,children:e.jsx(Nh,{trigger:e.jsx("div",{className:"w-full cursor-pointer px-2 py-1.5 text-sm",children:a("actions.traffic_reset_stats")})})}),e.jsx(rt,{}),e.jsx(_e,{onClick:()=>S(!0),className:"text-red-600 focus:text-red-600",children:a("actions.batch_ban")})]})]})]}),e.jsx(yh,{open:h,onOpenChange:k,table:s}),e.jsx(On,{open:C,onOpenChange:S,children:e.jsxs(Oa,{children:[e.jsxs(za,{children:[e.jsx(Aa,{children:a("actions.confirm_ban.title")}),e.jsx(qa,{children:a(l?"actions.confirm_ban.filtered_description":"actions.confirm_ban.all_description")})]}),e.jsxs($a,{children:[e.jsx(Ua,{disabled:f,children:a("actions.confirm_ban.cancel")}),e.jsx(Ha,{onClick:T,disabled:f,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:a(f?"actions.confirm_ban.banning":"actions.confirm_ban.confirm")})]})]})})]})}const ui=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m17.71 11.29l-5-5a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21l-5 5a1 1 0 0 0 1.42 1.42L11 9.41V17a1 1 0 0 0 2 0V9.41l3.29 3.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42"})}),xi=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17.71 11.29a1 1 0 0 0-1.42 0L13 14.59V7a1 1 0 0 0-2 0v7.59l-3.29-3.3a1 1 0 0 0-1.42 1.42l5 5a1 1 0 0 0 .33.21a.94.94 0 0 0 .76 0a1 1 0 0 0 .33-.21l5-5a1 1 0 0 0 0-1.42"})}),Dh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17 11H9.41l3.3-3.29a1 1 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33a1 1 0 0 0 0 .76a1 1 0 0 0 .21.33l5 5a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L9.41 13H17a1 1 0 0 0 0-2"})}),Ph=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17.92 11.62a1 1 0 0 0-.21-.33l-5-5a1 1 0 0 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l5-5a1 1 0 0 0 .21-.33a1 1 0 0 0 0-.76"})}),cn=[{accessorKey:"record_at",header:"时间",cell:({row:s})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("time",{className:"text-sm text-muted-foreground",children:wd(s.original.record_at)})})},{accessorKey:"u",header:"上行流量",cell:({row:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ui,{className:"h-4 w-4 text-emerald-500"}),e.jsx("span",{className:"font-mono text-sm",children:Oe(s.original.u/parseFloat(s.original.server_rate))})]})},{accessorKey:"d",header:"下行流量",cell:({row:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(xi,{className:"h-4 w-4 text-blue-500"}),e.jsx("span",{className:"font-mono text-sm",children:Oe(s.original.d/parseFloat(s.original.server_rate))})]})},{accessorKey:"server_rate",header:"倍率",cell:({row:s})=>{const n=s.original.server_rate;return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(U,{variant:"outline",className:"font-mono",children:[n,"x"]})})}},{id:"total",header:"总计",cell:({row:s})=>{const n=s.original.u+s.original.d;return e.jsx("div",{className:"flex items-center justify-end font-mono text-sm",children:Oe(n)})}}];function hi({user_id:s,dialogTrigger:n}){const{t}=V(["traffic"]),[r,a]=m.useState(!1),[i,l]=m.useState({pageIndex:0,pageSize:20}),{data:d,isLoading:u}=ne({queryKey:["userStats",s,i,r],queryFn:()=>r?Ps.getStats({user_id:s,pageSize:i.pageSize,page:i.pageIndex+1}):null}),o=ss({data:d?.data??[],columns:cn,pageCount:Math.ceil((d?.total??0)/i.pageSize),state:{pagination:i},manualPagination:!0,getCoreRowModel:ts(),onPaginationChange:l});return e.jsxs(ge,{open:r,onOpenChange:a,children:[e.jsx(as,{asChild:!0,children:n}),e.jsxs(de,{className:"sm:max-w-[700px]",children:[e.jsx(ve,{children:e.jsx(fe,{children:t("trafficRecord.title")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-md border",children:e.jsxs(En,{children:[e.jsx(Fn,{children:o.getHeaderGroups().map(c=>e.jsx(Bs,{children:c.headers.map(h=>e.jsx(Vn,{className:b("h-10 px-2 text-xs",h.id==="total"&&"text-right"),children:h.isPlaceholder?null:ba(h.column.columnDef.header,h.getContext())},h.id))},c.id))}),e.jsx(In,{children:u?Array.from({length:i.pageSize}).map((c,h)=>e.jsx(Bs,{children:Array.from({length:cn.length}).map((k,C)=>e.jsx(_t,{className:"p-2",children:e.jsx(je,{className:"h-6 w-full"})},C))},h)):o.getRowModel().rows?.length?o.getRowModel().rows.map(c=>e.jsx(Bs,{"data-state":c.getIsSelected()&&"selected",className:"h-10",children:c.getVisibleCells().map(h=>e.jsx(_t,{className:"px-2",children:ba(h.column.columnDef.cell,h.getContext())},h.id))},c.id)):e.jsx(Bs,{children:e.jsx(_t,{colSpan:cn.length,className:"h-24 text-center",children:t("trafficRecord.noRecords")})})})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:t("trafficRecord.perPage")}),e.jsxs(J,{value:`${o.getState().pagination.pageSize}`,onValueChange:c=>{o.setPageSize(Number(c))},children:[e.jsx(W,{className:"h-8 w-[70px]",children:e.jsx(Q,{placeholder:o.getState().pagination.pageSize})}),e.jsx(Y,{side:"top",children:[10,20,30,40,50].map(c=>e.jsx($,{value:`${c}`,children:c},c))})]}),e.jsx("p",{className:"text-sm font-medium",children:t("trafficRecord.records")})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"flex w-[100px] items-center justify-center text-sm",children:t("trafficRecord.page",{current:o.getState().pagination.pageIndex+1,total:o.getPageCount()})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(G,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o.previousPage(),disabled:!o.getCanPreviousPage()||u,children:e.jsx(Dh,{className:"h-4 w-4"})}),e.jsx(G,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o.nextPage(),disabled:!o.getCanNextPage()||u,children:e.jsx(Ph,{className:"h-4 w-4"})})]})]})]})]})]})]})}function Lh({user:s,trigger:n,onSuccess:t}){const{t:r}=V("user"),[a,i]=m.useState(!1),[l,d]=m.useState(""),[u,o]=m.useState(!1),{data:c,isLoading:h}=ne({queryKey:["trafficResetHistory",s.id],queryFn:()=>Xt.getUserHistory(s.id,{limit:10}),enabled:a}),k=async()=>{try{o(!0);const{data:f}=await Xt.resetUser({user_id:s.id,reason:l.trim()||void 0});f&&(A.success(r("traffic_reset.reset_success")),i(!1),d(""),t?.())}catch(f){A.error(f?.response?.data?.message||r("traffic_reset.reset_failed"))}finally{o(!1)}},C=f=>{switch(f){case"manual":return"bg-blue-100 text-blue-800 border-blue-200";case"monthly":return"bg-green-100 text-green-800 border-green-200";case"yearly":return"bg-purple-100 text-purple-800 border-purple-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}},S=f=>{switch(f){case"manual":return"bg-orange-100 text-orange-800 border-orange-200";case"cron":return"bg-indigo-100 text-indigo-800 border-indigo-200";case"auto":return"bg-emerald-100 text-emerald-800 border-emerald-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}};return e.jsxs(ge,{open:a,onOpenChange:i,children:[e.jsx(as,{asChild:!0,children:n}),e.jsxs(de,{className:"max-w-4xl max-h-[90vh] overflow-hidden",children:[e.jsxs(ve,{children:[e.jsxs(fe,{className:"flex items-center gap-2",children:[e.jsx(Ut,{className:"h-5 w-5"}),r("traffic_reset.title")]}),e.jsx(Ve,{children:r("traffic_reset.description",{email:s.email})})]}),e.jsxs(Dt,{defaultValue:"reset",className:"w-full",children:[e.jsxs(dt,{className:"grid w-full grid-cols-2",children:[e.jsxs(Xe,{value:"reset",className:"flex items-center gap-2",children:[e.jsx(Ut,{className:"h-4 w-4"}),r("traffic_reset.tabs.reset")]}),e.jsxs(Xe,{value:"history",className:"flex items-center gap-2",children:[e.jsx(nr,{className:"h-4 w-4"}),r("traffic_reset.tabs.history")]})]}),e.jsxs(ks,{value:"reset",className:"space-y-4",children:[e.jsxs(Re,{children:[e.jsx(Fe,{className:"pb-3",children:e.jsxs(Ge,{className:"text-lg flex items-center gap-2",children:[e.jsx(_l,{className:"h-5 w-5"}),r("traffic_reset.user_info")]})}),e.jsx(Ie,{className:"space-y-3",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("columns.email")}),e.jsx("p",{className:"font-medium",children:s.email})]}),e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("columns.used_traffic")}),e.jsx("p",{className:"font-medium",children:Oe(s.total_used)})]}),e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("columns.total_traffic")}),e.jsx("p",{className:"font-medium",children:Oe(s.transfer_enable)})]}),e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("columns.expire_time")}),e.jsx("p",{className:"font-medium",children:s.expired_at?me(s.expired_at):r("columns.expire_status.permanent")})]})]})})]}),e.jsxs(Re,{className:"border-amber-200 bg-amber-50",children:[e.jsx(Fe,{className:"pb-3",children:e.jsxs(Ge,{className:"text-lg flex items-center gap-2 text-amber-800",children:[e.jsx(Ht,{className:"h-5 w-5"}),r("traffic_reset.warning.title")]})}),e.jsx(Ie,{children:e.jsxs("ul",{className:"space-y-2 text-sm text-amber-700",children:[e.jsxs("li",{children:["• ",r("traffic_reset.warning.irreversible")]}),e.jsxs("li",{children:["• ",r("traffic_reset.warning.reset_to_zero")]}),e.jsxs("li",{children:["• ",r("traffic_reset.warning.logged")]})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"reason",children:r("traffic_reset.reason.label")}),e.jsx(Ds,{id:"reason",placeholder:r("traffic_reset.reason.placeholder"),value:l,onChange:f=>d(f.target.value),className:"min-h-[80px]"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r("traffic_reset.reason.optional")})]}),e.jsxs(Le,{children:[e.jsx(G,{variant:"outline",onClick:()=>i(!1),children:r("common:cancel")}),e.jsx(G,{onClick:k,disabled:u,className:"bg-destructive hover:bg-destructive/90",children:u?e.jsxs(e.Fragment,{children:[e.jsx(Yt,{className:"mr-2 h-4 w-4 animate-spin"}),r("traffic_reset.resetting")]}):e.jsxs(e.Fragment,{children:[e.jsx(Ut,{className:"mr-2 h-4 w-4"}),r("traffic_reset.confirm_reset")]})})]})]}),e.jsx(ks,{value:"history",className:"space-y-4",children:h?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Yt,{className:"h-6 w-6 animate-spin"})}):e.jsxs("div",{className:"space-y-4",children:[c?.data?.user&&e.jsxs(Re,{children:[e.jsx(Fe,{className:"pb-3",children:e.jsx(Ge,{className:"text-lg",children:r("traffic_reset.history.summary")})}),e.jsx(Ie,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("traffic_reset.history.reset_count")}),e.jsx("p",{className:"font-medium",children:c.data.user.reset_count})]}),e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("traffic_reset.history.last_reset")}),e.jsx("p",{className:"font-medium",children:c.data.user.last_reset_at?me(c.data.user.last_reset_at):r("traffic_reset.history.never")})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("traffic_reset.history.next_reset")}),e.jsx("p",{className:"font-medium",children:c.data.user.next_reset_at?me(c.data.user.next_reset_at):r("traffic_reset.history.no_schedule")})]})]})})]}),e.jsxs(Re,{children:[e.jsxs(Fe,{className:"pb-3",children:[e.jsx(Ge,{className:"text-lg",children:r("traffic_reset.history.records")}),e.jsx(Os,{children:r("traffic_reset.history.recent_records")})]}),e.jsx(Ie,{children:e.jsx(lt,{className:"h-[300px]",children:c?.data?.history?.length?e.jsx("div",{className:"space-y-3",children:c.data.history.map((f,N)=>e.jsxs("div",{children:[e.jsx("div",{className:"flex items-start justify-between p-3 rounded-lg border bg-card",children:e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:C(f.reset_type),children:f.reset_type_name}),e.jsx(U,{variant:"outline",className:S(f.trigger_source),children:f.trigger_source_name})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsxs(Ae,{className:"text-muted-foreground flex items-center gap-1",children:[e.jsx(Pn,{className:"h-3 w-3"}),r("traffic_reset.history.reset_time")]}),e.jsx("p",{className:"font-medium",children:me(f.reset_time)})]}),e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("traffic_reset.history.traffic_cleared")}),e.jsx("p",{className:"font-medium text-destructive",children:f.old_traffic.formatted})]})]})]})}),Ne.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M5 18h4.24a1 1 0 0 0 .71-.29l6.92-6.93L19.71 8a1 1 0 0 0 0-1.42l-4.24-4.29a1 1 0 0 0-1.42 0l-2.82 2.83l-6.94 6.93a1 1 0 0 0-.29.71V17a1 1 0 0 0 1 1m9.76-13.59l2.83 2.83l-1.42 1.42l-2.83-2.83ZM6 13.17l5.93-5.93l2.83 2.83L8.83 16H6ZM21 20H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2"})}),Fh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 11h-6V5a1 1 0 0 0-2 0v6H5a1 1 0 0 0 0 2h6v6a1 1 0 0 0 2 0v-6h6a1 1 0 0 0 0-2"})}),Ih=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21 8.94a1.3 1.3 0 0 0-.06-.27v-.09a1 1 0 0 0-.19-.28l-6-6a1 1 0 0 0-.28-.19a.3.3 0 0 0-.09 0a.9.9 0 0 0-.33-.11H10a3 3 0 0 0-3 3v1H6a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3zm-6-3.53L17.59 8H16a1 1 0 0 1-1-1ZM15 19a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h1v7a3 3 0 0 0 3 3h5Zm4-4a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3v3a3 3 0 0 0 3 3h3Z"})}),br=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21 11a1 1 0 0 0-1 1a8.05 8.05 0 1 1-2.22-5.5h-2.4a1 1 0 0 0 0 2h4.53a1 1 0 0 0 1-1V3a1 1 0 0 0-2 0v1.77A10 10 0 1 0 22 12a1 1 0 0 0-1-1"})}),Vh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M9.5 10.5H12a1 1 0 0 0 0-2h-1V8a1 1 0 0 0-2 0v.55a2.5 2.5 0 0 0 .5 4.95h1a.5.5 0 0 1 0 1H8a1 1 0 0 0 0 2h1v.5a1 1 0 0 0 2 0v-.55a2.5 2.5 0 0 0-.5-4.95h-1a.5.5 0 0 1 0-1M21 12h-3V3a1 1 0 0 0-.5-.87a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0A1 1 0 0 0 2 3v16a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1M5 20a1 1 0 0 1-1-1V4.73l2 1.14a1.08 1.08 0 0 0 1 0l3-1.72l3 1.72a1.08 1.08 0 0 0 1 0l2-1.14V19a3 3 0 0 0 .18 1Zm15-1a1 1 0 0 1-2 0v-5h2Z"})}),Mh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M12.3 12.22A4.92 4.92 0 0 0 14 8.5a5 5 0 0 0-10 0a4.92 4.92 0 0 0 1.7 3.72A8 8 0 0 0 1 19.5a1 1 0 0 0 2 0a6 6 0 0 1 12 0a1 1 0 0 0 2 0a8 8 0 0 0-4.7-7.28M9 11.5a3 3 0 1 1 3-3a3 3 0 0 1-3 3m9.74.32A5 5 0 0 0 15 3.5a1 1 0 0 0 0 2a3 3 0 0 1 3 3a3 3 0 0 1-1.5 2.59a1 1 0 0 0-.5.84a1 1 0 0 0 .45.86l.39.26l.13.07a7 7 0 0 1 4 6.38a1 1 0 0 0 2 0a9 9 0 0 0-4.23-7.68"})}),Oh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 0 0-6.88 2.77V3a1 1 0 0 0-2 0v4.5a1 1 0 0 0 1 1h4.5a1 1 0 0 0 0-2h-2.4A8 8 0 1 1 4 12a1 1 0 0 0-2 0A10 10 0 1 0 12 2m0 6a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h2a1 1 0 0 0 0-2h-1V9a1 1 0 0 0-1-1"})}),zh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M20 6h-4V5a3 3 0 0 0-3-3h-2a3 3 0 0 0-3 3v1H4a1 1 0 0 0 0 2h1v11a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V8h1a1 1 0 0 0 0-2M10 5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1h-4Zm7 14a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V8h10Z"})}),$h=(s,n,t,r)=>{const{t:a}=V("user");return[{accessorKey:"is_admin",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.is_admin")}),enableSorting:!1,enableHiding:!0,filterFn:(i,l,d)=>d.includes(i.getValue(l)),size:0},{accessorKey:"is_staff",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.is_staff")}),enableSorting:!1,enableHiding:!0,filterFn:(i,l,d)=>d.includes(i.getValue(l)),size:0},{accessorKey:"id",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.id")}),cell:({row:i})=>e.jsx(U,{variant:"outline",children:i.original.id}),enableSorting:!0,enableHiding:!1},{accessorKey:"email",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.email")}),cell:({row:i})=>{const l=i.original.t||0,d=Date.now()/1e3-l<120,u=Math.floor(Date.now()/1e3-l);let o=d?a("columns.online_status.online"):l===0?a("columns.online_status.never"):a("columns.online_status.last_online",{time:me(l)});if(!d&&l!==0){const c=Math.floor(u/60),h=Math.floor(c/60),k=Math.floor(h/24);k>0?o+=` +`);u.onChange(c)}})})}),e.jsx(E,{})]})}),e.jsx(v,{control:i.control,name:"action",render:({field:u})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.action")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsxs(J,{onValueChange:u.onChange,defaultValue:u.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("form.actionPlaceholder")})}),e.jsxs(Y,{children:[e.jsx($,{value:"block",children:a("actions.block")}),e.jsx($,{value:"dns",children:a("actions.dns")})]})]})})}),e.jsx(E,{})]})}),i.watch("action")==="dns"&&e.jsx(v,{control:i.control,name:"action_value",render:({field:u})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.dns")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(P,{type:"text",placeholder:a("form.dnsPlaceholder"),...u})})})]})}),e.jsxs(Le,{children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{variant:"outline",children:a("form.cancel")})}),e.jsx(L,{type:"submit",onClick:()=>{const u=i.getValues(),o={...u,match:Array.isArray(u.match)?u.match.filter(c=>c.trim()!==""):[]};Ma.save(o).then(({data:c})=>{c&&(d(!1),s&&s(),A.success(a(r==="edit"?"messages.updateSuccess":"messages.createSuccess")),i.reset())})},children:a("form.submit")})]})]})]})]})}function Fx({table:s,refetch:n}){const t=s.getState().columnFilters.length>0,{t:r}=V("route");return e.jsx("div",{className:"flex items-center justify-between ",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[e.jsx(ai,{refetch:n}),e.jsx(P,{placeholder:r("toolbar.searchPlaceholder"),value:s.getColumn("remarks")?.getFilterValue()??"",onChange:a=>s.getColumn("remarks")?.setFilterValue(a.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]})})}function Ix({columns:s,data:n,refetch:t}){const[r,a]=m.useState({}),[i,l]=m.useState({}),[d,u]=m.useState([]),[o,c]=m.useState([]),h=ss({data:n,columns:s,state:{sorting:o,columnVisibility:i,rowSelection:r,columnFilters:d},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:u,onColumnVisibilityChange:l,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(xs,{table:h,toolbar:k=>e.jsx(Fx,{table:k,refetch:t})})}const Vx=s=>{const{t:n}=V("route"),t={block:{icon:Qc,variant:"destructive",className:"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-800"},dns:{icon:Xc,variant:"secondary",className:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800"}};return[{accessorKey:"id",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.id")}),cell:({row:r})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(U,{variant:"outline",children:r.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"remarks",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.remarks")}),cell:({row:r})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:r.original.remarks})}),enableHiding:!1,enableSorting:!1},{accessorKey:"action_value",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.action_value.title")}),cell:({row:r})=>{const a=r.original.action,i=r.original.action_value,l=r.original.match?.length||0;return e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("span",{className:"text-sm font-medium",children:a==="dns"&&i?n("columns.action_value.dns",{value:i}):a==="block"?e.jsx("span",{className:"text-destructive",children:n("columns.action_value.block")}):n("columns.action_value.direct")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n("columns.matchRules",{count:l})})]})},enableHiding:!1,enableSorting:!1,size:300},{accessorKey:"action",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.action")}),cell:({row:r})=>{const a=r.getValue("action"),i=t[a]?.icon;return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(U,{variant:t[a]?.variant||"default",className:b("flex items-center gap-1.5 px-3 py-1 capitalize",t[a]?.className),children:[i&&e.jsx(i,{className:"h-3.5 w-3.5"}),n(`actions.${a}`)]})})},enableSorting:!1,size:9e3},{id:"actions",header:()=>e.jsx("div",{className:"text-right",children:n("columns.actions")}),cell:({row:r})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(ai,{defaultValues:r.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("form.edit")})]})}),e.jsx(ps,{title:n("messages.deleteConfirm"),description:n("messages.deleteDescription"),confirmText:n("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{Ma.drop({id:r.original.id}).then(({data:a})=>{a&&(A.success(n("messages.deleteSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:n("messages.deleteButton")})]})})]})}]};function Mx(){const{t:s}=V("route"),[n,t]=m.useState([]);function r(){Ma.getList().then(({data:a})=>{t(a)})}return m.useEffect(()=>{r()},[]),e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Ix,{data:n,columns:Vx(r),refetch:r})})]})]})}const Ox=Object.freeze(Object.defineProperty({__proto__:null,default:Mx},Symbol.toStringTag,{value:"Module"})),ni=m.createContext(void 0);function zx({children:s,refreshData:n}){const[t,r]=m.useState(!1),[a,i]=m.useState(null);return e.jsx(ni.Provider,{value:{isOpen:t,setIsOpen:r,editingPlan:a,setEditingPlan:i,refreshData:n},children:s})}function An(){const s=m.useContext(ni);if(s===void 0)throw new Error("usePlanEdit must be used within a PlanEditProvider");return s}function $x({table:s,saveOrder:n,isSortMode:t}){const{setIsOpen:r}=An(),{t:a}=V("subscribe");return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsxs(L,{variant:"outline",className:"space-x-2",size:"sm",onClick:()=>r(!0),children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:a("plan.add")})]}),e.jsx(P,{placeholder:a("plan.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:i=>s.getColumn("name")?.setFilterValue(i.target.value),className:"h-8 w-[150px] lg:w-[250px]"})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:t?"default":"outline",onClick:n,size:"sm",children:a(t?"plan.sort.save":"plan.sort.edit")})})]})}const jr={monthly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},quarterly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},half_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},two_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},three_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},onetime:{color:"text-slate-700",bgColor:"bg-slate-100/80"},reset_traffic:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},Ax=s=>{const{t:n}=V("subscribe");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:"cursor-move",children:e.jsx(Fa,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.id")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(U,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.show")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("show"),onCheckedChange:r=>{gs.update({id:t.original.id,show:r}).then(({data:a})=>{!a&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"sell",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.sell")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("sell"),onCheckedChange:r=>{gs.update({id:t.original.id,sell:r}).then(({data:a})=>{!a&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"renew",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.renew"),tooltip:n("plan.columns.renew_tooltip")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("renew"),onCheckedChange:r=>{gs.update({id:t.original.id,renew:r}).then(({data:a})=>{!a&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:t.getValue("name")})}),enableSorting:!1,enableHiding:!1,size:900},{accessorKey:"users_count",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.stats")}),cell:({row:t})=>{const r=t.getValue("users_count")||0,a=t.original.active_users_count||0,i=r>0?Math.round(a/r*100):0;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 rounded-md bg-slate-50 px-2 py-1 hover:bg-slate-100 transition-colors cursor-help",children:[e.jsx(ja,{className:"h-3.5 w-3.5 text-slate-500"}),e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r})]})}),e.jsx(oe,{side:"top",className:"max-w-xs",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"总用户数"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"所有使用该套餐的用户(包括已过期)"})]})})]})}),e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 rounded-md bg-green-50 px-2 py-1 hover:bg-green-100 transition-colors cursor-help",children:[e.jsx(Zc,{className:"h-3.5 w-3.5 text-green-600"}),e.jsx("span",{className:"text-sm font-medium text-green-700",children:a})]})}),e.jsx(oe,{side:"top",className:"max-w-xs",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"有效期内用户"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"当前仍在有效期内的活跃用户"}),r>0&&e.jsxs("p",{className:"text-xs font-medium text-green-600",children:["活跃率:",i,"%"]})]})})]})})]})},enableSorting:!0,size:120},{accessorKey:"group",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.group")}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[600px] flex-wrap items-center gap-1.5 text-nowrap",children:e.jsx(U,{variant:"secondary",className:b("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:t.getValue("group")?.name})}),enableSorting:!1,enableHiding:!1},{accessorKey:"prices",header:({column:t})=>e.jsx(z,{column:t,title:n("plan.columns.price")}),cell:({row:t})=>{const r=t.getValue("prices"),a=[{period:n("plan.columns.price_period.monthly"),key:"monthly",unit:n("plan.columns.price_period.unit.month")},{period:n("plan.columns.price_period.quarterly"),key:"quarterly",unit:n("plan.columns.price_period.unit.quarter")},{period:n("plan.columns.price_period.half_yearly"),key:"half_yearly",unit:n("plan.columns.price_period.unit.half_year")},{period:n("plan.columns.price_period.yearly"),key:"yearly",unit:n("plan.columns.price_period.unit.year")},{period:n("plan.columns.price_period.two_yearly"),key:"two_yearly",unit:n("plan.columns.price_period.unit.two_year")},{period:n("plan.columns.price_period.three_yearly"),key:"three_yearly",unit:n("plan.columns.price_period.unit.three_year")},{period:n("plan.columns.price_period.onetime"),key:"onetime",unit:""},{period:n("plan.columns.price_period.reset_traffic"),key:"reset_traffic",unit:n("plan.columns.price_period.unit.times")}];return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:a.map(({period:i,key:l,unit:d})=>r[l]!=null&&e.jsxs(U,{variant:"secondary",className:b("px-2 py-0.5 font-medium transition-colors text-nowrap",jr[l].color,jr[l].bgColor,"border border-border/50","hover:bg-slate-200/80"),children:[i," ¥",r[l],d]},l))})},enableSorting:!1,size:9e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:n("plan.columns.actions")}),cell:({row:t})=>{const{setIsOpen:r,setEditingPlan:a}=An();return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",onClick:()=>{a(t.original),r(!0)},children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("plan.columns.edit")})]}),e.jsx(ps,{title:n("plan.columns.delete_confirm.title"),description:n("plan.columns.delete_confirm.description"),confirmText:n("plan.columns.delete"),variant:"destructive",onConfirm:async()=>{gs.drop({id:t.original.id}).then(({data:i})=>{i&&(A.success(n("plan.columns.delete_confirm.success")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:n("plan.columns.delete")})]})})]})}}]},qx=x.object({id:x.number().nullable(),group_id:x.union([x.number(),x.string()]).nullable().optional(),name:x.string().min(1).max(250),content:x.string().nullable().optional(),transfer_enable:x.union([x.number().min(0),x.string().min(1)]),prices:x.object({monthly:x.union([x.number(),x.string()]).nullable().optional(),quarterly:x.union([x.number(),x.string()]).nullable().optional(),half_yearly:x.union([x.number(),x.string()]).nullable().optional(),yearly:x.union([x.number(),x.string()]).nullable().optional(),two_yearly:x.union([x.number(),x.string()]).nullable().optional(),three_yearly:x.union([x.number(),x.string()]).nullable().optional(),onetime:x.union([x.number(),x.string()]).nullable().optional(),reset_traffic:x.union([x.number(),x.string()]).nullable().optional()}).default({}),speed_limit:x.union([x.number(),x.string()]).nullable().optional(),capacity_limit:x.union([x.number(),x.string()]).nullable().optional(),device_limit:x.union([x.number(),x.string()]).nullable().optional(),force_update:x.boolean().optional(),reset_traffic_method:x.number().nullable(),users_count:x.number().optional(),active_users_count:x.number().optional(),group:x.object({id:x.number(),name:x.string()}).optional()}),qn=m.forwardRef(({className:s,...n},t)=>e.jsx(vl,{ref:t,className:b("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...n,children:e.jsx(ed,{className:b("flex items-center justify-center text-current"),children:e.jsx(ot,{className:"h-4 w-4"})})}));qn.displayName=vl.displayName;const ma={id:null,group_id:null,name:"",content:"",transfer_enable:"",prices:{monthly:"",quarterly:"",half_yearly:"",yearly:"",two_yearly:"",three_yearly:"",onetime:"",reset_traffic:""},speed_limit:"",capacity_limit:"",device_limit:"",force_update:!1,reset_traffic_method:null},ua={monthly:{label:"月付",months:1,discount:1},quarterly:{label:"季付",months:3,discount:.95},half_yearly:{label:"半年付",months:6,discount:.9},yearly:{label:"年付",months:12,discount:.85},two_yearly:{label:"两年付",months:24,discount:.8},three_yearly:{label:"三年付",months:36,discount:.75},onetime:{label:"流量包",months:1,discount:1},reset_traffic:{label:"重置包",months:1,discount:1}},Hx=[{value:null,label:"follow_system"},{value:0,label:"monthly_first"},{value:1,label:"monthly_reset"},{value:2,label:"no_reset"},{value:3,label:"yearly_first"},{value:4,label:"yearly_reset"}];function Ux(){const{isOpen:s,setIsOpen:n,editingPlan:t,setEditingPlan:r,refreshData:a}=An(),[i,l]=m.useState(!1),{t:d}=V("subscribe"),u=we({resolver:Ce(qx),defaultValues:{...ma,...t||{}},mode:"onChange"});m.useEffect(()=>{t?u.reset({...ma,...t}):u.reset(ma)},[t,u]);const o=new Dn({html:!0}),[c,h]=m.useState();async function k(){mt.getList().then(({data:f})=>{h(f)})}m.useEffect(()=>{s&&k()},[s]);const C=f=>{if(isNaN(f))return;const N=Object.entries(ua).reduce((_,[T,D])=>{const g=f*D.months*D.discount;return{..._,[T]:g.toFixed(2)}},{});u.setValue("prices",N,{shouldDirty:!0})},S=()=>{n(!1),r(null),u.reset(ma)};return e.jsx(ge,{open:s,onOpenChange:S,children:e.jsxs(ue,{children:[e.jsxs(be,{children:[e.jsx(fe,{children:d(t?"plan.form.edit_title":"plan.form.add_title")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...u,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:u.control,name:"name",render:({field:f})=>e.jsxs(p,{children:[e.jsx(j,{children:d("plan.form.name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:d("plan.form.name.placeholder"),...f})}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"group_id",render:({field:f})=>e.jsxs(p,{children:[e.jsxs(j,{className:"flex items-center justify-between",children:[d("plan.form.group.label"),e.jsx(Ba,{dialogTrigger:e.jsx(L,{variant:"link",children:d("plan.form.group.add")}),refetch:k})]}),e.jsxs(J,{value:f.value?.toString()??"",onValueChange:N=>f.onChange(N?Number(N):null),children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:d("plan.form.group.placeholder")})})}),e.jsx(Y,{children:c?.map(N=>e.jsx($,{value:N.id.toString(),children:N.name},N.id))})]}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"transfer_enable",render:({field:f})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:d("plan.form.transfer.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",min:0,placeholder:d("plan.form.transfer.placeholder"),className:"rounded-r-none",...f})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.transfer.unit")})]}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"speed_limit",render:({field:f})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:d("plan.form.speed.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",min:0,placeholder:d("plan.form.speed.placeholder"),className:"rounded-r-none",...f,value:f.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.speed.unit")})]}),e.jsx(E,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"}),e.jsx("h3",{className:"mx-4 text-sm font-medium text-gray-500 dark:text-gray-400",children:d("plan.form.price.title")}),e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(P,{type:"number",placeholder:d("plan.form.price.base_price"),className:"h-7 w-32 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500",onChange:f=>{const N=parseFloat(f.target.value);C(N)}})]}),e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>{const f=Object.keys(ua).reduce((N,_)=>({...N,[_]:""}),{});u.setValue("prices",f,{shouldDirty:!0})},children:d("plan.form.price.clear.button")})}),e.jsx(oe,{side:"top",align:"end",children:e.jsx("p",{className:"text-xs",children:d("plan.form.price.clear.tooltip")})})]})})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3",children:Object.entries(ua).filter(([f])=>!["onetime","reset_traffic"].includes(f)).map(([f,N])=>e.jsx("div",{className:"group relative rounded-md bg-card p-2 ring-1 ring-gray-200 transition-all hover:ring-primary dark:ring-gray-800",children:e.jsx(v,{control:u.control,name:`prices.${f}`,render:({field:_})=>e.jsxs(p,{children:[e.jsxs(j,{className:"text-xs font-medium text-muted-foreground",children:[d(`plan.columns.price_period.${f}`),e.jsxs("span",{className:"ml-1 text-[10px] text-gray-400",children:["(",N.months===1?d("plan.form.price.period.monthly"):d("plan.form.price.period.months",{count:N.months}),")"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:"0.00",min:0,..._,value:_.value??"",onChange:T=>_.onChange(T.target.value),className:"h-7 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500"})})]})]})})},f))}),e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:Object.entries(ua).filter(([f])=>["onetime","reset_traffic"].includes(f)).map(([f,N])=>e.jsx("div",{className:"rounded-md border border-dashed border-gray-200 bg-muted/30 p-3 dark:border-gray-700",children:e.jsx(v,{control:u.control,name:`prices.${f}`,render:({field:_})=>e.jsx(p,{children:e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"space-y-0",children:[e.jsx(j,{className:"text-xs font-medium",children:d(`plan.columns.price_period.${f}`)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:d(f==="onetime"?"plan.form.price.onetime_desc":"plan.form.price.reset_desc")})]}),e.jsxs("div",{className:"relative w-full md:w-32",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:"0.00",min:0,..._,className:"h-7 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500"})})]})]})})})},f))})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(v,{control:u.control,name:"device_limit",render:({field:f})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:d("plan.form.device.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",min:0,placeholder:d("plan.form.device.placeholder"),className:"rounded-r-none",...f,value:f.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.device.unit")})]}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"capacity_limit",render:({field:f})=>e.jsxs(p,{className:"flex-1",children:[e.jsx(j,{children:d("plan.form.capacity.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(P,{type:"number",min:0,placeholder:d("plan.form.capacity.placeholder"),className:"rounded-r-none",...f,value:f.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.capacity.unit")})]}),e.jsx(E,{})]})})]}),e.jsx(v,{control:u.control,name:"reset_traffic_method",render:({field:f})=>e.jsxs(p,{children:[e.jsx(j,{children:d("plan.form.reset_method.label")}),e.jsxs(J,{value:f.value?.toString()??"null",onValueChange:N=>f.onChange(N=="null"?null:Number(N)),children:[e.jsx(y,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:d("plan.form.reset_method.placeholder")})})}),e.jsx(Y,{children:Hx.map(N=>e.jsx($,{value:N.value?.toString()??"null",children:d(`plan.form.reset_method.options.${N.label}`)},N.value))})]}),e.jsx(O,{className:"text-xs",children:d("plan.form.reset_method.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:u.control,name:"content",render:({field:f})=>{const[N,_]=m.useState(!1);return e.jsxs(p,{className:"space-y-2",children:[e.jsxs(j,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[d("plan.form.content.label"),e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(L,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>_(!N),children:N?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-4 w-4",children:[e.jsx("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z"}),e.jsx("path",{fillRule:"evenodd",d:"M.664 10.59a1.651 1.651 0 010-1.186A10.004 10.004 0 0110 3c4.257 0 7.893 2.66 9.336 6.41.147.381.146.804 0 1.186A10.004 10.004 0 0110 17c-4.257 0-7.893-2.66-9.336-6.41zM14 10a4 4 0 11-8 0 4 4 0 018 0z",clipRule:"evenodd"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-4 w-4",children:[e.jsx("path",{fillRule:"evenodd",d:"M3.28 2.22a.75.75 0 00-1.06 1.06l14.5 14.5a.75.75 0 101.06-1.06l-1.745-1.745a10.029 10.029 0 003.3-4.38 1.651 1.651 0 000-1.185A10.004 10.004 0 009.999 3a9.956 9.956 0 00-4.744 1.194L3.28 2.22zM7.752 6.69l1.092 1.092a2.5 2.5 0 013.374 3.373l1.091 1.092a4 4 0 00-5.557-5.557z",clipRule:"evenodd"}),e.jsx("path",{d:"M10.748 13.93l2.523 2.523a9.987 9.987 0 01-3.27.547c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 010-1.186A10.007 10.007 0 012.839 6.02L6.07 9.252a4 4 0 004.678 4.678z"})]})})}),e.jsx(oe,{side:"top",children:e.jsx("p",{className:"text-xs",children:d(N?"plan.form.content.preview_button.hide":"plan.form.content.preview_button.show")})})]})})]}),e.jsx(pe,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",onClick:()=>{f.onChange(d("plan.form.content.template.content"))},children:d("plan.form.content.template.button")})}),e.jsx(oe,{side:"left",align:"center",children:e.jsx("p",{className:"text-xs",children:d("plan.form.content.template.tooltip")})})]})})]}),e.jsxs("div",{className:`grid gap-4 ${N?"grid-cols-1 lg:grid-cols-2":"grid-cols-1"}`,children:[e.jsx("div",{className:"space-y-2",children:e.jsx(y,{children:e.jsx(Pn,{style:{height:"400px"},value:f.value||"",renderHTML:T=>o.render(T),onChange:({text:T})=>f.onChange(T),config:{view:{menu:!0,md:!0,html:!1},canView:{menu:!0,md:!0,html:!1,fullScreen:!1,hideMenu:!1}},placeholder:d("plan.form.content.placeholder"),className:"rounded-md border"})})}),N&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:d("plan.form.content.preview")}),e.jsx("div",{className:"prose prose-sm dark:prose-invert h-[400px] max-w-none overflow-y-auto rounded-md border p-4",children:e.jsx("div",{dangerouslySetInnerHTML:{__html:o.render(f.value||"")}})})]})]}),e.jsx(O,{className:"text-xs",children:d("plan.form.content.description")}),e.jsx(E,{})]})}})]}),e.jsx(Le,{className:"mt-6",children:e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsx("div",{className:"flex-shrink-0",children:t&&e.jsx(v,{control:u.control,name:"force_update",render:({field:f})=>e.jsxs(p,{className:"flex flex-row items-center space-x-2 space-y-0",children:[e.jsx(y,{children:e.jsx(qn,{checked:f.value,onCheckedChange:f.onChange})}),e.jsx("div",{className:"",children:e.jsx(j,{className:"text-sm",children:d("plan.form.force_update.label")})})]})})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(L,{type:"button",variant:"outline",onClick:S,children:d("plan.form.submit.cancel")}),e.jsx(L,{type:"submit",disabled:i,onClick:()=>{u.handleSubmit(async f=>{l(!0),gs.save(f).then(({data:N})=>{N&&(A.success(d(t?"plan.form.submit.success.update":"plan.form.submit.success.add")),S(),a())}).finally(()=>{l(!1)})})()},children:d(i?"plan.form.submit.submitting":"plan.form.submit.submit")})]})]})})]})]})})}function Kx(){const[s,n]=m.useState({}),[t,r]=m.useState({"drag-handle":!1}),[a,i]=m.useState([]),[l,d]=m.useState([]),[u,o]=m.useState(!1),[c,h]=m.useState({pageSize:20,pageIndex:0}),[k,C]=m.useState([]),{refetch:S}=ne({queryKey:["planList"],queryFn:async()=>{const{data:D}=await gs.getList();return C(D),D}});m.useEffect(()=>{r({"drag-handle":u}),h({pageSize:u?99999:10,pageIndex:0})},[u]);const f=(D,g)=>{u&&(D.dataTransfer.setData("text/plain",g.toString()),D.currentTarget.classList.add("opacity-50"))},N=(D,g)=>{if(!u)return;D.preventDefault(),D.currentTarget.classList.remove("bg-muted");const w=parseInt(D.dataTransfer.getData("text/plain"));if(w===g)return;const R=[...k],[H]=R.splice(w,1);R.splice(g,0,H),C(R)},_=async()=>{if(!u){o(!0);return}const D=k?.map(g=>g.id);gs.sort(D).then(()=>{A.success("排序保存成功"),o(!1),S()}).finally(()=>{o(!1)})},T=ss({data:k||[],columns:Ax(S),state:{sorting:l,columnVisibility:t,rowSelection:s,columnFilters:a,pagination:c},enableRowSelection:!0,onPaginationChange:h,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:i,onColumnVisibilityChange:r,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}},pageCount:u?1:void 0});return e.jsx(zx,{refreshData:S,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(xs,{table:T,toolbar:D=>e.jsx($x,{table:D,refetch:S,saveOrder:_,isSortMode:u}),draggable:u,onDragStart:f,onDragEnd:D=>D.currentTarget.classList.remove("opacity-50"),onDragOver:D=>{D.preventDefault(),D.currentTarget.classList.add("bg-muted")},onDragLeave:D=>D.currentTarget.classList.remove("bg-muted"),onDrop:N,showPagination:!u}),e.jsx(Ux,{})]})})}function Bx(){const{t:s}=V("subscribe");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("plan.title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("plan.page.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Kx,{})})]})]})}const Gx=Object.freeze(Object.defineProperty({__proto__:null,default:Bx},Symbol.toStringTag,{value:"Module"})),vt=[{value:le.PENDING,label:Vt[le.PENDING],icon:sd,color:Mt[le.PENDING]},{value:le.PROCESSING,label:Vt[le.PROCESSING],icon:bl,color:Mt[le.PROCESSING]},{value:le.COMPLETED,label:Vt[le.COMPLETED],icon:fn,color:Mt[le.COMPLETED]},{value:le.CANCELLED,label:Vt[le.CANCELLED],icon:yl,color:Mt[le.CANCELLED]},{value:le.DISCOUNTED,label:Vt[le.DISCOUNTED],icon:fn,color:Mt[le.DISCOUNTED]}],At=[{value:Ne.PENDING,label:ia[Ne.PENDING],icon:td,color:oa[Ne.PENDING]},{value:Ne.PROCESSING,label:ia[Ne.PROCESSING],icon:bl,color:oa[Ne.PROCESSING]},{value:Ne.VALID,label:ia[Ne.VALID],icon:fn,color:oa[Ne.VALID]},{value:Ne.INVALID,label:ia[Ne.INVALID],icon:yl,color:oa[Ne.INVALID]}];function xa({column:s,title:n,options:t}){const r=s?.getFacetedUniqueValues(),a=s?.getFilterValue(),i=Array.isArray(a)?new Set(a):a!==void 0?new Set([a]):new Set;return e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Ia,{className:"mr-2 h-4 w-4"}),n,i?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:i.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:i.size>2?e.jsxs(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[i.size," selected"]}):t.filter(l=>i.has(l.value)).map(l=>e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:l.label},l.value))})]})]})}),e.jsx(Ze,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Js,{children:[e.jsx(ut,{placeholder:n}),e.jsxs(Qs,{children:[e.jsx(xt,{children:"No results found."}),e.jsx(fs,{children:t.map(l=>{const d=i.has(l.value);return e.jsxs(We,{onSelect:()=>{const u=new Set(i);d?u.delete(l.value):u.add(l.value);const o=Array.from(u);s?.setFilterValue(o.length?o:void 0)},children:[e.jsx("div",{className:b("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",d?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ot,{className:b("h-4 w-4")})}),l.icon&&e.jsx(l.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${l.color}`}),e.jsx("span",{children:l.label}),r?.get(l.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:r.get(l.value)})]},l.value)})}),i.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(fs,{children:e.jsx(We,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const Wx=x.object({email:x.string().min(1),plan_id:x.number(),period:x.string(),total_amount:x.number()}),Yx={email:"",plan_id:0,total_amount:0,period:""};function ri({refetch:s,trigger:n,defaultValues:t}){const{t:r}=V("order"),[a,i]=m.useState(!1),l=we({resolver:Ce(Wx),defaultValues:{...Yx,...t},mode:"onChange"}),[d,u]=m.useState([]);return m.useEffect(()=>{a&&gs.getList().then(({data:o})=>{u(o)})},[a]),e.jsxs(ge,{open:a,onOpenChange:i,children:[e.jsx(as,{asChild:!0,children:n||e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:r("dialog.addOrder")})]})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(be,{children:[e.jsx(fe,{children:r("dialog.assignOrder")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...l,children:[e.jsx(v,{control:l.control,name:"email",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dialog.fields.userEmail")}),e.jsx(y,{children:e.jsx(P,{placeholder:r("dialog.placeholders.email"),...o})})]})}),e.jsx(v,{control:l.control,name:"plan_id",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dialog.fields.subscriptionPlan")}),e.jsx(y,{children:e.jsxs(J,{value:o.value?o.value?.toString():void 0,onValueChange:c=>o.onChange(parseInt(c)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dialog.placeholders.plan")})}),e.jsx(Y,{children:d.map(c=>e.jsx($,{value:c.id.toString(),children:c.name},c.id))})]})})]})}),e.jsx(v,{control:l.control,name:"period",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dialog.fields.orderPeriod")}),e.jsx(y,{children:e.jsxs(J,{value:o.value,onValueChange:o.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:r("dialog.placeholders.period")})}),e.jsx(Y,{children:Object.keys(vm).map(c=>e.jsx($,{value:c,children:r(`period.${c}`)},c))})]})})]})}),e.jsx(v,{control:l.control,name:"total_amount",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{children:r("dialog.fields.paymentAmount")}),e.jsx(y,{children:e.jsx(P,{type:"number",placeholder:r("dialog.placeholders.amount"),value:o.value/100,onChange:c=>o.onChange(parseFloat(c.currentTarget.value)*100)})}),e.jsx(E,{})]})}),e.jsxs(Le,{children:[e.jsx(L,{variant:"outline",onClick:()=>i(!1),children:r("dialog.actions.cancel")}),e.jsx(L,{type:"submit",onClick:()=>{l.handleSubmit(o=>{tt.assign(o).then(({data:c})=>{c&&(s&&s(),l.reset(),i(!1),A.success(r("dialog.messages.addSuccess")))})})()},children:r("dialog.actions.confirm")})]})]})]})]})}function Jx({table:s,refetch:n}){const{t}=V("order"),r=s.getState().columnFilters.length>0,a=Object.values(Cs).filter(u=>typeof u=="number").map(u=>({label:t(`type.${Cs[u]}`),value:u,color:u===Cs.NEW?"green-500":u===Cs.RENEWAL?"blue-500":u===Cs.UPGRADE?"purple-500":"orange-500"})),i=Object.values(qe).map(u=>({label:t(`period.${u}`),value:u,color:u===qe.MONTH_PRICE?"slate-500":u===qe.QUARTER_PRICE?"cyan-500":u===qe.HALF_YEAR_PRICE?"indigo-500":u===qe.YEAR_PRICE?"violet-500":u===qe.TWO_YEAR_PRICE?"fuchsia-500":u===qe.THREE_YEAR_PRICE?"pink-500":u===qe.ONETIME_PRICE?"rose-500":"orange-500"})),l=Object.values(le).filter(u=>typeof u=="number").map(u=>({label:t(`status.${le[u]}`),value:u,icon:u===le.PENDING?vt[0].icon:u===le.PROCESSING?vt[1].icon:u===le.COMPLETED?vt[2].icon:u===le.CANCELLED?vt[3].icon:vt[4].icon,color:u===le.PENDING?"yellow-500":u===le.PROCESSING?"blue-500":u===le.COMPLETED?"green-500":u===le.CANCELLED?"red-500":"green-500"})),d=Object.values(Ne).filter(u=>typeof u=="number").map(u=>({label:t(`commission.${Ne[u]}`),value:u,icon:u===Ne.PENDING?At[0].icon:u===Ne.PROCESSING?At[1].icon:u===Ne.VALID?At[2].icon:At[3].icon,color:u===Ne.PENDING?"yellow-500":u===Ne.PROCESSING?"blue-500":u===Ne.VALID?"green-500":"red-500"}));return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ri,{refetch:n}),e.jsx(P,{placeholder:t("search.placeholder"),value:s.getColumn("trade_no")?.getFilterValue()??"",onChange:u=>s.getColumn("trade_no")?.setFilterValue(u.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2",children:[s.getColumn("type")&&e.jsx(xa,{column:s.getColumn("type"),title:t("table.columns.type"),options:a}),s.getColumn("period")&&e.jsx(xa,{column:s.getColumn("period"),title:t("table.columns.period"),options:i}),s.getColumn("status")&&e.jsx(xa,{column:s.getColumn("status"),title:t("table.columns.status"),options:l}),s.getColumn("commission_status")&&e.jsx(xa,{column:s.getColumn("commission_status"),title:t("table.columns.commissionStatus"),options:d})]}),r&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[t("actions.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]})}function Ke({label:s,value:n,className:t,valueClassName:r}){return e.jsxs("div",{className:b("flex items-center py-1.5",t),children:[e.jsx("div",{className:"w-28 shrink-0 text-sm text-muted-foreground",children:s}),e.jsx("div",{className:b("text-sm",r),children:n||"-"})]})}function Qx({status:s}){const{t:n}=V("order"),t={[le.PENDING]:"bg-yellow-100 text-yellow-800 hover:bg-yellow-100",[le.PROCESSING]:"bg-blue-100 text-blue-800 hover:bg-blue-100",[le.CANCELLED]:"bg-red-100 text-red-800 hover:bg-red-100",[le.COMPLETED]:"bg-green-100 text-green-800 hover:bg-green-100",[le.DISCOUNTED]:"bg-gray-100 text-gray-800 hover:bg-gray-100"};return e.jsx(U,{variant:"secondary",className:b("font-medium",t[s]),children:n(`status.${le[s]}`)})}function Xx({id:s,trigger:n}){const[t,r]=m.useState(!1),[a,i]=m.useState(),{t:l}=V("order");return m.useEffect(()=>{(async()=>{if(t){const{data:u}=await tt.getInfo({id:s});i(u)}})()},[t,s]),e.jsxs(ge,{onOpenChange:r,open:t,children:[e.jsx(as,{asChild:!0,children:n}),e.jsxs(ue,{className:"max-w-xl",children:[e.jsxs(be,{className:"space-y-2",children:[e.jsx(fe,{className:"text-lg font-medium",children:l("dialog.title")}),e.jsx("div",{className:"flex items-center justify-between text-sm",children:e.jsxs("div",{className:"flex items-center space-x-6",children:[e.jsxs("div",{className:"text-muted-foreground",children:[l("table.columns.tradeNo"),":",a?.trade_no]}),!!a?.status&&e.jsx(Qx,{status:a.status})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:l("dialog.basicInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{label:l("dialog.fields.userEmail"),value:a?.user?.email?e.jsxs(Ys,{to:`/user/manage?email=${a.user.email}`,className:"group inline-flex items-center gap-1 text-primary hover:underline",children:[a.user.email,e.jsx(pn,{className:"h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100"})]}):"-"}),e.jsx(Ke,{label:l("dialog.fields.orderPeriod"),value:a&&l(`period.${a.period}`)}),e.jsx(Ke,{label:l("dialog.fields.subscriptionPlan"),value:a?.plan?.name,valueClassName:"font-medium"}),e.jsx(Ke,{label:l("dialog.fields.callbackNo"),value:a?.callback_no,valueClassName:"font-mono text-xs"})]})]}),e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:l("dialog.amountInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{label:l("dialog.fields.paymentAmount"),value:Vs(a?.total_amount||0),valueClassName:"font-medium text-primary"}),e.jsx(Te,{className:"my-2"}),e.jsx(Ke,{label:l("dialog.fields.balancePayment"),value:Vs(a?.balance_amount||0)}),e.jsx(Ke,{label:l("dialog.fields.discountAmount"),value:Vs(a?.discount_amount||0),valueClassName:"text-green-600"}),e.jsx(Ke,{label:l("dialog.fields.refundAmount"),value:Vs(a?.refund_amount||0),valueClassName:"text-red-600"}),e.jsx(Ke,{label:l("dialog.fields.deductionAmount"),value:Vs(a?.surplus_amount||0)})]})]}),e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:l("dialog.timeInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{label:l("dialog.fields.createdAt"),value:xe(a?.created_at),valueClassName:"font-mono text-xs"}),e.jsx(Ke,{label:l("dialog.fields.updatedAt"),value:xe(a?.updated_at),valueClassName:"font-mono text-xs"})]})]}),a?.commission_status===1&&a?.commission_balance&&e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:l("dialog.commissionInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{label:l("dialog.fields.commissionStatus"),value:e.jsx(U,{variant:"secondary",className:"bg-orange-100 font-medium text-orange-800 hover:bg-orange-100",children:l("dialog.commissionStatusActive")})}),e.jsx(Ke,{label:l("dialog.fields.commissionAmount"),value:Vs(a?.commission_balance||0),valueClassName:"font-medium text-orange-600"}),a?.actual_commission_balance&&e.jsx(Ke,{label:l("dialog.fields.actualCommissionAmount"),value:Vs(a?.actual_commission_balance||0),valueClassName:"font-medium text-orange-700"}),a?.invite_user&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{className:"my-2"}),e.jsx(Ke,{label:l("dialog.fields.inviteUser"),value:e.jsxs(Ys,{to:`/user/manage?email=${a.invite_user.email}`,className:"group inline-flex items-center gap-1 text-primary hover:underline",children:[a.invite_user.email,e.jsx(pn,{className:"h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100"})]})}),e.jsx(Ke,{label:l("dialog.fields.inviteUserId"),value:a?.invite_user?.id,valueClassName:"font-mono text-xs"})]})]})]})]})]})]})}const Zx={[Cs.NEW]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Cs.RENEWAL]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Cs.UPGRADE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Cs.RESET_FLOW]:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},eh={[qe.MONTH_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.QUARTER_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.HALF_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.TWO_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.THREE_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.ONETIME_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[qe.RESET_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},sh=s=>le[s],th=s=>Ne[s],ah=s=>Cs[s],nh=s=>{const{t:n}=V("order");return[{accessorKey:"trade_no",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.tradeNo")}),cell:({row:t})=>{const r=t.original.trade_no,a=r.length>6?`${r.slice(0,3)}...${r.slice(-3)}`:r;return e.jsx("div",{className:"flex items-center",children:e.jsx(Xx,{trigger:e.jsxs(G,{variant:"ghost",size:"sm",className:"flex h-8 items-center gap-1.5 px-2 font-medium text-primary transition-colors hover:bg-primary/10 hover:text-primary/80",children:[e.jsx("span",{className:"font-mono",children:a}),e.jsx(pn,{className:"h-3.5 w-3.5 opacity-70"})]}),id:t.original.id})})},enableSorting:!1,enableHiding:!1},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.type")}),cell:({row:t})=>{const r=t.getValue("type"),a=Zx[r];return e.jsx(U,{variant:"secondary",className:b("font-medium transition-colors text-nowrap",a.color,a.bgColor,"border border-border/50","hover:bg-slate-200/80"),children:n(`type.${ah(r)}`)})},enableSorting:!1,enableHiding:!1},{accessorKey:"plan.name",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.plan")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium text-foreground/90 sm:max-w-72 md:max-w-[31rem]",children:t.original.plan?.name||"-"})}),enableSorting:!1,enableHiding:!1},{accessorKey:"period",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.period")}),cell:({row:t})=>{const r=t.getValue("period"),a=eh[r];return e.jsx(U,{variant:"secondary",className:b("font-medium transition-colors text-nowrap",a?.color,a?.bgColor,"hover:bg-opacity-80"),children:n(`period.${r}`)})},enableSorting:!1,enableHiding:!1},{accessorKey:"total_amount",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.amount")}),cell:({row:t})=>{const r=t.getValue("total_amount"),a=typeof r=="number"?(r/100).toFixed(2):"N/A";return e.jsxs("div",{className:"flex items-center font-mono text-foreground/90",children:["¥",a]})},enableSorting:!0,enableHiding:!1},{accessorKey:"status",header:({column:t})=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(z,{column:t,title:n("table.columns.status")}),e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{children:e.jsx(Ql,{className:"h-4 w-4 text-muted-foreground/70 transition-colors hover:text-muted-foreground"})}),e.jsx(oe,{side:"top",className:"max-w-[200px] text-sm",children:n("status.tooltip")})]})})]}),cell:({row:t})=>{const r=vt.find(a=>a.value===t.getValue("status"));return r?e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[r.icon&&e.jsx(r.icon,{className:`h-4 w-4 text-${r.color}`}),e.jsx("span",{className:"text-sm font-medium",children:n(`status.${sh(r.value)}`)})]}),r.value===le.PENDING&&e.jsxs(zs,{modal:!0,children:[e.jsx($s,{asChild:!0,children:e.jsxs(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-muted/60",children:[e.jsx(wa,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:n("actions.openMenu")})]})}),e.jsxs(Ls,{align:"end",className:"w-[140px]",children:[e.jsx(_e,{className:"cursor-pointer",onClick:async()=>{await tt.markPaid({trade_no:t.original.trade_no}),s()},children:n("actions.markAsPaid")}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onClick:async()=>{await tt.makeCancel({trade_no:t.original.trade_no}),s()},children:n("actions.cancel")})]})]})]}):null},enableSorting:!0,enableHiding:!1},{accessorKey:"commission_balance",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.commission")}),cell:({row:t})=>{const r=t.getValue("commission_balance"),a=r?(r/100).toFixed(2):"-";return e.jsx("div",{className:"flex items-center font-mono text-foreground/90",children:r?`¥${a}`:"-"})},enableSorting:!0,enableHiding:!1},{accessorKey:"commission_status",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.commissionStatus")}),cell:({row:t})=>{const r=t.original.status,a=t.original.commission_balance,i=At.find(l=>l.value===t.getValue("commission_status"));return a==0||!i?e.jsx("span",{className:"text-muted-foreground",children:"-"}):e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[i.icon&&e.jsx(i.icon,{className:`h-4 w-4 text-${i.color}`}),e.jsx("span",{className:"text-sm font-medium",children:n(`commission.${th(i.value)}`)})]}),i.value===Ne.PENDING&&r===le.COMPLETED&&e.jsxs(zs,{modal:!0,children:[e.jsx($s,{asChild:!0,children:e.jsxs(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-muted/60",children:[e.jsx(wa,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:n("actions.openMenu")})]})}),e.jsxs(Ls,{align:"end",className:"w-[120px]",children:[e.jsx(_e,{className:"cursor-pointer",onClick:async()=>{await tt.update({trade_no:t.original.trade_no,commission_status:Ne.PROCESSING}),s()},children:n("commission.PROCESSING")}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onClick:async()=>{await tt.update({trade_no:t.original.trade_no,commission_status:Ne.INVALID}),s()},children:n("commission.INVALID")})]})]})]})},enableSorting:!0,enableHiding:!1},{accessorKey:"created_at",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.createdAt")}),cell:({row:t})=>e.jsx("div",{className:"text-nowrap font-mono text-sm text-muted-foreground",children:xe(t.getValue("created_at"),"YYYY/MM/DD HH:mm:ss")}),enableSorting:!0,enableHiding:!1}]};function rh(){const[s]=Nl(),[n,t]=m.useState({}),[r,a]=m.useState({}),[i,l]=m.useState([]),[d,u]=m.useState([]),[o,c]=m.useState({pageIndex:0,pageSize:20});m.useEffect(()=>{const N=Object.entries({user_id:"string",order_id:"string",commission_status:"number",status:"number",commission_balance:"string"}).map(([_,T])=>{const D=s.get(_);return D?{id:_,value:T==="number"?parseInt(D):D}:null}).filter(Boolean);N.length>0&&l(N)},[s]);const{refetch:h,data:k,isLoading:C}=ne({queryKey:["orderList",o,i,d],queryFn:()=>tt.getList({pageSize:o.pageSize,current:o.pageIndex+1,filter:i,sort:d})}),S=ss({data:k?.data??[],columns:nh(h),state:{sorting:d,columnVisibility:r,rowSelection:n,columnFilters:i,pagination:o},rowCount:k?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:t,onSortingChange:u,onColumnFiltersChange:l,onColumnVisibilityChange:a,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),onPaginationChange:c,getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(xs,{table:S,toolbar:e.jsx(Jx,{table:S,refetch:h}),showPagination:!0})}function lh(){const{t:s}=V("order");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(rh,{})})]})]})}const ih=Object.freeze(Object.defineProperty({__proto__:null,default:lh},Symbol.toStringTag,{value:"Module"}));function oh({column:s,title:n,options:t}){const r=s?.getFacetedUniqueValues(),a=new Set(s?.getFilterValue());return e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Ia,{className:"mr-2 h-4 w-4"}),n,a?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:a.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:a.size>2?e.jsxs(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[a.size," selected"]}):t.filter(i=>a.has(i.value)).map(i=>e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:i.label},i.value))})]})]})}),e.jsx(Ze,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Js,{children:[e.jsx(ut,{placeholder:n}),e.jsxs(Qs,{children:[e.jsx(xt,{children:"No results found."}),e.jsx(fs,{children:t.map(i=>{const l=a.has(i.value);return e.jsxs(We,{onSelect:()=>{l?a.delete(i.value):a.add(i.value);const d=Array.from(a);s?.setFilterValue(d.length?d:void 0)},children:[e.jsx("div",{className:b("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",l?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ot,{className:b("h-4 w-4")})}),i.icon&&e.jsx(i.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${i.color}`}),e.jsx("span",{children:i.label}),r?.get(i.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:r.get(i.value)})]},i.value)})}),a.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(fs,{children:e.jsx(We,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const ch=x.object({id:x.coerce.number().nullable().optional(),name:x.string().min(1,"请输入优惠券名称"),code:x.string().nullable(),type:x.coerce.number(),value:x.coerce.number(),started_at:x.coerce.number(),ended_at:x.coerce.number(),limit_use:x.union([x.string(),x.number()]).nullable(),limit_use_with_user:x.union([x.string(),x.number()]).nullable(),generate_count:x.coerce.number().nullable().optional(),limit_plan_ids:x.array(x.coerce.number()).default([]).nullable(),limit_period:x.array(x.nativeEnum(Gt)).default([]).nullable()}).refine(s=>s.ended_at>s.started_at,{message:"结束时间必须晚于开始时间",path:["ended_at"]}),vr={name:"",code:null,type:hs.AMOUNT,value:0,started_at:Math.floor(Date.now()/1e3),ended_at:Math.floor(Date.now()/1e3)+7*24*60*60,limit_use:null,limit_use_with_user:null,limit_plan_ids:[],limit_period:[],generate_count:null},dh=[{label:"1周",days:7},{label:"2周",days:14},{label:"1个月",days:30},{label:"3个月",days:90},{label:"6个月",days:180},{label:"1年",days:365}];function li({defaultValues:s,refetch:n,type:t="create",dialogTrigger:r=null,open:a,onOpenChange:i}){const{t:l}=V("coupon"),[d,u]=m.useState(!1),o=a??d,c=i??u,[h,k]=m.useState([]),C=we({resolver:Ce(ch),defaultValues:s||vr});m.useEffect(()=>{s&&C.reset(s)},[s,C]),m.useEffect(()=>{gs.getList().then(({data:T})=>k(T))},[]);const S=T=>{if(!T)return;const D=(g,w)=>{const R=new Date(w*1e3);return g.setHours(R.getHours(),R.getMinutes(),R.getSeconds()),Math.floor(g.getTime()/1e3)};T.from&&C.setValue("started_at",D(T.from,C.watch("started_at"))),T.to&&C.setValue("ended_at",D(T.to,C.watch("ended_at")))},f=T=>{const D=new Date,g=Math.floor(D.getTime()/1e3),w=Math.floor((D.getTime()+T*24*60*60*1e3)/1e3);C.setValue("started_at",g),C.setValue("ended_at",w)},N=async T=>{const D=await ka.save(T);if(T.generate_count&&typeof D=="string"){const g=new Blob([D],{type:"text/csv;charset=utf-8;"}),w=document.createElement("a");w.href=window.URL.createObjectURL(g),w.download=`coupons_${new Date().getTime()}.csv`,w.click(),window.URL.revokeObjectURL(w.href)}c(!1),t==="create"&&C.reset(vr),n()},_=(T,D)=>e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:D}),e.jsx(P,{type:"datetime-local",step:"1",value:xe(C.watch(T),"YYYY-MM-DDTHH:mm:ss"),onChange:g=>{const w=new Date(g.target.value);C.setValue(T,Math.floor(w.getTime()/1e3))},className:"h-8 [&::-webkit-calendar-picker-indicator]:hidden"})]});return e.jsxs(ge,{open:o,onOpenChange:c,children:[r&&e.jsx(as,{asChild:!0,children:r}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsx(be,{children:e.jsx(fe,{children:l(t==="create"?"form.add":"form.edit")})}),e.jsx(Se,{...C,children:e.jsxs("form",{onSubmit:C.handleSubmit(N),className:"space-y-4",children:[e.jsx(v,{control:C.control,name:"name",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.name.label")}),e.jsx(P,{placeholder:l("form.name.placeholder"),...T}),e.jsx(E,{})]})}),t==="create"&&e.jsx(v,{control:C.control,name:"generate_count",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.generateCount.label")}),e.jsx(P,{type:"number",min:0,placeholder:l("form.generateCount.placeholder"),...T,value:T.value??"",onChange:D=>T.onChange(D.target.value===""?null:parseInt(D.target.value)),className:"h-9"}),e.jsx(O,{className:"text-xs",children:l("form.generateCount.description")}),e.jsx(E,{})]})}),(!C.watch("generate_count")||C.watch("generate_count")==null)&&e.jsx(v,{control:C.control,name:"code",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.code.label")}),e.jsx(P,{placeholder:l("form.code.placeholder"),...T,value:T.value??"",className:"h-9"}),e.jsx(O,{className:"text-xs",children:l("form.code.description")}),e.jsx(E,{})]})}),e.jsxs(p,{children:[e.jsx(j,{children:l("form.type.label")}),e.jsxs("div",{className:"flex",children:[e.jsx(v,{control:C.control,name:"type",render:({field:T})=>e.jsxs(J,{value:T.value.toString(),onValueChange:D=>{const g=T.value,w=parseInt(D);T.onChange(w);const R=C.getValues("value");R&&(g===hs.AMOUNT&&w===hs.PERCENTAGE?C.setValue("value",R/100):g===hs.PERCENTAGE&&w===hs.AMOUNT&&C.setValue("value",R*100))},children:[e.jsx(W,{className:"flex-[1.2] rounded-r-none border-r-0 focus:z-10",children:e.jsx(Q,{placeholder:l("form.type.placeholder")})}),e.jsx(Y,{children:Object.entries(bm).map(([D,g])=>e.jsx($,{value:D,children:l(`table.toolbar.types.${D}`)},D))})]})}),e.jsx(v,{control:C.control,name:"value",render:({field:T})=>{const D=T.value==null?"":C.watch("type")===hs.AMOUNT&&typeof T.value=="number"?(T.value/100).toString():T.value.toString();return e.jsx(P,{type:"number",placeholder:l("form.value.placeholder"),...T,value:D,onChange:g=>{const w=g.target.value;if(w===""){T.onChange("");return}const R=parseFloat(w);isNaN(R)||T.onChange(C.watch("type")===hs.AMOUNT?Math.round(R*100):R)},step:"any",min:0,className:"flex-[2] rounded-none border-x-0 text-left"})}}),e.jsx("div",{className:"flex min-w-[40px] items-center justify-center rounded-md rounded-l-none border border-l-0 border-input bg-muted/50 px-3 font-medium text-muted-foreground",children:e.jsx("span",{children:C.watch("type")==hs.AMOUNT?"¥":"%"})})]})]}),e.jsxs(p,{children:[e.jsx(j,{children:l("form.validity.label")}),e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:b("w-full justify-start text-left font-normal",!C.watch("started_at")&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),e.jsxs("span",{className:"truncate",children:[xe(C.watch("started_at"),"YYYY-MM-DD HH:mm:ss")," ",l("form.validity.to")," ",xe(C.watch("ended_at"),"YYYY-MM-DD HH:mm:ss")]})]})}),e.jsxs(Ze,{className:"w-auto p-0",align:"start",children:[e.jsxs("div",{className:"border-b border-border p-3",children:[e.jsx("div",{className:"mb-2 text-sm font-medium text-muted-foreground",children:"快速设置"}),e.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-6",children:dh.map(T=>e.jsx(L,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs",onClick:()=>f(T.days),type:"button",children:T.label},T.days))})]}),e.jsx("div",{className:"hidden border-b border-border sm:block",children:e.jsx(vs,{mode:"range",selected:{from:new Date(C.watch("started_at")*1e3),to:new Date(C.watch("ended_at")*1e3)},onSelect:S,numberOfMonths:2})}),e.jsx("div",{className:"border-b border-border sm:hidden",children:e.jsx(vs,{mode:"range",selected:{from:new Date(C.watch("started_at")*1e3),to:new Date(C.watch("ended_at")*1e3)},onSelect:S,numberOfMonths:1})}),e.jsx("div",{className:"p-3",children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center",children:[_("started_at",l("table.validity.startTime")),e.jsx("div",{className:"text-center text-sm text-muted-foreground sm:mt-6",children:l("form.validity.to")}),_("ended_at",l("table.validity.endTime"))]})})]})]}),e.jsx(E,{})]}),e.jsx(v,{control:C.control,name:"limit_use",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.limitUse.label")}),e.jsx(P,{type:"number",min:0,placeholder:l("form.limitUse.placeholder"),...T,value:T.value??"",onChange:D=>T.onChange(D.target.value===""?null:parseInt(D.target.value)),className:"h-9"}),e.jsx(O,{className:"text-xs",children:l("form.limitUse.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:C.control,name:"limit_use_with_user",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.limitUseWithUser.label")}),e.jsx(P,{type:"number",min:0,placeholder:l("form.limitUseWithUser.placeholder"),...T,value:T.value??"",onChange:D=>T.onChange(D.target.value===""?null:parseInt(D.target.value)),className:"h-9"}),e.jsx(O,{className:"text-xs",children:l("form.limitUseWithUser.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:C.control,name:"limit_period",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.limitPeriod.label")}),e.jsx(kt,{options:Object.entries(Gt).filter(([D])=>isNaN(Number(D))).map(([D,g])=>({label:l(`coupon:period.${g}`),value:D})),onChange:D=>{if(D.length===0){T.onChange([]);return}const g=D.map(w=>Gt[w.value]);T.onChange(g)},value:(T.value||[]).map(D=>({label:l(`coupon:period.${D}`),value:Object.entries(Gt).find(([g,w])=>w===D)?.[0]||""})),placeholder:l("form.limitPeriod.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:l("form.limitPeriod.empty")})}),e.jsx(O,{className:"text-xs",children:l("form.limitPeriod.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:C.control,name:"limit_plan_ids",render:({field:T})=>e.jsxs(p,{children:[e.jsx(j,{children:l("form.limitPlan.label")}),e.jsx(kt,{options:h?.map(D=>({label:D.name,value:D.id.toString()}))||[],onChange:D=>T.onChange(D.map(g=>Number(g.value))),value:(h||[]).filter(D=>(T.value||[]).includes(D.id)).map(D=>({label:D.name,value:D.id.toString()})),placeholder:l("form.limitPlan.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:l("form.limitPlan.empty")})}),e.jsx(E,{})]})}),e.jsx(Le,{children:e.jsx(L,{type:"submit",disabled:C.formState.isSubmitting,children:C.formState.isSubmitting?l("form.submit.saving"):l("form.submit.save")})})]})})]})]})}function mh({table:s,refetch:n}){const t=s.getState().columnFilters.length>0,{t:r}=V("coupon");return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(li,{refetch:n,dialogTrigger:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:r("form.add")})]})}),e.jsx(P,{placeholder:r("table.toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:a=>s.getColumn("name")?.setFilterValue(a.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),s.getColumn("type")&&e.jsx(oh,{column:s.getColumn("type"),title:r("table.toolbar.type"),options:[{value:hs.AMOUNT,label:r(`table.toolbar.types.${hs.AMOUNT}`)},{value:hs.PERCENTAGE,label:r(`table.toolbar.types.${hs.PERCENTAGE}`)}]}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("table.toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]})}const ii=m.createContext(void 0);function uh({children:s,refetch:n}){const[t,r]=m.useState(!1),[a,i]=m.useState(null),l=u=>{i(u),r(!0)},d=()=>{r(!1),i(null)};return e.jsxs(ii.Provider,{value:{isOpen:t,currentCoupon:a,openEdit:l,closeEdit:d},children:[s,a&&e.jsx(li,{defaultValues:a,refetch:n,type:"edit",open:t,onOpenChange:r})]})}function xh(){const s=m.useContext(ii);if(s===void 0)throw new Error("useCouponEdit must be used within a CouponEditProvider");return s}const hh=s=>{const{t:n}=V("coupon");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.id")}),cell:({row:t})=>e.jsx(U,{children:t.original.id}),enableSorting:!0},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.show")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.original.show,onCheckedChange:r=>{ka.update({id:t.original.id,show:r}).then(({data:a})=>!a&&s())}}),enableSorting:!1},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{children:t.original.name})}),enableSorting:!1,size:800},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.type")}),cell:({row:t})=>e.jsx(U,{variant:"outline",children:n(`table.toolbar.types.${t.original.type}`)}),enableSorting:!0},{accessorKey:"code",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.code")}),cell:({row:t})=>e.jsx(U,{variant:"secondary",children:t.original.code}),enableSorting:!0},{accessorKey:"limit_use",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.limitUse")}),cell:({row:t})=>e.jsx(U,{variant:"outline",children:t.original.limit_use===null?n("table.validity.unlimited"):t.original.limit_use}),enableSorting:!0},{accessorKey:"limit_use_with_user",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.limitUseWithUser")}),cell:({row:t})=>e.jsx(U,{variant:"outline",children:t.original.limit_use_with_user===null?n("table.validity.noLimit"):t.original.limit_use_with_user}),enableSorting:!0},{accessorKey:"#",header:({column:t})=>e.jsx(z,{column:t,title:n("table.columns.validity")}),cell:({row:t})=>{const[r,a]=m.useState(!1),i=Date.now(),l=t.original.started_at*1e3,d=t.original.ended_at*1e3,u=i>d,o=ie.jsx(z,{className:"justify-end",column:t,title:n("table.columns.actions")}),cell:({row:t})=>{const{openEdit:r}=xh();return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",onClick:()=>r(t.original),children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("table.actions.edit")})]}),e.jsx(ps,{title:n("table.actions.deleteConfirm.title"),description:n("table.actions.deleteConfirm.description"),confirmText:n("table.actions.deleteConfirm.confirmText"),variant:"destructive",onConfirm:async()=>{ka.drop({id:t.original.id}).then(({data:a})=>{a&&(A.success("删除成功"),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(ds,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:n("table.actions.delete")})]})})]})}}]};function gh(){const[s,n]=m.useState({}),[t,r]=m.useState({}),[a,i]=m.useState([]),[l,d]=m.useState([]),[u,o]=m.useState({pageIndex:0,pageSize:20}),{refetch:c,data:h}=ne({queryKey:["couponList",u,a,l],queryFn:()=>ka.getList({pageSize:u.pageSize,current:u.pageIndex+1,filter:a,sort:l})}),k=ss({data:h?.data??[],columns:hh(c),state:{sorting:l,columnVisibility:t,rowSelection:s,columnFilters:a,pagination:u},pageCount:Math.ceil((h?.total??0)/u.pageSize),rowCount:h?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:i,onColumnVisibilityChange:r,onPaginationChange:o,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(uh,{refetch:c,children:e.jsx("div",{className:"space-y-4",children:e.jsx(xs,{table:k,toolbar:e.jsx(mh,{table:k,refetch:c})})})})}function fh(){const{t:s}=V("coupon");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(gh,{})})]})]})}const ph=Object.freeze(Object.defineProperty({__proto__:null,default:fh},Symbol.toStringTag,{value:"Module"})),jh=1,vh=1e6;let on=0;function bh(){return on=(on+1)%Number.MAX_SAFE_INTEGER,on.toString()}const cn=new Map,br=s=>{if(cn.has(s))return;const n=setTimeout(()=>{cn.delete(s),Wt({type:"REMOVE_TOAST",toastId:s})},vh);cn.set(s,n)},yh=(s,n)=>{switch(n.type){case"ADD_TOAST":return{...s,toasts:[n.toast,...s.toasts].slice(0,jh)};case"UPDATE_TOAST":return{...s,toasts:s.toasts.map(t=>t.id===n.toast.id?{...t,...n.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=n;return t?br(t):s.toasts.forEach(r=>{br(r.id)}),{...s,toasts:s.toasts.map(r=>r.id===t||t===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return n.toastId===void 0?{...s,toasts:[]}:{...s,toasts:s.toasts.filter(t=>t.id!==n.toastId)}}},fa=[];let pa={toasts:[]};function Wt(s){pa=yh(pa,s),fa.forEach(n=>{n(pa)})}function Nh({...s}){const n=bh(),t=a=>Wt({type:"UPDATE_TOAST",toast:{...a,id:n}}),r=()=>Wt({type:"DISMISS_TOAST",toastId:n});return Wt({type:"ADD_TOAST",toast:{...s,id:n,open:!0,onOpenChange:a=>{a||r()}}}),{id:n,dismiss:r,update:t}}function oi(){const[s,n]=m.useState(pa);return m.useEffect(()=>(fa.push(n),()=>{const t=fa.indexOf(n);t>-1&&fa.splice(t,1)}),[s]),{...s,toast:Nh,dismiss:t=>Wt({type:"DISMISS_TOAST",toastId:t})}}function _h({open:s,onOpenChange:n,table:t}){const{t:r}=V("user"),{toast:a}=oi(),[i,l]=m.useState(!1),[d,u]=m.useState(""),[o,c]=m.useState(""),h=async()=>{if(!d||!o){a({title:r("messages.error"),description:r("messages.send_mail.required_fields"),variant:"destructive"});return}try{l(!0),await Ps.sendMail({subject:d,content:o,filter:t.getState().columnFilters,sort:t.getState().sorting[0]?.id,sort_type:t.getState().sorting[0]?.desc?"DESC":"ASC"}),a({title:r("messages.success"),description:r("messages.send_mail.success")}),n(!1),u(""),c("")}catch{a({title:r("messages.error"),description:r("messages.send_mail.failed"),variant:"destructive"})}finally{l(!1)}};return e.jsx(ge,{open:s,onOpenChange:n,children:e.jsxs(ue,{className:"sm:max-w-[500px]",children:[e.jsxs(be,{children:[e.jsx(fe,{children:r("send_mail.title")}),e.jsx(Ve,{children:r("send_mail.description")})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"subject",className:"text-right",children:r("send_mail.subject")}),e.jsx(P,{id:"subject",value:d,onChange:k=>u(k.target.value),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"content",className:"text-right",children:r("send_mail.content")}),e.jsx(Ds,{id:"content",value:o,onChange:k=>c(k.target.value),className:"col-span-3",rows:6})]})]}),e.jsx(Le,{children:e.jsx(G,{type:"submit",onClick:h,disabled:i,children:r(i?"send_mail.sending":"send_mail.send")})})]})})}function wh({trigger:s}){const{t:n}=V("user"),[t,r]=m.useState(!1),[a,i]=m.useState(30),{data:l,isLoading:d}=ne({queryKey:["trafficResetStats",a],queryFn:()=>Xt.getStats({days:a}),enabled:t}),u=[{title:n("traffic_reset.stats.total_resets"),value:l?.data?.total_resets||0,icon:Ut,color:"text-blue-600",bgColor:"bg-blue-100"},{title:n("traffic_reset.stats.auto_resets"),value:l?.data?.auto_resets||0,icon:Na,color:"text-green-600",bgColor:"bg-green-100"},{title:n("traffic_reset.stats.manual_resets"),value:l?.data?.manual_resets||0,icon:Ss,color:"text-orange-600",bgColor:"bg-orange-100"},{title:n("traffic_reset.stats.cron_resets"),value:l?.data?.cron_resets||0,icon:Ln,color:"text-purple-600",bgColor:"bg-purple-100"}],o=[{value:7,label:n("traffic_reset.stats.days_options.week")},{value:30,label:n("traffic_reset.stats.days_options.month")},{value:90,label:n("traffic_reset.stats.days_options.quarter")},{value:365,label:n("traffic_reset.stats.days_options.year")}];return e.jsxs(ge,{open:t,onOpenChange:r,children:[e.jsx(as,{asChild:!0,children:s}),e.jsxs(ue,{className:"max-w-2xl",children:[e.jsxs(be,{children:[e.jsxs(fe,{className:"flex items-center gap-2",children:[e.jsx(Tn,{className:"h-5 w-5"}),n("traffic_reset.stats.title")]}),e.jsx(Ve,{children:n("traffic_reset.stats.description")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-medium",children:n("traffic_reset.stats.time_range")}),e.jsxs(J,{value:a.toString(),onValueChange:c=>i(Number(c)),children:[e.jsx(W,{className:"w-[180px]",children:e.jsx(Q,{})}),e.jsx(Y,{children:o.map(c=>e.jsx($,{value:c.value.toString(),children:c.label},c.value))})]})]}),d?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Yt,{className:"h-6 w-6 animate-spin"})}):e.jsx("div",{className:"grid grid-cols-2 gap-4",children:u.map((c,h)=>e.jsxs(Re,{className:"relative overflow-hidden",children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ge,{className:"text-sm font-medium text-muted-foreground",children:c.title}),e.jsx("div",{className:`rounded-lg p-2 ${c.bgColor}`,children:e.jsx(c.icon,{className:`h-4 w-4 ${c.color}`})})]}),e.jsxs(Ie,{children:[e.jsx("div",{className:"text-2xl font-bold",children:c.value.toLocaleString()}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n("traffic_reset.stats.in_period",{days:a})})]})]},h))}),l?.data&&e.jsxs(Re,{children:[e.jsxs(Fe,{children:[e.jsx(Ge,{className:"text-lg",children:n("traffic_reset.stats.breakdown")}),e.jsx(Os,{children:n("traffic_reset.stats.breakdown_description")})]}),e.jsx(Ie,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:n("traffic_reset.stats.auto_percentage")}),e.jsxs(U,{variant:"outline",className:"border-green-200 bg-green-50 text-green-700",children:[l.data.total_resets>0?(l.data.auto_resets/l.data.total_resets*100).toFixed(1):0,"%"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:n("traffic_reset.stats.manual_percentage")}),e.jsxs(U,{variant:"outline",className:"border-orange-200 bg-orange-50 text-orange-700",children:[l.data.total_resets>0?(l.data.manual_resets/l.data.total_resets*100).toFixed(1):0,"%"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:n("traffic_reset.stats.cron_percentage")}),e.jsxs(U,{variant:"outline",className:"border-purple-200 bg-purple-50 text-purple-700",children:[l.data.total_resets>0?(l.data.cron_resets/l.data.total_resets*100).toFixed(1):0,"%"]})]})]})})]})]})]})]})}const Ch=x.object({email_prefix:x.string().optional(),email_suffix:x.string().min(1),password:x.string().optional(),expired_at:x.number().optional().nullable(),plan_id:x.number().nullable(),generate_count:x.number().optional().nullable(),download_csv:x.boolean().optional()}).refine(s=>s.generate_count===null?s.email_prefix!==void 0&&s.email_prefix!=="":!0,{message:"Email prefix is required when generate_count is null",path:["email_prefix"]}),Sh={email_prefix:"",email_suffix:"",password:"",expired_at:null,plan_id:null,generate_count:void 0,download_csv:!1};function kh({refetch:s}){const{t:n}=V("user"),[t,r]=m.useState(!1),a=we({resolver:Ce(Ch),defaultValues:Sh,mode:"onChange"}),[i,l]=m.useState([]);return m.useEffect(()=>{t&&gs.getList().then(({data:d})=>{d&&l(d)})},[t]),e.jsxs(ge,{open:t,onOpenChange:r,children:[e.jsx(as,{asChild:!0,children:e.jsxs(G,{size:"sm",variant:"outline",className:"gap-0 space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:n("generate.button")})]})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(be,{children:[e.jsx(fe,{children:n("generate.title")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...a,children:[e.jsxs(p,{children:[e.jsx(j,{children:n("generate.form.email")}),e.jsxs("div",{className:"flex",children:[!a.watch("generate_count")&&e.jsx(v,{control:a.control,name:"email_prefix",render:({field:d})=>e.jsx(P,{className:"flex-[5] rounded-r-none",placeholder:n("generate.form.email_prefix"),...d})}),e.jsx("div",{className:`z-[-1] border border-r-0 border-input px-3 py-1 shadow-sm ${a.watch("generate_count")?"rounded-l-md":"border-l-0"}`,children:"@"}),e.jsx(v,{control:a.control,name:"email_suffix",render:({field:d})=>e.jsx(P,{className:"flex-[4] rounded-l-none",placeholder:n("generate.form.email_domain"),...d})})]})]}),e.jsx(v,{control:a.control,name:"password",render:({field:d})=>e.jsxs(p,{children:[e.jsx(j,{children:n("generate.form.password")}),e.jsx(P,{placeholder:n("generate.form.password_placeholder"),...d}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"expired_at",render:({field:d})=>e.jsxs(p,{className:"flex flex-col",children:[e.jsx(j,{children:n("generate.form.expire_time")}),e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsx(y,{children:e.jsxs(G,{variant:"outline",className:b("w-full pl-3 text-left font-normal",!d.value&&"text-muted-foreground"),children:[d.value?xe(d.value):e.jsx("span",{children:n("generate.form.expire_time_placeholder")}),e.jsx(Ss,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsxs(Ze,{className:"flex w-auto flex-col space-y-2 p-2",children:[e.jsx(nd,{asChild:!0,children:e.jsx(G,{variant:"outline",className:"w-full",onClick:()=>{d.onChange(null)},children:n("generate.form.permanent")})}),e.jsx("div",{className:"rounded-md border",children:e.jsx(vs,{mode:"single",selected:d.value?new Date(d.value*1e3):void 0,onSelect:u=>{u&&d.onChange(u?.getTime()/1e3)}})})]})]})]})}),e.jsx(v,{control:a.control,name:"plan_id",render:({field:d})=>e.jsxs(p,{children:[e.jsx(j,{children:n("generate.form.subscription")}),e.jsx(y,{children:e.jsxs(J,{value:d.value?d.value.toString():"null",onValueChange:u=>d.onChange(u==="null"?null:parseInt(u)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("generate.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx($,{value:"null",children:n("generate.form.subscription_none")}),i.map(u=>e.jsx($,{value:u.id.toString(),children:u.name},u.id))]})]})})]})}),!a.watch("email_prefix")&&e.jsx(v,{control:a.control,name:"generate_count",render:({field:d})=>e.jsxs(p,{children:[e.jsx(j,{children:n("generate.form.generate_count")}),e.jsx(P,{type:"number",placeholder:n("generate.form.generate_count_placeholder"),value:d.value||"",onChange:u=>d.onChange(u.target.value?parseInt(u.target.value):null)})]})}),a.watch("generate_count")&&e.jsx(v,{control:a.control,name:"download_csv",render:({field:d})=>e.jsxs(p,{className:"flex cursor-pointer flex-row items-center space-x-2 space-y-0",children:[e.jsx(y,{children:e.jsx(qn,{checked:d.value,onCheckedChange:d.onChange})}),e.jsx(j,{children:n("generate.form.download_csv")})]})})]}),e.jsxs(Le,{children:[e.jsx(G,{variant:"outline",onClick:()=>r(!1),children:n("generate.form.cancel")}),e.jsx(G,{onClick:()=>a.handleSubmit(async d=>{if(d.download_csv){const u=await Ps.generate(d);if(u&&u instanceof Blob){const o=window.URL.createObjectURL(u),c=document.createElement("a");c.href=o,c.download=`users_${new Date().getTime()}.csv`,document.body.appendChild(c),c.click(),c.remove(),window.URL.revokeObjectURL(o),A.success(n("generate.form.success")),a.reset(),s(),r(!1)}}else{const{data:u}=await Ps.generate(d);u&&(A.success(n("generate.form.success")),a.reset(),s(),r(!1))}})(),children:n("generate.form.submit")})]})]})]})}const Hn=Dr,ci=Pr,Th=Lr,di=m.forwardRef(({className:s,...n},t)=>e.jsx(Pa,{className:b("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",s),...n,ref:t}));di.displayName=Pa.displayName;const Dh=it("fixed overflow-y-scroll z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out",{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-md",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-md"}},defaultVariants:{side:"right"}}),Ga=m.forwardRef(({side:s="right",className:n,children:t,...r},a)=>e.jsxs(Th,{children:[e.jsx(di,{}),e.jsxs(La,{ref:a,className:b(Dh({side:s}),n),...r,children:[e.jsxs(_n,{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:[e.jsx(ms,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]}),t]})]}));Ga.displayName=La.displayName;const Wa=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",s),...n});Wa.displayName="SheetHeader";const mi=({className:s,...n})=>e.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...n});mi.displayName="SheetFooter";const Ya=m.forwardRef(({className:s,...n},t)=>e.jsx(Ra,{ref:t,className:b("text-lg font-semibold text-foreground",s),...n}));Ya.displayName=Ra.displayName;const Ja=m.forwardRef(({className:s,...n},t)=>e.jsx(Ea,{ref:t,className:b("text-sm text-muted-foreground",s),...n}));Ja.displayName=Ea.displayName;function Ph({table:s,refetch:n,permissionGroups:t=[],subscriptionPlans:r=[]}){const{t:a}=V("user"),{toast:i}=oi(),l=s.getState().columnFilters.length>0,[d,u]=m.useState([]),[o,c]=m.useState(!1),[h,k]=m.useState(!1),[C,S]=m.useState(!1),[f,N]=m.useState(!1),_=async()=>{try{const ee=await Ps.dumpCSV({filter:s.getState().columnFilters,sort:s.getState().sorting[0]?.id,sort_type:s.getState().sorting[0]?.desc?"DESC":"ASC"}),te=ee;console.log(ee);const q=new Blob([te],{type:"text/csv;charset=utf-8;"}),F=window.URL.createObjectURL(q),X=document.createElement("a");X.href=F,X.setAttribute("download",`users_${new Date().toISOString()}.csv`),document.body.appendChild(X),X.click(),X.remove(),window.URL.revokeObjectURL(F),i({title:a("messages.success"),description:a("messages.export.success")})}catch{i({title:a("messages.error"),description:a("messages.export.failed"),variant:"destructive"})}},T=async()=>{try{N(!0),await Ps.batchBan({filter:s.getState().columnFilters,sort:s.getState().sorting[0]?.id,sort_type:s.getState().sorting[0]?.desc?"DESC":"ASC"}),i({title:a("messages.success"),description:a("messages.batch_ban.success")}),n()}catch{i({title:a("messages.error"),description:a("messages.batch_ban.failed"),variant:"destructive"})}finally{N(!1),S(!1)}},D=[{label:a("filter.fields.email"),value:"email",type:"text",operators:[{label:a("filter.operators.contains"),value:"contains"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.id"),value:"id",type:"number",operators:[{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.plan_id"),value:"plan_id",type:"select",operators:[{label:a("filter.operators.eq"),value:"eq"}],useOptions:!0},{label:a("filter.fields.transfer_enable"),value:"transfer_enable",type:"number",unit:"GB",operators:[{label:a("filter.operators.gt"),value:"gt"},{label:a("filter.operators.lt"),value:"lt"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.total_used"),value:"total_used",type:"number",unit:"GB",operators:[{label:a("filter.operators.gt"),value:"gt"},{label:a("filter.operators.lt"),value:"lt"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.online_count"),value:"online_count",type:"number",operators:[{label:a("filter.operators.eq"),value:"eq"},{label:a("filter.operators.gt"),value:"gt"},{label:a("filter.operators.lt"),value:"lt"}]},{label:a("filter.fields.expired_at"),value:"expired_at",type:"date",operators:[{label:a("filter.operators.lt"),value:"lt"},{label:a("filter.operators.gt"),value:"gt"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.uuid"),value:"uuid",type:"text",operators:[{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.token"),value:"token",type:"text",operators:[{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.banned"),value:"banned",type:"select",operators:[{label:a("filter.operators.eq"),value:"eq"}],options:[{label:a("filter.status.normal"),value:"0"},{label:a("filter.status.banned"),value:"1"}]},{label:a("filter.fields.remark"),value:"remarks",type:"text",operators:[{label:a("filter.operators.contains"),value:"contains"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.inviter_email"),value:"invite_user.email",type:"text",operators:[{label:a("filter.operators.contains"),value:"contains"},{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.invite_user_id"),value:"invite_user_id",type:"number",operators:[{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.is_admin"),value:"is_admin",type:"boolean",operators:[{label:a("filter.operators.eq"),value:"eq"}]},{label:a("filter.fields.is_staff"),value:"is_staff",type:"boolean",operators:[{label:a("filter.operators.eq"),value:"eq"}]}],g=ee=>ee*1024*1024*1024,w=ee=>ee/(1024*1024*1024),R=()=>{u([...d,{field:"",operator:"",value:""}])},H=ee=>{u(d.filter((te,q)=>q!==ee))},I=(ee,te,q)=>{const F=[...d];if(F[ee]={...F[ee],[te]:q},te==="field"){const X=D.find(Ns=>Ns.value===q);X&&(F[ee].operator=X.operators[0].value,F[ee].value=X.type==="boolean"?!1:"")}u(F)},K=(ee,te)=>{const q=D.find(F=>F.value===ee.field);if(!q)return null;switch(q.type){case"text":return e.jsx(P,{placeholder:a("filter.sheet.value"),value:ee.value,onChange:F=>I(te,"value",F.target.value)});case"number":return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(P,{type:"number",placeholder:a("filter.sheet.value_number",{unit:q.unit}),value:q.unit==="GB"?w(ee.value||0):ee.value,onChange:F=>{const X=Number(F.target.value);I(te,"value",q.unit==="GB"?g(X):X)}}),q.unit&&e.jsx("span",{className:"text-sm text-muted-foreground",children:q.unit})]});case"date":return e.jsx(vs,{mode:"single",selected:ee.value,onSelect:F=>I(te,"value",F),className:"flex flex-1 justify-center rounded-md border"});case"select":return e.jsxs(J,{value:ee.value,onValueChange:F=>I(te,"value",F),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("filter.sheet.value")})}),e.jsx(Y,{children:q.useOptions?r.map(F=>e.jsx($,{value:F.value.toString(),children:F.label},F.value)):q.options?.map(F=>e.jsx($,{value:F.value.toString(),children:F.label},F.value))})]});case"boolean":return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Z,{checked:ee.value,onCheckedChange:F=>I(te,"value",F)}),e.jsx(Ae,{children:ee.value?a("filter.boolean.true"):a("filter.boolean.false")})]});default:return null}},ae=()=>{const ee=d.filter(te=>te.field&&te.operator&&te.value!=="").map(te=>{const q=D.find(X=>X.value===te.field);let F=te.value;return te.operator==="contains"?{id:te.field,value:F}:(q?.type==="date"&&F instanceof Date&&(F=Math.floor(F.getTime()/1e3)),q?.type==="boolean"&&(F=F?1:0),{id:te.field,value:`${te.operator}:${F}`})});s.setColumnFilters(ee),c(!1)};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[e.jsx(kh,{refetch:n}),e.jsx(P,{placeholder:a("filter.email_search"),value:s.getColumn("email")?.getFilterValue()??"",onChange:ee=>s.getColumn("email")?.setFilterValue(ee.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs(Hn,{open:o,onOpenChange:c,children:[e.jsx(ci,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(rd,{className:"mr-2 h-4 w-4"}),a("filter.advanced"),d.length>0&&e.jsx(U,{variant:"secondary",className:"ml-2 rounded-sm px-1",children:d.length})]})}),e.jsxs(Ga,{className:"w-[400px] sm:w-[540px]",children:[e.jsxs(Wa,{children:[e.jsx(Ya,{children:a("filter.sheet.title")}),e.jsx(Ja,{children:a("filter.sheet.description")})]}),e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-medium",children:a("filter.sheet.conditions")}),e.jsx(L,{variant:"outline",size:"sm",onClick:R,children:a("filter.sheet.add")})]}),e.jsx(lt,{className:"h-[calc(100vh-280px)] ",children:e.jsx("div",{className:"space-y-4",children:d.map((ee,te)=>e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ae,{children:a("filter.sheet.condition",{number:te+1})}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>H(te),children:e.jsx(ms,{className:"h-4 w-4"})})]}),e.jsxs(J,{value:ee.field,onValueChange:q=>I(te,"field",q),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("filter.sheet.field")})}),e.jsx(Y,{children:e.jsx(rs,{children:D.map(q=>e.jsx($,{value:q.value,className:"cursor-pointer",children:q.label},q.value))})})]}),ee.field&&e.jsxs(J,{value:ee.operator,onValueChange:q=>I(te,"operator",q),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("filter.sheet.operator")})}),e.jsx(Y,{children:D.find(q=>q.value===ee.field)?.operators.map(q=>e.jsx($,{value:q.value,children:q.label},q.value))})]}),ee.field&&ee.operator&&K(ee,te)]},te))})}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(L,{variant:"outline",onClick:()=>{u([]),c(!1)},children:a("filter.sheet.reset")}),e.jsx(L,{onClick:ae,children:a("filter.sheet.apply")})]})]})]})]}),l&&e.jsxs(L,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),u([])},className:"h-8 px-2 lg:px-3",children:[a("filter.sheet.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]}),e.jsxs(zs,{modal:!1,children:[e.jsx($s,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:a("actions.title")})}),e.jsxs(Ls,{children:[e.jsx(_e,{onClick:()=>k(!0),children:a("actions.send_email")}),e.jsx(_e,{onClick:_,children:a("actions.export_csv")}),e.jsx(rt,{}),e.jsx(_e,{asChild:!0,children:e.jsx(wh,{trigger:e.jsx("div",{className:"w-full cursor-pointer px-2 py-1.5 text-sm",children:a("actions.traffic_reset_stats")})})}),e.jsx(rt,{}),e.jsx(_e,{onClick:()=>S(!0),className:"text-red-600 focus:text-red-600",children:a("actions.batch_ban")})]})]})]}),e.jsx(_h,{open:h,onOpenChange:k,table:s}),e.jsx(zn,{open:C,onOpenChange:S,children:e.jsxs(za,{children:[e.jsxs($a,{children:[e.jsx(qa,{children:a("actions.confirm_ban.title")}),e.jsx(Ha,{children:a(l?"actions.confirm_ban.filtered_description":"actions.confirm_ban.all_description")})]}),e.jsxs(Aa,{children:[e.jsx(Ka,{disabled:f,children:a("actions.confirm_ban.cancel")}),e.jsx(Ua,{onClick:T,disabled:f,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:a(f?"actions.confirm_ban.banning":"actions.confirm_ban.confirm")})]})]})})]})}const ui=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m17.71 11.29l-5-5a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21l-5 5a1 1 0 0 0 1.42 1.42L11 9.41V17a1 1 0 0 0 2 0V9.41l3.29 3.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42"})}),xi=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17.71 11.29a1 1 0 0 0-1.42 0L13 14.59V7a1 1 0 0 0-2 0v7.59l-3.29-3.3a1 1 0 0 0-1.42 1.42l5 5a1 1 0 0 0 .33.21a.94.94 0 0 0 .76 0a1 1 0 0 0 .33-.21l5-5a1 1 0 0 0 0-1.42"})}),Lh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17 11H9.41l3.3-3.29a1 1 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33a1 1 0 0 0 0 .76a1 1 0 0 0 .21.33l5 5a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L9.41 13H17a1 1 0 0 0 0-2"})}),Rh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17.92 11.62a1 1 0 0 0-.21-.33l-5-5a1 1 0 0 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l5-5a1 1 0 0 0 .21-.33a1 1 0 0 0 0-.76"})}),dn=[{accessorKey:"record_at",header:"时间",cell:({row:s})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("time",{className:"text-sm text-muted-foreground",children:Sd(s.original.record_at)})})},{accessorKey:"u",header:"上行流量",cell:({row:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ui,{className:"h-4 w-4 text-emerald-500"}),e.jsx("span",{className:"font-mono text-sm",children:Oe(s.original.u/parseFloat(s.original.server_rate))})]})},{accessorKey:"d",header:"下行流量",cell:({row:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(xi,{className:"h-4 w-4 text-blue-500"}),e.jsx("span",{className:"font-mono text-sm",children:Oe(s.original.d/parseFloat(s.original.server_rate))})]})},{accessorKey:"server_rate",header:"倍率",cell:({row:s})=>{const n=s.original.server_rate;return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(U,{variant:"outline",className:"font-mono",children:[n,"x"]})})}},{id:"total",header:"总计",cell:({row:s})=>{const n=s.original.u+s.original.d;return e.jsx("div",{className:"flex items-center justify-end font-mono text-sm",children:Oe(n)})}}];function hi({user_id:s,dialogTrigger:n}){const{t}=V(["traffic"]),[r,a]=m.useState(!1),[i,l]=m.useState({pageIndex:0,pageSize:20}),{data:d,isLoading:u}=ne({queryKey:["userStats",s,i,r],queryFn:()=>r?Ps.getStats({user_id:s,pageSize:i.pageSize,page:i.pageIndex+1}):null}),o=ss({data:d?.data??[],columns:dn,pageCount:Math.ceil((d?.total??0)/i.pageSize),state:{pagination:i},manualPagination:!0,getCoreRowModel:ts(),onPaginationChange:l});return e.jsxs(ge,{open:r,onOpenChange:a,children:[e.jsx(as,{asChild:!0,children:n}),e.jsxs(ue,{className:"sm:max-w-[700px]",children:[e.jsx(be,{children:e.jsx(fe,{children:t("trafficRecord.title")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-md border",children:e.jsxs(Fn,{children:[e.jsx(In,{children:o.getHeaderGroups().map(c=>e.jsx(Bs,{children:c.headers.map(h=>e.jsx(Mn,{className:b("h-10 px-2 text-xs",h.id==="total"&&"text-right"),children:h.isPlaceholder?null:ba(h.column.columnDef.header,h.getContext())},h.id))},c.id))}),e.jsx(Vn,{children:u?Array.from({length:i.pageSize}).map((c,h)=>e.jsx(Bs,{children:Array.from({length:dn.length}).map((k,C)=>e.jsx(_t,{className:"p-2",children:e.jsx(ve,{className:"h-6 w-full"})},C))},h)):o.getRowModel().rows?.length?o.getRowModel().rows.map(c=>e.jsx(Bs,{"data-state":c.getIsSelected()&&"selected",className:"h-10",children:c.getVisibleCells().map(h=>e.jsx(_t,{className:"px-2",children:ba(h.column.columnDef.cell,h.getContext())},h.id))},c.id)):e.jsx(Bs,{children:e.jsx(_t,{colSpan:dn.length,className:"h-24 text-center",children:t("trafficRecord.noRecords")})})})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:t("trafficRecord.perPage")}),e.jsxs(J,{value:`${o.getState().pagination.pageSize}`,onValueChange:c=>{o.setPageSize(Number(c))},children:[e.jsx(W,{className:"h-8 w-[70px]",children:e.jsx(Q,{placeholder:o.getState().pagination.pageSize})}),e.jsx(Y,{side:"top",children:[10,20,30,40,50].map(c=>e.jsx($,{value:`${c}`,children:c},c))})]}),e.jsx("p",{className:"text-sm font-medium",children:t("trafficRecord.records")})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"flex w-[100px] items-center justify-center text-sm",children:t("trafficRecord.page",{current:o.getState().pagination.pageIndex+1,total:o.getPageCount()})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(G,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o.previousPage(),disabled:!o.getCanPreviousPage()||u,children:e.jsx(Lh,{className:"h-4 w-4"})}),e.jsx(G,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o.nextPage(),disabled:!o.getCanNextPage()||u,children:e.jsx(Rh,{className:"h-4 w-4"})})]})]})]})]})]})]})}function Eh({user:s,trigger:n,onSuccess:t}){const{t:r}=V("user"),[a,i]=m.useState(!1),[l,d]=m.useState(""),[u,o]=m.useState(!1),{data:c,isLoading:h}=ne({queryKey:["trafficResetHistory",s.id],queryFn:()=>Xt.getUserHistory(s.id,{limit:10}),enabled:a}),k=async()=>{try{o(!0);const{data:f}=await Xt.resetUser({user_id:s.id,reason:l.trim()||void 0});f&&(A.success(r("traffic_reset.reset_success")),i(!1),d(""),t?.())}finally{o(!1)}},C=f=>{switch(f){case"manual":return"bg-blue-100 text-blue-800 border-blue-200";case"monthly":return"bg-green-100 text-green-800 border-green-200";case"yearly":return"bg-purple-100 text-purple-800 border-purple-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}},S=f=>{switch(f){case"manual":return"bg-orange-100 text-orange-800 border-orange-200";case"cron":return"bg-indigo-100 text-indigo-800 border-indigo-200";case"auto":return"bg-emerald-100 text-emerald-800 border-emerald-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}};return e.jsxs(ge,{open:a,onOpenChange:i,children:[e.jsx(as,{asChild:!0,children:n}),e.jsxs(ue,{className:"max-h-[90vh] max-w-4xl overflow-hidden",children:[e.jsxs(be,{children:[e.jsxs(fe,{className:"flex items-center gap-2",children:[e.jsx(Ut,{className:"h-5 w-5"}),r("traffic_reset.title")]}),e.jsx(Ve,{children:r("traffic_reset.description",{email:s.email})})]}),e.jsxs(Dt,{defaultValue:"reset",className:"w-full",children:[e.jsxs(dt,{className:"grid w-full grid-cols-2",children:[e.jsxs(Xe,{value:"reset",className:"flex items-center gap-2",children:[e.jsx(Ut,{className:"h-4 w-4"}),r("traffic_reset.tabs.reset")]}),e.jsxs(Xe,{value:"history",className:"flex items-center gap-2",children:[e.jsx(rr,{className:"h-4 w-4"}),r("traffic_reset.tabs.history")]})]}),e.jsxs(ks,{value:"reset",className:"space-y-4",children:[e.jsxs(Re,{children:[e.jsx(Fe,{className:"pb-3",children:e.jsxs(Ge,{className:"flex items-center gap-2 text-lg",children:[e.jsx(_l,{className:"h-5 w-5"}),r("traffic_reset.user_info")]})}),e.jsx(Ie,{className:"space-y-3",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("columns.email")}),e.jsx("p",{className:"font-medium",children:s.email})]}),e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("columns.used_traffic")}),e.jsx("p",{className:"font-medium",children:Oe(s.total_used)})]}),e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("columns.total_traffic")}),e.jsx("p",{className:"font-medium",children:Oe(s.transfer_enable)})]}),e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("columns.expire_time")}),e.jsx("p",{className:"font-medium",children:s.expired_at?xe(s.expired_at):r("columns.expire_status.permanent")})]})]})})]}),e.jsxs(Re,{className:"border-amber-200 bg-amber-50",children:[e.jsx(Fe,{className:"pb-3",children:e.jsxs(Ge,{className:"flex items-center gap-2 text-lg text-amber-800",children:[e.jsx(Ht,{className:"h-5 w-5"}),r("traffic_reset.warning.title")]})}),e.jsx(Ie,{children:e.jsxs("ul",{className:"space-y-2 text-sm text-amber-700",children:[e.jsxs("li",{children:["• ",r("traffic_reset.warning.irreversible")]}),e.jsxs("li",{children:["• ",r("traffic_reset.warning.reset_to_zero")]}),e.jsxs("li",{children:["• ",r("traffic_reset.warning.logged")]})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"reason",children:r("traffic_reset.reason.label")}),e.jsx(Ds,{id:"reason",placeholder:r("traffic_reset.reason.placeholder"),value:l,onChange:f=>d(f.target.value),className:"min-h-[80px]"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r("traffic_reset.reason.optional")})]}),e.jsxs(Le,{children:[e.jsx(G,{variant:"outline",onClick:()=>i(!1),children:r("common:cancel")}),e.jsx(G,{onClick:k,disabled:u,className:"bg-destructive hover:bg-destructive/90",children:u?e.jsxs(e.Fragment,{children:[e.jsx(Yt,{className:"mr-2 h-4 w-4 animate-spin"}),r("traffic_reset.resetting")]}):e.jsxs(e.Fragment,{children:[e.jsx(Ut,{className:"mr-2 h-4 w-4"}),r("traffic_reset.confirm_reset")]})})]})]}),e.jsx(ks,{value:"history",className:"space-y-4",children:h?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Yt,{className:"h-6 w-6 animate-spin"})}):e.jsxs("div",{className:"space-y-4",children:[c?.data?.user&&e.jsxs(Re,{children:[e.jsx(Fe,{className:"pb-3",children:e.jsx(Ge,{className:"text-lg",children:r("traffic_reset.history.summary")})}),e.jsx(Ie,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("traffic_reset.history.reset_count")}),e.jsx("p",{className:"font-medium",children:c.data.user.reset_count})]}),e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("traffic_reset.history.last_reset")}),e.jsx("p",{className:"font-medium",children:c.data.user.last_reset_at?xe(c.data.user.last_reset_at):r("traffic_reset.history.never")})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("traffic_reset.history.next_reset")}),e.jsx("p",{className:"font-medium",children:c.data.user.next_reset_at?xe(c.data.user.next_reset_at):r("traffic_reset.history.no_schedule")})]})]})})]}),e.jsxs(Re,{children:[e.jsxs(Fe,{className:"pb-3",children:[e.jsx(Ge,{className:"text-lg",children:r("traffic_reset.history.records")}),e.jsx(Os,{children:r("traffic_reset.history.recent_records")})]}),e.jsx(Ie,{children:e.jsx(lt,{className:"h-[300px]",children:c?.data?.history?.length?e.jsx("div",{className:"space-y-3",children:c.data.history.map((f,N)=>e.jsxs("div",{children:[e.jsx("div",{className:"flex items-start justify-between rounded-lg border bg-card p-3",children:e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:C(f.reset_type),children:f.reset_type_name}),e.jsx(U,{variant:"outline",className:S(f.trigger_source),children:f.trigger_source_name})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsxs(Ae,{className:"flex items-center gap-1 text-muted-foreground",children:[e.jsx(Ln,{className:"h-3 w-3"}),r("traffic_reset.history.reset_time")]}),e.jsx("p",{className:"font-medium",children:xe(f.reset_time)})]}),e.jsxs("div",{children:[e.jsx(Ae,{className:"text-muted-foreground",children:r("traffic_reset.history.traffic_cleared")}),e.jsx("p",{className:"font-medium text-destructive",children:f.old_traffic.formatted})]})]})]})}),Ne.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M5 18h4.24a1 1 0 0 0 .71-.29l6.92-6.93L19.71 8a1 1 0 0 0 0-1.42l-4.24-4.29a1 1 0 0 0-1.42 0l-2.82 2.83l-6.94 6.93a1 1 0 0 0-.29.71V17a1 1 0 0 0 1 1m9.76-13.59l2.83 2.83l-1.42 1.42l-2.83-2.83ZM6 13.17l5.93-5.93l2.83 2.83L8.83 16H6ZM21 20H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2"})}),Vh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 11h-6V5a1 1 0 0 0-2 0v6H5a1 1 0 0 0 0 2h6v6a1 1 0 0 0 2 0v-6h6a1 1 0 0 0 0-2"})}),Mh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21 8.94a1.3 1.3 0 0 0-.06-.27v-.09a1 1 0 0 0-.19-.28l-6-6a1 1 0 0 0-.28-.19a.3.3 0 0 0-.09 0a.9.9 0 0 0-.33-.11H10a3 3 0 0 0-3 3v1H6a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3zm-6-3.53L17.59 8H16a1 1 0 0 1-1-1ZM15 19a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h1v7a3 3 0 0 0 3 3h5Zm4-4a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3v3a3 3 0 0 0 3 3h3Z"})}),yr=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21 11a1 1 0 0 0-1 1a8.05 8.05 0 1 1-2.22-5.5h-2.4a1 1 0 0 0 0 2h4.53a1 1 0 0 0 1-1V3a1 1 0 0 0-2 0v1.77A10 10 0 1 0 22 12a1 1 0 0 0-1-1"})}),Oh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M9.5 10.5H12a1 1 0 0 0 0-2h-1V8a1 1 0 0 0-2 0v.55a2.5 2.5 0 0 0 .5 4.95h1a.5.5 0 0 1 0 1H8a1 1 0 0 0 0 2h1v.5a1 1 0 0 0 2 0v-.55a2.5 2.5 0 0 0-.5-4.95h-1a.5.5 0 0 1 0-1M21 12h-3V3a1 1 0 0 0-.5-.87a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0A1 1 0 0 0 2 3v16a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1M5 20a1 1 0 0 1-1-1V4.73l2 1.14a1.08 1.08 0 0 0 1 0l3-1.72l3 1.72a1.08 1.08 0 0 0 1 0l2-1.14V19a3 3 0 0 0 .18 1Zm15-1a1 1 0 0 1-2 0v-5h2Z"})}),zh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M12.3 12.22A4.92 4.92 0 0 0 14 8.5a5 5 0 0 0-10 0a4.92 4.92 0 0 0 1.7 3.72A8 8 0 0 0 1 19.5a1 1 0 0 0 2 0a6 6 0 0 1 12 0a1 1 0 0 0 2 0a8 8 0 0 0-4.7-7.28M9 11.5a3 3 0 1 1 3-3a3 3 0 0 1-3 3m9.74.32A5 5 0 0 0 15 3.5a1 1 0 0 0 0 2a3 3 0 0 1 3 3a3 3 0 0 1-1.5 2.59a1 1 0 0 0-.5.84a1 1 0 0 0 .45.86l.39.26l.13.07a7 7 0 0 1 4 6.38a1 1 0 0 0 2 0a9 9 0 0 0-4.23-7.68"})}),$h=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 0 0-6.88 2.77V3a1 1 0 0 0-2 0v4.5a1 1 0 0 0 1 1h4.5a1 1 0 0 0 0-2h-2.4A8 8 0 1 1 4 12a1 1 0 0 0-2 0A10 10 0 1 0 12 2m0 6a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h2a1 1 0 0 0 0-2h-1V9a1 1 0 0 0-1-1"})}),Ah=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M20 6h-4V5a3 3 0 0 0-3-3h-2a3 3 0 0 0-3 3v1H4a1 1 0 0 0 0 2h1v11a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V8h1a1 1 0 0 0 0-2M10 5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1h-4Zm7 14a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V8h10Z"})}),qh=(s,n,t,r)=>{const{t:a}=V("user");return[{accessorKey:"is_admin",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.is_admin")}),enableSorting:!1,enableHiding:!0,filterFn:(i,l,d)=>d.includes(i.getValue(l)),size:0},{accessorKey:"is_staff",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.is_staff")}),enableSorting:!1,enableHiding:!0,filterFn:(i,l,d)=>d.includes(i.getValue(l)),size:0},{accessorKey:"id",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.id")}),cell:({row:i})=>e.jsx(U,{variant:"outline",children:i.original.id}),enableSorting:!0,enableHiding:!1},{accessorKey:"email",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.email")}),cell:({row:i})=>{const l=i.original.t||0,d=Date.now()/1e3-l<120,u=Math.floor(Date.now()/1e3-l);let o=d?a("columns.online_status.online"):l===0?a("columns.online_status.never"):a("columns.online_status.last_online",{time:xe(l)});if(!d&&l!==0){const c=Math.floor(u/60),h=Math.floor(c/60),k=Math.floor(h/24);k>0?o+=` `+a("columns.online_status.offline_duration.days",{count:k}):h>0?o+=` `+a("columns.online_status.offline_duration.hours",{count:h}):c>0?o+=` `+a("columns.online_status.offline_duration.minutes",{count:c}):o+=` -`+a("columns.online_status.offline_duration.seconds",{count:u})}return e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:b("size-2.5 rounded-full ring-2 ring-offset-2",d?"bg-green-500 ring-green-500/20":"bg-gray-300 ring-gray-300/20","transition-all duration-300")}),e.jsx("span",{className:"font-medium text-foreground/90",children:i.original.email})]})}),e.jsx(ce,{side:"bottom",className:"max-w-[280px]",children:e.jsx("p",{className:"whitespace-pre-line text-sm",children:o})})]})})},enableSorting:!1,enableHiding:!1},{accessorKey:"online_count",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.online_count")}),cell:({row:i})=>{const l=i.original.device_limit,d=i.original.online_count||0;return e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{children:e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs(U,{variant:"outline",className:b("min-w-[4rem] justify-center",l!==null&&d>=l?"border-destructive/50 bg-destructive/10 text-destructive":"border-primary/40 bg-primary/5 text-primary/90"),children:[d," / ",l===null?"∞":l]})})}),e.jsx(ce,{side:"bottom",children:e.jsx("p",{className:"text-sm",children:l===null?a("columns.device_limit.unlimited"):a("columns.device_limit.limited",{count:l})})})]})})},enableSorting:!0,enableHiding:!1},{accessorKey:"banned",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.status")}),cell:({row:i})=>{const l=i.original.banned;return e.jsx("div",{className:"flex justify-center",children:e.jsx(U,{className:b("min-w-20 justify-center transition-colors",l?"bg-destructive/15 text-destructive hover:bg-destructive/25":"bg-success/15 text-success hover:bg-success/25"),children:a(l?"columns.status_text.banned":"columns.status_text.normal")})})},enableSorting:!0,filterFn:(i,l,d)=>d.includes(i.getValue(l))},{accessorKey:"plan_id",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.subscription")}),cell:({row:i})=>e.jsx("div",{className:"min-w-[10em] break-all",children:i.original?.plan?.name||"-"}),enableSorting:!1,enableHiding:!1},{accessorKey:"group_id",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.group")}),cell:({row:i})=>e.jsx("div",{className:"flex flex-wrap gap-1",children:e.jsx(U,{variant:"outline",className:b("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5 whitespace-nowrap"),children:i.original?.group?.name||"-"})}),enableSorting:!1},{accessorKey:"total_used",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.used_traffic")}),cell:({row:i})=>{const l=Oe(i.original?.total_used),d=Oe(i.original?.transfer_enable),u=i.original?.total_used/i.original?.transfer_enable*100||0;return e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{className:"w-full",children:e.jsxs("div",{className:"w-full space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.toFixed(1),"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-secondary",children:e.jsx("div",{className:b("h-full rounded-full transition-all",u>90?"bg-destructive":"bg-primary"),style:{width:`${Math.min(u,100)}%`}})})]})}),e.jsx(ce,{side:"bottom",children:e.jsxs("p",{className:"text-sm",children:[a("columns.total_traffic"),": ",d]})})]})})}},{accessorKey:"transfer_enable",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.total_traffic")}),cell:({row:i})=>e.jsx("div",{className:"font-medium text-muted-foreground",children:Oe(i.original?.transfer_enable)})},{accessorKey:"expired_at",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.expire_time")}),cell:({row:i})=>{const l=i.original.expired_at,d=Date.now()/1e3,u=l!=null&&le.jsx(z,{column:i,title:a("columns.balance")}),cell:({row:i})=>{const l=bt(i.original?.balance);return e.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"¥"}),e.jsx("span",{className:"tabular-nums text-foreground",children:l})]})}},{accessorKey:"commission_balance",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.commission")}),cell:({row:i})=>{const l=bt(i.original?.commission_balance);return e.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"¥"}),e.jsx("span",{className:"tabular-nums text-foreground",children:l})]})}},{accessorKey:"created_at",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.register_time")}),cell:({row:i})=>e.jsx("div",{className:"truncate",children:me(i.original?.created_at)}),size:1e3},{id:"actions",header:({column:i})=>e.jsx(z,{column:i,className:"justify-end",title:a("columns.actions")}),cell:({row:i,table:l})=>e.jsxs(zs,{modal:!1,children:[e.jsx($s,{asChild:!0,children:e.jsx("div",{className:"text-center",children:e.jsx(G,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted","aria-label":a("columns.actions"),children:e.jsx(_a,{className:"size-4"})})})}),e.jsxs(Ls,{align:"end",className:"min-w-[40px]",children:[e.jsx(_e,{onSelect:d=>{d.preventDefault(),t(i.original),r(!0)},className:"p-0",children:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(Eh,{className:"mr-2"}),a("columns.actions_menu.edit")]})}),e.jsx(_e,{onSelect:d=>d.preventDefault(),className:"p-0",children:e.jsx(ri,{defaultValues:{email:i.original.email},trigger:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(Fh,{className:"mr-2 "}),a("columns.actions_menu.assign_order")]})})}),e.jsx(_e,{onSelect:()=>{wa(i.original.subscribe_url).then(()=>{A.success(a("common:copy.success"))})},className:"p-0",children:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(Ih,{className:"mr-2"}),a("columns.actions_menu.copy_url")]})}),e.jsx(_e,{onSelect:()=>{Ps.resetSecret(i.original.id).then(({data:d})=>{d&&A.success("重置成功")})},children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(br,{className:"mr-2 "}),a("columns.actions_menu.reset_secret")]})}),e.jsx(_e,{onSelect:()=>{},className:"p-0",children:e.jsxs(Ys,{className:"flex items-center px-2 py-1.5",to:`/finance/order?user_id=eq:${i.original?.id}`,children:[e.jsx(Vh,{className:"mr-2"}),a("columns.actions_menu.orders")]})}),e.jsx(_e,{onSelect:()=>{l.setColumnFilters([{id:"invite_user_id",value:"eq:"+i.original?.id}])},children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(Mh,{className:"mr-2 "}),a("columns.actions_menu.invites")]})}),e.jsx(_e,{onSelect:d=>d.preventDefault(),className:"p-0",children:e.jsx(hi,{user_id:i.original?.id,dialogTrigger:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(Oh,{className:"mr-2 "}),a("columns.actions_menu.traffic_records")]})})}),e.jsx(_e,{onSelect:d=>d.preventDefault(),className:"p-0",children:e.jsx(Lh,{user:i.original,onSuccess:s,trigger:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(br,{className:"mr-2"}),a("columns.actions_menu.reset_traffic")]})})}),e.jsx(_e,{onSelect:d=>d.preventDefault(),className:"p-0",children:e.jsx(Rh,{title:a("columns.actions_menu.delete_confirm_title"),description:a("columns.actions_menu.delete_confirm_description",{email:i.original.email}),cancelText:a("common:cancel"),confirmText:a("common:confirm"),variant:"destructive",onConfirm:async()=>{try{const{data:d}=await Ps.destroy(i.original.id);d&&(A.success(a("common:delete.success")),s())}catch{A.error(a("common:delete.failed"))}},children:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5 text-destructive hover:text-destructive",children:[e.jsx(zh,{className:"mr-2"}),a("columns.actions_menu.delete")]})})})]})]})}]},gi=m.createContext(void 0),Hn=()=>{const s=m.useContext(gi);if(!s)throw new Error("useUserEdit must be used within an UserEditProvider");return s},fi=({children:s,refreshData:n})=>{const[t,r]=m.useState(!1),[a,i]=m.useState(null),l={isOpen:t,setIsOpen:r,editingUser:a,setEditingUser:i,refreshData:n};return e.jsx(gi.Provider,{value:l,children:s})},Ah=x.object({id:x.number().default(0),email:x.string().email().default(""),invite_user_email:x.string().email().nullable().optional().default(null),password:x.string().optional().nullable().default(null),balance:x.coerce.number().default(0),commission_balance:x.coerce.number().default(0),u:x.number().default(0),d:x.number().default(0),transfer_enable:x.number().default(0),expired_at:x.number().nullable().default(null),plan_id:x.number().nullable().default(null),banned:x.boolean().default(!1),commission_type:x.number().default(0),commission_rate:x.number().nullable().default(null),discount:x.number().nullable().default(null),speed_limit:x.number().nullable().default(null),device_limit:x.number().nullable().default(null),is_admin:x.boolean().default(!1),is_staff:x.boolean().default(!1),remarks:x.string().nullable().default(null)});function pi(){const{t:s}=V("user"),{isOpen:n,setIsOpen:t,editingUser:r,refreshData:a}=Hn(),[i,l]=m.useState(!1),[d,u]=m.useState([]),o=we({resolver:Ce(Ah)});return m.useEffect(()=>{n&&gs.getList().then(({data:c})=>{u(c)})},[n]),m.useEffect(()=>{if(r){const c=r.invite_user?.email,{invite_user:h,...k}=r;o.reset({...k,invite_user_email:c||null,password:null})}},[r,o]),e.jsx(qn,{open:n,onOpenChange:t,children:e.jsxs(Ba,{className:"max-w-[90%] space-y-4",children:[e.jsxs(Ga,{children:[e.jsx(Wa,{children:s("edit.title")}),e.jsx(Ya,{})]}),e.jsxs(Se,{...o,children:[e.jsx(v,{control:o.control,name:"email",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.email")}),e.jsx(y,{children:e.jsx(P,{...c,placeholder:s("edit.form.email_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(E,{...c})]})}),e.jsx(v,{control:o.control,name:"invite_user_email",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.inviter_email")}),e.jsx(y,{children:e.jsx(P,{value:c.value||"",onChange:h=>c.onChange(h.target.value?h.target.value:null),placeholder:s("edit.form.inviter_email_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(E,{...c})]})}),e.jsx(v,{control:o.control,name:"password",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.password")}),e.jsx(y,{children:e.jsx(P,{type:"password",value:c.value||"",onChange:c.onChange,placeholder:s("edit.form.password_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(E,{...c})]})}),e.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[e.jsx(v,{control:o.control,name:"balance",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.balance")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:c.onChange,placeholder:s("edit.form.balance_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"¥"})]})}),e.jsx(E,{...c})]})}),e.jsx(v,{control:o.control,name:"commission_balance",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.commission_balance")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:c.onChange,placeholder:s("edit.form.commission_balance_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"¥"})]})}),e.jsx(E,{...c})]})}),e.jsx(v,{control:o.control,name:"u",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.upload")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{value:c.value/1024/1024/1024||"",onChange:h=>c.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.upload_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(E,{...c})]})}),e.jsx(v,{control:o.control,name:"d",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.download")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value/1024/1024/1024||"",onChange:h=>c.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.download_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(E,{...c})]})})]}),e.jsx(v,{control:o.control,name:"transfer_enable",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.total_traffic")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value/1024/1024/1024||"",onChange:h=>c.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.total_traffic_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"expired_at",render:({field:c})=>e.jsxs(p,{className:"flex flex-col",children:[e.jsx(j,{children:s("edit.form.expire_time")}),e.jsxs(os,{open:i,onOpenChange:l,children:[e.jsx(cs,{asChild:!0,children:e.jsx(y,{children:e.jsxs(L,{type:"button",variant:"outline",className:b("w-full pl-3 text-left font-normal",!c.value&&"text-muted-foreground"),onClick:()=>l(!0),children:[c.value?me(c.value):e.jsx("span",{children:s("edit.form.expire_time_placeholder")}),e.jsx(Ss,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",side:"top",sideOffset:4,onInteractOutside:h=>{h.preventDefault()},onEscapeKeyDown:h=>{h.preventDefault()},children:e.jsxs("div",{className:"flex flex-col space-y-3 p-3",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{c.onChange(null),l(!1)},children:s("edit.form.expire_time_permanent")}),e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{const h=new Date;h.setMonth(h.getMonth()+1),h.setHours(23,59,59,999),c.onChange(Math.floor(h.getTime()/1e3)),l(!1)},children:s("edit.form.expire_time_1month")}),e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{const h=new Date;h.setMonth(h.getMonth()+3),h.setHours(23,59,59,999),c.onChange(Math.floor(h.getTime()/1e3)),l(!1)},children:s("edit.form.expire_time_3months")})]}),e.jsx("div",{className:"rounded-md border",children:e.jsx(vs,{mode:"single",selected:c.value?new Date(c.value*1e3):void 0,onSelect:h=>{if(h){const k=new Date(c.value?c.value*1e3:Date.now());h.setHours(k.getHours(),k.getMinutes(),k.getSeconds()),c.onChange(Math.floor(h.getTime()/1e3))}},disabled:h=>h{const h=new Date;h.setHours(23,59,59,999),c.onChange(Math.floor(h.getTime()/1e3))},className:"h-6 px-2 text-xs",children:s("edit.form.expire_time_today")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P,{type:"datetime-local",step:"1",value:me(c.value,"YYYY-MM-DDTHH:mm:ss"),onChange:h=>{const k=new Date(h.target.value);isNaN(k.getTime())||c.onChange(Math.floor(k.getTime()/1e3))},className:"flex-1"}),e.jsx(L,{type:"button",variant:"outline",onClick:()=>l(!1),children:s("edit.form.expire_time_confirm")})]})]})]})})]}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"plan_id",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.subscription")}),e.jsx(y,{children:e.jsxs(J,{value:c.value!==null?String(c.value):"null",onValueChange:h=>c.onChange(h==="null"?null:parseInt(h)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("edit.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx($,{value:"null",children:s("edit.form.subscription_none")}),d.map(h=>e.jsx($,{value:String(h.id),children:h.name},h.id))]})]})})]})}),e.jsx(v,{control:o.control,name:"banned",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.account_status")}),e.jsx(y,{children:e.jsxs(J,{value:c.value.toString(),onValueChange:h=>c.onChange(h==="true"),children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx($,{value:"true",children:s("columns.status_text.banned")}),e.jsx($,{value:"false",children:s("columns.status_text.normal")})]})]})})]})}),e.jsx(v,{control:o.control,name:"commission_type",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.commission_type")}),e.jsx(y,{children:e.jsxs(J,{value:c.value.toString(),onValueChange:h=>c.onChange(parseInt(h)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("edit.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("edit.form.commission_type_system")}),e.jsx($,{value:"1",children:s("edit.form.commission_type_cycle")}),e.jsx($,{value:"2",children:s("edit.form.commission_type_onetime")})]})]})})]})}),e.jsx(v,{control:o.control,name:"commission_rate",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.commission_rate")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:h=>c.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.commission_rate_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"%"})]})})]})}),e.jsx(v,{control:o.control,name:"discount",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.discount")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:h=>c.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.discount_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"%"})]})}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"speed_limit",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.speed_limit")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:h=>c.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.speed_limit_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"Mbps"})]})}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"device_limit",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.device_limit")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:h=>c.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.device_limit_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"台"})]})}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"is_admin",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.is_admin")}),e.jsx("div",{className:"py-2",children:e.jsx(y,{children:e.jsx(Z,{checked:c.value,onCheckedChange:h=>c.onChange(h)})})}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"is_staff",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.is_staff")}),e.jsx("div",{className:"py-2",children:e.jsx(y,{children:e.jsx(Z,{checked:c.value,onCheckedChange:h=>c.onChange(h)})})})]})}),e.jsx(v,{control:o.control,name:"remarks",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.remarks")}),e.jsx(y,{children:e.jsx(Ds,{className:"h-24",value:c.value||"",onChange:h=>c.onChange(h.currentTarget.value??null),placeholder:s("edit.form.remarks_placeholder")})}),e.jsx(E,{})]})}),e.jsxs(mi,{children:[e.jsx(L,{variant:"outline",onClick:()=>t(!1),children:s("edit.form.cancel")}),e.jsx(L,{type:"submit",onClick:()=>{o.handleSubmit(c=>{Ps.update(c).then(({data:h})=>{h&&(A.success(s("edit.form.success")),t(!1),a())})})()},children:s("edit.form.submit")})]})]})]})})}function qh(){const[s]=Nl(),[n,t]=m.useState({}),[r,a]=m.useState({is_admin:!1,is_staff:!1}),[i,l]=m.useState([]),[d,u]=m.useState([]),[o,c]=m.useState({pageIndex:0,pageSize:20});m.useEffect(()=>{const g=s.get("email");g&&l(w=>w.some(H=>H.id==="email")?w:[...w,{id:"email",value:g}])},[s]);const{refetch:h,data:k,isLoading:C}=ne({queryKey:["userList",o,i,d],queryFn:()=>Ps.getList({pageSize:o.pageSize,current:o.pageIndex+1,filter:i,sort:d})}),[S,f]=m.useState([]),[N,_]=m.useState([]);m.useEffect(()=>{mt.getList().then(({data:g})=>{f(g)}),gs.getList().then(({data:g})=>{_(g)})},[]);const T=S.map(g=>({label:g.name,value:g.id})),D=N.map(g=>({label:g.name,value:g.id}));return e.jsxs(fi,{refreshData:h,children:[e.jsx(Hh,{data:k?.data??[],rowCount:k?.total??0,sorting:d,setSorting:u,columnVisibility:r,setColumnVisibility:a,rowSelection:n,setRowSelection:t,columnFilters:i,setColumnFilters:l,pagination:o,setPagination:c,refetch:h,serverGroupList:S,permissionGroups:T,subscriptionPlans:D,isLoading:C}),e.jsx(pi,{})]})}function Hh({data:s,rowCount:n,sorting:t,setSorting:r,columnVisibility:a,setColumnVisibility:i,rowSelection:l,setRowSelection:d,columnFilters:u,setColumnFilters:o,pagination:c,setPagination:h,refetch:k,serverGroupList:C,permissionGroups:S,subscriptionPlans:f,isLoading:N}){const{setIsOpen:_,setEditingUser:T}=Hn(),D=ss({data:s,columns:$h(k,C,T,_),state:{sorting:t,columnVisibility:a,rowSelection:l,columnFilters:u,pagination:c},rowCount:n,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:d,onSortingChange:r,onColumnFiltersChange:o,onColumnVisibilityChange:i,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),onPaginationChange:h,getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnVisibility:{commission_balance:!1,created_at:!1,is_admin:!1,is_staff:!1,permission_group:!1,plan_id:!1},columnPinning:{right:["actions"]}}});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Th,{table:D,refetch:k,serverGroupList:C,permissionGroups:S,subscriptionPlans:f}),e.jsx(xs,{table:D,isLoading:N})]})}function Uh(){const{t:s}=V("user");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("manage.title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("manage.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx("div",{className:"w-full",children:e.jsx(qh,{})})})]})]})}const Kh=Object.freeze(Object.defineProperty({__proto__:null,default:Uh},Symbol.toStringTag,{value:"Module"}));function Bh({column:s,title:n,options:t}){const r=new Set(s?.getFilterValue());return e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(G,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(ld,{className:"mr-2 h-4 w-4"}),n,r?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:r.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:r.size>2?e.jsxs(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):t.filter(a=>r.has(a.value)).map(a=>e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:a.label},`selected-${a.value}`))})]})]})}),e.jsx(Ze,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Js,{children:[e.jsx(ut,{placeholder:n}),e.jsxs(Qs,{children:[e.jsx(xt,{children:"No results found."}),e.jsx(fs,{children:t.map(a=>{const i=r.has(a.value);return e.jsxs(We,{onSelect:()=>{i?r.delete(a.value):r.add(a.value);const l=Array.from(r);s?.setFilterValue(l.length?l:void 0)},children:[e.jsx("div",{className:b("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",i?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(id,{className:b("h-4 w-4")})}),a.icon&&e.jsx(a.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:a.label})]},`option-${a.value}`)})}),r.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(fs,{children:e.jsx(We,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const Gh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 11H5a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2"})});function Wh({table:s}){const{t:n}=V("ticket");return e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-4",children:[e.jsx(Dt,{defaultValue:s.getColumn("status")?.getFilterValue(),onValueChange:t=>s.getColumn("status")?.setFilterValue(t),children:e.jsxs(dt,{className:"grid w-full grid-cols-2",children:[e.jsx(Xe,{value:"0",children:n("status.pending")}),e.jsx(Xe,{value:"1",children:n("status.closed")})]})}),s.getColumn("level")&&e.jsx(Bh,{column:s.getColumn("level"),title:n("columns.level"),options:[{label:n("level.low"),value:Qe.LOW,icon:Gh,color:"gray"},{label:n("level.medium"),value:Qe.MIDDLE,icon:ui,color:"yellow"},{label:n("level.high"),value:Qe.HIGH,icon:xi,color:"red"}]})]})})}function Yh(){return e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"text-foreground",children:[e.jsx("circle",{cx:"4",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{id:"spinner_qFRN",begin:"0;spinner_OcgL.end+0.25s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})}),e.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{begin:"spinner_qFRN.begin+0.1s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})}),e.jsx("circle",{cx:"20",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{id:"spinner_OcgL",begin:"spinner_qFRN.begin+0.2s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})})]})}const Jh=it("flex gap-2 max-w-[60%] items-end relative group",{variants:{variant:{received:"self-start",sent:"self-end flex-row-reverse"},layout:{default:"",ai:"max-w-full w-full items-center"}},defaultVariants:{variant:"received",layout:"default"}}),ji=m.forwardRef(({className:s,variant:n,layout:t,children:r,...a},i)=>e.jsx("div",{className:b(Jh({variant:n,layout:t,className:s}),"relative group"),ref:i,...a,children:m.Children.map(r,l=>m.isValidElement(l)&&typeof l.type!="string"?m.cloneElement(l,{variant:n,layout:t}):l)}));ji.displayName="ChatBubble";const Qh=it("p-4",{variants:{variant:{received:"bg-secondary text-secondary-foreground rounded-r-lg rounded-tl-lg",sent:"bg-primary text-primary-foreground rounded-l-lg rounded-tr-lg"},layout:{default:"",ai:"border-t w-full rounded-none bg-transparent"}},defaultVariants:{variant:"received",layout:"default"}}),vi=m.forwardRef(({className:s,variant:n,layout:t,isLoading:r=!1,children:a,...i},l)=>e.jsx("div",{className:b(Qh({variant:n,layout:t,className:s}),"break-words max-w-full whitespace-pre-wrap"),ref:l,...i,children:r?e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(Yh,{})}):a}));vi.displayName="ChatBubbleMessage";const Xh=m.forwardRef(({variant:s,className:n,children:t,...r},a)=>e.jsx("div",{ref:a,className:b("absolute top-1/2 -translate-y-1/2 flex opacity-0 group-hover:opacity-100 transition-opacity duration-200",s==="sent"?"-left-1 -translate-x-full flex-row-reverse":"-right-1 translate-x-full",n),...r,children:t}));Xh.displayName="ChatBubbleActionWrapper";const bi=m.forwardRef(({className:s,...n},t)=>e.jsx(Ds,{autoComplete:"off",ref:t,name:"message",className:b("max-h-12 px-4 py-3 bg-background text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 w-full rounded-md flex items-center h-16 resize-none",s),...n}));bi.displayName="ChatInput";const yi=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29l-4.3 4.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l4.29-4.3l4.29 4.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42Z"})}),Ni=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M15.098 12.634L13 11.423V7a1 1 0 0 0-2 0v5a1 1 0 0 0 .5.866l2.598 1.5a1 1 0 1 0 1-1.732M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8.01 8.01 0 0 1-8 8"})}),yr=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m11.29 12l3.54-3.54a1 1 0 0 0 0-1.41a1 1 0 0 0-1.42 0l-4.24 4.24a1 1 0 0 0 0 1.42L13.41 17a1 1 0 0 0 .71.29a1 1 0 0 0 .71-.29a1 1 0 0 0 0-1.41Z"})}),Zh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})}),eg=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M3.71 16.29a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21a1 1 0 0 0-.21.33a1 1 0 0 0 .21 1.09a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21a1 1 0 0 0 .21-1.09a1 1 0 0 0-.21-.33M7 8h14a1 1 0 0 0 0-2H7a1 1 0 0 0 0 2m-3.29 3.29a1 1 0 0 0-1.09-.21a1.2 1.2 0 0 0-.33.21a1 1 0 0 0-.21.33a.94.94 0 0 0 0 .76a1.2 1.2 0 0 0 .21.33a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21a1.2 1.2 0 0 0 .21-.33a.94.94 0 0 0 0-.76a1 1 0 0 0-.21-.33M21 11H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2M3.71 6.29a1 1 0 0 0-.33-.21a1 1 0 0 0-1.09.21a1.2 1.2 0 0 0-.21.33a.94.94 0 0 0 0 .76a1.2 1.2 0 0 0 .21.33a1.2 1.2 0 0 0 .33.21a1 1 0 0 0 1.09-.21a1.2 1.2 0 0 0 .21-.33a.94.94 0 0 0 0-.76a1.2 1.2 0 0 0-.21-.33M21 16H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2"})}),sg=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M9 12H7a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2m-1-2h4a1 1 0 0 0 0-2H8a1 1 0 0 0 0 2m1 6H7a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2m12-4h-3V3a1 1 0 0 0-.5-.87a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0A1 1 0 0 0 2 3v16a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1M5 20a1 1 0 0 1-1-1V4.73l2 1.14a1.08 1.08 0 0 0 1 0l3-1.72l3 1.72a1.08 1.08 0 0 0 1 0l2-1.14V19a3 3 0 0 0 .18 1Zm15-1a1 1 0 0 1-2 0v-5h2Zm-6.44-2.83a.8.8 0 0 0-.18-.09a.6.6 0 0 0-.19-.06a1 1 0 0 0-.9.27A1.05 1.05 0 0 0 12 17a1 1 0 0 0 .07.38a1.2 1.2 0 0 0 .22.33a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21A1 1 0 0 0 14 17a1.05 1.05 0 0 0-.29-.71a2 2 0 0 0-.15-.12m.14-3.88a1 1 0 0 0-1.62.33A1 1 0 0 0 13 14a1 1 0 0 0 1-1a1 1 0 0 0-.08-.38a.9.9 0 0 0-.22-.33"})});function tg(){return e.jsxs("div",{className:"flex h-full flex-col space-y-4 p-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(je,{className:"h-8 w-3/4"}),e.jsx(je,{className:"h-4 w-1/2"})]}),e.jsx("div",{className:"flex-1 space-y-4",children:[1,2,3].map(s=>e.jsx(je,{className:"h-20 w-2/3"},s))})]})}function ag(){return e.jsx("div",{className:"space-y-4 p-4",children:[1,2,3,4].map(s=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(je,{className:"h-5 w-4/5"}),e.jsx(je,{className:"h-4 w-2/3"}),e.jsx(je,{className:"h-3 w-1/2"})]},s))})}function ng({ticket:s,isActive:n,onClick:t}){const{t:r}=V("ticket"),a=i=>{switch(i){case Qe.HIGH:return"bg-red-50 text-red-600 border-red-200";case Qe.MIDDLE:return"bg-yellow-50 text-yellow-600 border-yellow-200";case Qe.LOW:return"bg-green-50 text-green-600 border-green-200";default:return"bg-gray-50 text-gray-600 border-gray-200"}};return e.jsxs("div",{className:b("flex cursor-pointer flex-col border-b p-4 hover:bg-accent/50",n&&"bg-accent"),onClick:t,children:[e.jsxs("div",{className:"flex max-w-[280px] items-center justify-between gap-2",children:[e.jsx("h4",{className:"flex-1 truncate font-medium",children:s.subject}),e.jsx(U,{variant:s.status===Ws.CLOSED?"secondary":"default",className:"shrink-0",children:s.status===Ws.CLOSED?r("status.closed"):r("status.processing")})]}),e.jsx("div",{className:"mt-1 max-w-[280px] truncate text-sm text-muted-foreground",children:s.user?.email}),e.jsxs("div",{className:"mt-2 flex items-center justify-between text-xs",children:[e.jsx("time",{className:"text-muted-foreground",children:me(s.updated_at)}),e.jsx("div",{className:b("rounded-full border px-2 py-0.5 text-xs font-medium",a(s.level)),children:r(`level.${s.level===Qe.LOW?"low":s.level===Qe.MIDDLE?"medium":"high"}`)})]})]})}function rg({ticketId:s,dialogTrigger:n}){const{t}=V("ticket"),r=As(),a=m.useRef(null),i=m.useRef(null),[l,d]=m.useState(!1),[u,o]=m.useState(""),[c,h]=m.useState(!1),[k,C]=m.useState(s),[S,f]=m.useState(""),[N,_]=m.useState(!1),{setIsOpen:T,setEditingUser:D}=Hn(),{data:g,isLoading:w,refetch:R}=ne({queryKey:["tickets",l],queryFn:()=>l?Nt.getList({filter:[{id:"status",value:[Ws.OPENING]}]}):Promise.resolve(null),enabled:l}),{data:H,refetch:I,isLoading:K}=ne({queryKey:["ticket",k,l],queryFn:()=>l?Nt.getInfo(k):Promise.resolve(null),refetchInterval:l?5e3:!1,retry:3}),ae=H?.data,te=(g?.data||[]).filter(ie=>ie.subject.toLowerCase().includes(S.toLowerCase())||ie.user?.email.toLowerCase().includes(S.toLowerCase())),q=(ie="smooth")=>{if(a.current){const{scrollHeight:_s,clientHeight:Fs}=a.current;a.current.scrollTo({top:_s-Fs,behavior:ie})}};m.useEffect(()=>{if(!l)return;const ie=requestAnimationFrame(()=>{q("instant"),setTimeout(()=>q(),1e3)});return()=>{cancelAnimationFrame(ie)}},[l,ae?.messages]);const F=async()=>{const ie=u.trim();!ie||c||(h(!0),Nt.reply({id:k,message:ie}).then(()=>{o(""),I(),q(),setTimeout(()=>{i.current?.focus()},0)}).finally(()=>{h(!1)}))},X=async()=>{Nt.close(k).then(()=>{A.success(t("actions.close_success")),I(),R()})},Ns=()=>{ae?.user&&r("/finance/order?user_id="+ae.user.id)},De=ae?.status===Ws.CLOSED;return e.jsxs(ge,{open:l,onOpenChange:d,children:[e.jsx(as,{asChild:!0,children:n??e.jsx(G,{variant:"outline",children:t("actions.view_ticket")})}),e.jsxs(de,{className:"flex h-[90vh] max-w-6xl flex-col gap-0 p-0",children:[e.jsx(fe,{}),e.jsxs("div",{className:"flex h-full",children:[e.jsx(G,{variant:"ghost",size:"icon",className:"absolute left-2 top-2 z-50 md:hidden",onClick:()=>_(!N),children:e.jsx(yr,{className:b("h-4 w-4 transition-transform",!N&&"rotate-180")})}),e.jsxs("div",{className:b("absolute inset-y-0 left-0 z-40 flex flex-col border-r bg-background transition-transform duration-200 ease-in-out md:relative",N?"-translate-x-full":"translate-x-0","w-80 md:w-80 md:translate-x-0"),children:[e.jsxs("div",{className:"space-y-4 border-b p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-semibold",children:t("list.title")}),e.jsx(G,{variant:"ghost",size:"icon",className:"hidden h-8 w-8 md:flex",onClick:()=>_(!N),children:e.jsx(yr,{className:b("h-4 w-4 transition-transform",!N&&"rotate-180")})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Zh,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 transform text-muted-foreground"}),e.jsx(P,{placeholder:t("list.search_placeholder"),value:S,onChange:ie=>f(ie.target.value),className:"pl-8"})]})]}),e.jsx(lt,{className:"flex-1",children:e.jsx("div",{className:"w-full",children:w?e.jsx(ag,{}):te.length===0?e.jsx("div",{className:"flex h-full items-center justify-center p-4 text-muted-foreground",children:t(S?"list.no_search_results":"list.no_tickets")}):te.map(ie=>e.jsx(ng,{ticket:ie,isActive:ie.id===k,onClick:()=>{C(ie.id),window.innerWidth<768&&_(!0)}},ie.id))})})]}),e.jsxs("div",{className:"relative flex flex-1 flex-col",children:[!N&&e.jsx("div",{className:"absolute inset-0 z-30 bg-black/20 md:hidden",onClick:()=>_(!0)}),K?e.jsx(tg,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col space-y-4 border-b p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("h2",{className:"text-2xl font-semibold",children:ae?.subject}),e.jsx(U,{variant:De?"secondary":"default",children:t(De?"status.closed":"status.processing")}),!De&&e.jsx(ps,{title:t("actions.close_confirm_title"),description:t("actions.close_confirm_description"),confirmText:t("actions.close_confirm_button"),variant:"destructive",onConfirm:X,children:e.jsxs(G,{variant:"ghost",size:"sm",className:"gap-1 text-muted-foreground hover:text-destructive",children:[e.jsx(yi,{className:"h-4 w-4"}),t("actions.close_ticket")]})})]}),e.jsxs("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(Ta,{className:"h-4 w-4"}),e.jsx("span",{children:ae?.user?.email})]}),e.jsx(Te,{orientation:"vertical",className:"h-4"}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(Ni,{className:"h-4 w-4"}),e.jsxs("span",{children:[t("detail.created_at")," ",me(ae?.created_at)]})]}),e.jsx(Te,{orientation:"vertical",className:"h-4"}),e.jsx(U,{variant:"outline",children:ae?.level!=null&&t(`level.${ae.level===Qe.LOW?"low":ae.level===Qe.MIDDLE?"medium":"high"}`)})]})]}),ae?.user&&e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(G,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.user_info"),onClick:()=>{D(ae.user),T(!0)},children:e.jsx(Ta,{className:"h-4 w-4"})}),e.jsx(hi,{user_id:ae.user.id,dialogTrigger:e.jsx(G,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.traffic_records"),children:e.jsx(eg,{className:"h-4 w-4"})})}),e.jsx(G,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.order_records"),onClick:Ns,children:e.jsx(sg,{className:"h-4 w-4"})})]})]})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx("div",{ref:a,className:"h-full space-y-4 overflow-y-auto p-6",children:ae?.messages?.length===0?e.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:t("detail.no_messages")}):ae?.messages?.map(ie=>e.jsx(ji,{variant:ie.is_from_admin?"sent":"received",className:ie.is_from_admin?"ml-auto":"mr-auto",children:e.jsx(vi,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"whitespace-pre-wrap break-words",children:ie.message}),e.jsx("div",{className:"text-right",children:e.jsx("time",{className:"text-[10px] text-muted-foreground",children:me(ie.created_at)})})]})})},ie.id))})}),e.jsx("div",{className:"border-t p-4",children:e.jsxs("div",{className:"relative flex items-center space-x-2",children:[e.jsx(bi,{ref:i,disabled:De||c,placeholder:t(De?"detail.input.closed_placeholder":"detail.input.reply_placeholder"),className:"flex-1 resize-none rounded-lg border bg-background p-3 focus-visible:ring-1",value:u,onChange:ie=>o(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),F())}}),e.jsx(G,{disabled:De||c||!u.trim(),onClick:F,children:t(c?"detail.input.sending":"detail.input.send")})]})})]})]})]})]})]})}const lg=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3m-.41 2l-5.88 5.88a1 1 0 0 1-1.42 0L5.41 6ZM20 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7.41l5.88 5.88a3 3 0 0 0 4.24 0L20 7.41Z"})}),ig=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21.92 11.6C19.9 6.91 16.1 4 12 4s-7.9 2.91-9.92 7.6a1 1 0 0 0 0 .8C4.1 17.09 7.9 20 12 20s7.9-2.91 9.92-7.6a1 1 0 0 0 0-.8M12 18c-3.17 0-6.17-2.29-7.9-6C5.83 8.29 8.83 6 12 6s6.17 2.29 7.9 6c-1.73 3.71-4.73 6-7.9 6m0-10a4 4 0 1 0 4 4a4 4 0 0 0-4-4m0 6a2 2 0 1 1 2-2a2 2 0 0 1-2 2"})}),og=s=>{const{t:n}=V("ticket");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.id")}),cell:({row:t})=>e.jsx(U,{variant:"outline",children:t.getValue("id")}),enableSorting:!1,enableHiding:!1},{accessorKey:"subject",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.subject")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(lg,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"max-w-[500px] truncate font-medium",children:t.getValue("subject")})]}),enableSorting:!1,enableHiding:!1,size:4e3},{accessorKey:"level",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.level")}),cell:({row:t})=>{const r=t.getValue("level"),a=r===Qe.LOW?"default":r===Qe.MIDDLE?"secondary":"destructive";return e.jsx(U,{variant:a,className:"whitespace-nowrap",children:n(`level.${r===Qe.LOW?"low":r===Qe.MIDDLE?"medium":"high"}`)})},filterFn:(t,r,a)=>a.includes(t.getValue(r))},{accessorKey:"status",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.status")}),cell:({row:t})=>{const r=t.getValue("status"),a=t.original.reply_status,i=r===Ws.CLOSED?n("status.closed"):n(a===0?"status.replied":"status.pending"),l=r===Ws.CLOSED?"default":a===0?"secondary":"destructive";return e.jsx(U,{variant:l,className:"whitespace-nowrap",children:i})}},{accessorKey:"updated_at",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.updated_at")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[e.jsx(Ni,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:me(t.getValue("updated_at"))})]}),enableSorting:!0},{accessorKey:"created_at",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.created_at")}),cell:({row:t})=>e.jsx("div",{className:"text-sm text-muted-foreground",children:me(t.getValue("created_at"))}),enableSorting:!0,meta:{isFlexGrow:!0}},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:n("columns.actions")}),cell:({row:t})=>{const r=t.original.status!==Ws.CLOSED;return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(rg,{ticketId:t.original.id,dialogTrigger:e.jsx(G,{variant:"ghost",size:"icon",className:"h-8 w-8",title:n("actions.view_details"),children:e.jsx(ig,{className:"h-4 w-4"})})}),r&&e.jsx(ps,{title:n("actions.close_confirm_title"),description:n("actions.close_confirm_description"),confirmText:n("actions.close_confirm_button"),variant:"destructive",onConfirm:async()=>{Nt.close(t.original.id).then(()=>{A.success(n("actions.close_success")),s()})},children:e.jsx(G,{variant:"ghost",size:"icon",className:"h-8 w-8",title:n("actions.close_ticket"),children:e.jsx(yi,{className:"h-4 w-4"})})})]})}}]};function cg(){const[s,n]=m.useState({}),[t,r]=m.useState({}),[a,i]=m.useState([{id:"status",value:"0"}]),[l,d]=m.useState([]),[u,o]=m.useState({pageIndex:0,pageSize:20}),{refetch:c,data:h}=ne({queryKey:["orderList",u,a,l],queryFn:()=>Nt.getList({pageSize:u.pageSize,current:u.pageIndex+1,filter:a,sort:l})}),k=ss({data:h?.data??[],columns:og(c),state:{sorting:l,columnVisibility:t,rowSelection:s,columnFilters:a,pagination:u},rowCount:h?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:i,onColumnVisibilityChange:r,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),onPaginationChange:o,getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Wh,{table:k,refetch:c}),e.jsx(xs,{table:k,showPagination:!0})]})}function dg(){const{t:s}=V("ticket");return e.jsxs(fi,{refreshData:()=>{},children:[e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(cg,{})})]})]}),e.jsx(pi,{})]})}const mg=Object.freeze(Object.defineProperty({__proto__:null,default:dg},Symbol.toStringTag,{value:"Module"}));function ug({table:s,refetch:n}){const{t}=V("user"),r=s.getState().columnFilters.length>0,[a,i]=m.useState(),[l,d]=m.useState(),[u,o]=m.useState(!1),c=[{value:"monthly",label:t("traffic_reset_logs.filters.reset_types.monthly")},{value:"first_day_month",label:t("traffic_reset_logs.filters.reset_types.first_day_month")},{value:"yearly",label:t("traffic_reset_logs.filters.reset_types.yearly")},{value:"first_day_year",label:t("traffic_reset_logs.filters.reset_types.first_day_year")},{value:"manual",label:t("traffic_reset_logs.filters.reset_types.manual")}],h=[{value:"auto",label:t("traffic_reset_logs.filters.trigger_sources.auto")},{value:"manual",label:t("traffic_reset_logs.filters.trigger_sources.manual")},{value:"cron",label:t("traffic_reset_logs.filters.trigger_sources.cron")}],k=()=>{let N=s.getState().columnFilters.filter(_=>_.id!=="date_range");(a||l)&&N.push({id:"date_range",value:{start:a?Pe(a,"yyyy-MM-dd"):null,end:l?Pe(l,"yyyy-MM-dd"):null}}),s.setColumnFilters(N)},C=async()=>{try{o(!0);const N=s.getState().columnFilters.reduce((I,K)=>{if(K.value)if(K.id==="date_range"){const ae=K.value;ae.start&&(I.start_date=ae.start),ae.end&&(I.end_date=ae.end)}else I[K.id]=K.value;return I},{}),T=(await Xt.getLogs({...N,page:1,per_page:1e4})).data.map(I=>({ID:I.id,用户邮箱:I.user_email,用户ID:I.user_id,重置类型:I.reset_type_name,触发源:I.trigger_source_name,清零流量:I.old_traffic.formatted,"上传流量(GB)":(I.old_traffic.upload/1024**3).toFixed(2),"下载流量(GB)":(I.old_traffic.download/1024**3).toFixed(2),重置时间:Pe(new Date(I.reset_time),"yyyy-MM-dd HH:mm:ss"),记录时间:Pe(new Date(I.created_at),"yyyy-MM-dd HH:mm:ss"),原因:I.reason||""})),D=Object.keys(T[0]||{}),g=[D.join(","),...T.map(I=>D.map(K=>{const ae=I[K];return typeof ae=="string"&&ae.includes(",")?`"${ae}"`:ae}).join(","))].join(` -`),w=new Blob([g],{type:"text/csv;charset=utf-8;"}),R=document.createElement("a"),H=URL.createObjectURL(w);R.setAttribute("href",H),R.setAttribute("download",`traffic-reset-logs-${Pe(new Date,"yyyy-MM-dd")}.csv`),R.style.visibility="hidden",document.body.appendChild(R),R.click(),document.body.removeChild(R),A.success(t("traffic_reset_logs.actions.export_success"))}catch(f){console.error("导出失败:",f),A.error(t("traffic_reset_logs.actions.export_failed"))}finally{o(!1)}},S=()=>e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.search_user")}),e.jsx(P,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:f=>s.getColumn("user_email")?.setFilterValue(f.target.value),className:"h-9"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.reset_type")}),e.jsxs(J,{value:s.getColumn("reset_type")?.getFilterValue()??"",onValueChange:f=>s.getColumn("reset_type")?.setFilterValue(f==="all"?"":f),children:[e.jsx(W,{className:"h-9",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.reset_type")})}),e.jsxs(Y,{children:[e.jsx($,{value:"all",children:t("traffic_reset_logs.filters.all_types")}),c.map(f=>e.jsx($,{value:f.value,children:f.label},f.value))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.trigger_source")}),e.jsxs(J,{value:s.getColumn("trigger_source")?.getFilterValue()??"",onValueChange:f=>s.getColumn("trigger_source")?.setFilterValue(f==="all"?"":f),children:[e.jsx(W,{className:"h-9",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.trigger_source")})}),e.jsxs(Y,{children:[e.jsx($,{value:"all",children:t("traffic_reset_logs.filters.all_sources")}),h.map(f=>e.jsx($,{value:f.value,children:f.label},f.value))]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.start_date")}),e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:b("h-9 w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),a?Pe(a,"MM-dd"):t("traffic_reset_logs.filters.start_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(vs,{mode:"single",selected:a,onSelect:i,initialFocus:!0})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.end_date")}),e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:b("h-9 w-full justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),l?Pe(l,"MM-dd"):t("traffic_reset_logs.filters.end_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(vs,{mode:"single",selected:l,onSelect:d,initialFocus:!0})})]})]})]}),(a||l)&&e.jsxs(L,{variant:"outline",className:"w-full",onClick:k,children:[e.jsx(rr,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.apply_date")]}),r&&e.jsxs(L,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),i(void 0),d(void 0)},className:"w-full",children:[t("traffic_reset_logs.filters.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between md:hidden",children:[e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(qn,{children:[e.jsx(ci,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8",children:[e.jsx(od,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.reset_type"),r&&e.jsx("div",{className:"ml-1 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground",children:s.getState().columnFilters.length})]})}),e.jsxs(Ba,{side:"bottom",className:"h-[85vh]",children:[e.jsxs(Ga,{className:"mb-4",children:[e.jsx(Wa,{children:t("traffic_reset_logs.filters.filter_title")}),e.jsx(Ya,{children:t("traffic_reset_logs.filters.filter_description")})]}),e.jsx("div",{className:"max-h-[calc(85vh-120px)] overflow-y-auto",children:e.jsx(S,{})})]})]})}),e.jsxs(L,{variant:"outline",size:"sm",className:"h-8",onClick:C,disabled:u,children:[e.jsx(va,{className:"mr-2 h-4 w-4"}),t(u?"traffic_reset_logs.actions.exporting":"traffic_reset_logs.actions.export")]})]}),e.jsxs("div",{className:"hidden items-center justify-between md:flex",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsx(P,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:f=>s.getColumn("user_email")?.setFilterValue(f.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs(J,{value:s.getColumn("reset_type")?.getFilterValue()??"",onValueChange:f=>s.getColumn("reset_type")?.setFilterValue(f==="all"?"":f),children:[e.jsx(W,{className:"h-8 w-[180px]",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.reset_type")})}),e.jsxs(Y,{children:[e.jsx($,{value:"all",children:t("traffic_reset_logs.filters.all_types")}),c.map(f=>e.jsx($,{value:f.value,children:f.label},f.value))]})]}),e.jsxs(J,{value:s.getColumn("trigger_source")?.getFilterValue()??"",onValueChange:f=>s.getColumn("trigger_source")?.setFilterValue(f==="all"?"":f),children:[e.jsx(W,{className:"h-8 w-[180px]",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.trigger_source")})}),e.jsxs(Y,{children:[e.jsx($,{value:"all",children:t("traffic_reset_logs.filters.all_sources")}),h.map(f=>e.jsx($,{value:f.value,children:f.label},f.value))]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:b("h-8 w-[140px] justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),a?Pe(a,"yyyy-MM-dd"):t("traffic_reset_logs.filters.start_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(vs,{mode:"single",selected:a,onSelect:i,initialFocus:!0})})]}),e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:b("h-8 w-[140px] justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),l?Pe(l,"yyyy-MM-dd"):t("traffic_reset_logs.filters.end_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(vs,{mode:"single",selected:l,onSelect:d,initialFocus:!0})})]}),(a||l)&&e.jsxs(L,{variant:"outline",size:"sm",className:"h-8",onClick:k,children:[e.jsx(rr,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.apply_date")]})]}),r&&e.jsxs(L,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),i(void 0),d(void 0)},className:"h-8 px-2 lg:px-3",children:[t("traffic_reset_logs.filters.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]}),e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",onClick:C,disabled:u,children:[e.jsx(va,{className:"mr-2 h-4 w-4"}),t(u?"traffic_reset_logs.actions.exporting":"traffic_reset_logs.actions.export")]})})]})]})}const xg=()=>{const{t:s}=V("user"),n=r=>{switch(r){case"manual":return"bg-blue-100 text-blue-800 border-blue-200";case"monthly":return"bg-green-100 text-green-800 border-green-200";case"yearly":return"bg-purple-100 text-purple-800 border-purple-200";case"first_day_month":return"bg-orange-100 text-orange-800 border-orange-200";case"first_day_year":return"bg-indigo-100 text-indigo-800 border-indigo-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}},t=r=>{switch(r){case"manual":return"bg-orange-100 text-orange-800 border-orange-200";case"cron":return"bg-indigo-100 text-indigo-800 border-indigo-200";case"auto":return"bg-emerald-100 text-emerald-800 border-emerald-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}};return[{accessorKey:"id",header:({column:r})=>e.jsx(z,{column:r,title:s("traffic_reset_logs.columns.id"),className:"w-[60px]"}),cell:({row:r})=>e.jsx("div",{className:"w-[60px]",children:e.jsx(U,{variant:"outline",className:"text-xs",children:r.original.id})}),enableSorting:!0,enableHiding:!0,size:60},{accessorKey:"user_email",header:({column:r})=>e.jsx(z,{column:r,title:s("traffic_reset_logs.columns.user"),className:"min-w-[200px]"}),cell:({row:r})=>e.jsxs("div",{className:"flex items-start gap-2 min-w-[200px]",children:[e.jsx(_l,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate font-medium text-sm",children:r.original.user_email}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["ID: ",r.original.user_id]})]})]}),enableSorting:!1,enableHiding:!1,size:100},{accessorKey:"reset_type",header:({column:r})=>e.jsx(z,{column:r,title:s("traffic_reset_logs.columns.reset_type"),className:"w-[120px]"}),cell:({row:r})=>e.jsx("div",{className:"w-[120px]",children:e.jsx(U,{className:b("border text-xs",n(r.original.reset_type)),children:e.jsx("span",{className:"truncate",children:r.original.reset_type_name})})}),enableSorting:!0,enableHiding:!1,filterFn:(r,a,i)=>i.includes(r.getValue(a)),size:120},{accessorKey:"trigger_source",header:({column:r})=>e.jsx(z,{column:r,title:s("traffic_reset_logs.columns.trigger_source"),className:"w-[100px]"}),cell:({row:r})=>e.jsx("div",{className:"w-[100px]",children:e.jsx(U,{variant:"outline",className:b("border text-xs",t(r.original.trigger_source)),children:e.jsx("span",{className:"truncate",children:r.original.trigger_source_name})})}),enableSorting:!0,enableHiding:!0,filterFn:(r,a,i)=>i.includes(r.getValue(a)),size:100},{accessorKey:"old_traffic",header:({column:r})=>e.jsx(z,{column:r,title:s("traffic_reset_logs.columns.cleared_traffic"),className:"w-[120px]"}),cell:({row:r})=>{const a=r.original.old_traffic;return e.jsx("div",{className:"w-[120px]",children:e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{asChild:!0,children:e.jsxs("div",{className:"text-center cursor-pointer",children:[e.jsx("div",{className:"font-medium text-destructive text-sm",children:a.formatted}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("traffic_reset_logs.columns.cleared")})]})}),e.jsxs(ce,{side:"bottom",className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(wt,{className:"h-3 w-3"}),e.jsxs("span",{children:[s("traffic_reset_logs.columns.upload"),":"," ",(a.upload/1024**3).toFixed(2)," GB"]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(va,{className:"h-3 w-3"}),e.jsxs("span",{children:[s("traffic_reset_logs.columns.download"),":"," ",(a.download/1024**3).toFixed(2)," GB"]})]})]})]})})})},enableSorting:!1,enableHiding:!1,size:120},{accessorKey:"reset_time",header:({column:r})=>e.jsx(z,{column:r,title:s("traffic_reset_logs.columns.reset_time"),className:"w-[140px]"}),cell:({row:r})=>e.jsx("div",{className:"w-[140px]",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ut,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium text-sm",children:me(r.original.reset_time,"MM-DD")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:me(r.original.reset_time,"HH:mm")})]})]})}),enableSorting:!0,enableHiding:!0,size:140},{accessorKey:"created_at",header:({column:r})=>e.jsx(z,{column:r,title:s("traffic_reset_logs.columns.log_time"),className:"w-[140px]"}),cell:({row:r})=>e.jsx("div",{className:"w-[140px]",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Pn,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium text-sm",children:me(r.original.created_at,"YYYY-MM-DD")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:me(r.original.created_at,"H:m:s")})]})]})}),enableSorting:!0,enableHiding:!1,size:1400}]};function hg(){const[s,n]=m.useState({}),[t,r]=m.useState({id:!1,trigger_source:!1,reset_time:!1}),[a,i]=m.useState([]),[l,d]=m.useState([{id:"created_at",desc:!0}]),[u,o]=m.useState({pageIndex:0,pageSize:20}),c={page:u.pageIndex+1,per_page:u.pageSize,...a.reduce((S,f)=>{if(f.value)if(f.id==="date_range"){const N=f.value;N.start&&(S.start_date=N.start),N.end&&(S.end_date=N.end)}else S[f.id]=f.value;return S},{})},{refetch:h,data:k,isLoading:C}=ne({queryKey:["trafficResetLogs",u,a,l],queryFn:()=>Xt.getLogs(c)});return e.jsx(gg,{data:k?.data??[],rowCount:k?.total??0,sorting:l,setSorting:d,columnVisibility:t,setColumnVisibility:r,rowSelection:s,setRowSelection:n,columnFilters:a,setColumnFilters:i,pagination:u,setPagination:o,refetch:h,isLoading:C})}function gg({data:s,rowCount:n,sorting:t,setSorting:r,columnVisibility:a,setColumnVisibility:i,rowSelection:l,setRowSelection:d,columnFilters:u,setColumnFilters:o,pagination:c,setPagination:h,refetch:k,isLoading:C}){const S=ss({data:s,columns:xg(),state:{sorting:t,columnVisibility:a,rowSelection:l,columnFilters:u,pagination:c},rowCount:n,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:d,onSortingChange:r,onColumnFiltersChange:o,onColumnVisibilityChange:i,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),onPaginationChange:h,getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnVisibility:{id:!1,trigger_source:!1,reset_time:!1},columnPinning:{left:["user_email"]}}});return e.jsxs("div",{className:"h-full space-y-4",children:[e.jsx(ug,{table:S,refetch:k}),e.jsx("div",{className:"rounded-md border",children:e.jsx(xs,{table:S,isLoading:C})})]})}function fg(){const{t:s}=V("user");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsx(ns,{})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-4 space-y-2 md:mb-2 md:flex md:items-center md:justify-between md:space-y-0",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-xl font-bold tracking-tight md:text-2xl",children:s("traffic_reset_logs.title")}),e.jsx("p",{className:"text-sm text-muted-foreground md:mt-2",children:s("traffic_reset_logs.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-hidden px-4 py-1",children:e.jsx("div",{className:"h-full w-full",children:e.jsx(hg,{})})})]})]})}const pg=Object.freeze(Object.defineProperty({__proto__:null,default:fg},Symbol.toStringTag,{value:"Module"}));export{_g as a,yg as c,Ng as g,wg as r}; +`+a("columns.online_status.offline_duration.seconds",{count:u})}return e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:b("size-2.5 rounded-full ring-2 ring-offset-2",d?"bg-green-500 ring-green-500/20":"bg-gray-300 ring-gray-300/20","transition-all duration-300")}),e.jsx("span",{className:"font-medium text-foreground/90",children:i.original.email})]})}),e.jsx(oe,{side:"bottom",className:"max-w-[280px]",children:e.jsx("p",{className:"whitespace-pre-line text-sm",children:o})})]})})},enableSorting:!1,enableHiding:!1},{accessorKey:"online_count",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.online_count")}),cell:({row:i})=>{const l=i.original.device_limit,d=i.original.online_count||0;return e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{children:e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs(U,{variant:"outline",className:b("min-w-[4rem] justify-center",l!==null&&d>=l?"border-destructive/50 bg-destructive/10 text-destructive":"border-primary/40 bg-primary/5 text-primary/90"),children:[d," / ",l===null?"∞":l]})})}),e.jsx(oe,{side:"bottom",children:e.jsx("p",{className:"text-sm",children:l===null?a("columns.device_limit.unlimited"):a("columns.device_limit.limited",{count:l})})})]})})},enableSorting:!0,enableHiding:!1},{accessorKey:"banned",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.status")}),cell:({row:i})=>{const l=i.original.banned;return e.jsx("div",{className:"flex justify-center",children:e.jsx(U,{className:b("min-w-20 justify-center transition-colors",l?"bg-destructive/15 text-destructive hover:bg-destructive/25":"bg-success/15 text-success hover:bg-success/25"),children:a(l?"columns.status_text.banned":"columns.status_text.normal")})})},enableSorting:!0,filterFn:(i,l,d)=>d.includes(i.getValue(l))},{accessorKey:"plan_id",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.subscription")}),cell:({row:i})=>e.jsx("div",{className:"min-w-[10em] break-all",children:i.original?.plan?.name||"-"}),enableSorting:!1,enableHiding:!1},{accessorKey:"group_id",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.group")}),cell:({row:i})=>e.jsx("div",{className:"flex flex-wrap gap-1",children:e.jsx(U,{variant:"outline",className:b("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5 whitespace-nowrap"),children:i.original?.group?.name||"-"})}),enableSorting:!1},{accessorKey:"total_used",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.used_traffic")}),cell:({row:i})=>{const l=Oe(i.original?.total_used),d=Oe(i.original?.transfer_enable),u=i.original?.total_used/i.original?.transfer_enable*100||0;return e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{className:"w-full",children:e.jsxs("div",{className:"w-full space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.toFixed(1),"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-secondary",children:e.jsx("div",{className:b("h-full rounded-full transition-all",u>90?"bg-destructive":"bg-primary"),style:{width:`${Math.min(u,100)}%`}})})]})}),e.jsx(oe,{side:"bottom",children:e.jsxs("p",{className:"text-sm",children:[a("columns.total_traffic"),": ",d]})})]})})}},{accessorKey:"transfer_enable",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.total_traffic")}),cell:({row:i})=>e.jsx("div",{className:"font-medium text-muted-foreground",children:Oe(i.original?.transfer_enable)})},{accessorKey:"expired_at",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.expire_time")}),cell:({row:i})=>{const l=i.original.expired_at,d=Date.now()/1e3,u=l!=null&&le.jsx(z,{column:i,title:a("columns.balance")}),cell:({row:i})=>{const l=bt(i.original?.balance);return e.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"¥"}),e.jsx("span",{className:"tabular-nums text-foreground",children:l})]})}},{accessorKey:"commission_balance",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.commission")}),cell:({row:i})=>{const l=bt(i.original?.commission_balance);return e.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"¥"}),e.jsx("span",{className:"tabular-nums text-foreground",children:l})]})}},{accessorKey:"created_at",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.register_time")}),cell:({row:i})=>e.jsx("div",{className:"truncate",children:xe(i.original?.created_at)}),size:1e3},{id:"actions",header:({column:i})=>e.jsx(z,{column:i,className:"justify-end",title:a("columns.actions")}),cell:({row:i,table:l})=>e.jsxs(zs,{modal:!1,children:[e.jsx($s,{asChild:!0,children:e.jsx("div",{className:"text-center",children:e.jsx(G,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted","aria-label":a("columns.actions"),children:e.jsx(wa,{className:"size-4"})})})}),e.jsxs(Ls,{align:"end",className:"min-w-[40px]",children:[e.jsx(_e,{onSelect:d=>{d.preventDefault(),t(i.original),r(!0)},className:"p-0",children:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(Ih,{className:"mr-2"}),a("columns.actions_menu.edit")]})}),e.jsx(_e,{onSelect:d=>d.preventDefault(),className:"p-0",children:e.jsx(ri,{defaultValues:{email:i.original.email},trigger:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(Vh,{className:"mr-2 "}),a("columns.actions_menu.assign_order")]})})}),e.jsx(_e,{onSelect:()=>{Ca(i.original.subscribe_url).then(()=>{A.success(a("common:copy.success"))})},className:"p-0",children:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(Mh,{className:"mr-2"}),a("columns.actions_menu.copy_url")]})}),e.jsx(_e,{onSelect:()=>{Ps.resetSecret(i.original.id).then(({data:d})=>{d&&A.success("重置成功")})},children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(yr,{className:"mr-2 "}),a("columns.actions_menu.reset_secret")]})}),e.jsx(_e,{onSelect:()=>{},className:"p-0",children:e.jsxs(Ys,{className:"flex items-center px-2 py-1.5",to:`/finance/order?user_id=eq:${i.original?.id}`,children:[e.jsx(Oh,{className:"mr-2"}),a("columns.actions_menu.orders")]})}),e.jsx(_e,{onSelect:()=>{l.setColumnFilters([{id:"invite_user_id",value:"eq:"+i.original?.id}])},children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(zh,{className:"mr-2 "}),a("columns.actions_menu.invites")]})}),e.jsx(_e,{onSelect:d=>d.preventDefault(),className:"p-0",children:e.jsx(hi,{user_id:i.original?.id,dialogTrigger:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx($h,{className:"mr-2 "}),a("columns.actions_menu.traffic_records")]})})}),e.jsx(_e,{onSelect:d=>d.preventDefault(),className:"p-0",children:e.jsx(Eh,{user:i.original,onSuccess:s,trigger:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(yr,{className:"mr-2"}),a("columns.actions_menu.reset_traffic")]})})}),e.jsx(_e,{onSelect:d=>d.preventDefault(),className:"p-0",children:e.jsx(Fh,{title:a("columns.actions_menu.delete_confirm_title"),description:a("columns.actions_menu.delete_confirm_description",{email:i.original.email}),cancelText:a("common:cancel"),confirmText:a("common:confirm"),variant:"destructive",onConfirm:async()=>{try{const{data:d}=await Ps.destroy(i.original.id);d&&(A.success(a("common:delete.success")),s())}catch{A.error(a("common:delete.failed"))}},children:e.jsxs(G,{variant:"ghost",className:"w-full justify-start px-2 py-1.5 text-destructive hover:text-destructive",children:[e.jsx(Ah,{className:"mr-2"}),a("columns.actions_menu.delete")]})})})]})]})}]},gi=m.createContext(void 0),Un=()=>{const s=m.useContext(gi);if(!s)throw new Error("useUserEdit must be used within an UserEditProvider");return s},fi=({children:s,refreshData:n})=>{const[t,r]=m.useState(!1),[a,i]=m.useState(null),l={isOpen:t,setIsOpen:r,editingUser:a,setEditingUser:i,refreshData:n};return e.jsx(gi.Provider,{value:l,children:s})},Hh=x.object({id:x.number().default(0),email:x.string().email().default(""),invite_user_email:x.string().email().nullable().optional().default(null),password:x.string().optional().nullable().default(null),balance:x.coerce.number().default(0),commission_balance:x.coerce.number().default(0),u:x.number().default(0),d:x.number().default(0),transfer_enable:x.number().default(0),expired_at:x.number().nullable().default(null),plan_id:x.number().nullable().default(null),banned:x.boolean().default(!1),commission_type:x.number().default(0),commission_rate:x.number().nullable().default(null),discount:x.number().nullable().default(null),speed_limit:x.number().nullable().default(null),device_limit:x.number().nullable().default(null),is_admin:x.boolean().default(!1),is_staff:x.boolean().default(!1),remarks:x.string().nullable().default(null)});function pi(){const{t:s}=V("user"),{isOpen:n,setIsOpen:t,editingUser:r,refreshData:a}=Un(),[i,l]=m.useState(!1),[d,u]=m.useState([]),o=we({resolver:Ce(Hh)});return m.useEffect(()=>{n&&gs.getList().then(({data:c})=>{u(c)})},[n]),m.useEffect(()=>{if(r){const c=r.invite_user?.email,{invite_user:h,...k}=r;o.reset({...k,invite_user_email:c||null,password:null})}},[r,o]),e.jsx(Hn,{open:n,onOpenChange:t,children:e.jsxs(Ga,{className:"max-w-[90%] space-y-4",children:[e.jsxs(Wa,{children:[e.jsx(Ya,{children:s("edit.title")}),e.jsx(Ja,{})]}),e.jsxs(Se,{...o,children:[e.jsx(v,{control:o.control,name:"email",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.email")}),e.jsx(y,{children:e.jsx(P,{...c,placeholder:s("edit.form.email_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(E,{...c})]})}),e.jsx(v,{control:o.control,name:"invite_user_email",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.inviter_email")}),e.jsx(y,{children:e.jsx(P,{value:c.value||"",onChange:h=>c.onChange(h.target.value?h.target.value:null),placeholder:s("edit.form.inviter_email_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(E,{...c})]})}),e.jsx(v,{control:o.control,name:"password",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.password")}),e.jsx(y,{children:e.jsx(P,{type:"password",value:c.value||"",onChange:c.onChange,placeholder:s("edit.form.password_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(E,{...c})]})}),e.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[e.jsx(v,{control:o.control,name:"balance",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.balance")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:c.onChange,placeholder:s("edit.form.balance_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"¥"})]})}),e.jsx(E,{...c})]})}),e.jsx(v,{control:o.control,name:"commission_balance",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.commission_balance")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:c.onChange,placeholder:s("edit.form.commission_balance_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"¥"})]})}),e.jsx(E,{...c})]})}),e.jsx(v,{control:o.control,name:"u",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.upload")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{value:c.value/1024/1024/1024||"",onChange:h=>c.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.upload_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(E,{...c})]})}),e.jsx(v,{control:o.control,name:"d",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.download")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value/1024/1024/1024||"",onChange:h=>c.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.download_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(E,{...c})]})})]}),e.jsx(v,{control:o.control,name:"transfer_enable",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.total_traffic")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value/1024/1024/1024||"",onChange:h=>c.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.total_traffic_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"expired_at",render:({field:c})=>e.jsxs(p,{className:"flex flex-col",children:[e.jsx(j,{children:s("edit.form.expire_time")}),e.jsxs(os,{open:i,onOpenChange:l,children:[e.jsx(cs,{asChild:!0,children:e.jsx(y,{children:e.jsxs(L,{type:"button",variant:"outline",className:b("w-full pl-3 text-left font-normal",!c.value&&"text-muted-foreground"),onClick:()=>l(!0),children:[c.value?xe(c.value):e.jsx("span",{children:s("edit.form.expire_time_placeholder")}),e.jsx(Ss,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",side:"top",sideOffset:4,onInteractOutside:h=>{h.preventDefault()},onEscapeKeyDown:h=>{h.preventDefault()},children:e.jsxs("div",{className:"flex flex-col space-y-3 p-3",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{c.onChange(null),l(!1)},children:s("edit.form.expire_time_permanent")}),e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{const h=new Date;h.setMonth(h.getMonth()+1),h.setHours(23,59,59,999),c.onChange(Math.floor(h.getTime()/1e3)),l(!1)},children:s("edit.form.expire_time_1month")}),e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{const h=new Date;h.setMonth(h.getMonth()+3),h.setHours(23,59,59,999),c.onChange(Math.floor(h.getTime()/1e3)),l(!1)},children:s("edit.form.expire_time_3months")})]}),e.jsx("div",{className:"rounded-md border",children:e.jsx(vs,{mode:"single",selected:c.value?new Date(c.value*1e3):void 0,onSelect:h=>{if(h){const k=new Date(c.value?c.value*1e3:Date.now());h.setHours(k.getHours(),k.getMinutes(),k.getSeconds()),c.onChange(Math.floor(h.getTime()/1e3))}},disabled:h=>h{const h=new Date;h.setHours(23,59,59,999),c.onChange(Math.floor(h.getTime()/1e3))},className:"h-6 px-2 text-xs",children:s("edit.form.expire_time_today")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P,{type:"datetime-local",step:"1",value:xe(c.value,"YYYY-MM-DDTHH:mm:ss"),onChange:h=>{const k=new Date(h.target.value);isNaN(k.getTime())||c.onChange(Math.floor(k.getTime()/1e3))},className:"flex-1"}),e.jsx(L,{type:"button",variant:"outline",onClick:()=>l(!1),children:s("edit.form.expire_time_confirm")})]})]})]})})]}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"plan_id",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.subscription")}),e.jsx(y,{children:e.jsxs(J,{value:c.value!==null?String(c.value):"null",onValueChange:h=>c.onChange(h==="null"?null:parseInt(h)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("edit.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx($,{value:"null",children:s("edit.form.subscription_none")}),d.map(h=>e.jsx($,{value:String(h.id),children:h.name},h.id))]})]})})]})}),e.jsx(v,{control:o.control,name:"banned",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.account_status")}),e.jsx(y,{children:e.jsxs(J,{value:c.value.toString(),onValueChange:h=>c.onChange(h==="true"),children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx($,{value:"true",children:s("columns.status_text.banned")}),e.jsx($,{value:"false",children:s("columns.status_text.normal")})]})]})})]})}),e.jsx(v,{control:o.control,name:"commission_type",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.commission_type")}),e.jsx(y,{children:e.jsxs(J,{value:c.value.toString(),onValueChange:h=>c.onChange(parseInt(h)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("edit.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx($,{value:"0",children:s("edit.form.commission_type_system")}),e.jsx($,{value:"1",children:s("edit.form.commission_type_cycle")}),e.jsx($,{value:"2",children:s("edit.form.commission_type_onetime")})]})]})})]})}),e.jsx(v,{control:o.control,name:"commission_rate",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.commission_rate")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:h=>c.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.commission_rate_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"%"})]})})]})}),e.jsx(v,{control:o.control,name:"discount",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.discount")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:h=>c.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.discount_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"%"})]})}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"speed_limit",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.speed_limit")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:h=>c.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.speed_limit_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"Mbps"})]})}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"device_limit",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.device_limit")}),e.jsx(y,{children:e.jsxs("div",{className:"flex",children:[e.jsx(P,{type:"number",value:c.value||"",onChange:h=>c.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.device_limit_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"台"})]})}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"is_admin",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.is_admin")}),e.jsx("div",{className:"py-2",children:e.jsx(y,{children:e.jsx(Z,{checked:c.value,onCheckedChange:h=>c.onChange(h)})})}),e.jsx(E,{})]})}),e.jsx(v,{control:o.control,name:"is_staff",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.is_staff")}),e.jsx("div",{className:"py-2",children:e.jsx(y,{children:e.jsx(Z,{checked:c.value,onCheckedChange:h=>c.onChange(h)})})})]})}),e.jsx(v,{control:o.control,name:"remarks",render:({field:c})=>e.jsxs(p,{children:[e.jsx(j,{children:s("edit.form.remarks")}),e.jsx(y,{children:e.jsx(Ds,{className:"h-24",value:c.value||"",onChange:h=>c.onChange(h.currentTarget.value??null),placeholder:s("edit.form.remarks_placeholder")})}),e.jsx(E,{})]})}),e.jsxs(mi,{children:[e.jsx(L,{variant:"outline",onClick:()=>t(!1),children:s("edit.form.cancel")}),e.jsx(L,{type:"submit",onClick:()=>{o.handleSubmit(c=>{Ps.update(c).then(({data:h})=>{h&&(A.success(s("edit.form.success")),t(!1),a())})})()},children:s("edit.form.submit")})]})]})]})})}function Uh(){const[s]=Nl(),[n,t]=m.useState({}),[r,a]=m.useState({is_admin:!1,is_staff:!1}),[i,l]=m.useState([]),[d,u]=m.useState([]),[o,c]=m.useState({pageIndex:0,pageSize:20});m.useEffect(()=>{const g=s.get("email");g&&l(w=>w.some(H=>H.id==="email")?w:[...w,{id:"email",value:g}])},[s]);const{refetch:h,data:k,isLoading:C}=ne({queryKey:["userList",o,i,d],queryFn:()=>Ps.getList({pageSize:o.pageSize,current:o.pageIndex+1,filter:i,sort:d})}),[S,f]=m.useState([]),[N,_]=m.useState([]);m.useEffect(()=>{mt.getList().then(({data:g})=>{f(g)}),gs.getList().then(({data:g})=>{_(g)})},[]);const T=S.map(g=>({label:g.name,value:g.id})),D=N.map(g=>({label:g.name,value:g.id}));return e.jsxs(fi,{refreshData:h,children:[e.jsx(Kh,{data:k?.data??[],rowCount:k?.total??0,sorting:d,setSorting:u,columnVisibility:r,setColumnVisibility:a,rowSelection:n,setRowSelection:t,columnFilters:i,setColumnFilters:l,pagination:o,setPagination:c,refetch:h,serverGroupList:S,permissionGroups:T,subscriptionPlans:D,isLoading:C}),e.jsx(pi,{})]})}function Kh({data:s,rowCount:n,sorting:t,setSorting:r,columnVisibility:a,setColumnVisibility:i,rowSelection:l,setRowSelection:d,columnFilters:u,setColumnFilters:o,pagination:c,setPagination:h,refetch:k,serverGroupList:C,permissionGroups:S,subscriptionPlans:f,isLoading:N}){const{setIsOpen:_,setEditingUser:T}=Un(),D=ss({data:s,columns:qh(k,C,T,_),state:{sorting:t,columnVisibility:a,rowSelection:l,columnFilters:u,pagination:c},rowCount:n,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:d,onSortingChange:r,onColumnFiltersChange:o,onColumnVisibilityChange:i,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),onPaginationChange:h,getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnVisibility:{commission_balance:!1,created_at:!1,is_admin:!1,is_staff:!1,permission_group:!1,plan_id:!1},columnPinning:{right:["actions"]}}});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Ph,{table:D,refetch:k,serverGroupList:C,permissionGroups:S,subscriptionPlans:f}),e.jsx(xs,{table:D,isLoading:N})]})}function Bh(){const{t:s}=V("user");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("manage.title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("manage.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx("div",{className:"w-full",children:e.jsx(Uh,{})})})]})]})}const Gh=Object.freeze(Object.defineProperty({__proto__:null,default:Bh},Symbol.toStringTag,{value:"Module"}));function Wh({column:s,title:n,options:t}){const r=new Set(s?.getFilterValue());return e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(G,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(ld,{className:"mr-2 h-4 w-4"}),n,r?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Te,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:r.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:r.size>2?e.jsxs(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):t.filter(a=>r.has(a.value)).map(a=>e.jsx(U,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:a.label},`selected-${a.value}`))})]})]})}),e.jsx(Ze,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Js,{children:[e.jsx(ut,{placeholder:n}),e.jsxs(Qs,{children:[e.jsx(xt,{children:"No results found."}),e.jsx(fs,{children:t.map(a=>{const i=r.has(a.value);return e.jsxs(We,{onSelect:()=>{i?r.delete(a.value):r.add(a.value);const l=Array.from(r);s?.setFilterValue(l.length?l:void 0)},children:[e.jsx("div",{className:b("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",i?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(id,{className:b("h-4 w-4")})}),a.icon&&e.jsx(a.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:a.label})]},`option-${a.value}`)})}),r.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(fs,{children:e.jsx(We,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const Yh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 11H5a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2"})});function Jh({table:s}){const{t:n}=V("ticket");return e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-4",children:[e.jsx(Dt,{defaultValue:s.getColumn("status")?.getFilterValue(),onValueChange:t=>s.getColumn("status")?.setFilterValue(t),children:e.jsxs(dt,{className:"grid w-full grid-cols-2",children:[e.jsx(Xe,{value:"0",children:n("status.pending")}),e.jsx(Xe,{value:"1",children:n("status.closed")})]})}),s.getColumn("level")&&e.jsx(Wh,{column:s.getColumn("level"),title:n("columns.level"),options:[{label:n("level.low"),value:Qe.LOW,icon:Yh,color:"gray"},{label:n("level.medium"),value:Qe.MIDDLE,icon:ui,color:"yellow"},{label:n("level.high"),value:Qe.HIGH,icon:xi,color:"red"}]})]})})}function Qh(){return e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"text-foreground",children:[e.jsx("circle",{cx:"4",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{id:"spinner_qFRN",begin:"0;spinner_OcgL.end+0.25s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})}),e.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{begin:"spinner_qFRN.begin+0.1s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})}),e.jsx("circle",{cx:"20",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{id:"spinner_OcgL",begin:"spinner_qFRN.begin+0.2s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})})]})}const Xh=it("flex gap-2 max-w-[60%] items-end relative group",{variants:{variant:{received:"self-start",sent:"self-end flex-row-reverse"},layout:{default:"",ai:"max-w-full w-full items-center"}},defaultVariants:{variant:"received",layout:"default"}}),ji=m.forwardRef(({className:s,variant:n,layout:t,children:r,...a},i)=>e.jsx("div",{className:b(Xh({variant:n,layout:t,className:s}),"relative group"),ref:i,...a,children:m.Children.map(r,l=>m.isValidElement(l)&&typeof l.type!="string"?m.cloneElement(l,{variant:n,layout:t}):l)}));ji.displayName="ChatBubble";const Zh=it("p-4",{variants:{variant:{received:"bg-secondary text-secondary-foreground rounded-r-lg rounded-tl-lg",sent:"bg-primary text-primary-foreground rounded-l-lg rounded-tr-lg"},layout:{default:"",ai:"border-t w-full rounded-none bg-transparent"}},defaultVariants:{variant:"received",layout:"default"}}),vi=m.forwardRef(({className:s,variant:n,layout:t,isLoading:r=!1,children:a,...i},l)=>e.jsx("div",{className:b(Zh({variant:n,layout:t,className:s}),"break-words max-w-full whitespace-pre-wrap"),ref:l,...i,children:r?e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(Qh,{})}):a}));vi.displayName="ChatBubbleMessage";const eg=m.forwardRef(({variant:s,className:n,children:t,...r},a)=>e.jsx("div",{ref:a,className:b("absolute top-1/2 -translate-y-1/2 flex opacity-0 group-hover:opacity-100 transition-opacity duration-200",s==="sent"?"-left-1 -translate-x-full flex-row-reverse":"-right-1 translate-x-full",n),...r,children:t}));eg.displayName="ChatBubbleActionWrapper";const bi=m.forwardRef(({className:s,...n},t)=>e.jsx(Ds,{autoComplete:"off",ref:t,name:"message",className:b("max-h-12 px-4 py-3 bg-background text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 w-full rounded-md flex items-center h-16 resize-none",s),...n}));bi.displayName="ChatInput";const yi=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29l-4.3 4.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l4.29-4.3l4.29 4.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42Z"})}),Ni=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M15.098 12.634L13 11.423V7a1 1 0 0 0-2 0v5a1 1 0 0 0 .5.866l2.598 1.5a1 1 0 1 0 1-1.732M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8.01 8.01 0 0 1-8 8"})}),Nr=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m11.29 12l3.54-3.54a1 1 0 0 0 0-1.41a1 1 0 0 0-1.42 0l-4.24 4.24a1 1 0 0 0 0 1.42L13.41 17a1 1 0 0 0 .71.29a1 1 0 0 0 .71-.29a1 1 0 0 0 0-1.41Z"})}),sg=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})}),tg=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M3.71 16.29a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21a1 1 0 0 0-.21.33a1 1 0 0 0 .21 1.09a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21a1 1 0 0 0 .21-1.09a1 1 0 0 0-.21-.33M7 8h14a1 1 0 0 0 0-2H7a1 1 0 0 0 0 2m-3.29 3.29a1 1 0 0 0-1.09-.21a1.2 1.2 0 0 0-.33.21a1 1 0 0 0-.21.33a.94.94 0 0 0 0 .76a1.2 1.2 0 0 0 .21.33a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21a1.2 1.2 0 0 0 .21-.33a.94.94 0 0 0 0-.76a1 1 0 0 0-.21-.33M21 11H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2M3.71 6.29a1 1 0 0 0-.33-.21a1 1 0 0 0-1.09.21a1.2 1.2 0 0 0-.21.33a.94.94 0 0 0 0 .76a1.2 1.2 0 0 0 .21.33a1.2 1.2 0 0 0 .33.21a1 1 0 0 0 1.09-.21a1.2 1.2 0 0 0 .21-.33a.94.94 0 0 0 0-.76a1.2 1.2 0 0 0-.21-.33M21 16H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2"})}),ag=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M9 12H7a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2m-1-2h4a1 1 0 0 0 0-2H8a1 1 0 0 0 0 2m1 6H7a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2m12-4h-3V3a1 1 0 0 0-.5-.87a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0A1 1 0 0 0 2 3v16a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1M5 20a1 1 0 0 1-1-1V4.73l2 1.14a1.08 1.08 0 0 0 1 0l3-1.72l3 1.72a1.08 1.08 0 0 0 1 0l2-1.14V19a3 3 0 0 0 .18 1Zm15-1a1 1 0 0 1-2 0v-5h2Zm-6.44-2.83a.8.8 0 0 0-.18-.09a.6.6 0 0 0-.19-.06a1 1 0 0 0-.9.27A1.05 1.05 0 0 0 12 17a1 1 0 0 0 .07.38a1.2 1.2 0 0 0 .22.33a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21A1 1 0 0 0 14 17a1.05 1.05 0 0 0-.29-.71a2 2 0 0 0-.15-.12m.14-3.88a1 1 0 0 0-1.62.33A1 1 0 0 0 13 14a1 1 0 0 0 1-1a1 1 0 0 0-.08-.38a.9.9 0 0 0-.22-.33"})});function ng(){return e.jsxs("div",{className:"flex h-full flex-col space-y-4 p-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ve,{className:"h-8 w-3/4"}),e.jsx(ve,{className:"h-4 w-1/2"})]}),e.jsx("div",{className:"flex-1 space-y-4",children:[1,2,3].map(s=>e.jsx(ve,{className:"h-20 w-2/3"},s))})]})}function rg(){return e.jsx("div",{className:"space-y-4 p-4",children:[1,2,3,4].map(s=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(ve,{className:"h-5 w-4/5"}),e.jsx(ve,{className:"h-4 w-2/3"}),e.jsx(ve,{className:"h-3 w-1/2"})]},s))})}function lg({ticket:s,isActive:n,onClick:t}){const{t:r}=V("ticket"),a=i=>{switch(i){case Qe.HIGH:return"bg-red-50 text-red-600 border-red-200";case Qe.MIDDLE:return"bg-yellow-50 text-yellow-600 border-yellow-200";case Qe.LOW:return"bg-green-50 text-green-600 border-green-200";default:return"bg-gray-50 text-gray-600 border-gray-200"}};return e.jsxs("div",{className:b("flex cursor-pointer flex-col border-b p-4 hover:bg-accent/50",n&&"bg-accent"),onClick:t,children:[e.jsxs("div",{className:"flex max-w-[280px] items-center justify-between gap-2",children:[e.jsx("h4",{className:"flex-1 truncate font-medium",children:s.subject}),e.jsx(U,{variant:s.status===Ws.CLOSED?"secondary":"default",className:"shrink-0",children:s.status===Ws.CLOSED?r("status.closed"):r("status.processing")})]}),e.jsx("div",{className:"mt-1 max-w-[280px] truncate text-sm text-muted-foreground",children:s.user?.email}),e.jsxs("div",{className:"mt-2 flex items-center justify-between text-xs",children:[e.jsx("time",{className:"text-muted-foreground",children:xe(s.updated_at)}),e.jsx("div",{className:b("rounded-full border px-2 py-0.5 text-xs font-medium",a(s.level)),children:r(`level.${s.level===Qe.LOW?"low":s.level===Qe.MIDDLE?"medium":"high"}`)})]})]})}function ig({ticketId:s,dialogTrigger:n}){const{t}=V("ticket"),r=As(),a=m.useRef(null),i=m.useRef(null),[l,d]=m.useState(!1),[u,o]=m.useState(""),[c,h]=m.useState(!1),[k,C]=m.useState(s),[S,f]=m.useState(""),[N,_]=m.useState(!1),{setIsOpen:T,setEditingUser:D}=Un(),{data:g,isLoading:w,refetch:R}=ne({queryKey:["tickets",l],queryFn:()=>l?Nt.getList({filter:[{id:"status",value:[Ws.OPENING]}]}):Promise.resolve(null),enabled:l}),{data:H,refetch:I,isLoading:K}=ne({queryKey:["ticket",k,l],queryFn:()=>l?Nt.getInfo(k):Promise.resolve(null),refetchInterval:l?5e3:!1,retry:3}),ae=H?.data,te=(g?.data||[]).filter(ie=>ie.subject.toLowerCase().includes(S.toLowerCase())||ie.user?.email.toLowerCase().includes(S.toLowerCase())),q=(ie="smooth")=>{if(a.current){const{scrollHeight:_s,clientHeight:Fs}=a.current;a.current.scrollTo({top:_s-Fs,behavior:ie})}};m.useEffect(()=>{if(!l)return;const ie=requestAnimationFrame(()=>{q("instant"),setTimeout(()=>q(),1e3)});return()=>{cancelAnimationFrame(ie)}},[l,ae?.messages]);const F=async()=>{const ie=u.trim();!ie||c||(h(!0),Nt.reply({id:k,message:ie}).then(()=>{o(""),I(),q(),setTimeout(()=>{i.current?.focus()},0)}).finally(()=>{h(!1)}))},X=async()=>{Nt.close(k).then(()=>{A.success(t("actions.close_success")),I(),R()})},Ns=()=>{ae?.user&&r("/finance/order?user_id="+ae.user.id)},De=ae?.status===Ws.CLOSED;return e.jsxs(ge,{open:l,onOpenChange:d,children:[e.jsx(as,{asChild:!0,children:n??e.jsx(G,{variant:"outline",children:t("actions.view_ticket")})}),e.jsxs(ue,{className:"flex h-[90vh] max-w-6xl flex-col gap-0 p-0",children:[e.jsx(fe,{}),e.jsxs("div",{className:"flex h-full",children:[e.jsx(G,{variant:"ghost",size:"icon",className:"absolute left-2 top-2 z-50 md:hidden",onClick:()=>_(!N),children:e.jsx(Nr,{className:b("h-4 w-4 transition-transform",!N&&"rotate-180")})}),e.jsxs("div",{className:b("absolute inset-y-0 left-0 z-40 flex flex-col border-r bg-background transition-transform duration-200 ease-in-out md:relative",N?"-translate-x-full":"translate-x-0","w-80 md:w-80 md:translate-x-0"),children:[e.jsxs("div",{className:"space-y-4 border-b p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-semibold",children:t("list.title")}),e.jsx(G,{variant:"ghost",size:"icon",className:"hidden h-8 w-8 md:flex",onClick:()=>_(!N),children:e.jsx(Nr,{className:b("h-4 w-4 transition-transform",!N&&"rotate-180")})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(sg,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 transform text-muted-foreground"}),e.jsx(P,{placeholder:t("list.search_placeholder"),value:S,onChange:ie=>f(ie.target.value),className:"pl-8"})]})]}),e.jsx(lt,{className:"flex-1",children:e.jsx("div",{className:"w-full",children:w?e.jsx(rg,{}):te.length===0?e.jsx("div",{className:"flex h-full items-center justify-center p-4 text-muted-foreground",children:t(S?"list.no_search_results":"list.no_tickets")}):te.map(ie=>e.jsx(lg,{ticket:ie,isActive:ie.id===k,onClick:()=>{C(ie.id),window.innerWidth<768&&_(!0)}},ie.id))})})]}),e.jsxs("div",{className:"relative flex flex-1 flex-col",children:[!N&&e.jsx("div",{className:"absolute inset-0 z-30 bg-black/20 md:hidden",onClick:()=>_(!0)}),K?e.jsx(ng,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col space-y-4 border-b p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("h2",{className:"text-2xl font-semibold",children:ae?.subject}),e.jsx(U,{variant:De?"secondary":"default",children:t(De?"status.closed":"status.processing")}),!De&&e.jsx(ps,{title:t("actions.close_confirm_title"),description:t("actions.close_confirm_description"),confirmText:t("actions.close_confirm_button"),variant:"destructive",onConfirm:X,children:e.jsxs(G,{variant:"ghost",size:"sm",className:"gap-1 text-muted-foreground hover:text-destructive",children:[e.jsx(yi,{className:"h-4 w-4"}),t("actions.close_ticket")]})})]}),e.jsxs("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(Da,{className:"h-4 w-4"}),e.jsx("span",{children:ae?.user?.email})]}),e.jsx(Te,{orientation:"vertical",className:"h-4"}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(Ni,{className:"h-4 w-4"}),e.jsxs("span",{children:[t("detail.created_at")," ",xe(ae?.created_at)]})]}),e.jsx(Te,{orientation:"vertical",className:"h-4"}),e.jsx(U,{variant:"outline",children:ae?.level!=null&&t(`level.${ae.level===Qe.LOW?"low":ae.level===Qe.MIDDLE?"medium":"high"}`)})]})]}),ae?.user&&e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(G,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.user_info"),onClick:()=>{D(ae.user),T(!0)},children:e.jsx(Da,{className:"h-4 w-4"})}),e.jsx(hi,{user_id:ae.user.id,dialogTrigger:e.jsx(G,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.traffic_records"),children:e.jsx(tg,{className:"h-4 w-4"})})}),e.jsx(G,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.order_records"),onClick:Ns,children:e.jsx(ag,{className:"h-4 w-4"})})]})]})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx("div",{ref:a,className:"h-full space-y-4 overflow-y-auto p-6",children:ae?.messages?.length===0?e.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:t("detail.no_messages")}):ae?.messages?.map(ie=>e.jsx(ji,{variant:ie.is_from_admin?"sent":"received",className:ie.is_from_admin?"ml-auto":"mr-auto",children:e.jsx(vi,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"whitespace-pre-wrap break-words",children:ie.message}),e.jsx("div",{className:"text-right",children:e.jsx("time",{className:"text-[10px] text-muted-foreground",children:xe(ie.created_at)})})]})})},ie.id))})}),e.jsx("div",{className:"border-t p-4",children:e.jsxs("div",{className:"relative flex items-center space-x-2",children:[e.jsx(bi,{ref:i,disabled:De||c,placeholder:t(De?"detail.input.closed_placeholder":"detail.input.reply_placeholder"),className:"flex-1 resize-none rounded-lg border bg-background p-3 focus-visible:ring-1",value:u,onChange:ie=>o(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),F())}}),e.jsx(G,{disabled:De||c||!u.trim(),onClick:F,children:t(c?"detail.input.sending":"detail.input.send")})]})})]})]})]})]})]})}const og=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3m-.41 2l-5.88 5.88a1 1 0 0 1-1.42 0L5.41 6ZM20 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7.41l5.88 5.88a3 3 0 0 0 4.24 0L20 7.41Z"})}),cg=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21.92 11.6C19.9 6.91 16.1 4 12 4s-7.9 2.91-9.92 7.6a1 1 0 0 0 0 .8C4.1 17.09 7.9 20 12 20s7.9-2.91 9.92-7.6a1 1 0 0 0 0-.8M12 18c-3.17 0-6.17-2.29-7.9-6C5.83 8.29 8.83 6 12 6s6.17 2.29 7.9 6c-1.73 3.71-4.73 6-7.9 6m0-10a4 4 0 1 0 4 4a4 4 0 0 0-4-4m0 6a2 2 0 1 1 2-2a2 2 0 0 1-2 2"})}),dg=s=>{const{t:n}=V("ticket");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.id")}),cell:({row:t})=>e.jsx(U,{variant:"outline",children:t.getValue("id")}),enableSorting:!1,enableHiding:!1},{accessorKey:"subject",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.subject")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(og,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"max-w-[500px] truncate font-medium",children:t.getValue("subject")})]}),enableSorting:!1,enableHiding:!1,size:4e3},{accessorKey:"level",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.level")}),cell:({row:t})=>{const r=t.getValue("level"),a=r===Qe.LOW?"default":r===Qe.MIDDLE?"secondary":"destructive";return e.jsx(U,{variant:a,className:"whitespace-nowrap",children:n(`level.${r===Qe.LOW?"low":r===Qe.MIDDLE?"medium":"high"}`)})},filterFn:(t,r,a)=>a.includes(t.getValue(r))},{accessorKey:"status",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.status")}),cell:({row:t})=>{const r=t.getValue("status"),a=t.original.reply_status,i=r===Ws.CLOSED?n("status.closed"):n(a===0?"status.replied":"status.pending"),l=r===Ws.CLOSED?"default":a===0?"secondary":"destructive";return e.jsx(U,{variant:l,className:"whitespace-nowrap",children:i})}},{accessorKey:"updated_at",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.updated_at")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[e.jsx(Ni,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:xe(t.getValue("updated_at"))})]}),enableSorting:!0},{accessorKey:"created_at",header:({column:t})=>e.jsx(z,{column:t,title:n("columns.created_at")}),cell:({row:t})=>e.jsx("div",{className:"text-sm text-muted-foreground",children:xe(t.getValue("created_at"))}),enableSorting:!0,meta:{isFlexGrow:!0}},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:n("columns.actions")}),cell:({row:t})=>{const r=t.original.status!==Ws.CLOSED;return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(ig,{ticketId:t.original.id,dialogTrigger:e.jsx(G,{variant:"ghost",size:"icon",className:"h-8 w-8",title:n("actions.view_details"),children:e.jsx(cg,{className:"h-4 w-4"})})}),r&&e.jsx(ps,{title:n("actions.close_confirm_title"),description:n("actions.close_confirm_description"),confirmText:n("actions.close_confirm_button"),variant:"destructive",onConfirm:async()=>{Nt.close(t.original.id).then(()=>{A.success(n("actions.close_success")),s()})},children:e.jsx(G,{variant:"ghost",size:"icon",className:"h-8 w-8",title:n("actions.close_ticket"),children:e.jsx(yi,{className:"h-4 w-4"})})})]})}}]};function mg(){const[s,n]=m.useState({}),[t,r]=m.useState({}),[a,i]=m.useState([{id:"status",value:"0"}]),[l,d]=m.useState([]),[u,o]=m.useState({pageIndex:0,pageSize:20}),{refetch:c,data:h}=ne({queryKey:["orderList",u,a,l],queryFn:()=>Nt.getList({pageSize:u.pageSize,current:u.pageIndex+1,filter:a,sort:l})}),k=ss({data:h?.data??[],columns:dg(c),state:{sorting:l,columnVisibility:t,rowSelection:s,columnFilters:a,pagination:u},rowCount:h?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:i,onColumnVisibilityChange:r,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),onPaginationChange:o,getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Jh,{table:k,refetch:c}),e.jsx(xs,{table:k,showPagination:!0})]})}function ug(){const{t:s}=V("ticket");return e.jsxs(fi,{refreshData:()=>{},children:[e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx(ns,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(mg,{})})]})]}),e.jsx(pi,{})]})}const xg=Object.freeze(Object.defineProperty({__proto__:null,default:ug},Symbol.toStringTag,{value:"Module"}));function hg({table:s,refetch:n}){const{t}=V("user"),r=s.getState().columnFilters.length>0,[a,i]=m.useState(),[l,d]=m.useState(),[u,o]=m.useState(!1),c=[{value:"monthly",label:t("traffic_reset_logs.filters.reset_types.monthly")},{value:"first_day_month",label:t("traffic_reset_logs.filters.reset_types.first_day_month")},{value:"yearly",label:t("traffic_reset_logs.filters.reset_types.yearly")},{value:"first_day_year",label:t("traffic_reset_logs.filters.reset_types.first_day_year")},{value:"manual",label:t("traffic_reset_logs.filters.reset_types.manual")}],h=[{value:"auto",label:t("traffic_reset_logs.filters.trigger_sources.auto")},{value:"manual",label:t("traffic_reset_logs.filters.trigger_sources.manual")},{value:"cron",label:t("traffic_reset_logs.filters.trigger_sources.cron")}],k=()=>{let N=s.getState().columnFilters.filter(_=>_.id!=="date_range");(a||l)&&N.push({id:"date_range",value:{start:a?Pe(a,"yyyy-MM-dd"):null,end:l?Pe(l,"yyyy-MM-dd"):null}}),s.setColumnFilters(N)},C=async()=>{try{o(!0);const N=s.getState().columnFilters.reduce((I,K)=>{if(K.value)if(K.id==="date_range"){const ae=K.value;ae.start&&(I.start_date=ae.start),ae.end&&(I.end_date=ae.end)}else I[K.id]=K.value;return I},{}),T=(await Xt.getLogs({...N,page:1,per_page:1e4})).data.map(I=>({ID:I.id,用户邮箱:I.user_email,用户ID:I.user_id,重置类型:I.reset_type_name,触发源:I.trigger_source_name,清零流量:I.old_traffic.formatted,"上传流量(GB)":(I.old_traffic.upload/1024**3).toFixed(2),"下载流量(GB)":(I.old_traffic.download/1024**3).toFixed(2),重置时间:Pe(new Date(I.reset_time),"yyyy-MM-dd HH:mm:ss"),记录时间:Pe(new Date(I.created_at),"yyyy-MM-dd HH:mm:ss"),原因:I.reason||""})),D=Object.keys(T[0]||{}),g=[D.join(","),...T.map(I=>D.map(K=>{const ae=I[K];return typeof ae=="string"&&ae.includes(",")?`"${ae}"`:ae}).join(","))].join(` +`),w=new Blob([g],{type:"text/csv;charset=utf-8;"}),R=document.createElement("a"),H=URL.createObjectURL(w);R.setAttribute("href",H),R.setAttribute("download",`traffic-reset-logs-${Pe(new Date,"yyyy-MM-dd")}.csv`),R.style.visibility="hidden",document.body.appendChild(R),R.click(),document.body.removeChild(R),A.success(t("traffic_reset_logs.actions.export_success"))}catch(f){console.error("导出失败:",f),A.error(t("traffic_reset_logs.actions.export_failed"))}finally{o(!1)}},S=()=>e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.search_user")}),e.jsx(P,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:f=>s.getColumn("user_email")?.setFilterValue(f.target.value),className:"h-9"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.reset_type")}),e.jsxs(J,{value:s.getColumn("reset_type")?.getFilterValue()??"",onValueChange:f=>s.getColumn("reset_type")?.setFilterValue(f==="all"?"":f),children:[e.jsx(W,{className:"h-9",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.reset_type")})}),e.jsxs(Y,{children:[e.jsx($,{value:"all",children:t("traffic_reset_logs.filters.all_types")}),c.map(f=>e.jsx($,{value:f.value,children:f.label},f.value))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.trigger_source")}),e.jsxs(J,{value:s.getColumn("trigger_source")?.getFilterValue()??"",onValueChange:f=>s.getColumn("trigger_source")?.setFilterValue(f==="all"?"":f),children:[e.jsx(W,{className:"h-9",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.trigger_source")})}),e.jsxs(Y,{children:[e.jsx($,{value:"all",children:t("traffic_reset_logs.filters.all_sources")}),h.map(f=>e.jsx($,{value:f.value,children:f.label},f.value))]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.start_date")}),e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:b("h-9 w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),a?Pe(a,"MM-dd"):t("traffic_reset_logs.filters.start_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(vs,{mode:"single",selected:a,onSelect:i,initialFocus:!0})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.end_date")}),e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:b("h-9 w-full justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),l?Pe(l,"MM-dd"):t("traffic_reset_logs.filters.end_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(vs,{mode:"single",selected:l,onSelect:d,initialFocus:!0})})]})]})]}),(a||l)&&e.jsxs(L,{variant:"outline",className:"w-full",onClick:k,children:[e.jsx(lr,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.apply_date")]}),r&&e.jsxs(L,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),i(void 0),d(void 0)},className:"w-full",children:[t("traffic_reset_logs.filters.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between md:hidden",children:[e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(Hn,{children:[e.jsx(ci,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8",children:[e.jsx(od,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.reset_type"),r&&e.jsx("div",{className:"ml-1 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground",children:s.getState().columnFilters.length})]})}),e.jsxs(Ga,{side:"bottom",className:"h-[85vh]",children:[e.jsxs(Wa,{className:"mb-4",children:[e.jsx(Ya,{children:t("traffic_reset_logs.filters.filter_title")}),e.jsx(Ja,{children:t("traffic_reset_logs.filters.filter_description")})]}),e.jsx("div",{className:"max-h-[calc(85vh-120px)] overflow-y-auto",children:e.jsx(S,{})})]})]})}),e.jsxs(L,{variant:"outline",size:"sm",className:"h-8",onClick:C,disabled:u,children:[e.jsx(va,{className:"mr-2 h-4 w-4"}),t(u?"traffic_reset_logs.actions.exporting":"traffic_reset_logs.actions.export")]})]}),e.jsxs("div",{className:"hidden items-center justify-between md:flex",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsx(P,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:f=>s.getColumn("user_email")?.setFilterValue(f.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs(J,{value:s.getColumn("reset_type")?.getFilterValue()??"",onValueChange:f=>s.getColumn("reset_type")?.setFilterValue(f==="all"?"":f),children:[e.jsx(W,{className:"h-8 w-[180px]",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.reset_type")})}),e.jsxs(Y,{children:[e.jsx($,{value:"all",children:t("traffic_reset_logs.filters.all_types")}),c.map(f=>e.jsx($,{value:f.value,children:f.label},f.value))]})]}),e.jsxs(J,{value:s.getColumn("trigger_source")?.getFilterValue()??"",onValueChange:f=>s.getColumn("trigger_source")?.setFilterValue(f==="all"?"":f),children:[e.jsx(W,{className:"h-8 w-[180px]",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.trigger_source")})}),e.jsxs(Y,{children:[e.jsx($,{value:"all",children:t("traffic_reset_logs.filters.all_sources")}),h.map(f=>e.jsx($,{value:f.value,children:f.label},f.value))]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:b("h-8 w-[140px] justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),a?Pe(a,"yyyy-MM-dd"):t("traffic_reset_logs.filters.start_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(vs,{mode:"single",selected:a,onSelect:i,initialFocus:!0})})]}),e.jsxs(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:b("h-8 w-[140px] justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),l?Pe(l,"yyyy-MM-dd"):t("traffic_reset_logs.filters.end_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(vs,{mode:"single",selected:l,onSelect:d,initialFocus:!0})})]}),(a||l)&&e.jsxs(L,{variant:"outline",size:"sm",className:"h-8",onClick:k,children:[e.jsx(lr,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.apply_date")]})]}),r&&e.jsxs(L,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),i(void 0),d(void 0)},className:"h-8 px-2 lg:px-3",children:[t("traffic_reset_logs.filters.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]}),e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",onClick:C,disabled:u,children:[e.jsx(va,{className:"mr-2 h-4 w-4"}),t(u?"traffic_reset_logs.actions.exporting":"traffic_reset_logs.actions.export")]})})]})]})}const gg=()=>{const{t:s}=V("user"),n=a=>{switch(a){case"manual":return"bg-blue-100 text-blue-800 border-blue-200";case"monthly":return"bg-green-100 text-green-800 border-green-200";case"yearly":return"bg-purple-100 text-purple-800 border-purple-200";case"first_day_month":return"bg-orange-100 text-orange-800 border-orange-200";case"first_day_year":return"bg-indigo-100 text-indigo-800 border-indigo-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}},t=a=>{switch(a){case"manual":return"bg-orange-100 text-orange-800 border-orange-200";case"cron":return"bg-indigo-100 text-indigo-800 border-indigo-200";case"auto":return"bg-emerald-100 text-emerald-800 border-emerald-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}},r=a=>{switch(a){case"manual":return e.jsx(Na,{className:"h-3 w-3"});case"cron":return e.jsx(dd,{className:"h-3 w-3"});case"auto":return e.jsx(cd,{className:"h-3 w-3"});default:return e.jsx(Na,{className:"h-3 w-3"})}};return[{accessorKey:"id",header:({column:a})=>e.jsx(z,{column:a,title:s("traffic_reset_logs.columns.id"),className:"w-[60px]"}),cell:({row:a})=>e.jsx("div",{className:"w-[60px]",children:e.jsx(U,{variant:"outline",className:"text-xs",children:a.original.id})}),enableSorting:!0,enableHiding:!0,size:60},{accessorKey:"user_email",header:({column:a})=>e.jsx(z,{column:a,title:s("traffic_reset_logs.columns.user"),className:"min-w-[200px]"}),cell:({row:a})=>e.jsxs("div",{className:"flex min-w-[200px] items-start gap-2",children:[e.jsx(_l,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:a.original.user_email}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["ID: ",a.original.user_id]})]})]}),enableSorting:!1,enableHiding:!1,size:100},{accessorKey:"trigger_source",header:({column:a})=>e.jsx(z,{column:a,title:s("traffic_reset_logs.columns.trigger_source"),className:"w-[120px]"}),cell:({row:a})=>e.jsx("div",{className:"w-[120px]",children:e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx("div",{className:"cursor-pointer",children:e.jsxs(U,{variant:"outline",className:b("flex items-center gap-1.5 border text-xs",t(a.original.trigger_source)),children:[r(a.original.trigger_source),e.jsx("span",{className:"truncate",children:a.original.trigger_source_name})]})})}),e.jsx(oe,{side:"bottom",className:"max-w-[200px]",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm font-medium",children:a.original.trigger_source_name}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[a.original.trigger_source==="manual"&&s("traffic_reset_logs.trigger_descriptions.manual"),a.original.trigger_source==="cron"&&s("traffic_reset_logs.trigger_descriptions.cron"),a.original.trigger_source==="auto"&&s("traffic_reset_logs.trigger_descriptions.auto"),!["manual","cron","auto"].includes(a.original.trigger_source)&&s("traffic_reset_logs.trigger_descriptions.other")]})]})})]})})}),enableSorting:!0,enableHiding:!1,filterFn:(a,i,l)=>l.includes(a.getValue(i)),size:120},{accessorKey:"reset_type",header:({column:a})=>e.jsx(z,{column:a,title:s("traffic_reset_logs.columns.reset_type"),className:"w-[120px]"}),cell:({row:a})=>e.jsx("div",{className:"w-[120px]",children:e.jsx(U,{className:b("border text-xs",n(a.original.reset_type)),children:e.jsx("span",{className:"truncate",children:a.original.reset_type_name})})}),enableSorting:!0,enableHiding:!1,filterFn:(a,i,l)=>l.includes(a.getValue(i)),size:120},{accessorKey:"old_traffic",header:({column:a})=>e.jsx(z,{column:a,title:s("traffic_reset_logs.columns.cleared_traffic"),className:"w-[120px]"}),cell:({row:a})=>{const i=a.original.old_traffic;return e.jsx("div",{className:"w-[120px]",children:e.jsx(pe,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"cursor-pointer text-center",children:[e.jsx("div",{className:"text-sm font-medium text-destructive",children:i.formatted}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("traffic_reset_logs.columns.cleared")})]})}),e.jsxs(oe,{side:"bottom",className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(wt,{className:"h-3 w-3"}),e.jsxs("span",{children:[s("traffic_reset_logs.columns.upload"),":"," ",(i.upload/1024**3).toFixed(2)," GB"]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(va,{className:"h-3 w-3"}),e.jsxs("span",{children:[s("traffic_reset_logs.columns.download"),":"," ",(i.download/1024**3).toFixed(2)," GB"]})]})]})]})})})},enableSorting:!1,enableHiding:!1,size:120},{accessorKey:"reset_time",header:({column:a})=>e.jsx(z,{column:a,title:s("traffic_reset_logs.columns.reset_time"),className:"w-[140px]"}),cell:({row:a})=>e.jsx("div",{className:"w-[140px]",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ut,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-medium",children:xe(a.original.reset_time,"MM-DD")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:xe(a.original.reset_time,"HH:mm")})]})]})}),enableSorting:!0,enableHiding:!0,size:140},{accessorKey:"created_at",header:({column:a})=>e.jsx(z,{column:a,title:s("traffic_reset_logs.columns.log_time"),className:"w-[140px]"}),cell:({row:a})=>e.jsx("div",{className:"w-[140px]",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ln,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-medium",children:xe(a.original.created_at,"YYYY-MM-DD")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:xe(a.original.created_at,"H:m:s")})]})]})}),enableSorting:!0,enableHiding:!1,size:1400}]};function fg(){const[s,n]=m.useState({}),[t,r]=m.useState({reset_time:!1}),[a,i]=m.useState([]),[l,d]=m.useState([{id:"created_at",desc:!0}]),[u,o]=m.useState({pageIndex:0,pageSize:20}),c={page:u.pageIndex+1,per_page:u.pageSize,...a.reduce((S,f)=>{if(f.value)if(f.id==="date_range"){const N=f.value;N.start&&(S.start_date=N.start),N.end&&(S.end_date=N.end)}else S[f.id]=f.value;return S},{})},{refetch:h,data:k,isLoading:C}=ne({queryKey:["trafficResetLogs",u,a,l],queryFn:()=>Xt.getLogs(c)});return e.jsx(pg,{data:k?.data??[],rowCount:k?.total??0,sorting:l,setSorting:d,columnVisibility:t,setColumnVisibility:r,rowSelection:s,setRowSelection:n,columnFilters:a,setColumnFilters:i,pagination:u,setPagination:o,refetch:h,isLoading:C})}function pg({data:s,rowCount:n,sorting:t,setSorting:r,columnVisibility:a,setColumnVisibility:i,rowSelection:l,setRowSelection:d,columnFilters:u,setColumnFilters:o,pagination:c,setPagination:h,refetch:k,isLoading:C}){const S=ss({data:s,columns:gg(),state:{sorting:t,columnVisibility:a,rowSelection:l,columnFilters:u,pagination:c},rowCount:n,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:d,onSortingChange:r,onColumnFiltersChange:o,onColumnVisibilityChange:i,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),onPaginationChange:h,getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnVisibility:{reset_time:!1}}});return e.jsxs("div",{className:"h-full space-y-4",children:[e.jsx(hg,{table:S,refetch:k}),e.jsx(xs,{table:S,isLoading:C})]})}function jg(){const{t:s}=V("user");return e.jsxs(ze,{children:[e.jsxs($e,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsx(ns,{})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsxs(He,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-4 space-y-2 md:mb-2 md:flex md:items-center md:justify-between md:space-y-0",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-xl font-bold tracking-tight md:text-2xl",children:s("traffic_reset_logs.title")}),e.jsx("p",{className:"text-sm text-muted-foreground md:mt-2",children:s("traffic_reset_logs.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-hidden px-4 py-1",children:e.jsx("div",{className:"h-full w-full",children:e.jsx(fg,{})})})]})]})}const vg=Object.freeze(Object.defineProperty({__proto__:null,default:jg},Symbol.toStringTag,{value:"Module"}));export{Cg as a,_g as c,wg as g,Sg as r}; diff --git a/public/assets/admin/assets/vendor.js b/public/assets/admin/assets/vendor.js index 9f253de..b061387 100644 --- a/public/assets/admin/assets/vendor.js +++ b/public/assets/admin/assets/vendor.js @@ -46,7 +46,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function or(){return or=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function zc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $ae(){return Math.random().toString(36).substr(2,8)}function _M(e,t){return{usr:e.state,key:e.key,idx:t}}function J0(e,t,n,r){return n===void 0&&(n=null),or({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Pu(t):t,{state:n,key:t&&t.key||r||$ae()})}function Wc(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Pu(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Iae(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Tr.Pop,u=null,l=c();l==null&&(l=0,a.replaceState(or({},a.state,{idx:l}),""));function c(){return(a.state||{idx:null}).idx}function f(){s=Tr.Pop;let b=c(),w=b==null?null:b-l;l=b,u&&u({action:s,location:y.location,delta:w})}function h(b,w){s=Tr.Push;let x=J0(y.location,b,w);n(x,b),l=c()+1;let S=_M(x,l),O=y.createHref(x);try{a.pushState(S,"",O)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(O)}o&&u&&u({action:s,location:y.location,delta:1})}function p(b,w){s=Tr.Replace;let x=J0(y.location,b,w);n(x,b),l=c();let S=_M(x,l),O=y.createHref(x);a.replaceState(S,"",O),o&&u&&u({action:s,location:y.location,delta:0})}function m(b){let w=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof b=="string"?b:Wc(b);return x=x.replace(/ $/,"%20"),fn(w,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,w)}let y={get action(){return s},get location(){return e(i,a)},listen(b){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(wM,f),u=b,()=>{i.removeEventListener(wM,f),u=null}},createHref(b){return t(i,b)},createURL:m,encodeLocation(b){let w=m(b);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:h,replace:p,go(b){return a.go(b)}};return y}var Nn;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Nn||(Nn={}));const Nae=new Set(["lazy","caseSensitive","path","id","index","children"]);function Lae(e){return e.index===!0}function K1(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let a=[...n,String(o)],s=typeof i.id=="string"?i.id:a.join("-");if(fn(i.index!==!0||!i.children,"Cannot specify children on an index route"),fn(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Lae(i)){let u=or({},i,t(i),{id:s});return r[s]=u,u}else{let u=or({},i,t(i),{id:s,children:void 0});return r[s]=u,i.children&&(u.children=K1(i.children,t,a,r)),u}})}function mc(e,t,n){return n===void 0&&(n="/"),c1(e,t,n,!1)}function c1(e,t,n,r){let i=typeof t=="string"?Pu(t):t,o=Dh(i.pathname||"/",n);if(o==null)return null;let a=fj(e);jae(a);let s=null;for(let u=0;s==null&&u{let u={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};u.relativePath.startsWith("/")&&(fn(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let l=lu([r,u.relativePath]),c=n.concat(u);o.children&&o.children.length>0&&(fn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),fj(o.children,t,c,l)),!(o.path==null&&!o.index)&&t.push({path:l,score:qae(l,o.index),routesMeta:c})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let u of dj(o.path))i(o,a,u)}),t}function dj(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=dj(r.join("/")),s=[];return s.push(...a.map(u=>u===""?o:[o,u].join("/"))),i&&s.push(...a),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function jae(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Kae(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Bae=/^:[\w-]+$/,Uae=3,zae=2,Wae=1,Vae=10,Hae=-2,SM=e=>e==="*";function qae(e,t){let n=e.split("/"),r=n.length;return n.some(SM)&&(r+=Hae),t&&(r+=zae),n.filter(i=>!SM(i)).reduce((i,o)=>i+(Bae.test(o)?Uae:o===""?Wae:Vae),r)}function Kae(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Gae(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s{let{paramName:h,isOptional:p}=c;if(h==="*"){let y=s[f]||"";a=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const m=s[f];return p&&!m?l[h]=void 0:l[h]=(m||"").replace(/%2F/g,"/"),l},{}),pathname:o,pathnameBase:a,pattern:e}}function Yae(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),zc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,u)=>(r.push({paramName:s,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Zae(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Dh(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Xae(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Pu(e):e;return{pathname:n?n.startsWith("/")?n:Qae(n,t):t,search:ese(r),hash:tse(i)}}function Qae(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function _S(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` 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 hj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function WO(e,t){let n=hj(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function VO(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Pu(e):(i=or({},e),fn(!i.pathname||!i.pathname.includes("?"),_S("?","pathname","search",i)),fn(!i.pathname||!i.pathname.includes("#"),_S("#","pathname","hash",i)),fn(!i.search||!i.search.includes("#"),_S("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}s=f>=0?t[f]:"/"}let u=Xae(i,s),l=a&&a!=="/"&&a.endsWith("/"),c=(o||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(l||c)&&(u.pathname+="/"),u}const lu=e=>e.join("/").replace(/\/\/+/g,"/"),Jae=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ese=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,tse=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class G1{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ow(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const pj=["post","put","patch","delete"],nse=new Set(pj),rse=["get",...pj],ise=new Set(rse),ose=new Set([301,302,303,307,308]),ase=new Set([307,308]),SS={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sse={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Tp={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},HO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,use=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),gj="remix-router-transitions";function lse(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;fn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let ae=e.detectErrorBoundary;i=le=>({hasErrorBoundary:ae(le)})}else i=use;let o={},a=K1(e.routes,i,void 0,o),s,u=e.basename||"/",l=e.dataStrategy||hse,c=e.patchRoutesOnNavigation,f=or({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,p=new Set,m=null,y=null,b=null,w=e.hydrationData!=null,x=mc(a,e.history.location,u),S=null;if(x==null&&!c){let ae=no(404,{pathname:e.history.location.pathname}),{matches:le,route:xe}=IM(a);x=le,S={[xe.id]:ae}}x&&!e.hydrationData&&Xr(x,a,e.history.location.pathname).active&&(x=null);let O;if(x)if(x.some(ae=>ae.route.lazy))O=!1;else if(!x.some(ae=>ae.route.loader))O=!0;else if(f.v7_partialHydration){let ae=e.hydrationData?e.hydrationData.loaderData:null,le=e.hydrationData?e.hydrationData.errors:null;if(le){let xe=x.findIndex(T=>le[T.route.id]!==void 0);O=x.slice(0,xe+1).every(T=>!eE(T.route,ae,le))}else O=x.every(xe=>!eE(xe.route,ae,le))}else O=e.hydrationData!=null;else if(O=!1,x=[],f.v7_partialHydration){let ae=Xr(null,a,e.history.location.pathname);ae.active&&ae.matches&&(x=ae.matches)}let E,C={historyAction:e.history.action,location:e.history.location,matches:x,initialized:O,navigation:SS,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},P=Tr.Pop,M=!1,N,B=!1,V=new Map,W=null,ne=!1,Z=!1,q=[],G=new Set,H=new Map,j=0,K=-1,Y=new Map,oe=new Set,X=new Map,Q=new Map,ue=new Set,de=new Map,Se=new Map,me;function Ze(){if(h=e.history.listen(ae=>{let{action:le,location:xe,delta:T}=ae;if(me){me(),me=void 0;return}zc(Se.size===0||T!=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 D=$r({currentLocation:C.location,nextLocation:xe,historyAction:le});if(D&&T!=null){let $=new Promise(A=>{me=A});e.history.go(T*-1),yi(D,{state:"blocked",location:xe,proceed(){yi(D,{state:"proceeding",proceed:void 0,reset:void 0,location:xe}),$.then(()=>e.history.go(T))},reset(){let A=new Map(C.blockers);A.set(D,Tp),$e({blockers:A})}});return}return Ft(le,xe)}),n){Ase(t,V);let ae=()=>Pse(t,V);t.addEventListener("pagehide",ae),W=()=>t.removeEventListener("pagehide",ae)}return C.initialized||Ft(Tr.Pop,C.location,{initialHydration:!0}),E}function Ae(){h&&h(),W&&W(),p.clear(),N&&N.abort(),C.fetchers.forEach((ae,le)=>xr(le)),C.blockers.forEach((ae,le)=>vo(le))}function Le(ae){return p.add(ae),()=>p.delete(ae)}function $e(ae,le){le===void 0&&(le={}),C=or({},C,ae);let xe=[],T=[];f.v7_fetcherPersist&&C.fetchers.forEach((D,$)=>{D.state==="idle"&&(ue.has($)?T.push($):xe.push($))}),[...p].forEach(D=>D(C,{deletedFetchers:T,viewTransitionOpts:le.viewTransitionOpts,flushSync:le.flushSync===!0})),f.v7_fetcherPersist&&(xe.forEach(D=>C.fetchers.delete(D)),T.forEach(D=>xr(D)))}function be(ae,le,xe){var T,D;let{flushSync:$}=xe===void 0?{}:xe,A=C.actionData!=null&&C.navigation.formMethod!=null&&Da(C.navigation.formMethod)&&C.navigation.state==="loading"&&((T=ae.state)==null?void 0:T._isRedirect)!==!0,L;le.actionData?Object.keys(le.actionData).length>0?L=le.actionData:L=null:A?L=C.actionData:L=null;let ee=le.loaderData?DM(C.loaderData,le.loaderData,le.matches||[],le.errors):C.loaderData,re=C.blockers;re.size>0&&(re=new Map(re),re.forEach((Be,He)=>re.set(He,Tp)));let he=M===!0||C.navigation.formMethod!=null&&Da(C.navigation.formMethod)&&((D=ae.state)==null?void 0:D._isRedirect)!==!0;s&&(a=s,s=void 0),ne||P===Tr.Pop||(P===Tr.Push?e.history.push(ae,ae.state):P===Tr.Replace&&e.history.replace(ae,ae.state));let Ce;if(P===Tr.Pop){let Be=V.get(C.location.pathname);Be&&Be.has(ae.pathname)?Ce={currentLocation:C.location,nextLocation:ae}:V.has(ae.pathname)&&(Ce={currentLocation:ae,nextLocation:C.location})}else if(B){let Be=V.get(C.location.pathname);Be?Be.add(ae.pathname):(Be=new Set([ae.pathname]),V.set(C.location.pathname,Be)),Ce={currentLocation:C.location,nextLocation:ae}}$e(or({},le,{actionData:L,loaderData:ee,historyAction:P,location:ae,initialized:!0,navigation:SS,revalidation:"idle",restoreScrollPosition:lr(ae,le.matches||C.matches),preventScrollReset:he,blockers:re}),{viewTransitionOpts:Ce,flushSync:$===!0}),P=Tr.Pop,M=!1,B=!1,ne=!1,Z=!1,q=[]}async function bt(ae,le){if(typeof ae=="number"){e.history.go(ae);return}let xe=JC(C.location,C.matches,u,f.v7_prependBasename,ae,f.v7_relativeSplatPath,le?.fromRouteId,le?.relative),{path:T,submission:D,error:$}=EM(f.v7_normalizeFormMethod,!1,xe,le),A=C.location,L=J0(C.location,T,le&&le.state);L=or({},L,e.history.encodeLocation(L));let ee=le&&le.replace!=null?le.replace:void 0,re=Tr.Push;ee===!0?re=Tr.Replace:ee===!1||D!=null&&Da(D.formMethod)&&D.formAction===C.location.pathname+C.location.search&&(re=Tr.Replace);let he=le&&"preventScrollReset"in le?le.preventScrollReset===!0:void 0,Ce=(le&&le.flushSync)===!0,Be=$r({currentLocation:A,nextLocation:L,historyAction:re});if(Be){yi(Be,{state:"blocked",location:L,proceed(){yi(Be,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),bt(ae,le)},reset(){let He=new Map(C.blockers);He.set(Be,Tp),$e({blockers:He})}});return}return await Ft(re,L,{submission:D,pendingError:$,preventScrollReset:he,replace:le&&le.replace,enableViewTransition:le&&le.viewTransition,flushSync:Ce})}function lt(){if(wn(),$e({revalidation:"loading"}),C.navigation.state!=="submitting"){if(C.navigation.state==="idle"){Ft(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}Ft(P||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:B===!0})}}async function Ft(ae,le,xe){N&&N.abort(),N=null,P=ae,ne=(xe&&xe.startUninterruptedRevalidation)===!0,Gn(C.location,C.matches),M=(xe&&xe.preventScrollReset)===!0,B=(xe&&xe.enableViewTransition)===!0;let T=s||a,D=xe&&xe.overrideNavigation,$=mc(T,le,u),A=(xe&&xe.flushSync)===!0,L=Xr($,T,le.pathname);if(L.active&&L.matches&&($=L.matches),!$){let{error:ct,notFoundMatches:Ne,route:rt}=Sa(le.pathname);be(le,{matches:Ne,loaderData:{},errors:{[rt.id]:ct}},{flushSync:A});return}if(C.initialized&&!Z&&bse(C.location,le)&&!(xe&&xe.submission&&Da(xe.submission.formMethod))){be(le,{matches:$},{flushSync:A});return}N=new AbortController;let ee=jf(e.history,le,N.signal,xe&&xe.submission),re;if(xe&&xe.pendingError)re=[vc($).route.id,{type:Nn.error,error:xe.pendingError}];else if(xe&&xe.submission&&Da(xe.submission.formMethod)){let ct=await yn(ee,le,xe.submission,$,L.active,{replace:xe.replace,flushSync:A});if(ct.shortCircuited)return;if(ct.pendingActionResult){let[Ne,rt]=ct.pendingActionResult;if(To(rt)&&ow(rt.error)&&rt.error.status===404){N=null,be(le,{matches:ct.matches,loaderData:{},errors:{[Ne]:rt.error}});return}}$=ct.matches||$,re=ct.pendingActionResult,D=CS(le,xe.submission),A=!1,L.active=!1,ee=jf(e.history,ee.url,ee.signal)}let{shortCircuited:he,matches:Ce,loaderData:Be,errors:He}=await nn(ee,le,$,L.active,D,xe&&xe.submission,xe&&xe.fetcherSubmission,xe&&xe.replace,xe&&xe.initialHydration===!0,A,re);he||(N=null,be(le,or({matches:Ce||$},$M(re),{loaderData:Be,errors:He})))}async function yn(ae,le,xe,T,D,$){$===void 0&&($={}),wn();let A=Ese(le,xe);if($e({navigation:A},{flushSync:$.flushSync===!0}),D){let re=await yo(T,le.pathname,ae.signal);if(re.type==="aborted")return{shortCircuited:!0};if(re.type==="error"){let he=vc(re.partialMatches).route.id;return{matches:re.partialMatches,pendingActionResult:[he,{type:Nn.error,error:re.error}]}}else if(re.matches)T=re.matches;else{let{notFoundMatches:he,error:Ce,route:Be}=Sa(le.pathname);return{matches:he,pendingActionResult:[Be.id,{type:Nn.error,error:Ce}]}}}let L,ee=o0(T,le);if(!ee.route.action&&!ee.route.lazy)L={type:Nn.error,error:no(405,{method:ae.method,pathname:le.pathname,routeId:ee.route.id})};else if(L=(await nt("action",C,ae,[ee],T,null))[ee.route.id],ae.signal.aborted)return{shortCircuited:!0};if(wc(L)){let re;return $&&$.replace!=null?re=$.replace:re=TM(L.response.headers.get("Location"),new URL(ae.url),u)===C.location.pathname+C.location.search,await ke(ae,L,!0,{submission:xe,replace:re}),{shortCircuited:!0}}if(sl(L))throw no(400,{type:"defer-action"});if(To(L)){let re=vc(T,ee.route.id);return($&&$.replace)!==!0&&(P=Tr.Push),{matches:T,pendingActionResult:[re.route.id,L]}}return{matches:T,pendingActionResult:[ee.route.id,L]}}async function nn(ae,le,xe,T,D,$,A,L,ee,re,he){let Ce=D||CS(le,$),Be=$||A||LM(Ce),He=!ne&&(!f.v7_partialHydration||!ee);if(T){if(He){let qe=ie(he);$e(or({navigation:Ce},qe!==void 0?{actionData:qe}:{}),{flushSync:re})}let Fe=await yo(xe,le.pathname,ae.signal);if(Fe.type==="aborted")return{shortCircuited:!0};if(Fe.type==="error"){let qe=vc(Fe.partialMatches).route.id;return{matches:Fe.partialMatches,loaderData:{},errors:{[qe]:Fe.error}}}else if(Fe.matches)xe=Fe.matches;else{let{error:qe,notFoundMatches:Ge,route:ve}=Sa(le.pathname);return{matches:Ge,loaderData:{},errors:{[ve.id]:qe}}}}let ct=s||a,[Ne,rt]=AM(e.history,C,xe,Be,le,f.v7_partialHydration&&ee===!0,f.v7_skipActionErrorRevalidation,Z,q,G,ue,X,oe,ct,u,he);if(St(Fe=>!(xe&&xe.some(qe=>qe.route.id===Fe))||Ne&&Ne.some(qe=>qe.route.id===Fe)),K=++j,Ne.length===0&&rt.length===0){let Fe=vi();return be(le,or({matches:xe,loaderData:{},errors:he&&To(he[1])?{[he[0]]:he[1].error}:null},$M(he),Fe?{fetchers:new Map(C.fetchers)}:{}),{flushSync:re}),{shortCircuited:!0}}if(He){let Fe={};if(!T){Fe.navigation=Ce;let qe=ie(he);qe!==void 0&&(Fe.actionData=qe)}rt.length>0&&(Fe.fetchers=pe(rt)),$e(Fe,{flushSync:re})}rt.forEach(Fe=>{ur(Fe.key),Fe.controller&&H.set(Fe.key,Fe.controller)});let xt=()=>rt.forEach(Fe=>ur(Fe.key));N&&N.signal.addEventListener("abort",xt);let{loaderResults:At,fetcherResults:pt}=await mt(C,xe,Ne,rt,ae);if(ae.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",xt),rt.forEach(Fe=>H.delete(Fe.key));let ht=ay(At);if(ht)return await ke(ae,ht.result,!0,{replace:L}),{shortCircuited:!0};if(ht=ay(pt),ht)return oe.add(ht.key),await ke(ae,ht.result,!0,{replace:L}),{shortCircuited:!0};let{loaderData:wt,errors:_t}=RM(C,xe,At,he,rt,pt,de);de.forEach((Fe,qe)=>{Fe.subscribe(Ge=>{(Ge||Fe.done)&&de.delete(qe)})}),f.v7_partialHydration&&ee&&C.errors&&(_t=or({},C.errors,_t));let Je=vi(),ut=Dr(K),Qe=Je||ut||rt.length>0;return or({matches:xe,loaderData:wt,errors:_t},Qe?{fetchers:new Map(C.fetchers)}:{})}function ie(ae){if(ae&&!To(ae[1]))return{[ae[0]]:ae[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function pe(ae){return ae.forEach(le=>{let xe=C.fetchers.get(le.key),T=Mp(void 0,xe?xe.data:void 0);C.fetchers.set(le.key,T)}),new Map(C.fetchers)}function ye(ae,le,xe,T){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.");ur(ae);let D=(T&&T.flushSync)===!0,$=s||a,A=JC(C.location,C.matches,u,f.v7_prependBasename,xe,f.v7_relativeSplatPath,le,T?.relative),L=mc($,A,u),ee=Xr(L,$,A);if(ee.active&&ee.matches&&(L=ee.matches),!L){_n(ae,le,no(404,{pathname:A}),{flushSync:D});return}let{path:re,submission:he,error:Ce}=EM(f.v7_normalizeFormMethod,!0,A,T);if(Ce){_n(ae,le,Ce,{flushSync:D});return}let Be=o0(L,re),He=(T&&T.preventScrollReset)===!0;if(he&&Da(he.formMethod)){ze(ae,le,re,Be,L,ee.active,D,He,he);return}X.set(ae,{routeId:le,path:re}),je(ae,le,re,Be,L,ee.active,D,He,he)}async function ze(ae,le,xe,T,D,$,A,L,ee){wn(),X.delete(ae);function re(ge){if(!ge.route.action&&!ge.route.lazy){let De=no(405,{method:ee.formMethod,pathname:xe,routeId:le});return _n(ae,le,De,{flushSync:A}),!0}return!1}if(!$&&re(T))return;let he=C.fetchers.get(ae);Kt(ae,Ose(ee,he),{flushSync:A});let Ce=new AbortController,Be=jf(e.history,xe,Ce.signal,ee);if($){let ge=await yo(D,xe,Be.signal);if(ge.type==="aborted")return;if(ge.type==="error"){_n(ae,le,ge.error,{flushSync:A});return}else if(ge.matches){if(D=ge.matches,T=o0(D,xe),re(T))return}else{_n(ae,le,no(404,{pathname:xe}),{flushSync:A});return}}H.set(ae,Ce);let He=j,Ne=(await nt("action",C,Be,[T],D,ae))[T.route.id];if(Be.signal.aborted){H.get(ae)===Ce&&H.delete(ae);return}if(f.v7_fetcherPersist&&ue.has(ae)){if(wc(Ne)||To(Ne)){Kt(ae,Ku(void 0));return}}else{if(wc(Ne))if(H.delete(ae),K>He){Kt(ae,Ku(void 0));return}else return oe.add(ae),Kt(ae,Mp(ee)),ke(Be,Ne,!1,{fetcherSubmission:ee,preventScrollReset:L});if(To(Ne)){_n(ae,le,Ne.error);return}}if(sl(Ne))throw no(400,{type:"defer-action"});let rt=C.navigation.location||C.location,xt=jf(e.history,rt,Ce.signal),At=s||a,pt=C.navigation.state!=="idle"?mc(At,C.navigation.location,u):C.matches;fn(pt,"Didn't find any matches after fetcher action");let ht=++j;Y.set(ae,ht);let wt=Mp(ee,Ne.data);C.fetchers.set(ae,wt);let[_t,Je]=AM(e.history,C,pt,ee,rt,!1,f.v7_skipActionErrorRevalidation,Z,q,G,ue,X,oe,At,u,[T.route.id,Ne]);Je.filter(ge=>ge.key!==ae).forEach(ge=>{let De=ge.key,Pe=C.fetchers.get(De),Te=Mp(void 0,Pe?Pe.data:void 0);C.fetchers.set(De,Te),ur(De),ge.controller&&H.set(De,ge.controller)}),$e({fetchers:new Map(C.fetchers)});let ut=()=>Je.forEach(ge=>ur(ge.key));Ce.signal.addEventListener("abort",ut);let{loaderResults:Qe,fetcherResults:Fe}=await mt(C,pt,_t,Je,xt);if(Ce.signal.aborted)return;Ce.signal.removeEventListener("abort",ut),Y.delete(ae),H.delete(ae),Je.forEach(ge=>H.delete(ge.key));let qe=ay(Qe);if(qe)return ke(xt,qe.result,!1,{preventScrollReset:L});if(qe=ay(Fe),qe)return oe.add(qe.key),ke(xt,qe.result,!1,{preventScrollReset:L});let{loaderData:Ge,errors:ve}=RM(C,pt,Qe,void 0,Je,Fe,de);if(C.fetchers.has(ae)){let ge=Ku(Ne.data);C.fetchers.set(ae,ge)}Dr(ht),C.navigation.state==="loading"&&ht>K?(fn(P,"Expected pending action"),N&&N.abort(),be(C.navigation.location,{matches:pt,loaderData:Ge,errors:ve,fetchers:new Map(C.fetchers)})):($e({errors:ve,loaderData:DM(C.loaderData,Ge,pt,ve),fetchers:new Map(C.fetchers)}),Z=!1)}async function je(ae,le,xe,T,D,$,A,L,ee){let re=C.fetchers.get(ae);Kt(ae,Mp(ee,re?re.data:void 0),{flushSync:A});let he=new AbortController,Ce=jf(e.history,xe,he.signal);if($){let Ne=await yo(D,xe,Ce.signal);if(Ne.type==="aborted")return;if(Ne.type==="error"){_n(ae,le,Ne.error,{flushSync:A});return}else if(Ne.matches)D=Ne.matches,T=o0(D,xe);else{_n(ae,le,no(404,{pathname:xe}),{flushSync:A});return}}H.set(ae,he);let Be=j,ct=(await nt("loader",C,Ce,[T],D,ae))[T.route.id];if(sl(ct)&&(ct=await qO(ct,Ce.signal,!0)||ct),H.get(ae)===he&&H.delete(ae),!Ce.signal.aborted){if(ue.has(ae)){Kt(ae,Ku(void 0));return}if(wc(ct))if(K>Be){Kt(ae,Ku(void 0));return}else{oe.add(ae),await ke(Ce,ct,!1,{preventScrollReset:L});return}if(To(ct)){_n(ae,le,ct.error);return}fn(!sl(ct),"Unhandled fetcher deferred data"),Kt(ae,Ku(ct.data))}}async function ke(ae,le,xe,T){let{submission:D,fetcherSubmission:$,preventScrollReset:A,replace:L}=T===void 0?{}:T;le.response.headers.has("X-Remix-Revalidate")&&(Z=!0);let ee=le.response.headers.get("Location");fn(ee,"Expected a Location header on the redirect Response"),ee=TM(ee,new URL(ae.url),u);let re=J0(C.location,ee,{_isRedirect:!0});if(n){let Ne=!1;if(le.response.headers.has("X-Remix-Reload-Document"))Ne=!0;else if(HO.test(ee)){const rt=e.history.createURL(ee);Ne=rt.origin!==t.location.origin||Dh(rt.pathname,u)==null}if(Ne){L?t.location.replace(ee):t.location.assign(ee);return}}N=null;let he=L===!0||le.response.headers.has("X-Remix-Replace")?Tr.Replace:Tr.Push,{formMethod:Ce,formAction:Be,formEncType:He}=C.navigation;!D&&!$&&Ce&&Be&&He&&(D=LM(C.navigation));let ct=D||$;if(ase.has(le.response.status)&&ct&&Da(ct.formMethod))await Ft(he,re,{submission:or({},ct,{formAction:ee}),preventScrollReset:A||M,enableViewTransition:xe?B:void 0});else{let Ne=CS(re,D);await Ft(he,re,{overrideNavigation:Ne,fetcherSubmission:$,preventScrollReset:A||M,enableViewTransition:xe?B:void 0})}}async function nt(ae,le,xe,T,D,$){let A,L={};try{A=await pse(l,ae,le,xe,T,D,$,o,i)}catch(ee){return T.forEach(re=>{L[re.route.id]={type:Nn.error,error:ee}}),L}for(let[ee,re]of Object.entries(A))if(xse(re)){let he=re.result;L[ee]={type:Nn.redirect,response:vse(he,xe,ee,D,u,f.v7_relativeSplatPath)}}else L[ee]=await mse(re);return L}async function mt(ae,le,xe,T,D){let $=ae.matches,A=nt("loader",ae,D,xe,le,null),L=Promise.all(T.map(async he=>{if(he.matches&&he.match&&he.controller){let Be=(await nt("loader",ae,jf(e.history,he.path,he.controller.signal),[he.match],he.matches,he.key))[he.match.route.id];return{[he.key]:Be}}else return Promise.resolve({[he.key]:{type:Nn.error,error:no(404,{pathname:he.path})}})})),ee=await A,re=(await L).reduce((he,Ce)=>Object.assign(he,Ce),{});return await Promise.all([Sse(le,ee,D.signal,$,ae.loaderData),Cse(le,re,T)]),{loaderResults:ee,fetcherResults:re}}function wn(){Z=!0,q.push(...St()),X.forEach((ae,le)=>{H.has(le)&&G.add(le),ur(le)})}function Kt(ae,le,xe){xe===void 0&&(xe={}),C.fetchers.set(ae,le),$e({fetchers:new Map(C.fetchers)},{flushSync:(xe&&xe.flushSync)===!0})}function _n(ae,le,xe,T){T===void 0&&(T={});let D=vc(C.matches,le);xr(ae),$e({errors:{[D.route.id]:xe},fetchers:new Map(C.fetchers)},{flushSync:(T&&T.flushSync)===!0})}function $i(ae){return f.v7_fetcherPersist&&(Q.set(ae,(Q.get(ae)||0)+1),ue.has(ae)&&ue.delete(ae)),C.fetchers.get(ae)||sse}function xr(ae){let le=C.fetchers.get(ae);H.has(ae)&&!(le&&le.state==="loading"&&Y.has(ae))&&ur(ae),X.delete(ae),Y.delete(ae),oe.delete(ae),ue.delete(ae),G.delete(ae),C.fetchers.delete(ae)}function mi(ae){if(f.v7_fetcherPersist){let le=(Q.get(ae)||0)-1;le<=0?(Q.delete(ae),ue.add(ae)):Q.set(ae,le)}else xr(ae);$e({fetchers:new Map(C.fetchers)})}function ur(ae){let le=H.get(ae);le&&(le.abort(),H.delete(ae))}function ai(ae){for(let le of ae){let xe=$i(le),T=Ku(xe.data);C.fetchers.set(le,T)}}function vi(){let ae=[],le=!1;for(let xe of oe){let T=C.fetchers.get(xe);fn(T,"Expected fetcher: "+xe),T.state==="loading"&&(oe.delete(xe),ae.push(xe),le=!0)}return ai(ae),le}function Dr(ae){let le=[];for(let[xe,T]of Y)if(T0}function Zi(ae,le){let xe=C.blockers.get(ae)||Tp;return Se.get(ae)!==le&&Se.set(ae,le),xe}function vo(ae){C.blockers.delete(ae),Se.delete(ae)}function yi(ae,le){let xe=C.blockers.get(ae)||Tp;fn(xe.state==="unblocked"&&le.state==="blocked"||xe.state==="blocked"&&le.state==="blocked"||xe.state==="blocked"&&le.state==="proceeding"||xe.state==="blocked"&&le.state==="unblocked"||xe.state==="proceeding"&&le.state==="unblocked","Invalid blocker state transition: "+xe.state+" -> "+le.state);let T=new Map(C.blockers);T.set(ae,le),$e({blockers:T})}function $r(ae){let{currentLocation:le,nextLocation:xe,historyAction:T}=ae;if(Se.size===0)return;Se.size>1&&zc(!1,"A router only supports one blocker at a time");let D=Array.from(Se.entries()),[$,A]=D[D.length-1],L=C.blockers.get($);if(!(L&&L.state==="proceeding")&&A({currentLocation:le,nextLocation:xe,historyAction:T}))return $}function Sa(ae){let le=no(404,{pathname:ae}),xe=s||a,{matches:T,route:D}=IM(xe);return St(),{notFoundMatches:T,route:D,error:le}}function St(ae){let le=[];return de.forEach((xe,T)=>{(!ae||ae(T))&&(xe.cancel(),le.push(T),de.delete(T))}),le}function hn(ae,le,xe){if(m=ae,b=le,y=xe||null,!w&&C.navigation===SS){w=!0;let T=lr(C.location,C.matches);T!=null&&$e({restoreScrollPosition:T})}return()=>{m=null,b=null,y=null}}function Sn(ae,le){return y&&y(ae,le.map(T=>Fae(T,C.loaderData)))||ae.key}function Gn(ae,le){if(m&&b){let xe=Sn(ae,le);m[xe]=b()}}function lr(ae,le){if(m){let xe=Sn(ae,le),T=m[xe];if(typeof T=="number")return T}return null}function Xr(ae,le,xe){if(c)if(ae){if(Object.keys(ae[0].params).length>0)return{active:!0,matches:c1(le,xe,u,!0)}}else return{active:!0,matches:c1(le,xe,u,!0)||[]};return{active:!1,matches:null}}async function yo(ae,le,xe){if(!c)return{type:"success",matches:ae};let T=ae;for(;;){let D=s==null,$=s||a,A=o;try{await c({path:le,matches:T,patch:(re,he)=>{xe.aborted||kM(re,he,$,A,i)}})}catch(re){return{type:"error",error:re,partialMatches:T}}finally{D&&!xe.aborted&&(a=[...a])}if(xe.aborted)return{type:"aborted"};let L=mc($,le,u);if(L)return{type:"success",matches:L};let ee=c1($,le,u,!0);if(!ee||T.length===ee.length&&T.every((re,he)=>re.route.id===ee[he].route.id))return{type:"success",matches:null};T=ee}}function Xl(ae){o={},s=K1(ae,i,void 0,o)}function Cf(ae,le){let xe=s==null;kM(ae,le,s||a,o,i),xe&&(a=[...a],$e({}))}return E={get basename(){return u},get future(){return f},get state(){return C},get routes(){return a},get window(){return t},initialize:Ze,subscribe:Le,enableScrollRestoration:hn,navigate:bt,fetch:ye,revalidate:lt,createHref:ae=>e.history.createHref(ae),encodeLocation:ae=>e.history.encodeLocation(ae),getFetcher:$i,deleteFetcher:mi,dispose:Ae,getBlocker:Zi,deleteBlocker:vo,patchRoutes:Cf,_internalFetchControllers:H,_internalActiveDeferreds:de,_internalSetRoutes:Xl},E}function cse(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function JC(e,t,n,r,i,o,a,s){let u,l;if(a){u=[];for(let f of t)if(u.push(f),f.route.id===a){l=f;break}}else u=t,l=t[t.length-1];let c=VO(i||".",WO(u,o),Dh(e.pathname,n)||e.pathname,s==="path");if(i==null&&(c.search=e.search,c.hash=e.hash),(i==null||i===""||i===".")&&l){let f=KO(c.search);if(l.route.index&&!f)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&f){let h=new URLSearchParams(c.search),p=h.getAll("index");h.delete("index"),p.filter(y=>y).forEach(y=>h.append("index",y));let m=h.toString();c.search=m?"?"+m:""}}return r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:lu([n,c.pathname])),Wc(c)}function EM(e,t,n,r){if(!r||!cse(r))return{path:n};if(r.formMethod&&!_se(r.formMethod))return{path:n,error:no(405,{method:r.formMethod})};let i=()=>({path:n,error:no(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),s=yj(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Da(a))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,m)=>{let[y,b]=m;return""+p+y+"="+b+` + */function or(){return or=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function zc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $ae(){return Math.random().toString(36).substr(2,8)}function _M(e,t){return{usr:e.state,key:e.key,idx:t}}function J0(e,t,n,r){return n===void 0&&(n=null),or({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Pu(t):t,{state:n,key:t&&t.key||r||$ae()})}function Wc(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Pu(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Iae(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Tr.Pop,u=null,l=c();l==null&&(l=0,a.replaceState(or({},a.state,{idx:l}),""));function c(){return(a.state||{idx:null}).idx}function f(){s=Tr.Pop;let b=c(),w=b==null?null:b-l;l=b,u&&u({action:s,location:y.location,delta:w})}function h(b,w){s=Tr.Push;let x=J0(y.location,b,w);n(x,b),l=c()+1;let S=_M(x,l),O=y.createHref(x);try{a.pushState(S,"",O)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(O)}o&&u&&u({action:s,location:y.location,delta:1})}function p(b,w){s=Tr.Replace;let x=J0(y.location,b,w);n(x,b),l=c();let S=_M(x,l),O=y.createHref(x);a.replaceState(S,"",O),o&&u&&u({action:s,location:y.location,delta:0})}function m(b){let w=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof b=="string"?b:Wc(b);return x=x.replace(/ $/,"%20"),fn(w,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,w)}let y={get action(){return s},get location(){return e(i,a)},listen(b){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(wM,f),u=b,()=>{i.removeEventListener(wM,f),u=null}},createHref(b){return t(i,b)},createURL:m,encodeLocation(b){let w=m(b);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:h,replace:p,go(b){return a.go(b)}};return y}var Nn;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Nn||(Nn={}));const Nae=new Set(["lazy","caseSensitive","path","id","index","children"]);function Lae(e){return e.index===!0}function K1(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let a=[...n,String(o)],s=typeof i.id=="string"?i.id:a.join("-");if(fn(i.index!==!0||!i.children,"Cannot specify children on an index route"),fn(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Lae(i)){let u=or({},i,t(i),{id:s});return r[s]=u,u}else{let u=or({},i,t(i),{id:s,children:void 0});return r[s]=u,i.children&&(u.children=K1(i.children,t,a,r)),u}})}function mc(e,t,n){return n===void 0&&(n="/"),c1(e,t,n,!1)}function c1(e,t,n,r){let i=typeof t=="string"?Pu(t):t,o=Dh(i.pathname||"/",n);if(o==null)return null;let a=fj(e);jae(a);let s=null;for(let u=0;s==null&&u{let u={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};u.relativePath.startsWith("/")&&(fn(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let l=lu([r,u.relativePath]),c=n.concat(u);o.children&&o.children.length>0&&(fn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),fj(o.children,t,c,l)),!(o.path==null&&!o.index)&&t.push({path:l,score:qae(l,o.index),routesMeta:c})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let u of dj(o.path))i(o,a,u)}),t}function dj(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=dj(r.join("/")),s=[];return s.push(...a.map(u=>u===""?o:[o,u].join("/"))),i&&s.push(...a),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function jae(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Kae(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Bae=/^:[\w-]+$/,Uae=3,zae=2,Wae=1,Vae=10,Hae=-2,SM=e=>e==="*";function qae(e,t){let n=e.split("/"),r=n.length;return n.some(SM)&&(r+=Hae),t&&(r+=zae),n.filter(i=>!SM(i)).reduce((i,o)=>i+(Bae.test(o)?Uae:o===""?Wae:Vae),r)}function Kae(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Gae(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s{let{paramName:h,isOptional:p}=c;if(h==="*"){let y=s[f]||"";a=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const m=s[f];return p&&!m?l[h]=void 0:l[h]=(m||"").replace(/%2F/g,"/"),l},{}),pathname:o,pathnameBase:a,pattern:e}}function Yae(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),zc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,u)=>(r.push({paramName:s,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Zae(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Dh(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Xae(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Pu(e):e;return{pathname:n?n.startsWith("/")?n:Qae(n,t):t,search:ese(r),hash:tse(i)}}function Qae(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function _S(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` 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 hj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function WO(e,t){let n=hj(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function VO(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Pu(e):(i=or({},e),fn(!i.pathname||!i.pathname.includes("?"),_S("?","pathname","search",i)),fn(!i.pathname||!i.pathname.includes("#"),_S("#","pathname","hash",i)),fn(!i.search||!i.search.includes("#"),_S("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}s=f>=0?t[f]:"/"}let u=Xae(i,s),l=a&&a!=="/"&&a.endsWith("/"),c=(o||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(l||c)&&(u.pathname+="/"),u}const lu=e=>e.join("/").replace(/\/\/+/g,"/"),Jae=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ese=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,tse=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class G1{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ow(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const pj=["post","put","patch","delete"],nse=new Set(pj),rse=["get",...pj],ise=new Set(rse),ose=new Set([301,302,303,307,308]),ase=new Set([307,308]),SS={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sse={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Tp={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},HO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,use=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),gj="remix-router-transitions";function lse(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;fn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let ae=e.detectErrorBoundary;i=le=>({hasErrorBoundary:ae(le)})}else i=use;let o={},a=K1(e.routes,i,void 0,o),s,u=e.basename||"/",l=e.dataStrategy||hse,c=e.patchRoutesOnNavigation,f=or({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,p=new Set,m=null,y=null,b=null,w=e.hydrationData!=null,x=mc(a,e.history.location,u),S=null;if(x==null&&!c){let ae=no(404,{pathname:e.history.location.pathname}),{matches:le,route:xe}=IM(a);x=le,S={[xe.id]:ae}}x&&!e.hydrationData&&Xr(x,a,e.history.location.pathname).active&&(x=null);let O;if(x)if(x.some(ae=>ae.route.lazy))O=!1;else if(!x.some(ae=>ae.route.loader))O=!0;else if(f.v7_partialHydration){let ae=e.hydrationData?e.hydrationData.loaderData:null,le=e.hydrationData?e.hydrationData.errors:null;if(le){let xe=x.findIndex(T=>le[T.route.id]!==void 0);O=x.slice(0,xe+1).every(T=>!eE(T.route,ae,le))}else O=x.every(xe=>!eE(xe.route,ae,le))}else O=e.hydrationData!=null;else if(O=!1,x=[],f.v7_partialHydration){let ae=Xr(null,a,e.history.location.pathname);ae.active&&ae.matches&&(x=ae.matches)}let E,C={historyAction:e.history.action,location:e.history.location,matches:x,initialized:O,navigation:SS,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},P=Tr.Pop,M=!1,N,B=!1,V=new Map,W=null,ne=!1,Z=!1,q=[],G=new Set,H=new Map,j=0,K=-1,Y=new Map,oe=new Set,X=new Map,Q=new Map,ue=new Set,de=new Map,Se=new Map,me;function Ze(){if(h=e.history.listen(ae=>{let{action:le,location:xe,delta:T}=ae;if(me){me(),me=void 0;return}zc(Se.size===0||T!=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 D=$r({currentLocation:C.location,nextLocation:xe,historyAction:le});if(D&&T!=null){let $=new Promise(A=>{me=A});e.history.go(T*-1),yi(D,{state:"blocked",location:xe,proceed(){yi(D,{state:"proceeding",proceed:void 0,reset:void 0,location:xe}),$.then(()=>e.history.go(T))},reset(){let A=new Map(C.blockers);A.set(D,Tp),$e({blockers:A})}});return}return Ft(le,xe)}),n){Ase(t,V);let ae=()=>Pse(t,V);t.addEventListener("pagehide",ae),W=()=>t.removeEventListener("pagehide",ae)}return C.initialized||Ft(Tr.Pop,C.location,{initialHydration:!0}),E}function Ae(){h&&h(),W&&W(),p.clear(),N&&N.abort(),C.fetchers.forEach((ae,le)=>xr(le)),C.blockers.forEach((ae,le)=>vo(le))}function Le(ae){return p.add(ae),()=>p.delete(ae)}function $e(ae,le){le===void 0&&(le={}),C=or({},C,ae);let xe=[],T=[];f.v7_fetcherPersist&&C.fetchers.forEach((D,$)=>{D.state==="idle"&&(ue.has($)?T.push($):xe.push($))}),[...p].forEach(D=>D(C,{deletedFetchers:T,viewTransitionOpts:le.viewTransitionOpts,flushSync:le.flushSync===!0})),f.v7_fetcherPersist&&(xe.forEach(D=>C.fetchers.delete(D)),T.forEach(D=>xr(D)))}function be(ae,le,xe){var T,D;let{flushSync:$}=xe===void 0?{}:xe,A=C.actionData!=null&&C.navigation.formMethod!=null&&Da(C.navigation.formMethod)&&C.navigation.state==="loading"&&((T=ae.state)==null?void 0:T._isRedirect)!==!0,L;le.actionData?Object.keys(le.actionData).length>0?L=le.actionData:L=null:A?L=C.actionData:L=null;let ee=le.loaderData?DM(C.loaderData,le.loaderData,le.matches||[],le.errors):C.loaderData,re=C.blockers;re.size>0&&(re=new Map(re),re.forEach((Be,He)=>re.set(He,Tp)));let he=M===!0||C.navigation.formMethod!=null&&Da(C.navigation.formMethod)&&((D=ae.state)==null?void 0:D._isRedirect)!==!0;s&&(a=s,s=void 0),ne||P===Tr.Pop||(P===Tr.Push?e.history.push(ae,ae.state):P===Tr.Replace&&e.history.replace(ae,ae.state));let Ce;if(P===Tr.Pop){let Be=V.get(C.location.pathname);Be&&Be.has(ae.pathname)?Ce={currentLocation:C.location,nextLocation:ae}:V.has(ae.pathname)&&(Ce={currentLocation:ae,nextLocation:C.location})}else if(B){let Be=V.get(C.location.pathname);Be?Be.add(ae.pathname):(Be=new Set([ae.pathname]),V.set(C.location.pathname,Be)),Ce={currentLocation:C.location,nextLocation:ae}}$e(or({},le,{actionData:L,loaderData:ee,historyAction:P,location:ae,initialized:!0,navigation:SS,revalidation:"idle",restoreScrollPosition:lr(ae,le.matches||C.matches),preventScrollReset:he,blockers:re}),{viewTransitionOpts:Ce,flushSync:$===!0}),P=Tr.Pop,M=!1,B=!1,ne=!1,Z=!1,q=[]}async function bt(ae,le){if(typeof ae=="number"){e.history.go(ae);return}let xe=JC(C.location,C.matches,u,f.v7_prependBasename,ae,f.v7_relativeSplatPath,le?.fromRouteId,le?.relative),{path:T,submission:D,error:$}=EM(f.v7_normalizeFormMethod,!1,xe,le),A=C.location,L=J0(C.location,T,le&&le.state);L=or({},L,e.history.encodeLocation(L));let ee=le&&le.replace!=null?le.replace:void 0,re=Tr.Push;ee===!0?re=Tr.Replace:ee===!1||D!=null&&Da(D.formMethod)&&D.formAction===C.location.pathname+C.location.search&&(re=Tr.Replace);let he=le&&"preventScrollReset"in le?le.preventScrollReset===!0:void 0,Ce=(le&&le.flushSync)===!0,Be=$r({currentLocation:A,nextLocation:L,historyAction:re});if(Be){yi(Be,{state:"blocked",location:L,proceed(){yi(Be,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),bt(ae,le)},reset(){let He=new Map(C.blockers);He.set(Be,Tp),$e({blockers:He})}});return}return await Ft(re,L,{submission:D,pendingError:$,preventScrollReset:he,replace:le&&le.replace,enableViewTransition:le&&le.viewTransition,flushSync:Ce})}function lt(){if(wn(),$e({revalidation:"loading"}),C.navigation.state!=="submitting"){if(C.navigation.state==="idle"){Ft(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}Ft(P||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:B===!0})}}async function Ft(ae,le,xe){N&&N.abort(),N=null,P=ae,ne=(xe&&xe.startUninterruptedRevalidation)===!0,Gn(C.location,C.matches),M=(xe&&xe.preventScrollReset)===!0,B=(xe&&xe.enableViewTransition)===!0;let T=s||a,D=xe&&xe.overrideNavigation,$=mc(T,le,u),A=(xe&&xe.flushSync)===!0,L=Xr($,T,le.pathname);if(L.active&&L.matches&&($=L.matches),!$){let{error:ct,notFoundMatches:Ne,route:rt}=Sa(le.pathname);be(le,{matches:Ne,loaderData:{},errors:{[rt.id]:ct}},{flushSync:A});return}if(C.initialized&&!Z&&bse(C.location,le)&&!(xe&&xe.submission&&Da(xe.submission.formMethod))){be(le,{matches:$},{flushSync:A});return}N=new AbortController;let ee=jf(e.history,le,N.signal,xe&&xe.submission),re;if(xe&&xe.pendingError)re=[vc($).route.id,{type:Nn.error,error:xe.pendingError}];else if(xe&&xe.submission&&Da(xe.submission.formMethod)){let ct=await yn(ee,le,xe.submission,$,L.active,{replace:xe.replace,flushSync:A});if(ct.shortCircuited)return;if(ct.pendingActionResult){let[Ne,rt]=ct.pendingActionResult;if(To(rt)&&ow(rt.error)&&rt.error.status===404){N=null,be(le,{matches:ct.matches,loaderData:{},errors:{[Ne]:rt.error}});return}}$=ct.matches||$,re=ct.pendingActionResult,D=CS(le,xe.submission),A=!1,L.active=!1,ee=jf(e.history,ee.url,ee.signal)}let{shortCircuited:he,matches:Ce,loaderData:Be,errors:He}=await nn(ee,le,$,L.active,D,xe&&xe.submission,xe&&xe.fetcherSubmission,xe&&xe.replace,xe&&xe.initialHydration===!0,A,re);he||(N=null,be(le,or({matches:Ce||$},$M(re),{loaderData:Be,errors:He})))}async function yn(ae,le,xe,T,D,$){$===void 0&&($={}),wn();let A=Ese(le,xe);if($e({navigation:A},{flushSync:$.flushSync===!0}),D){let re=await yo(T,le.pathname,ae.signal);if(re.type==="aborted")return{shortCircuited:!0};if(re.type==="error"){let he=vc(re.partialMatches).route.id;return{matches:re.partialMatches,pendingActionResult:[he,{type:Nn.error,error:re.error}]}}else if(re.matches)T=re.matches;else{let{notFoundMatches:he,error:Ce,route:Be}=Sa(le.pathname);return{matches:he,pendingActionResult:[Be.id,{type:Nn.error,error:Ce}]}}}let L,ee=o0(T,le);if(!ee.route.action&&!ee.route.lazy)L={type:Nn.error,error:no(405,{method:ae.method,pathname:le.pathname,routeId:ee.route.id})};else if(L=(await nt("action",C,ae,[ee],T,null))[ee.route.id],ae.signal.aborted)return{shortCircuited:!0};if(wc(L)){let re;return $&&$.replace!=null?re=$.replace:re=TM(L.response.headers.get("Location"),new URL(ae.url),u)===C.location.pathname+C.location.search,await ke(ae,L,!0,{submission:xe,replace:re}),{shortCircuited:!0}}if(sl(L))throw no(400,{type:"defer-action"});if(To(L)){let re=vc(T,ee.route.id);return($&&$.replace)!==!0&&(P=Tr.Push),{matches:T,pendingActionResult:[re.route.id,L]}}return{matches:T,pendingActionResult:[ee.route.id,L]}}async function nn(ae,le,xe,T,D,$,A,L,ee,re,he){let Ce=D||CS(le,$),Be=$||A||LM(Ce),He=!ne&&(!f.v7_partialHydration||!ee);if(T){if(He){let qe=ie(he);$e(or({navigation:Ce},qe!==void 0?{actionData:qe}:{}),{flushSync:re})}let Fe=await yo(xe,le.pathname,ae.signal);if(Fe.type==="aborted")return{shortCircuited:!0};if(Fe.type==="error"){let qe=vc(Fe.partialMatches).route.id;return{matches:Fe.partialMatches,loaderData:{},errors:{[qe]:Fe.error}}}else if(Fe.matches)xe=Fe.matches;else{let{error:qe,notFoundMatches:Ge,route:ve}=Sa(le.pathname);return{matches:Ge,loaderData:{},errors:{[ve.id]:qe}}}}let ct=s||a,[Ne,rt]=AM(e.history,C,xe,Be,le,f.v7_partialHydration&&ee===!0,f.v7_skipActionErrorRevalidation,Z,q,G,ue,X,oe,ct,u,he);if(St(Fe=>!(xe&&xe.some(qe=>qe.route.id===Fe))||Ne&&Ne.some(qe=>qe.route.id===Fe)),K=++j,Ne.length===0&&rt.length===0){let Fe=vi();return be(le,or({matches:xe,loaderData:{},errors:he&&To(he[1])?{[he[0]]:he[1].error}:null},$M(he),Fe?{fetchers:new Map(C.fetchers)}:{}),{flushSync:re}),{shortCircuited:!0}}if(He){let Fe={};if(!T){Fe.navigation=Ce;let qe=ie(he);qe!==void 0&&(Fe.actionData=qe)}rt.length>0&&(Fe.fetchers=pe(rt)),$e(Fe,{flushSync:re})}rt.forEach(Fe=>{ur(Fe.key),Fe.controller&&H.set(Fe.key,Fe.controller)});let xt=()=>rt.forEach(Fe=>ur(Fe.key));N&&N.signal.addEventListener("abort",xt);let{loaderResults:At,fetcherResults:pt}=await vt(C,xe,Ne,rt,ae);if(ae.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",xt),rt.forEach(Fe=>H.delete(Fe.key));let ht=ay(At);if(ht)return await ke(ae,ht.result,!0,{replace:L}),{shortCircuited:!0};if(ht=ay(pt),ht)return oe.add(ht.key),await ke(ae,ht.result,!0,{replace:L}),{shortCircuited:!0};let{loaderData:wt,errors:_t}=RM(C,xe,At,he,rt,pt,de);de.forEach((Fe,qe)=>{Fe.subscribe(Ge=>{(Ge||Fe.done)&&de.delete(qe)})}),f.v7_partialHydration&&ee&&C.errors&&(_t=or({},C.errors,_t));let Je=vi(),ut=Dr(K),Qe=Je||ut||rt.length>0;return or({matches:xe,loaderData:wt,errors:_t},Qe?{fetchers:new Map(C.fetchers)}:{})}function ie(ae){if(ae&&!To(ae[1]))return{[ae[0]]:ae[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function pe(ae){return ae.forEach(le=>{let xe=C.fetchers.get(le.key),T=Mp(void 0,xe?xe.data:void 0);C.fetchers.set(le.key,T)}),new Map(C.fetchers)}function ye(ae,le,xe,T){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.");ur(ae);let D=(T&&T.flushSync)===!0,$=s||a,A=JC(C.location,C.matches,u,f.v7_prependBasename,xe,f.v7_relativeSplatPath,le,T?.relative),L=mc($,A,u),ee=Xr(L,$,A);if(ee.active&&ee.matches&&(L=ee.matches),!L){_n(ae,le,no(404,{pathname:A}),{flushSync:D});return}let{path:re,submission:he,error:Ce}=EM(f.v7_normalizeFormMethod,!0,A,T);if(Ce){_n(ae,le,Ce,{flushSync:D});return}let Be=o0(L,re),He=(T&&T.preventScrollReset)===!0;if(he&&Da(he.formMethod)){ze(ae,le,re,Be,L,ee.active,D,He,he);return}X.set(ae,{routeId:le,path:re}),je(ae,le,re,Be,L,ee.active,D,He,he)}async function ze(ae,le,xe,T,D,$,A,L,ee){wn(),X.delete(ae);function re(ge){if(!ge.route.action&&!ge.route.lazy){let De=no(405,{method:ee.formMethod,pathname:xe,routeId:le});return _n(ae,le,De,{flushSync:A}),!0}return!1}if(!$&&re(T))return;let he=C.fetchers.get(ae);Kt(ae,Ose(ee,he),{flushSync:A});let Ce=new AbortController,Be=jf(e.history,xe,Ce.signal,ee);if($){let ge=await yo(D,xe,Be.signal);if(ge.type==="aborted")return;if(ge.type==="error"){_n(ae,le,ge.error,{flushSync:A});return}else if(ge.matches){if(D=ge.matches,T=o0(D,xe),re(T))return}else{_n(ae,le,no(404,{pathname:xe}),{flushSync:A});return}}H.set(ae,Ce);let He=j,Ne=(await nt("action",C,Be,[T],D,ae))[T.route.id];if(Be.signal.aborted){H.get(ae)===Ce&&H.delete(ae);return}if(f.v7_fetcherPersist&&ue.has(ae)){if(wc(Ne)||To(Ne)){Kt(ae,Ku(void 0));return}}else{if(wc(Ne))if(H.delete(ae),K>He){Kt(ae,Ku(void 0));return}else return oe.add(ae),Kt(ae,Mp(ee)),ke(Be,Ne,!1,{fetcherSubmission:ee,preventScrollReset:L});if(To(Ne)){_n(ae,le,Ne.error);return}}if(sl(Ne))throw no(400,{type:"defer-action"});let rt=C.navigation.location||C.location,xt=jf(e.history,rt,Ce.signal),At=s||a,pt=C.navigation.state!=="idle"?mc(At,C.navigation.location,u):C.matches;fn(pt,"Didn't find any matches after fetcher action");let ht=++j;Y.set(ae,ht);let wt=Mp(ee,Ne.data);C.fetchers.set(ae,wt);let[_t,Je]=AM(e.history,C,pt,ee,rt,!1,f.v7_skipActionErrorRevalidation,Z,q,G,ue,X,oe,At,u,[T.route.id,Ne]);Je.filter(ge=>ge.key!==ae).forEach(ge=>{let De=ge.key,Pe=C.fetchers.get(De),Te=Mp(void 0,Pe?Pe.data:void 0);C.fetchers.set(De,Te),ur(De),ge.controller&&H.set(De,ge.controller)}),$e({fetchers:new Map(C.fetchers)});let ut=()=>Je.forEach(ge=>ur(ge.key));Ce.signal.addEventListener("abort",ut);let{loaderResults:Qe,fetcherResults:Fe}=await vt(C,pt,_t,Je,xt);if(Ce.signal.aborted)return;Ce.signal.removeEventListener("abort",ut),Y.delete(ae),H.delete(ae),Je.forEach(ge=>H.delete(ge.key));let qe=ay(Qe);if(qe)return ke(xt,qe.result,!1,{preventScrollReset:L});if(qe=ay(Fe),qe)return oe.add(qe.key),ke(xt,qe.result,!1,{preventScrollReset:L});let{loaderData:Ge,errors:ve}=RM(C,pt,Qe,void 0,Je,Fe,de);if(C.fetchers.has(ae)){let ge=Ku(Ne.data);C.fetchers.set(ae,ge)}Dr(ht),C.navigation.state==="loading"&&ht>K?(fn(P,"Expected pending action"),N&&N.abort(),be(C.navigation.location,{matches:pt,loaderData:Ge,errors:ve,fetchers:new Map(C.fetchers)})):($e({errors:ve,loaderData:DM(C.loaderData,Ge,pt,ve),fetchers:new Map(C.fetchers)}),Z=!1)}async function je(ae,le,xe,T,D,$,A,L,ee){let re=C.fetchers.get(ae);Kt(ae,Mp(ee,re?re.data:void 0),{flushSync:A});let he=new AbortController,Ce=jf(e.history,xe,he.signal);if($){let Ne=await yo(D,xe,Ce.signal);if(Ne.type==="aborted")return;if(Ne.type==="error"){_n(ae,le,Ne.error,{flushSync:A});return}else if(Ne.matches)D=Ne.matches,T=o0(D,xe);else{_n(ae,le,no(404,{pathname:xe}),{flushSync:A});return}}H.set(ae,he);let Be=j,ct=(await nt("loader",C,Ce,[T],D,ae))[T.route.id];if(sl(ct)&&(ct=await qO(ct,Ce.signal,!0)||ct),H.get(ae)===he&&H.delete(ae),!Ce.signal.aborted){if(ue.has(ae)){Kt(ae,Ku(void 0));return}if(wc(ct))if(K>Be){Kt(ae,Ku(void 0));return}else{oe.add(ae),await ke(Ce,ct,!1,{preventScrollReset:L});return}if(To(ct)){_n(ae,le,ct.error);return}fn(!sl(ct),"Unhandled fetcher deferred data"),Kt(ae,Ku(ct.data))}}async function ke(ae,le,xe,T){let{submission:D,fetcherSubmission:$,preventScrollReset:A,replace:L}=T===void 0?{}:T;le.response.headers.has("X-Remix-Revalidate")&&(Z=!0);let ee=le.response.headers.get("Location");fn(ee,"Expected a Location header on the redirect Response"),ee=TM(ee,new URL(ae.url),u);let re=J0(C.location,ee,{_isRedirect:!0});if(n){let Ne=!1;if(le.response.headers.has("X-Remix-Reload-Document"))Ne=!0;else if(HO.test(ee)){const rt=e.history.createURL(ee);Ne=rt.origin!==t.location.origin||Dh(rt.pathname,u)==null}if(Ne){L?t.location.replace(ee):t.location.assign(ee);return}}N=null;let he=L===!0||le.response.headers.has("X-Remix-Replace")?Tr.Replace:Tr.Push,{formMethod:Ce,formAction:Be,formEncType:He}=C.navigation;!D&&!$&&Ce&&Be&&He&&(D=LM(C.navigation));let ct=D||$;if(ase.has(le.response.status)&&ct&&Da(ct.formMethod))await Ft(he,re,{submission:or({},ct,{formAction:ee}),preventScrollReset:A||M,enableViewTransition:xe?B:void 0});else{let Ne=CS(re,D);await Ft(he,re,{overrideNavigation:Ne,fetcherSubmission:$,preventScrollReset:A||M,enableViewTransition:xe?B:void 0})}}async function nt(ae,le,xe,T,D,$){let A,L={};try{A=await pse(l,ae,le,xe,T,D,$,o,i)}catch(ee){return T.forEach(re=>{L[re.route.id]={type:Nn.error,error:ee}}),L}for(let[ee,re]of Object.entries(A))if(xse(re)){let he=re.result;L[ee]={type:Nn.redirect,response:vse(he,xe,ee,D,u,f.v7_relativeSplatPath)}}else L[ee]=await mse(re);return L}async function vt(ae,le,xe,T,D){let $=ae.matches,A=nt("loader",ae,D,xe,le,null),L=Promise.all(T.map(async he=>{if(he.matches&&he.match&&he.controller){let Be=(await nt("loader",ae,jf(e.history,he.path,he.controller.signal),[he.match],he.matches,he.key))[he.match.route.id];return{[he.key]:Be}}else return Promise.resolve({[he.key]:{type:Nn.error,error:no(404,{pathname:he.path})}})})),ee=await A,re=(await L).reduce((he,Ce)=>Object.assign(he,Ce),{});return await Promise.all([Sse(le,ee,D.signal,$,ae.loaderData),Cse(le,re,T)]),{loaderResults:ee,fetcherResults:re}}function wn(){Z=!0,q.push(...St()),X.forEach((ae,le)=>{H.has(le)&&G.add(le),ur(le)})}function Kt(ae,le,xe){xe===void 0&&(xe={}),C.fetchers.set(ae,le),$e({fetchers:new Map(C.fetchers)},{flushSync:(xe&&xe.flushSync)===!0})}function _n(ae,le,xe,T){T===void 0&&(T={});let D=vc(C.matches,le);xr(ae),$e({errors:{[D.route.id]:xe},fetchers:new Map(C.fetchers)},{flushSync:(T&&T.flushSync)===!0})}function $i(ae){return f.v7_fetcherPersist&&(Q.set(ae,(Q.get(ae)||0)+1),ue.has(ae)&&ue.delete(ae)),C.fetchers.get(ae)||sse}function xr(ae){let le=C.fetchers.get(ae);H.has(ae)&&!(le&&le.state==="loading"&&Y.has(ae))&&ur(ae),X.delete(ae),Y.delete(ae),oe.delete(ae),ue.delete(ae),G.delete(ae),C.fetchers.delete(ae)}function mi(ae){if(f.v7_fetcherPersist){let le=(Q.get(ae)||0)-1;le<=0?(Q.delete(ae),ue.add(ae)):Q.set(ae,le)}else xr(ae);$e({fetchers:new Map(C.fetchers)})}function ur(ae){let le=H.get(ae);le&&(le.abort(),H.delete(ae))}function ai(ae){for(let le of ae){let xe=$i(le),T=Ku(xe.data);C.fetchers.set(le,T)}}function vi(){let ae=[],le=!1;for(let xe of oe){let T=C.fetchers.get(xe);fn(T,"Expected fetcher: "+xe),T.state==="loading"&&(oe.delete(xe),ae.push(xe),le=!0)}return ai(ae),le}function Dr(ae){let le=[];for(let[xe,T]of Y)if(T0}function Zi(ae,le){let xe=C.blockers.get(ae)||Tp;return Se.get(ae)!==le&&Se.set(ae,le),xe}function vo(ae){C.blockers.delete(ae),Se.delete(ae)}function yi(ae,le){let xe=C.blockers.get(ae)||Tp;fn(xe.state==="unblocked"&&le.state==="blocked"||xe.state==="blocked"&&le.state==="blocked"||xe.state==="blocked"&&le.state==="proceeding"||xe.state==="blocked"&&le.state==="unblocked"||xe.state==="proceeding"&&le.state==="unblocked","Invalid blocker state transition: "+xe.state+" -> "+le.state);let T=new Map(C.blockers);T.set(ae,le),$e({blockers:T})}function $r(ae){let{currentLocation:le,nextLocation:xe,historyAction:T}=ae;if(Se.size===0)return;Se.size>1&&zc(!1,"A router only supports one blocker at a time");let D=Array.from(Se.entries()),[$,A]=D[D.length-1],L=C.blockers.get($);if(!(L&&L.state==="proceeding")&&A({currentLocation:le,nextLocation:xe,historyAction:T}))return $}function Sa(ae){let le=no(404,{pathname:ae}),xe=s||a,{matches:T,route:D}=IM(xe);return St(),{notFoundMatches:T,route:D,error:le}}function St(ae){let le=[];return de.forEach((xe,T)=>{(!ae||ae(T))&&(xe.cancel(),le.push(T),de.delete(T))}),le}function hn(ae,le,xe){if(m=ae,b=le,y=xe||null,!w&&C.navigation===SS){w=!0;let T=lr(C.location,C.matches);T!=null&&$e({restoreScrollPosition:T})}return()=>{m=null,b=null,y=null}}function Sn(ae,le){return y&&y(ae,le.map(T=>Fae(T,C.loaderData)))||ae.key}function Gn(ae,le){if(m&&b){let xe=Sn(ae,le);m[xe]=b()}}function lr(ae,le){if(m){let xe=Sn(ae,le),T=m[xe];if(typeof T=="number")return T}return null}function Xr(ae,le,xe){if(c)if(ae){if(Object.keys(ae[0].params).length>0)return{active:!0,matches:c1(le,xe,u,!0)}}else return{active:!0,matches:c1(le,xe,u,!0)||[]};return{active:!1,matches:null}}async function yo(ae,le,xe){if(!c)return{type:"success",matches:ae};let T=ae;for(;;){let D=s==null,$=s||a,A=o;try{await c({path:le,matches:T,patch:(re,he)=>{xe.aborted||kM(re,he,$,A,i)}})}catch(re){return{type:"error",error:re,partialMatches:T}}finally{D&&!xe.aborted&&(a=[...a])}if(xe.aborted)return{type:"aborted"};let L=mc($,le,u);if(L)return{type:"success",matches:L};let ee=c1($,le,u,!0);if(!ee||T.length===ee.length&&T.every((re,he)=>re.route.id===ee[he].route.id))return{type:"success",matches:null};T=ee}}function Xl(ae){o={},s=K1(ae,i,void 0,o)}function Cf(ae,le){let xe=s==null;kM(ae,le,s||a,o,i),xe&&(a=[...a],$e({}))}return E={get basename(){return u},get future(){return f},get state(){return C},get routes(){return a},get window(){return t},initialize:Ze,subscribe:Le,enableScrollRestoration:hn,navigate:bt,fetch:ye,revalidate:lt,createHref:ae=>e.history.createHref(ae),encodeLocation:ae=>e.history.encodeLocation(ae),getFetcher:$i,deleteFetcher:mi,dispose:Ae,getBlocker:Zi,deleteBlocker:vo,patchRoutes:Cf,_internalFetchControllers:H,_internalActiveDeferreds:de,_internalSetRoutes:Xl},E}function cse(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function JC(e,t,n,r,i,o,a,s){let u,l;if(a){u=[];for(let f of t)if(u.push(f),f.route.id===a){l=f;break}}else u=t,l=t[t.length-1];let c=VO(i||".",WO(u,o),Dh(e.pathname,n)||e.pathname,s==="path");if(i==null&&(c.search=e.search,c.hash=e.hash),(i==null||i===""||i===".")&&l){let f=KO(c.search);if(l.route.index&&!f)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&f){let h=new URLSearchParams(c.search),p=h.getAll("index");h.delete("index"),p.filter(y=>y).forEach(y=>h.append("index",y));let m=h.toString();c.search=m?"?"+m:""}}return r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:lu([n,c.pathname])),Wc(c)}function EM(e,t,n,r){if(!r||!cse(r))return{path:n};if(r.formMethod&&!_se(r.formMethod))return{path:n,error:no(405,{method:r.formMethod})};let i=()=>({path:n,error:no(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),s=yj(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Da(a))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,m)=>{let[y,b]=m;return""+p+y+"="+b+` `},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Da(a))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}fn(typeof FormData=="function","FormData is not available in this environment");let u,l;if(r.formData)u=tE(r.formData),l=r.formData;else if(r.body instanceof FormData)u=tE(r.body),l=r.body;else if(r.body instanceof URLSearchParams)u=r.body,l=MM(u);else if(r.body==null)u=new URLSearchParams,l=new FormData;else try{u=new URLSearchParams(r.body),l=MM(u)}catch{return i()}let c={formMethod:a,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(Da(c.formMethod))return{path:n,submission:c};let f=Pu(n);return t&&f.search&&KO(f.search)&&u.append("index",""),f.search="?"+u,{path:Wc(f),submission:c}}function OM(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function AM(e,t,n,r,i,o,a,s,u,l,c,f,h,p,m,y){let b=y?To(y[1])?y[1].error:y[1].data:void 0,w=e.createURL(t.location),x=e.createURL(i),S=n;o&&t.errors?S=OM(n,Object.keys(t.errors)[0],!0):y&&To(y[1])&&(S=OM(n,y[0]));let O=y?y[1].statusCode:void 0,E=a&&O&&O>=400,C=S.filter((M,N)=>{let{route:B}=M;if(B.lazy)return!0;if(B.loader==null)return!1;if(o)return eE(B,t.loaderData,t.errors);if(fse(t.loaderData,t.matches[N],M)||u.some(ne=>ne===M.route.id))return!0;let V=t.matches[N],W=M;return PM(M,or({currentUrl:w,currentParams:V.params,nextUrl:x,nextParams:W.params},r,{actionResult:b,actionStatus:O,defaultShouldRevalidate:E?!1:s||w.pathname+w.search===x.pathname+x.search||w.search!==x.search||mj(V,W)}))}),P=[];return f.forEach((M,N)=>{if(o||!n.some(Z=>Z.route.id===M.routeId)||c.has(N))return;let B=mc(p,M.path,m);if(!B){P.push({key:N,routeId:M.routeId,path:M.path,matches:null,match:null,controller:null});return}let V=t.fetchers.get(N),W=o0(B,M.path),ne=!1;h.has(N)?ne=!1:l.has(N)?(l.delete(N),ne=!0):V&&V.state!=="idle"&&V.data===void 0?ne=s:ne=PM(W,or({currentUrl:w,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:b,actionStatus:O,defaultShouldRevalidate:E?!1:s})),ne&&P.push({key:N,routeId:M.routeId,path:M.path,matches:B,match:W,controller:new AbortController})}),[C,P]}function eE(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function fse(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function mj(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function PM(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function kM(e,t,n,r,i){var o;let a;if(e){let l=r[e];fn(l,"No route found to patch children into: routeId = "+e),l.children||(l.children=[]),a=l.children}else a=n;let s=t.filter(l=>!a.some(c=>vj(l,c))),u=K1(s,i,[e||"_","patch",String(((o=a)==null?void 0:o.length)||"0")],r);a.push(...u)}function vj(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(o=>vj(n,o))}):!1}async function dse(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];fn(i,"No route found in manifest");let o={};for(let a in r){let u=i[a]!==void 0&&a!=="hasErrorBoundary";zc(!u,'Route "'+i.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.')),!u&&!Nae.has(a)&&(o[a]=r[a])}Object.assign(i,o),Object.assign(i,or({},t(i),{lazy:void 0}))}async function hse(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,o,a)=>Object.assign(i,{[n[a].route.id]:o}),{})}async function pse(e,t,n,r,i,o,a,s,u,l){let c=o.map(p=>p.route.lazy?dse(p.route,u,s):void 0),f=o.map((p,m)=>{let y=c[m],b=i.some(x=>x.route.id===p.route.id);return or({},p,{shouldLoad:b,resolve:async x=>(x&&r.method==="GET"&&(p.route.lazy||p.route.loader)&&(b=!0),b?gse(t,r,p,y,x,l):Promise.resolve({type:Nn.data,result:void 0}))})}),h=await e({matches:f,request:r,params:o[0].params,fetcherKey:a,context:l});try{await Promise.all(c)}catch{}return h}async function gse(e,t,n,r,i,o){let a,s,u=l=>{let c,f=new Promise((m,y)=>c=y);s=()=>c(),t.signal.addEventListener("abort",s);let h=m=>typeof l!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):l({request:t,params:n.params,context:o},...m!==void 0?[m]:[]),p=(async()=>{try{return{type:"data",result:await(i?i(y=>h(y)):h())}}catch(m){return{type:"error",result:m}}})();return Promise.race([p,f])};try{let l=n.route[e];if(r)if(l){let c,[f]=await Promise.all([u(l).catch(h=>{c=h}),r]);if(c!==void 0)throw c;a=f}else if(await r,l=n.route[e],l)a=await u(l);else if(e==="action"){let c=new URL(t.url),f=c.pathname+c.search;throw no(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:Nn.data,result:void 0};else if(l)a=await u(l);else{let c=new URL(t.url),f=c.pathname+c.search;throw no(404,{pathname:f})}fn(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(l){return{type:Nn.error,result:l}}finally{s&&t.signal.removeEventListener("abort",s)}return a}async function mse(e){let{result:t,type:n}=e;if(bj(t)){let l;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?l=null:l=await t.json():l=await t.text()}catch(c){return{type:Nn.error,error:c}}return n===Nn.error?{type:Nn.error,error:new G1(t.status,t.statusText,l),statusCode:t.status,headers:t.headers}:{type:Nn.data,data:l,statusCode:t.status,headers:t.headers}}if(n===Nn.error){if(NM(t)){var r;if(t.data instanceof Error){var i;return{type:Nn.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status}}t=new G1(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Nn.error,error:t,statusCode:ow(t)?t.status:void 0}}if(wse(t)){var o,a;return{type:Nn.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(NM(t)){var s,u;return{type:Nn.data,data:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:Nn.data,data:t}}function vse(e,t,n,r,i,o){let a=e.headers.get("Location");if(fn(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!HO.test(a)){let s=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=JC(new URL(t.url),s,i,!0,a,o),e.headers.set("Location",a)}return e}function TM(e,t,n){if(HO.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=Dh(i.pathname,n)!=null;if(i.origin===t.origin&&o)return i.pathname+i.search+i.hash}return e}function jf(e,t,n,r){let i=e.createURL(yj(t)).toString(),o={signal:n};if(r&&Da(r.formMethod)){let{formMethod:a,formEncType:s}=r;o.method=a.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(r.json)):s==="text/plain"?o.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?o.body=tE(r.formData):o.body=r.formData}return new Request(i,o)}function tE(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function MM(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function yse(e,t,n,r,i){let o={},a=null,s,u=!1,l={},c=n&&To(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let h=f.route.id,p=t[h];if(fn(!wc(p),"Cannot handle redirect results in processLoaderData"),To(p)){let m=p.error;c!==void 0&&(m=c,c=void 0),a=a||{};{let y=vc(e,h);a[y.route.id]==null&&(a[y.route.id]=m)}o[h]=void 0,u||(u=!0,s=ow(p.error)?p.error.status:500),p.headers&&(l[h]=p.headers)}else sl(p)?(r.set(h,p.deferredData),o[h]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!u&&(s=p.statusCode),p.headers&&(l[h]=p.headers)):(o[h]=p.data,p.statusCode&&p.statusCode!==200&&!u&&(s=p.statusCode),p.headers&&(l[h]=p.headers))}),c!==void 0&&n&&(a={[n[0]]:c},o[n[0]]=void 0),{loaderData:o,errors:a,statusCode:s||200,loaderHeaders:l}}function RM(e,t,n,r,i,o,a){let{loaderData:s,errors:u}=yse(t,n,r,a);return i.forEach(l=>{let{key:c,match:f,controller:h}=l,p=o[c];if(fn(p,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(To(p)){let m=vc(e.matches,f?.route.id);u&&u[m.route.id]||(u=or({},u,{[m.route.id]:p.error})),e.fetchers.delete(c)}else if(wc(p))fn(!1,"Unhandled fetcher revalidation redirect");else if(sl(p))fn(!1,"Unhandled fetcher deferred data");else{let m=Ku(p.data);e.fetchers.set(c,m)}}),{loaderData:s,errors:u}}function DM(e,t,n,r){let i=or({},t);for(let o of n){let a=o.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&o.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function $M(e){return e?To(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function vc(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function IM(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function no(e,t){let{pathname:n,routeId:r,method:i,type:o,message:a}=t===void 0?{}:t,s="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(s="Bad Request",i&&n&&r?u="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?u="defer() is not supported in actions":o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(s="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",u='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",i&&n&&r?u="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(u='Invalid request method "'+i.toUpperCase()+'"')),new G1(e||500,s,new Error(u),!0)}function ay(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(wc(i))return{key:r,result:i}}}function yj(e){let t=typeof e=="string"?Pu(e):e;return Wc(or({},t,{hash:""}))}function bse(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function xse(e){return bj(e.result)&&ose.has(e.result.status)}function sl(e){return e.type===Nn.deferred}function To(e){return e.type===Nn.error}function wc(e){return(e&&e.type)===Nn.redirect}function NM(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function wse(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function bj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function _se(e){return ise.has(e.toLowerCase())}function Da(e){return nse.has(e.toLowerCase())}async function Sse(e,t,n,r,i){let o=Object.entries(t);for(let a=0;ah?.route.id===s);if(!l)continue;let c=r.find(h=>h.route.id===l.route.id),f=c!=null&&!mj(c,l)&&(i&&i[l.route.id])!==void 0;sl(u)&&f&&await qO(u,n,!1).then(h=>{h&&(t[s]=h)})}}async function Cse(e,t,n){for(let r=0;rl?.route.id===o)&&sl(s)&&(fn(a,"Expected an AbortController for revalidating fetcher deferred result"),await qO(s,a.signal,!0).then(l=>{l&&(t[i]=l)}))}}async function qO(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Nn.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Nn.error,error:i}}return{type:Nn.data,data:e.deferredData.data}}}function KO(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function o0(e,t){let n=typeof t=="string"?Pu(t).search:t.search;if(e[e.length-1].route.index&&KO(n||""))return e[e.length-1];let r=hj(e);return r[r.length-1]}function LM(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function CS(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ese(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Mp(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Ose(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ku(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Ase(e,t){try{let n=e.sessionStorage.getItem(gj);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function Pse(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(gj,JSON.stringify(n))}catch(r){zc(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** * React Router v6.28.1 * @@ -73,7 +73,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _m=v;function pue(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gue=typeof Object.is=="function"?Object.is:pue,mue=_m.useSyncExternalStore,vue=_m.useRef,yue=_m.useEffect,bue=_m.useMemo,xue=_m.useDebugValue;Pj.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=vue(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=bue(function(){function u(p){if(!l){if(l=!0,c=p,p=r(p),i!==void 0&&a.hasValue){var m=a.value;if(i(m,p))return f=m}return f=p}if(m=f,gue(c,p))return m;var y=r(p);return i!==void 0&&i(m,y)?(c=p,m):(c=p,f=y)}var l=!1,c,f,h=n===void 0?null:n;return[function(){return u(t())},h===null?void 0:function(){return u(h())}]},[t,n,r,i]);var s=mue(e,o[0],o[1]);return yue(function(){a.hasValue=!0,a.value=s},[s]),xue(s),s};Aj.exports=Pj;var wue=Aj.exports;function _ue(e){e()}function Sue(){let e=null,t=null;return{clear(){e=null,t=null},notify(){_ue(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var VM={notify(){},get:()=>[]};function Cue(e,t){let n,r=VM,i=0,o=!1;function a(y){c();const b=r.subscribe(y);let w=!1;return()=>{w||(w=!0,b(),f())}}function s(){r.notify()}function u(){m.onStateChange&&m.onStateChange()}function l(){return o}function c(){i++,n||(n=e.subscribe(u),r=Sue())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=VM)}function h(){o||(o=!0,c())}function p(){o&&(o=!1,f())}const m={addNestedSub:a,notifyNestedSubs:s,handleChangeWrapper:u,isSubscribed:l,trySubscribe:h,tryUnsubscribe:p,getListeners:()=>r};return m}var Eue=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Oue=Eue(),Aue=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Pue=Aue(),kue=()=>Oue||Pue?v.useLayoutEffect:v.useEffect,Tue=kue(),Mue=Symbol.for("react-redux-context"),Rue=typeof globalThis<"u"?globalThis:{};function Due(){if(!v.createContext)return{};const e=Rue[Mue]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var Al=Due();function $ue(e){const{children:t,context:n,serverState:r,store:i}=e,o=v.useMemo(()=>{const u=Cue(i);return{store:i,subscription:u,getServerState:r?()=>r:void 0}},[i,r]),a=v.useMemo(()=>i.getState(),[i]);Tue(()=>{const{subscription:u}=o;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==i.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[o,a]);const s=n||Al;return v.createElement(s.Provider,{value:o},t)}var NXe=$ue;function YO(e=Al){return function(){return v.useContext(e)}}var kj=YO();function Tj(e=Al){const t=e===Al?kj:YO(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var Iue=Tj();function Nue(e=Al){const t=e===Al?Iue:Tj(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var LXe=Nue(),Lue=(e,t)=>e===t;function Fue(e=Al){const t=e===Al?kj:YO(e),n=(r,i={})=>{const{equalityFn:o=Lue}=typeof i=="function"?{equalityFn:i}:i,a=t(),{store:s,subscription:u,getServerState:l}=a;v.useRef(!0);const c=v.useCallback({[r.name](h){return r(h)}}[r.name],[r]),f=wue.useSyncExternalStoreWithSelector(u.addNestedSub,s.getState,l||s.getState,c,o);return v.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var FXe=Fue();function HM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sw(...e){return t=>{let n=!1;const r=e.map(i=>{const o=HM(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:n,...r}=e,i=v.Children.toArray(n),o=i.find(jue);if(o){const a=o.props.children,s=i.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return I.jsx(rE,{...r,ref:t,children:v.isValidElement(a)?v.cloneElement(a,void 0,s):null})}return I.jsx(rE,{...r,ref:t,children:n})});Pl.displayName="Slot";var rE=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const i=Uue(n);return v.cloneElement(n,{...Bue(r,n.props),ref:t?sw(t,i):i})}return v.Children.count(n)>1?v.Children.only(null):null});rE.displayName="SlotClone";var ZO=({children:e})=>I.jsx(I.Fragment,{children:e});function jue(e){return v.isValidElement(e)&&e.type===ZO}function Bue(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Uue(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mj(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,KM=dn,jXe=(e,t)=>n=>{var r;if(t?.variants==null)return KM(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(l=>{const c=n?.[l],f=o?.[l];if(c===null)return null;const h=qM(c)||qM(f);return i[l][h]}),s=n&&Object.entries(n).reduce((l,c)=>{let[f,h]=c;return h===void 0||(l[f]=h),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,c)=>{let{class:f,className:h,...p}=c;return Object.entries(p).every(m=>{let[y,b]=m;return Array.isArray(b)?b.includes({...o,...s}[y]):{...o,...s}[y]===b})?[...l,f,h]:l},[]);return KM(e,a,u,n?.class,n?.className)},XO="-",zue=e=>{const t=Vue(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(XO);return s[0]===""&&s.length!==1&&s.shift(),Rj(s,t)||Wue(a)},getConflictingClassGroupIds:(a,s)=>{const u=n[a]||[];return s&&r[a]?[...u,...r[a]]:u}}},Rj=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Rj(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(XO);return t.validators.find(({validator:a})=>a(o))?.classGroupId},GM=/^\[(.+)\]$/,Wue=e=>{if(GM.test(e)){const t=GM.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Vue=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return que(Object.entries(e.classGroups),n).forEach(([o,a])=>{iE(a,r,o,t)}),r},iE=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:YM(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Hue(i)){iE(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{iE(a,YM(t,o),n,r)})})},YM=(e,t)=>{let n=e;return t.split(XO).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Hue=e=>e.isThemeGetter,que=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,Kue=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},Dj="!",Gue=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const u=[];let l=0,c=0,f;for(let b=0;bc?f-c:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}};return n?s=>n({className:s,parseClassName:a}):a},Yue=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Zue=e=>({cache:Kue(e.cacheSize),parseClassName:Gue(e),...zue(e)}),Xue=/\s+/,Que=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(Xue);let s="";for(let u=a.length-1;u>=0;u-=1){const l=a[u],{modifiers:c,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(l);let m=!!p,y=r(m?h.substring(0,p):h);if(!y){if(!m){s=l+(s.length>0?" "+s:s);continue}if(y=r(h),!y){s=l+(s.length>0?" "+s:s);continue}m=!1}const b=Yue(c).join(":"),w=f?b+Dj:b,x=w+y;if(o.includes(x))continue;o.push(x);const S=i(y,m);for(let O=0;O0?" "+s:s)}return s};function Jue(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rf(c),e());return n=Zue(l),r=n.cache.get,i=n.cache.set,o=s,s(u)}function s(u){const l=r(u);if(l)return l;const c=Que(u,n);return i(u,c),c}return function(){return o(Jue.apply(null,arguments))}}const Jn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ij=/^\[(?:([a-z-]+):)?(.+)\]$/i,tle=/^\d+\/\d+$/,nle=new Set(["px","full","screen"]),rle=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ile=/\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$/,ole=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ale=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sle=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>Ad(e)||nle.has(e)||tle.test(e),Vu=e=>$h(e,"length",gle),Ad=e=>!!e&&!Number.isNaN(Number(e)),ES=e=>$h(e,"number",Ad),Dp=e=>!!e&&Number.isInteger(Number(e)),ule=e=>e.endsWith("%")&&Ad(e.slice(0,-1)),Qt=e=>Ij.test(e),Hu=e=>rle.test(e),lle=new Set(["length","size","percentage"]),cle=e=>$h(e,lle,Nj),fle=e=>$h(e,"position",Nj),dle=new Set(["image","url"]),hle=e=>$h(e,dle,vle),ple=e=>$h(e,"",mle),$p=()=>!0,$h=(e,t,n)=>{const r=Ij.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},gle=e=>ile.test(e)&&!ole.test(e),Nj=()=>!1,mle=e=>ale.test(e),vle=e=>sle.test(e),yle=()=>{const e=Jn("colors"),t=Jn("spacing"),n=Jn("blur"),r=Jn("brightness"),i=Jn("borderColor"),o=Jn("borderRadius"),a=Jn("borderSpacing"),s=Jn("borderWidth"),u=Jn("contrast"),l=Jn("grayscale"),c=Jn("hueRotate"),f=Jn("invert"),h=Jn("gap"),p=Jn("gradientColorStops"),m=Jn("gradientColorStopPositions"),y=Jn("inset"),b=Jn("margin"),w=Jn("opacity"),x=Jn("padding"),S=Jn("saturate"),O=Jn("scale"),E=Jn("sepia"),C=Jn("skew"),P=Jn("space"),M=Jn("translate"),N=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",Qt,t],W=()=>[Qt,t],ne=()=>["",qs,Vu],Z=()=>["auto",Ad,Qt],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Qt],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],oe=()=>[Ad,Qt];return{cacheSize:500,separator:":",theme:{colors:[$p],spacing:[qs,Vu],blur:["none","",Hu,Qt],brightness:oe(),borderColor:[e],borderRadius:["none","","full",Hu,Qt],borderSpacing:W(),borderWidth:ne(),contrast:oe(),grayscale:K(),hueRotate:oe(),invert:K(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[ule,Vu],inset:V(),margin:V(),opacity:oe(),padding:W(),saturate:oe(),scale:oe(),sepia:K(),skew:oe(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",Qt]}],container:["container"],columns:[{columns:[Hu]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"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:[...q(),Qt]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dp,Qt]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Qt]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",Dp,Qt]}],"grid-cols":[{"grid-cols":[$p]}],"col-start-end":[{col:["auto",{span:["full",Dp,Qt]},Qt]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[$p]}],"row-start-end":[{row:["auto",{span:[Dp,Qt]},Qt]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Qt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Qt]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Qt,t]}],"min-w":[{"min-w":[Qt,t,"min","max","fit"]}],"max-w":[{"max-w":[Qt,t,"none","full","min","max","fit","prose",{screen:[Hu]},Hu]}],h:[{h:[Qt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Qt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Qt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Qt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Hu,Vu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ES]}],"font-family":[{font:[$p]}],"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",Qt]}],"line-clamp":[{"line-clamp":["none",Ad,ES]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qs,Qt]}],"list-image":[{"list-image":["none",Qt]}],"list-style-type":[{list:["none","disc","decimal",Qt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qs,Vu]}],"underline-offset":[{"underline-offset":["auto",qs,Qt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qt]}],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",Qt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),fle]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cle]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hle]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:G()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[qs,Qt]}],"outline-w":[{outline:[qs,Vu]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[qs,Vu]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Hu,ple]}],"shadow-color":[{shadow:[$p]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Hu,Qt]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"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",Qt]}],duration:[{duration:oe()}],ease:[{ease:["linear","in","out","in-out",Qt]}],delay:[{delay:oe()}],animate:[{animate:["none","spin","ping","pulse","bounce",Qt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[Dp,Qt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Qt]}],accent:[{accent:["auto",e]}],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",Qt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"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",Qt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[qs,Vu,ES]}],stroke:[{stroke:[e,"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"]}}},BXe=ele(yle);var Lj={exports:{}},ble="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xle=ble,wle=xle;function Fj(){}function jj(){}jj.resetWarningCache=Fj;var _le=function(){function e(r,i,o,a,s,u){if(u!==wle){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:jj,resetWarningCache:Fj};return n.PropTypes=n,n};Lj.exports=_le();var Sle=Lj.exports;const Rt=kn(Sle);var Cle={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"},Ele=Object.defineProperty,Ole=Object.defineProperties,Ale=Object.getOwnPropertyDescriptors,X1=Object.getOwnPropertySymbols,Bj=Object.prototype.hasOwnProperty,Uj=Object.prototype.propertyIsEnumerable,ZM=(e,t,n)=>t in e?Ele(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XM=(e,t)=>{for(var n in t||(t={}))Bj.call(t,n)&&ZM(e,n,t[n]);if(X1)for(var n of X1(t))Uj.call(t,n)&&ZM(e,n,t[n]);return e},Ple=(e,t)=>Ole(e,Ale(t)),kle=(e,t)=>{var n={};for(var r in e)Bj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&X1)for(var r of X1(e))t.indexOf(r)<0&&Uj.call(e,r)&&(n[r]=e[r]);return n},xn=(e,t,n)=>{const r=v.forwardRef((i,o)=>{var a=i,{color:s="currentColor",size:u=24,stroke:l=2,children:c}=a,f=kle(a,["color","size","stroke","children"]);return v.createElement("svg",XM(Ple(XM({ref:o},Cle),{width:u,height:u,stroke:s,strokeWidth:l,className:`tabler-icon tabler-icon-${e}`}),f),[...n.map(([h,p])=>v.createElement(h,p)),...c||[]])});return r.propTypes={color:Rt.string,size:Rt.oneOfType([Rt.string,Rt.number]),stroke:Rt.oneOfType([Rt.string,Rt.number])},r.displayName=`${t}`,r},UXe=xn("adjustments","IconAdjustments",[["path",{d:"M4 10a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M6 4v4",key:"svg-1"}],["path",{d:"M6 12v8",key:"svg-2"}],["path",{d:"M10 16a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-3"}],["path",{d:"M12 4v10",key:"svg-4"}],["path",{d:"M12 18v2",key:"svg-5"}],["path",{d:"M16 7a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-6"}],["path",{d:"M18 4v1",key:"svg-7"}],["path",{d:"M18 9v11",key:"svg-8"}]]),zXe=xn("brand-telegram","IconBrandTelegram",[["path",{d:"M15 10l-4 4l6 6l4 -16l-18 7l4 2l2 6l3 -4",key:"svg-0"}]]),WXe=xn("building-store","IconBuildingStore",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M3 7v1a3 3 0 0 0 6 0v-1m0 1a3 3 0 0 0 6 0v-1m0 1a3 3 0 0 0 6 0v-1h-18l2 -4h14l2 4",key:"svg-1"}],["path",{d:"M5 21l0 -10.15",key:"svg-2"}],["path",{d:"M19 21l0 -10.15",key:"svg-3"}],["path",{d:"M9 21v-4a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v4",key:"svg-4"}]]),VXe=xn("building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]),HXe=xn("cash","IconCash",[["path",{d:"M7 9m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M14 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M17 9v-2a2 2 0 0 0 -2 -2h-10a2 2 0 0 0 -2 2v6a2 2 0 0 0 2 2h2",key:"svg-2"}]]),qXe=xn("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),KXe=xn("chevrons-left","IconChevronsLeft",[["path",{d:"M11 7l-5 5l5 5",key:"svg-0"}],["path",{d:"M17 7l-5 5l5 5",key:"svg-1"}]]),GXe=xn("copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]),YXe=xn("credit-card","IconCreditCard",[["path",{d:"M3 5m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M3 10l18 0",key:"svg-1"}],["path",{d:"M7 15l.01 0",key:"svg-2"}],["path",{d:"M11 15l2 0",key:"svg-3"}]]),ZXe=xn("dashboard","IconDashboard",[["path",{d:"M12 13m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M13.45 11.55l2.05 -2.05",key:"svg-1"}],["path",{d:"M6.4 20a9 9 0 1 1 11.2 0z",key:"svg-2"}]]),XXe=xn("device-desktop","IconDeviceDesktop",[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10z",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}]]),QXe=xn("discount-check","IconDiscountCheck",[["path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]),JXe=xn("eye-off","IconEyeOff",[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]),eQe=xn("eye","IconEye",[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]]),tQe=xn("file-text","IconFileText",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]]),nQe=xn("loader-2","IconLoader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]),rQe=xn("lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]),iQe=xn("mail","IconMail",[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]]),oQe=xn("menu-2","IconMenu2",[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]]),aQe=xn("moon","IconMoon",[["path",{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z",key:"svg-0"}]]),sQe=xn("news","IconNews",[["path",{d:"M16 6h3a1 1 0 0 1 1 1v11a2 2 0 0 1 -4 0v-13a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1v12a3 3 0 0 0 3 3h11",key:"svg-0"}],["path",{d:"M8 8l4 0",key:"svg-1"}],["path",{d:"M8 12l4 0",key:"svg-2"}],["path",{d:"M8 16l4 0",key:"svg-3"}]]),uQe=xn("route","IconRoute",[["path",{d:"M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4z",key:"svg-1"}],["path",{d:"M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5",key:"svg-2"}]]),lQe=xn("server-bolt","IconServerBolt",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M15 20h-9a3 3 0 0 1 -3 -3v-2a3 3 0 0 1 3 -3h12",key:"svg-1"}],["path",{d:"M7 8v.01",key:"svg-2"}],["path",{d:"M7 16v.01",key:"svg-3"}],["path",{d:"M20 15l-2 3h3l-2 3",key:"svg-4"}]]),cQe=xn("server","IconServer",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M3 12m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-1"}],["path",{d:"M7 8l0 .01",key:"svg-2"}],["path",{d:"M7 16l0 .01",key:"svg-3"}]]),fQe=xn("settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]),dQe=xn("sun","IconSun",[["path",{d:"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7",key:"svg-1"}]]),hQe=xn("template","IconTemplate",[["path",{d:"M4 4m0 1a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M4 12m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M14 12l6 0",key:"svg-2"}],["path",{d:"M14 16l6 0",key:"svg-3"}],["path",{d:"M14 20l6 0",key:"svg-4"}]]),pQe=xn("ticket","IconTicket",[["path",{d:"M15 5l0 2",key:"svg-0"}],["path",{d:"M15 11l0 2",key:"svg-1"}],["path",{d:"M15 17l0 2",key:"svg-2"}],["path",{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2",key:"svg-3"}]]),gQe=xn("user-circle","IconUserCircle",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 10m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855",key:"svg-2"}]]),mQe=xn("user","IconUser",[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]]),vQe=xn("users","IconUsers",[["path",{d:"M9 7m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"svg-2"}],["path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85",key:"svg-3"}]]),yQe=xn("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]),Tle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],gt=Tle.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Pl:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function zj(e,t){e&&Au.flushSync(()=>e.dispatchEvent(t))}var Mle="Separator",QM="horizontal",Rle=["horizontal","vertical"],Wj=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=QM,...i}=e,o=Dle(r)?r:QM,s=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return I.jsx(gt.div,{"data-orientation":o,...s,...i,ref:t})});Wj.displayName=Mle;function Dle(e){return Rle.includes(e)}var bQe=Wj,Sm=e=>e.type==="checkbox",_c=e=>e instanceof Date,Bi=e=>e==null;const Vj=e=>typeof e=="object";var Ar=e=>!Bi(e)&&!Array.isArray(e)&&Vj(e)&&!_c(e),Hj=e=>Ar(e)&&e.target?Sm(e.target)?e.target.checked:e.target.value:e,$le=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qj=(e,t)=>e.has($le(t)),Ile=e=>{const t=e.constructor&&e.constructor.prototype;return Ar(t)&&t.hasOwnProperty("isPrototypeOf")},QO=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function to(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(QO&&(e instanceof Blob||r))&&(n||Ar(e)))if(t=n?[]:{},!n&&!Ile(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=to(e[i]));else return e;return t}var uw=e=>Array.isArray(e)?e.filter(Boolean):[],Cr=e=>e===void 0,Xe=(e,t,n)=>{if(!t||!Ar(e))return n;const r=uw(t.split(/[,[\].]+?/)).reduce((i,o)=>Bi(i)?i:i[o],e);return Cr(r)||r===e?Cr(e[t])?n:e[t]:r},aa=e=>typeof e=="boolean",JO=e=>/^\w*$/.test(e),Kj=e=>uw(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pn=(e,t,n)=>{let r=-1;const i=JO(t)?[t]:Kj(t),o=i.length,a=o-1;for(;++rF.useContext(Gj),xQe=e=>{const{children:t,...n}=e;return F.createElement(Gj.Provider,{value:n},t)};var Yj=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Fa.all&&(t._proxyFormState[a]=!r||Fa.all),n&&(n[a]=!0),e[a]}});return i},ro=e=>Ar(e)&&!Object.keys(e).length,Zj=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return ro(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||Fa.all))},_0=e=>Array.isArray(e)?e:[e],Xj=(e,t,n)=>!e||!t||e===t||_0(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function tA(e){const t=F.useRef(e);t.current=e,F.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function Nle(e){const t=eA(),{control:n=t.control,disabled:r,name:i,exact:o}=e,[a,s]=F.useState(n._formState),u=F.useRef(!0),l=F.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=F.useRef(i);return c.current=i,tA({disabled:r,next:f=>u.current&&Xj(c.current,f.name,o)&&Zj(f,l.current,n._updateFormState)&&s({...n._formState,...f}),subject:n._subjects.state}),F.useEffect(()=>(u.current=!0,l.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),F.useMemo(()=>Yj(a,n,l.current,!1),[a,n])}var gs=e=>typeof e=="string",Qj=(e,t,n,r,i)=>gs(e)?(r&&t.watch.add(e),Xe(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Xe(n,o))):(r&&(t.watchAll=!0),n);function Lle(e){const t=eA(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a}=e,s=F.useRef(r);s.current=r,tA({disabled:o,subject:n._subjects.values,next:c=>{Xj(s.current,c.name,a)&&l(to(Qj(s.current,n._names,c.values||n._formValues,!1,i)))}});const[u,l]=F.useState(n._getWatch(r,i));return F.useEffect(()=>n._removeUnmounted()),u}function Fle(e){const t=eA(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o}=e,a=qj(i._names.array,n),s=Lle({control:i,name:n,defaultValue:Xe(i._formValues,n,Xe(i._defaultValues,n,e.defaultValue)),exact:!0}),u=Nle({control:i,name:n,exact:!0}),l=F.useRef(i.register(n,{...e.rules,value:s,...aa(e.disabled)?{disabled:e.disabled}:{}})),c=F.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Xe(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Xe(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Xe(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Xe(u.validatingFields,n)},error:{enumerable:!0,get:()=>Xe(u.errors,n)}}),[u,n]),f=F.useMemo(()=>({name:n,value:s,...aa(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h=>l.current.onChange({target:{value:Hj(h),name:n},type:Q1.CHANGE}),onBlur:()=>l.current.onBlur({target:{value:Xe(i._formValues,n),name:n},type:Q1.BLUR}),ref:h=>{const p=Xe(i._fields,n);p&&h&&(p._f.ref={focus:()=>h.focus(),select:()=>h.select(),setCustomValidity:m=>h.setCustomValidity(m),reportValidity:()=>h.reportValidity()})}}),[n,i._formValues,r,u.disabled,s,i._fields]);return F.useEffect(()=>{const h=i._options.shouldUnregister||o,p=(m,y)=>{const b=Xe(i._fields,m);b&&b._f&&(b._f.mount=y)};if(p(n,!0),h){const m=to(Xe(i._options.defaultValues,n));Pn(i._defaultValues,n,m),Cr(Xe(i._formValues,n))&&Pn(i._formValues,n,m)}return!a&&i.register(n),()=>{(a?h&&!i._state.action:h)?i.unregister(n):p(n,!1)}},[n,i,a,o]),F.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),F.useMemo(()=>({field:f,formState:u,fieldState:c}),[f,u,c])}const wQe=e=>e.render(Fle(e));var Jj=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},JM=e=>({isOnSubmit:!e||e===Fa.onSubmit,isOnBlur:e===Fa.onBlur,isOnChange:e===Fa.onChange,isOnAll:e===Fa.all,isOnTouch:e===Fa.onTouched}),eR=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const S0=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Xe(e,i);if(o){const{_f:a,...s}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(S0(s,t))break}else if(Ar(s)&&S0(s,t))break}}};var jle=(e,t,n)=>{const r=_0(Xe(e,n));return Pn(r,"root",t[n]),Pn(e,n,r),e},nA=e=>e.type==="file",ds=e=>typeof e=="function",J1=e=>{if(!QO)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},f1=e=>gs(e),rA=e=>e.type==="radio",eb=e=>e instanceof RegExp;const tR={value:!1,isValid:!1},nR={value:!0,isValid:!0};var eB=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Cr(e[0].attributes.value)?Cr(e[0].value)||e[0].value===""?nR:{value:e[0].value,isValid:!0}:nR:tR}return tR};const rR={isValid:!1,value:null};var tB=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,rR):rR;function iR(e,t,n="validate"){if(f1(e)||Array.isArray(e)&&e.every(f1)||aa(e)&&!e)return{type:n,message:f1(e)?e:"",ref:t}}var Uf=e=>Ar(e)&&!eb(e)?e:{value:e,message:""},oR=async(e,t,n,r,i,o)=>{const{ref:a,refs:s,required:u,maxLength:l,minLength:c,min:f,max:h,pattern:p,validate:m,name:y,valueAsNumber:b,mount:w}=e._f,x=Xe(n,y);if(!w||t.has(y))return{};const S=s?s[0]:a,O=W=>{i&&S.reportValidity&&(S.setCustomValidity(aa(W)?"":W||""),S.reportValidity())},E={},C=rA(a),P=Sm(a),M=C||P,N=(b||nA(a))&&Cr(a.value)&&Cr(x)||J1(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,B=Jj.bind(null,y,r,E),V=(W,ne,Z,q=Ks.maxLength,G=Ks.minLength)=>{const H=W?ne:Z;E[y]={type:W?q:G,message:H,ref:a,...B(W?q:G,H)}};if(o?!Array.isArray(x)||!x.length:u&&(!M&&(N||Bi(x))||aa(x)&&!x||P&&!eB(s).isValid||C&&!tB(s).isValid)){const{value:W,message:ne}=f1(u)?{value:!!u,message:u}:Uf(u);if(W&&(E[y]={type:Ks.required,message:ne,ref:S,...B(Ks.required,ne)},!r))return O(ne),E}if(!N&&(!Bi(f)||!Bi(h))){let W,ne;const Z=Uf(h),q=Uf(f);if(!Bi(x)&&!isNaN(x)){const G=a.valueAsNumber||x&&+x;Bi(Z.value)||(W=G>Z.value),Bi(q.value)||(ne=Gnew Date(new Date().toDateString()+" "+Y),j=a.type=="time",K=a.type=="week";gs(Z.value)&&x&&(W=j?H(x)>H(Z.value):K?x>Z.value:G>new Date(Z.value)),gs(q.value)&&x&&(ne=j?H(x)+W.value,q=!Bi(ne.value)&&x.length<+ne.value;if((Z||q)&&(V(Z,W.message,ne.message),!r))return O(E[y].message),E}if(p&&!N&&gs(x)){const{value:W,message:ne}=Uf(p);if(eb(W)&&!x.match(W)&&(E[y]={type:Ks.pattern,message:ne,ref:a,...B(Ks.pattern,ne)},!r))return O(ne),E}if(m){if(ds(m)){const W=await m(x,n),ne=iR(W,S);if(ne&&(E[y]={...ne,...B(Ks.validate,ne.message)},!r))return O(ne.message),E}else if(Ar(m)){let W={};for(const ne in m){if(!ro(W)&&!r)break;const Z=iR(await m[ne](x,n),S,ne);Z&&(W={...Z,...B(ne,Z.message)},O(Z.message),r&&(E[y]=W))}if(!ro(W)&&(E[y]={ref:S,...W},!r))return E}}return O(!0),E};function Ble(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},oE=e=>Bi(e)||!Vj(e);function nl(e,t){if(oE(e)||oE(t))return e===t;if(_c(e)&&_c(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const a=t[i];if(_c(o)&&_c(a)||Ar(o)&&Ar(a)||Array.isArray(o)&&Array.isArray(a)?!nl(o,a):o!==a)return!1}}return!0}var nB=e=>e.type==="select-multiple",zle=e=>rA(e)||Sm(e),AS=e=>J1(e)&&e.isConnected,rB=e=>{for(const t in e)if(ds(e[t]))return!0;return!1};function tb(e,t={}){const n=Array.isArray(e);if(Ar(e)||n)for(const r in e)Array.isArray(e[r])||Ar(e[r])&&!rB(e[r])?(t[r]=Array.isArray(e[r])?[]:{},tb(e[r],t[r])):Bi(e[r])||(t[r]=!0);return t}function iB(e,t,n){const r=Array.isArray(e);if(Ar(e)||r)for(const i in e)Array.isArray(e[i])||Ar(e[i])&&!rB(e[i])?Cr(t)||oE(n[i])?n[i]=Array.isArray(e[i])?tb(e[i],[]):{...tb(e[i])}:iB(e[i],Bi(t)?{}:t[i],n[i]):n[i]=!nl(e[i],t[i]);return n}var Ip=(e,t)=>iB(e,t,tb(t)),oB=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Cr(e)?e:t?e===""?NaN:e&&+e:n&&gs(e)?new Date(e):r?r(e):e;function PS(e){const t=e.ref;return nA(t)?t.files:rA(t)?tB(e.refs).value:nB(t)?[...t.selectedOptions].map(({value:n})=>n):Sm(t)?eB(e.refs).value:oB(Cr(t.value)?e.ref.value:t.value,e)}var Wle=(e,t,n,r)=>{const i={};for(const o of e){const a=Xe(t,o);a&&Pn(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Np=e=>Cr(e)?e:eb(e)?e.source:Ar(e)?eb(e.value)?e.value.source:e.value:e;const aR="AsyncFunction";var Vle=e=>!!e&&!!e.validate&&!!(ds(e.validate)&&e.validate.constructor.name===aR||Ar(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===aR)),Hle=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function sR(e,t,n){const r=Xe(e,n);if(r||JO(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Xe(t,o),s=Xe(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(s&&s.type)return{name:o,error:s};i.pop()}return{name:n}}var qle=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,Kle=(e,t)=>!uw(Xe(e,t)).length&&Ur(e,t);const Gle={mode:Fa.onSubmit,reValidateMode:Fa.onChange,shouldFocusError:!0};function Yle(e={}){let t={...Gle,...e},n={submitCount:0,isDirty:!1,isLoading:ds(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=Ar(t.defaultValues)||Ar(t.values)?to(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:to(i),a={action:!1,mount:!1,watch:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,l=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:OS(),array:OS(),state:OS()},h=JM(t.mode),p=JM(t.reValidateMode),m=t.criteriaMode===Fa.all,y=ie=>pe=>{clearTimeout(l),l=setTimeout(ie,pe)},b=async ie=>{if(!t.disabled&&(c.isValid||ie)){const pe=t.resolver?ro((await M()).errors):await B(r,!0);pe!==n.isValid&&f.state.next({isValid:pe})}},w=(ie,pe)=>{!t.disabled&&(c.isValidating||c.validatingFields)&&((ie||Array.from(s.mount)).forEach(ye=>{ye&&(pe?Pn(n.validatingFields,ye,pe):Ur(n.validatingFields,ye))}),f.state.next({validatingFields:n.validatingFields,isValidating:!ro(n.validatingFields)}))},x=(ie,pe=[],ye,ze,je=!0,ke=!0)=>{if(ze&&ye&&!t.disabled){if(a.action=!0,ke&&Array.isArray(Xe(r,ie))){const nt=ye(Xe(r,ie),ze.argA,ze.argB);je&&Pn(r,ie,nt)}if(ke&&Array.isArray(Xe(n.errors,ie))){const nt=ye(Xe(n.errors,ie),ze.argA,ze.argB);je&&Pn(n.errors,ie,nt),Kle(n.errors,ie)}if(c.touchedFields&&ke&&Array.isArray(Xe(n.touchedFields,ie))){const nt=ye(Xe(n.touchedFields,ie),ze.argA,ze.argB);je&&Pn(n.touchedFields,ie,nt)}c.dirtyFields&&(n.dirtyFields=Ip(i,o)),f.state.next({name:ie,isDirty:W(ie,pe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Pn(o,ie,pe)},S=(ie,pe)=>{Pn(n.errors,ie,pe),f.state.next({errors:n.errors})},O=ie=>{n.errors=ie,f.state.next({errors:n.errors,isValid:!1})},E=(ie,pe,ye,ze)=>{const je=Xe(r,ie);if(je){const ke=Xe(o,ie,Cr(ye)?Xe(i,ie):ye);Cr(ke)||ze&&ze.defaultChecked||pe?Pn(o,ie,pe?ke:PS(je._f)):q(ie,ke),a.mount&&b()}},C=(ie,pe,ye,ze,je)=>{let ke=!1,nt=!1;const mt={name:ie};if(!t.disabled){const wn=!!(Xe(r,ie)&&Xe(r,ie)._f&&Xe(r,ie)._f.disabled);if(!ye||ze){c.isDirty&&(nt=n.isDirty,n.isDirty=mt.isDirty=W(),ke=nt!==mt.isDirty);const Kt=wn||nl(Xe(i,ie),pe);nt=!!(!wn&&Xe(n.dirtyFields,ie)),Kt||wn?Ur(n.dirtyFields,ie):Pn(n.dirtyFields,ie,!0),mt.dirtyFields=n.dirtyFields,ke=ke||c.dirtyFields&&nt!==!Kt}if(ye){const Kt=Xe(n.touchedFields,ie);Kt||(Pn(n.touchedFields,ie,ye),mt.touchedFields=n.touchedFields,ke=ke||c.touchedFields&&Kt!==ye)}ke&&je&&f.state.next(mt)}return ke?mt:{}},P=(ie,pe,ye,ze)=>{const je=Xe(n.errors,ie),ke=c.isValid&&aa(pe)&&n.isValid!==pe;if(t.delayError&&ye?(u=y(()=>S(ie,ye)),u(t.delayError)):(clearTimeout(l),u=null,ye?Pn(n.errors,ie,ye):Ur(n.errors,ie)),(ye?!nl(je,ye):je)||!ro(ze)||ke){const nt={...ze,...ke&&aa(pe)?{isValid:pe}:{},errors:n.errors,name:ie};n={...n,...nt},f.state.next(nt)}},M=async ie=>{w(ie,!0);const pe=await t.resolver(o,t.context,Wle(ie||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(ie),pe},N=async ie=>{const{errors:pe}=await M(ie);if(ie)for(const ye of ie){const ze=Xe(pe,ye);ze?Pn(n.errors,ye,ze):Ur(n.errors,ye)}else n.errors=pe;return pe},B=async(ie,pe,ye={valid:!0})=>{for(const ze in ie){const je=ie[ze];if(je){const{_f:ke,...nt}=je;if(ke){const mt=s.array.has(ke.name),wn=je._f&&Vle(je._f);wn&&c.validatingFields&&w([ze],!0);const Kt=await oR(je,s.disabled,o,m,t.shouldUseNativeValidation&&!pe,mt);if(wn&&c.validatingFields&&w([ze]),Kt[ke.name]&&(ye.valid=!1,pe))break;!pe&&(Xe(Kt,ke.name)?mt?jle(n.errors,Kt,ke.name):Pn(n.errors,ke.name,Kt[ke.name]):Ur(n.errors,ke.name))}!ro(nt)&&await B(nt,pe,ye)}}return ye.valid},V=()=>{for(const ie of s.unMount){const pe=Xe(r,ie);pe&&(pe._f.refs?pe._f.refs.every(ye=>!AS(ye)):!AS(pe._f.ref))&&Se(ie)}s.unMount=new Set},W=(ie,pe)=>!t.disabled&&(ie&&pe&&Pn(o,ie,pe),!nl(oe(),i)),ne=(ie,pe,ye)=>Qj(ie,s,{...a.mount?o:Cr(pe)?i:gs(ie)?{[ie]:pe}:pe},ye,pe),Z=ie=>uw(Xe(a.mount?o:i,ie,t.shouldUnregister?Xe(i,ie,[]):[])),q=(ie,pe,ye={})=>{const ze=Xe(r,ie);let je=pe;if(ze){const ke=ze._f;ke&&(!ke.disabled&&Pn(o,ie,oB(pe,ke)),je=J1(ke.ref)&&Bi(pe)?"":pe,nB(ke.ref)?[...ke.ref.options].forEach(nt=>nt.selected=je.includes(nt.value)):ke.refs?Sm(ke.ref)?ke.refs.length>1?ke.refs.forEach(nt=>(!nt.defaultChecked||!nt.disabled)&&(nt.checked=Array.isArray(je)?!!je.find(mt=>mt===nt.value):je===nt.value)):ke.refs[0]&&(ke.refs[0].checked=!!je):ke.refs.forEach(nt=>nt.checked=nt.value===je):nA(ke.ref)?ke.ref.value="":(ke.ref.value=je,ke.ref.type||f.values.next({name:ie,values:{...o}})))}(ye.shouldDirty||ye.shouldTouch)&&C(ie,je,ye.shouldTouch,ye.shouldDirty,!0),ye.shouldValidate&&Y(ie)},G=(ie,pe,ye)=>{for(const ze in pe){const je=pe[ze],ke=`${ie}.${ze}`,nt=Xe(r,ke);(s.array.has(ie)||Ar(je)||nt&&!nt._f)&&!_c(je)?G(ke,je,ye):q(ke,je,ye)}},H=(ie,pe,ye={})=>{const ze=Xe(r,ie),je=s.array.has(ie),ke=to(pe);Pn(o,ie,ke),je?(f.array.next({name:ie,values:{...o}}),(c.isDirty||c.dirtyFields)&&ye.shouldDirty&&f.state.next({name:ie,dirtyFields:Ip(i,o),isDirty:W(ie,ke)})):ze&&!ze._f&&!Bi(ke)?G(ie,ke,ye):q(ie,ke,ye),eR(ie,s)&&f.state.next({...n}),f.values.next({name:a.mount?ie:void 0,values:{...o}})},j=async ie=>{a.mount=!0;const pe=ie.target;let ye=pe.name,ze=!0;const je=Xe(r,ye),ke=()=>pe.type?PS(je._f):Hj(ie),nt=mt=>{ze=Number.isNaN(mt)||_c(mt)&&isNaN(mt.getTime())||nl(mt,Xe(o,ye,mt))};if(je){let mt,wn;const Kt=ke(),_n=ie.type===Q1.BLUR||ie.type===Q1.FOCUS_OUT,$i=!Hle(je._f)&&!t.resolver&&!Xe(n.errors,ye)&&!je._f.deps||qle(_n,Xe(n.touchedFields,ye),n.isSubmitted,p,h),xr=eR(ye,s,_n);Pn(o,ye,Kt),_n?(je._f.onBlur&&je._f.onBlur(ie),u&&u(0)):je._f.onChange&&je._f.onChange(ie);const mi=C(ye,Kt,_n,!1),ur=!ro(mi)||xr;if(!_n&&f.values.next({name:ye,type:ie.type,values:{...o}}),$i)return c.isValid&&(t.mode==="onBlur"&&_n?b():_n||b()),ur&&f.state.next({name:ye,...xr?{}:mi});if(!_n&&xr&&f.state.next({...n}),t.resolver){const{errors:ai}=await M([ye]);if(nt(Kt),ze){const vi=sR(n.errors,r,ye),Dr=sR(ai,r,vi.name||ye);mt=Dr.error,ye=Dr.name,wn=ro(ai)}}else w([ye],!0),mt=(await oR(je,s.disabled,o,m,t.shouldUseNativeValidation))[ye],w([ye]),nt(Kt),ze&&(mt?wn=!1:c.isValid&&(wn=await B(r,!0)));ze&&(je._f.deps&&Y(je._f.deps),P(ye,wn,mt,mi))}},K=(ie,pe)=>{if(Xe(n.errors,pe)&&ie.focus)return ie.focus(),1},Y=async(ie,pe={})=>{let ye,ze;const je=_0(ie);if(t.resolver){const ke=await N(Cr(ie)?ie:je);ye=ro(ke),ze=ie?!je.some(nt=>Xe(ke,nt)):ye}else ie?(ze=(await Promise.all(je.map(async ke=>{const nt=Xe(r,ke);return await B(nt&&nt._f?{[ke]:nt}:nt)}))).every(Boolean),!(!ze&&!n.isValid)&&b()):ze=ye=await B(r);return f.state.next({...!gs(ie)||c.isValid&&ye!==n.isValid?{}:{name:ie},...t.resolver||!ie?{isValid:ye}:{},errors:n.errors}),pe.shouldFocus&&!ze&&S0(r,K,ie?je:s.mount),ze},oe=ie=>{const pe={...a.mount?o:i};return Cr(ie)?pe:gs(ie)?Xe(pe,ie):ie.map(ye=>Xe(pe,ye))},X=(ie,pe)=>({invalid:!!Xe((pe||n).errors,ie),isDirty:!!Xe((pe||n).dirtyFields,ie),error:Xe((pe||n).errors,ie),isValidating:!!Xe(n.validatingFields,ie),isTouched:!!Xe((pe||n).touchedFields,ie)}),Q=ie=>{ie&&_0(ie).forEach(pe=>Ur(n.errors,pe)),f.state.next({errors:ie?n.errors:{}})},ue=(ie,pe,ye)=>{const ze=(Xe(r,ie,{_f:{}})._f||{}).ref,je=Xe(n.errors,ie)||{},{ref:ke,message:nt,type:mt,...wn}=je;Pn(n.errors,ie,{...wn,...pe,ref:ze}),f.state.next({name:ie,errors:n.errors,isValid:!1}),ye&&ye.shouldFocus&&ze&&ze.focus&&ze.focus()},de=(ie,pe)=>ds(ie)?f.values.subscribe({next:ye=>ie(ne(void 0,pe),ye)}):ne(ie,pe,!0),Se=(ie,pe={})=>{for(const ye of ie?_0(ie):s.mount)s.mount.delete(ye),s.array.delete(ye),pe.keepValue||(Ur(r,ye),Ur(o,ye)),!pe.keepError&&Ur(n.errors,ye),!pe.keepDirty&&Ur(n.dirtyFields,ye),!pe.keepTouched&&Ur(n.touchedFields,ye),!pe.keepIsValidating&&Ur(n.validatingFields,ye),!t.shouldUnregister&&!pe.keepDefaultValue&&Ur(i,ye);f.values.next({values:{...o}}),f.state.next({...n,...pe.keepDirty?{isDirty:W()}:{}}),!pe.keepIsValid&&b()},me=({disabled:ie,name:pe,field:ye,fields:ze})=>{(aa(ie)&&a.mount||ie||s.disabled.has(pe))&&(ie?s.disabled.add(pe):s.disabled.delete(pe),C(pe,PS(ye?ye._f:Xe(ze,pe)._f),!1,!1,!0))},Ze=(ie,pe={})=>{let ye=Xe(r,ie);const ze=aa(pe.disabled)||aa(t.disabled);return Pn(r,ie,{...ye||{},_f:{...ye&&ye._f?ye._f:{ref:{name:ie}},name:ie,mount:!0,...pe}}),s.mount.add(ie),ye?me({field:ye,disabled:aa(pe.disabled)?pe.disabled:t.disabled,name:ie}):E(ie,!0,pe.value),{...ze?{disabled:pe.disabled||t.disabled}:{},...t.progressive?{required:!!pe.required,min:Np(pe.min),max:Np(pe.max),minLength:Np(pe.minLength),maxLength:Np(pe.maxLength),pattern:Np(pe.pattern)}:{},name:ie,onChange:j,onBlur:j,ref:je=>{if(je){Ze(ie,pe),ye=Xe(r,ie);const ke=Cr(je.value)&&je.querySelectorAll&&je.querySelectorAll("input,select,textarea")[0]||je,nt=zle(ke),mt=ye._f.refs||[];if(nt?mt.find(wn=>wn===ke):ke===ye._f.ref)return;Pn(r,ie,{_f:{...ye._f,...nt?{refs:[...mt.filter(AS),ke,...Array.isArray(Xe(i,ie))?[{}]:[]],ref:{type:ke.type,name:ie}}:{ref:ke}}}),E(ie,!1,void 0,ke)}else ye=Xe(r,ie,{}),ye._f&&(ye._f.mount=!1),(t.shouldUnregister||pe.shouldUnregister)&&!(qj(s.array,ie)&&a.action)&&s.unMount.add(ie)}}},Ae=()=>t.shouldFocusError&&S0(r,K,s.mount),Le=ie=>{aa(ie)&&(f.state.next({disabled:ie}),S0(r,(pe,ye)=>{const ze=Xe(r,ye);ze&&(pe.disabled=ze._f.disabled||ie,Array.isArray(ze._f.refs)&&ze._f.refs.forEach(je=>{je.disabled=ze._f.disabled||ie}))},0,!1))},$e=(ie,pe)=>async ye=>{let ze;ye&&(ye.preventDefault&&ye.preventDefault(),ye.persist&&ye.persist());let je=to(o);if(s.disabled.size)for(const ke of s.disabled)Pn(je,ke,void 0);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:ke,values:nt}=await M();n.errors=ke,je=nt}else await B(r);if(Ur(n.errors,"root"),ro(n.errors)){f.state.next({errors:{}});try{await ie(je,ye)}catch(ke){ze=ke}}else pe&&await pe({...n.errors},ye),Ae(),setTimeout(Ae);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ro(n.errors)&&!ze,submitCount:n.submitCount+1,errors:n.errors}),ze)throw ze},be=(ie,pe={})=>{Xe(r,ie)&&(Cr(pe.defaultValue)?H(ie,to(Xe(i,ie))):(H(ie,pe.defaultValue),Pn(i,ie,to(pe.defaultValue))),pe.keepTouched||Ur(n.touchedFields,ie),pe.keepDirty||(Ur(n.dirtyFields,ie),n.isDirty=pe.defaultValue?W(ie,to(Xe(i,ie))):W()),pe.keepError||(Ur(n.errors,ie),c.isValid&&b()),f.state.next({...n}))},bt=(ie,pe={})=>{const ye=ie?to(ie):i,ze=to(ye),je=ro(ie),ke=je?i:ze;if(pe.keepDefaultValues||(i=ye),!pe.keepValues){if(pe.keepDirtyValues){const nt=new Set([...s.mount,...Object.keys(Ip(i,o))]);for(const mt of Array.from(nt))Xe(n.dirtyFields,mt)?Pn(ke,mt,Xe(o,mt)):H(mt,Xe(ke,mt))}else{if(QO&&Cr(ie))for(const nt of s.mount){const mt=Xe(r,nt);if(mt&&mt._f){const wn=Array.isArray(mt._f.refs)?mt._f.refs[0]:mt._f.ref;if(J1(wn)){const Kt=wn.closest("form");if(Kt){Kt.reset();break}}}}r={}}o=t.shouldUnregister?pe.keepDefaultValues?to(i):{}:to(ke),f.array.next({values:{...ke}}),f.values.next({values:{...ke}})}s={mount:pe.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!c.isValid||!!pe.keepIsValid||!!pe.keepDirtyValues,a.watch=!!t.shouldUnregister,f.state.next({submitCount:pe.keepSubmitCount?n.submitCount:0,isDirty:je?!1:pe.keepDirty?n.isDirty:!!(pe.keepDefaultValues&&!nl(ie,i)),isSubmitted:pe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:je?{}:pe.keepDirtyValues?pe.keepDefaultValues&&o?Ip(i,o):n.dirtyFields:pe.keepDefaultValues&&ie?Ip(i,ie):pe.keepDirty?n.dirtyFields:{},touchedFields:pe.keepTouched?n.touchedFields:{},errors:pe.keepErrors?n.errors:{},isSubmitSuccessful:pe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},lt=(ie,pe)=>bt(ds(ie)?ie(o):ie,pe);return{control:{register:Ze,unregister:Se,getFieldState:X,handleSubmit:$e,setError:ue,_executeSchema:M,_getWatch:ne,_getDirty:W,_updateValid:b,_removeUnmounted:V,_updateFieldArray:x,_updateDisabledField:me,_getFieldArray:Z,_reset:bt,_resetDefaultValues:()=>ds(t.defaultValues)&&t.defaultValues().then(ie=>{lt(ie,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:ie=>{n={...n,...ie}},_disableForm:Le,_subjects:f,_proxyFormState:c,_setErrors:O,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(ie){a=ie},get _defaultValues(){return i},get _names(){return s},set _names(ie){s=ie},get _formState(){return n},set _formState(ie){n=ie},get _options(){return t},set _options(ie){t={...t,...ie}}},trigger:Y,register:Ze,handleSubmit:$e,watch:de,setValue:H,getValues:oe,reset:lt,resetField:be,clearErrors:Q,unregister:Se,setError:ue,setFocus:(ie,pe={})=>{const ye=Xe(r,ie),ze=ye&&ye._f;if(ze){const je=ze.refs?ze.refs[0]:ze.ref;je.focus&&(je.focus(),pe.shouldSelect&&ds(je.select)&&je.select())}},getFieldState:X}}function _Qe(e={}){const t=F.useRef(void 0),n=F.useRef(void 0),[r,i]=F.useState({isDirty:!1,isValidating:!1,isLoading:ds(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ds(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Yle(e),formState:r});const o=t.current.control;return o._options=e,tA({subject:o._subjects.state,next:a=>{Zj(a,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),F.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),F.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),F.useEffect(()=>{e.values&&!nl(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(a=>({...a}))):o._resetDefaultValues()},[e.values,o]),F.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),F.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),F.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=Yj(r,o),t.current}const uR=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Xe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},aB=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?uR(r.ref,n,e):r.refs&&r.refs.forEach(i=>uR(i,n,e))}},Zle=(e,t)=>{t.shouldUseNativeValidation&&aB(e,t);const n={};for(const r in e){const i=Xe(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(Xle(t.names||Object.keys(e),r)){const a=Object.assign({},Xe(n,r));Pn(a,"root",o),Pn(n,r,a)}else Pn(n,r,o)}return n},Xle=(e,t)=>e.some(n=>n.startsWith(t+"."));var Qle=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[a]={message:s.message,type:s.code}}else n[a]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(c){return c.errors.forEach(function(f){return e.push(f)})}),t){var u=n[a].types,l=u&&u[r.code];n[a]=Jj(a,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n},SQe=function(e,t,n){return n===void 0&&(n={}),function(r,i,o){try{return Promise.resolve(function(a,s){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return o.shouldUseNativeValidation&&aB({},o),{errors:{},values:n.raw?r:l}})}catch(l){return s(l)}return u&&u.then?u.then(void 0,s):u}(0,function(a){if(function(s){return Array.isArray(s?.errors)}(a))return{values:{},errors:Zle(Qle(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},gn;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(gn||(gn={}));var aE;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(aE||(aE={}));const it=gn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nu=e=>{switch(typeof e){case"undefined":return it.undefined;case"string":return it.string;case"number":return isNaN(e)?it.nan:it.number;case"boolean":return it.boolean;case"function":return it.function;case"bigint":return it.bigint;case"symbol":return it.symbol;case"object":return Array.isArray(e)?it.array:e===null?it.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?it.promise:typeof Map<"u"&&e instanceof Map?it.map:typeof Set<"u"&&e instanceof Set?it.set:typeof Date<"u"&&e instanceof Date?it.date:it.object;default:return it.unknown}},We=gn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Jle=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class No extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;un.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}No.create=e=>new No(e);const Gd=(e,t)=>{let n;switch(e.code){case We.invalid_type:e.received===it.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case We.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,gn.jsonStringifyReplacer)}`;break;case We.unrecognized_keys:n=`Unrecognized key(s) in object: ${gn.joinValues(e.keys,", ")}`;break;case We.invalid_union:n="Invalid input";break;case We.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gn.joinValues(e.options)}`;break;case We.invalid_enum_value:n=`Invalid enum value. Expected ${gn.joinValues(e.options)}, received '${e.received}'`;break;case We.invalid_arguments:n="Invalid function arguments";break;case We.invalid_return_type:n="Invalid function return type";break;case We.invalid_date:n="Invalid date";break;case We.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:gn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case We.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case We.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case We.custom:n="Invalid input";break;case We.invalid_intersection_types:n="Intersection results could not be merged";break;case We.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case We.not_finite:n="Number must be finite";break;default:n=t.defaultError,gn.assertNever(e)}return{message:n}};let sB=Gd;function ece(e){sB=e}function nb(){return sB}const rb=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="";const u=r.filter(l=>!!l).slice().reverse();for(const l of u)s=l(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},tce=[];function tt(e,t){const n=nb(),r=rb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Gd?void 0:Gd].filter(i=>!!i)});e.common.issues.push(r)}class Ri{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return $t;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,a=await i.value;r.push({key:o,value:a})}return Ri.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return $t;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const $t=Object.freeze({status:"aborted"}),md=e=>({status:"dirty",value:e}),Vi=e=>({status:"valid",value:e}),sE=e=>e.status==="aborted",uE=e=>e.status==="dirty",Vc=e=>e.status==="valid",tg=e=>typeof Promise<"u"&&e instanceof Promise;function ib(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function uB(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var dt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(dt||(dt={}));var a0,s0;class Ps{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const lR=(e,t)=>{if(Vc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new No(e.common.issues);return this._error=n,this._error}}};function Yt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{var u,l;const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(u=c??r)!==null&&u!==void 0?u:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(l=c??n)!==null&&l!==void 0?l:s.defaultError}},description:i}}class en{get description(){return this._def.description}_getType(t){return nu(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:nu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ri,ctx:{common:t.parent.common,data:t.data,parsedType:nu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(tg(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)},o=this._parseSync({data:t,path:i.path,parent:i});return lR(i,o)}"~validate"(t){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:i});return Vc(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((r=(n=o?.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(o=>Vc(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(tg(i)?i:Promise.resolve(i));return lR(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:We.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Ya({schema:this,typeName:Mt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Cs.create(this,this._def)}nullable(){return Rl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ha.create(this)}promise(){return Zd.create(this,this._def)}or(t){return og.create([this,t],this._def)}and(t){return ag.create(this,t,this._def)}transform(t){return new Ya({...Yt(this._def),schema:this,typeName:Mt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new fg({...Yt(this._def),innerType:this,defaultValue:n,typeName:Mt.ZodDefault})}brand(){return new iA({typeName:Mt.ZodBranded,type:this,...Yt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new dg({...Yt(this._def),innerType:this,catchValue:n,typeName:Mt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Cm.create(this,t)}readonly(){return hg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const nce=/^c[^\s-]{8,}$/i,rce=/^[0-9a-z]+$/,ice=/^[0-9A-HJKMNP-TV-Z]{26}$/i,oce=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ace=/^[a-z0-9_-]{21}$/i,sce=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,uce=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lce=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cce="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kS;const fce=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dce=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,hce=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,pce=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gce=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,mce=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lB="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",vce=new RegExp(`^${lB}$`);function cB(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function yce(e){return new RegExp(`^${cB(e)}$`)}function fB(e){let t=`${lB}T${cB(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function bce(e,t){return!!((t==="v4"||!t)&&fce.test(e)||(t==="v6"||!t)&&hce.test(e))}function xce(e,t){if(!sce.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function wce(e,t){return!!((t==="v4"||!t)&&dce.test(e)||(t==="v6"||!t)&&pce.test(e))}class Ua extends en{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==it.string){const o=this._getOrReturnCtx(t);return tt(o,{code:We.invalid_type,expected:it.string,received:o.parsedType}),$t}const r=new Ri;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:We.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.lengtht.test(i),{validation:n,code:We.invalid_string,...dt.errToObj(r)})}_addCheck(t){return new Ua({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...dt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...dt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...dt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...dt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...dt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...dt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...dt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...dt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...dt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...dt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...dt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...dt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...dt.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...dt.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...dt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...dt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...dt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...dt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...dt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...dt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...dt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...dt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...dt.errToObj(n)})}nonempty(t){return this.min(1,dt.errToObj(t))}trim(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ua({checks:[],typeName:Mt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Yt(e)})};function _ce(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class kl extends en{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==it.number){const o=this._getOrReturnCtx(t);return tt(o,{code:We.invalid_type,expected:it.number,received:o.parsedType}),$t}let r;const i=new Ri;for(const o of this._def.checks)o.kind==="int"?gn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),tt(r,{code:We.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),tt(r,{code:We.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?_ce(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),tt(r,{code:We.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),tt(r,{code:We.not_finite,message:o.message}),i.dirty()):gn.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,dt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,dt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,dt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,dt.toString(n))}setLimit(t,n,r,i){return new kl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:dt.toString(i)}]})}_addCheck(t){return new kl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:dt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:dt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:dt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:dt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:dt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:dt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:dt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:dt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:dt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&gn.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew kl({checks:[],typeName:Mt.ZodNumber,coerce:e?.coerce||!1,...Yt(e)});class Tl extends en{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==it.bigint)return this._getInvalidInput(t);let r;const i=new Ri;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),tt(r,{code:We.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),tt(r,{code:We.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):gn.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return tt(n,{code:We.invalid_type,expected:it.bigint,received:n.parsedType}),$t}gte(t,n){return this.setLimit("min",t,!0,dt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,dt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,dt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,dt.toString(n))}setLimit(t,n,r,i){return new Tl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:dt.toString(i)}]})}_addCheck(t){return new Tl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:dt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:dt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:dt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:dt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:dt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Tl({checks:[],typeName:Mt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Yt(e)})};class ng extends en{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==it.boolean){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.boolean,received:r.parsedType}),$t}return Vi(t.data)}}ng.create=e=>new ng({typeName:Mt.ZodBoolean,coerce:e?.coerce||!1,...Yt(e)});class Hc extends en{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==it.date){const o=this._getOrReturnCtx(t);return tt(o,{code:We.invalid_type,expected:it.date,received:o.parsedType}),$t}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return tt(o,{code:We.invalid_date}),$t}const r=new Ri;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:We.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):gn.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Hc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:dt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:dt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Hc({checks:[],coerce:e?.coerce||!1,typeName:Mt.ZodDate,...Yt(e)});class ob extends en{_parse(t){if(this._getType(t)!==it.symbol){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.symbol,received:r.parsedType}),$t}return Vi(t.data)}}ob.create=e=>new ob({typeName:Mt.ZodSymbol,...Yt(e)});class rg extends en{_parse(t){if(this._getType(t)!==it.undefined){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.undefined,received:r.parsedType}),$t}return Vi(t.data)}}rg.create=e=>new rg({typeName:Mt.ZodUndefined,...Yt(e)});class ig extends en{_parse(t){if(this._getType(t)!==it.null){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.null,received:r.parsedType}),$t}return Vi(t.data)}}ig.create=e=>new ig({typeName:Mt.ZodNull,...Yt(e)});class Yd extends en{constructor(){super(...arguments),this._any=!0}_parse(t){return Vi(t.data)}}Yd.create=e=>new Yd({typeName:Mt.ZodAny,...Yt(e)});class Mc extends en{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vi(t.data)}}Mc.create=e=>new Mc({typeName:Mt.ZodUnknown,...Yt(e)});class yu extends en{_parse(t){const n=this._getOrReturnCtx(t);return tt(n,{code:We.invalid_type,expected:it.never,received:n.parsedType}),$t}}yu.create=e=>new yu({typeName:Mt.ZodNever,...Yt(e)});class ab extends en{_parse(t){if(this._getType(t)!==it.undefined){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.void,received:r.parsedType}),$t}return Vi(t.data)}}ab.create=e=>new ab({typeName:Mt.ZodVoid,...Yt(e)});class Ha extends en{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==it.array)return tt(n,{code:We.invalid_type,expected:it.array,received:n.parsedType}),$t;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.lengthi.maxLength.value&&(tt(n,{code:We.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new Ps(n,a,n.path,s)))).then(a=>Ri.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new Ps(n,a,n.path,s)));return Ri.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Ha({...this._def,minLength:{value:t,message:dt.toString(n)}})}max(t,n){return new Ha({...this._def,maxLength:{value:t,message:dt.toString(n)}})}length(t,n){return new Ha({...this._def,exactLength:{value:t,message:dt.toString(n)}})}nonempty(t){return this.min(1,t)}}Ha.create=(e,t)=>new Ha({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Mt.ZodArray,...Yt(t)});function td(e){if(e instanceof fr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Cs.create(td(r))}return new fr({...e._def,shape:()=>t})}else return e instanceof Ha?new Ha({...e._def,type:td(e.element)}):e instanceof Cs?Cs.create(td(e.unwrap())):e instanceof Rl?Rl.create(td(e.unwrap())):e instanceof ks?ks.create(e.items.map(t=>td(t))):e}class fr extends en{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=gn.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==it.object){const l=this._getOrReturnCtx(t);return tt(l,{code:We.invalid_type,expected:it.object,received:l.parsedType}),$t}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof yu&&this._def.unknownKeys==="strip"))for(const l in i.data)a.includes(l)||s.push(l);const u=[];for(const l of a){const c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Ps(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof yu){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")s.length>0&&(tt(i,{code:We.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of s){const f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Ps(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of u){const f=await c.key,h=await c.value;l.push({key:f,value:h,alwaysSet:c.alwaysSet})}return l}).then(l=>Ri.mergeObjectSync(r,l)):Ri.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return dt.errToObj,new fr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const u=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=dt.errToObj(t).message)!==null&&s!==void 0?s:u}:{message:u}}}:{}})}strip(){return new fr({...this._def,unknownKeys:"strip"})}passthrough(){return new fr({...this._def,unknownKeys:"passthrough"})}extend(t){return new fr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new fr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Mt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new fr({...this._def,catchall:t})}pick(t){const n={};return gn.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new fr({...this._def,shape:()=>n})}omit(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new fr({...this._def,shape:()=>n})}deepPartial(){return td(this)}partial(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new fr({...this._def,shape:()=>n})}required(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Cs;)o=o._def.innerType;n[r]=o}}),new fr({...this._def,shape:()=>n})}keyof(){return dB(gn.objectKeys(this.shape))}}fr.create=(e,t)=>new fr({shape:()=>e,unknownKeys:"strip",catchall:yu.create(),typeName:Mt.ZodObject,...Yt(t)});fr.strictCreate=(e,t)=>new fr({shape:()=>e,unknownKeys:"strict",catchall:yu.create(),typeName:Mt.ZodObject,...Yt(t)});fr.lazycreate=(e,t)=>new fr({shape:e,unknownKeys:"strip",catchall:yu.create(),typeName:Mt.ZodObject,...Yt(t)});class og extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new No(s.ctx.common.issues));return tt(n,{code:We.invalid_union,unionErrors:a}),$t}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const u of r){const l={...n,common:{...n.common,issues:[]},parent:null},c=u._parseSync({data:n.data,path:n.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(u=>new No(u));return tt(n,{code:We.invalid_union,unionErrors:s}),$t}}get options(){return this._def.options}}og.create=(e,t)=>new og({options:e,typeName:Mt.ZodUnion,...Yt(t)});const Zs=e=>e instanceof ug?Zs(e.schema):e instanceof Ya?Zs(e.innerType()):e instanceof lg?[e.value]:e instanceof Ml?e.options:e instanceof cg?gn.objectValues(e.enum):e instanceof fg?Zs(e._def.innerType):e instanceof rg?[void 0]:e instanceof ig?[null]:e instanceof Cs?[void 0,...Zs(e.unwrap())]:e instanceof Rl?[null,...Zs(e.unwrap())]:e instanceof iA||e instanceof hg?Zs(e.unwrap()):e instanceof dg?Zs(e._def.innerType):[];class lw extends en{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==it.object)return tt(n,{code:We.invalid_type,expected:it.object,received:n.parsedType}),$t;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(tt(n,{code:We.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),$t)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=Zs(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new lw({typeName:Mt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Yt(r)})}}function lE(e,t){const n=nu(e),r=nu(t);if(e===t)return{valid:!0,data:e};if(n===it.object&&r===it.object){const i=gn.objectKeys(t),o=gn.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const u=lE(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(n===it.array&&r===it.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o{if(sE(o)||sE(a))return $t;const s=lE(o.value,a.value);return s.valid?((uE(o)||uE(a))&&n.dirty(),{status:n.value,value:s.data}):(tt(r,{code:We.invalid_intersection_types}),$t)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ag.create=(e,t,n)=>new ag({left:e,right:t,typeName:Mt.ZodIntersection,...Yt(n)});class ks extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.array)return tt(r,{code:We.invalid_type,expected:it.array,received:r.parsedType}),$t;if(r.data.lengththis._def.items.length&&(tt(r,{code:We.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const u=this._def.items[s]||this._def.rest;return u?u._parse(new Ps(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Ri.mergeArray(n,a)):Ri.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ks({...this._def,rest:t})}}ks.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ks({items:e,typeName:Mt.ZodTuple,rest:null,...Yt(t)})};class sg extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.object)return tt(r,{code:We.invalid_type,expected:it.object,received:r.parsedType}),$t;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new Ps(r,s,r.path,s)),value:a._parse(new Ps(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?Ri.mergeObjectAsync(n,i):Ri.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof en?new sg({keyType:t,valueType:n,typeName:Mt.ZodRecord,...Yt(r)}):new sg({keyType:Ua.create(),valueType:t,typeName:Mt.ZodRecord,...Yt(n)})}}class sb extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.map)return tt(r,{code:We.invalid_type,expected:it.map,received:r.parsedType}),$t;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,u],l)=>({key:i._parse(new Ps(r,s,r.path,[l,"key"])),value:o._parse(new Ps(r,u,r.path,[l,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const u of a){const l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return $t;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const u of a){const l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return $t;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}}}}sb.create=(e,t,n)=>new sb({valueType:t,keyType:e,typeName:Mt.ZodMap,...Yt(n)});class qc extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.set)return tt(r,{code:We.invalid_type,expected:it.set,received:r.parsedType}),$t;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(tt(r,{code:We.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(u){const l=new Set;for(const c of u){if(c.status==="aborted")return $t;c.status==="dirty"&&n.dirty(),l.add(c.value)}return{status:n.value,value:l}}const s=[...r.data.values()].map((u,l)=>o._parse(new Ps(r,u,r.path,l)));return r.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,n){return new qc({...this._def,minSize:{value:t,message:dt.toString(n)}})}max(t,n){return new qc({...this._def,maxSize:{value:t,message:dt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}qc.create=(e,t)=>new qc({valueType:e,minSize:null,maxSize:null,typeName:Mt.ZodSet,...Yt(t)});class Pd extends en{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==it.function)return tt(n,{code:We.invalid_type,expected:it.function,received:n.parsedType}),$t;function r(s,u){return rb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,nb(),Gd].filter(l=>!!l),issueData:{code:We.invalid_arguments,argumentsError:u}})}function i(s,u){return rb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,nb(),Gd].filter(l=>!!l),issueData:{code:We.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Zd){const s=this;return Vi(async function(...u){const l=new No([]),c=await s._def.args.parseAsync(u,o).catch(p=>{throw l.addIssue(r(u,p)),l}),f=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(f,o).catch(p=>{throw l.addIssue(i(f,p)),l})})}else{const s=this;return Vi(function(...u){const l=s._def.args.safeParse(u,o);if(!l.success)throw new No([r(u,l.error)]);const c=Reflect.apply(a,this,l.data),f=s._def.returns.safeParse(c,o);if(!f.success)throw new No([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Pd({...this._def,args:ks.create(t).rest(Mc.create())})}returns(t){return new Pd({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Pd({args:t||ks.create([]).rest(Mc.create()),returns:n||Mc.create(),typeName:Mt.ZodFunction,...Yt(r)})}}class ug extends en{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ug.create=(e,t)=>new ug({getter:e,typeName:Mt.ZodLazy,...Yt(t)});class lg extends en{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return tt(n,{received:n.data,code:We.invalid_literal,expected:this._def.value}),$t}return{status:"valid",value:t.data}}get value(){return this._def.value}}lg.create=(e,t)=>new lg({value:e,typeName:Mt.ZodLiteral,...Yt(t)});function dB(e,t){return new Ml({values:e,typeName:Mt.ZodEnum,...Yt(t)})}class Ml extends en{constructor(){super(...arguments),a0.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return tt(n,{expected:gn.joinValues(r),received:n.parsedType,code:We.invalid_type}),$t}if(ib(this,a0)||uB(this,a0,new Set(this._def.values)),!ib(this,a0).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return tt(n,{received:n.data,code:We.invalid_enum_value,options:r}),$t}return Vi(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Ml.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ml.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}a0=new WeakMap;Ml.create=dB;class cg extends en{constructor(){super(...arguments),s0.set(this,void 0)}_parse(t){const n=gn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==it.string&&r.parsedType!==it.number){const i=gn.objectValues(n);return tt(r,{expected:gn.joinValues(i),received:r.parsedType,code:We.invalid_type}),$t}if(ib(this,s0)||uB(this,s0,new Set(gn.getValidEnumValues(this._def.values))),!ib(this,s0).has(t.data)){const i=gn.objectValues(n);return tt(r,{received:r.data,code:We.invalid_enum_value,options:i}),$t}return Vi(t.data)}get enum(){return this._def.values}}s0=new WeakMap;cg.create=(e,t)=>new cg({values:e,typeName:Mt.ZodNativeEnum,...Yt(t)});class Zd extends en{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==it.promise&&n.common.async===!1)return tt(n,{code:We.invalid_type,expected:it.promise,received:n.parsedType}),$t;const r=n.parsedType===it.promise?n.data:Promise.resolve(n.data);return Vi(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Zd.create=(e,t)=>new Zd({type:e,typeName:Mt.ZodPromise,...Yt(t)});class Ya extends en{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{tt(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return $t;const u=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return u.status==="aborted"?$t:u.status==="dirty"||n.value==="dirty"?md(u.value):u});{if(n.value==="aborted")return $t;const s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?$t:s.status==="dirty"||n.value==="dirty"?md(s.value):s}}if(i.type==="refinement"){const a=s=>{const u=i.refinement(s,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?$t:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?$t:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Vc(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Vc(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);gn.assertNever(i)}}Ya.create=(e,t,n)=>new Ya({schema:e,typeName:Mt.ZodEffects,effect:t,...Yt(n)});Ya.createWithPreprocess=(e,t,n)=>new Ya({schema:t,effect:{type:"preprocess",transform:e},typeName:Mt.ZodEffects,...Yt(n)});class Cs extends en{_parse(t){return this._getType(t)===it.undefined?Vi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Cs.create=(e,t)=>new Cs({innerType:e,typeName:Mt.ZodOptional,...Yt(t)});class Rl extends en{_parse(t){return this._getType(t)===it.null?Vi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Rl.create=(e,t)=>new Rl({innerType:e,typeName:Mt.ZodNullable,...Yt(t)});class fg extends en{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===it.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}fg.create=(e,t)=>new fg({innerType:e,typeName:Mt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Yt(t)});class dg extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return tg(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new No(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new No(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}dg.create=(e,t)=>new dg({innerType:e,typeName:Mt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Yt(t)});class ub extends en{_parse(t){if(this._getType(t)!==it.nan){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.nan,received:r.parsedType}),$t}return{status:"valid",value:t.data}}}ub.create=e=>new ub({typeName:Mt.ZodNaN,...Yt(e)});const Sce=Symbol("zod_brand");class iA extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Cm extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?$t:o.status==="dirty"?(n.dirty(),md(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?$t:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Cm({in:t,out:n,typeName:Mt.ZodPipeline})}}class hg extends en{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Vc(i)&&(i.value=Object.freeze(i.value)),i);return tg(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}hg.create=(e,t)=>new hg({innerType:e,typeName:Mt.ZodReadonly,...Yt(t)});function hB(e,t={},n){return e?Yd.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,l=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...l,fatal:u})}}):Yd.create()}const Cce={object:fr.lazycreate};var Mt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Mt||(Mt={}));const Ece=(e,t={message:`Input not instance of ${e.name}`})=>hB(n=>n instanceof e,t),pB=Ua.create,gB=kl.create,Oce=ub.create,Ace=Tl.create,mB=ng.create,Pce=Hc.create,kce=ob.create,Tce=rg.create,Mce=ig.create,Rce=Yd.create,Dce=Mc.create,$ce=yu.create,Ice=ab.create,Nce=Ha.create,Lce=fr.create,Fce=fr.strictCreate,jce=og.create,Bce=lw.create,Uce=ag.create,zce=ks.create,Wce=sg.create,Vce=sb.create,Hce=qc.create,qce=Pd.create,Kce=ug.create,Gce=lg.create,Yce=Ml.create,Zce=cg.create,Xce=Zd.create,cR=Ya.create,Qce=Cs.create,Jce=Rl.create,efe=Ya.createWithPreprocess,tfe=Cm.create,nfe=()=>pB().optional(),rfe=()=>gB().optional(),ife=()=>mB().optional(),ofe={string:e=>Ua.create({...e,coerce:!0}),number:e=>kl.create({...e,coerce:!0}),boolean:e=>ng.create({...e,coerce:!0}),bigint:e=>Tl.create({...e,coerce:!0}),date:e=>Hc.create({...e,coerce:!0})},afe=$t;var CQe=Object.freeze({__proto__:null,defaultErrorMap:Gd,setErrorMap:ece,getErrorMap:nb,makeIssue:rb,EMPTY_PATH:tce,addIssueToContext:tt,ParseStatus:Ri,INVALID:$t,DIRTY:md,OK:Vi,isAborted:sE,isDirty:uE,isValid:Vc,isAsync:tg,get util(){return gn},get objectUtil(){return aE},ZodParsedType:it,getParsedType:nu,ZodType:en,datetimeRegex:fB,ZodString:Ua,ZodNumber:kl,ZodBigInt:Tl,ZodBoolean:ng,ZodDate:Hc,ZodSymbol:ob,ZodUndefined:rg,ZodNull:ig,ZodAny:Yd,ZodUnknown:Mc,ZodNever:yu,ZodVoid:ab,ZodArray:Ha,ZodObject:fr,ZodUnion:og,ZodDiscriminatedUnion:lw,ZodIntersection:ag,ZodTuple:ks,ZodRecord:sg,ZodMap:sb,ZodSet:qc,ZodFunction:Pd,ZodLazy:ug,ZodLiteral:lg,ZodEnum:Ml,ZodNativeEnum:cg,ZodPromise:Zd,ZodEffects:Ya,ZodTransformer:Ya,ZodOptional:Cs,ZodNullable:Rl,ZodDefault:fg,ZodCatch:dg,ZodNaN:ub,BRAND:Sce,ZodBranded:iA,ZodPipeline:Cm,ZodReadonly:hg,custom:hB,Schema:en,ZodSchema:en,late:Cce,get ZodFirstPartyTypeKind(){return Mt},coerce:ofe,any:Rce,array:Nce,bigint:Ace,boolean:mB,date:Pce,discriminatedUnion:Bce,effect:cR,enum:Yce,function:qce,instanceof:Ece,intersection:Uce,lazy:Kce,literal:Gce,map:Vce,nan:Oce,nativeEnum:Zce,never:$ce,null:Mce,nullable:Jce,number:gB,object:Lce,oboolean:ife,onumber:rfe,optional:Qce,ostring:nfe,pipeline:tfe,preprocess:efe,promise:Xce,record:Wce,set:Hce,strictObject:Fce,string:pB,symbol:kce,transformer:cR,tuple:zce,undefined:Tce,union:jce,unknown:Dce,void:Ice,NEVER:afe,ZodIssueCode:We,quotelessJson:Jle,ZodError:No});const sfe=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);Rc(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},fR={},cE=(e,t,n,r)=>{Rc(n)&&fR[n]||(Rc(n)&&(fR[n]=new Date),sfe(e,t,n,r))},vB=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},fE=(e,t,n)=>{e.loadNamespaces(t,vB(e,n))},dR=(e,t,n,r)=>{if(Rc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return fE(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,vB(e,r))},ufe=(e,t,n={})=>!t.languages||!t.languages.length?(cE(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n?.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Rc=e=>typeof e=="string",lfe=e=>typeof e=="object"&&e!==null,cfe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ffe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},dfe=e=>ffe[e],hfe=e=>e.replace(cfe,dfe);let dE={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:hfe};const pfe=(e={})=>{dE={...dE,...e}},gfe=()=>dE;let yB;const mfe=e=>{yB=e},vfe=()=>yB,EQe={type:"3rdParty",init(e){pfe(e.options.react),mfe(e)}},yfe=v.createContext();class bfe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const xfe=(e,t)=>{const n=v.useRef();return v.useEffect(()=>{n.current=e},[e,t]),n.current},bB=(e,t,n,r)=>e.getFixedT(t,n,r),wfe=(e,t,n,r)=>v.useCallback(bB(e,t,n,r),[e,t,n,r]),OQe=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=v.useContext(yfe)||{},o=n||r||vfe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new bfe),!o){cE(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const O=(C,P)=>Rc(P)?P:lfe(P)&&Rc(P.defaultValue)?P.defaultValue:Array.isArray(C)?C[C.length-1]:C,E=[O,{},!1];return E.t=O,E.i18n={},E.ready=!1,E}o.options.react?.wait&&cE(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...gfe(),...o.options.react,...t},{useSuspense:s,keyPrefix:u}=a;let l=e||i||o.options?.defaultNS;l=Rc(l)?[l]:l||["translation"],o.reportNamespaces.addUsedNamespaces?.(l);const c=(o.isInitialized||o.initializedStoreOnce)&&l.every(O=>ufe(O,o,a)),f=wfe(o,t.lng||null,a.nsMode==="fallback"?l:l[0],u),h=()=>f,p=()=>bB(o,t.lng||null,a.nsMode==="fallback"?l:l[0],u),[m,y]=v.useState(h);let b=l.join();t.lng&&(b=`${t.lng}${b}`);const w=xfe(b),x=v.useRef(!0);v.useEffect(()=>{const{bindI18n:O,bindI18nStore:E}=a;x.current=!0,!c&&!s&&(t.lng?dR(o,t.lng,l,()=>{x.current&&y(p)}):fE(o,l,()=>{x.current&&y(p)})),c&&w&&w!==b&&x.current&&y(p);const C=()=>{x.current&&y(p)};return O&&o?.on(O,C),E&&o?.store.on(E,C),()=>{x.current=!1,o&&O?.split(" ").forEach(P=>o.off(P,C)),E&&o&&E.split(" ").forEach(P=>o.store.off(P,C))}},[o,b]),v.useEffect(()=>{x.current&&c&&y(h)},[o,u,c]);const S=[m,o,c];if(S.t=m,S.i18n=o,S.ready=c,c||!c&&!s)return S;throw new Promise(O=>{t.lng?dR(o,t.lng,l,()=>O()):fE(o,l,()=>O())})};var _fe="Label",xB=v.forwardRef((e,t)=>I.jsx(gt.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));xB.displayName=_fe;var AQe=xB;function Ye(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Sfe(e,t){const n=v.createContext(t),r=o=>{const{children:a,...s}=o,u=v.useMemo(()=>s,Object.values(s));return I.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function i(o){const a=v.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Di(e,t=[]){let n=[];function r(o,a){const s=v.createContext(a),u=n.length;n=[...n,a];const l=f=>{const{scope:h,children:p,...m}=f,y=h?.[e]?.[u]||s,b=v.useMemo(()=>m,Object.values(m));return I.jsx(y.Provider,{value:b,children:p})};l.displayName=o+"Provider";function c(f,h){const p=h?.[e]?.[u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,Cfe(i,...t)]}function Cfe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function oA(e){const t=e+"CollectionProvider",[n,r]=Di(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:y}=p,b=F.useRef(null),w=F.useRef(new Map).current;return I.jsx(i,{scope:m,itemMap:w,collectionRef:b,children:y})};a.displayName=t;const s=e+"CollectionSlot",u=F.forwardRef((p,m)=>{const{scope:y,children:b}=p,w=o(s,y),x=Nt(m,w.collectionRef);return I.jsx(Pl,{ref:x,children:b})});u.displayName=s;const l=e+"CollectionItemSlot",c="data-radix-collection-item",f=F.forwardRef((p,m)=>{const{scope:y,children:b,...w}=p,x=F.useRef(null),S=Nt(m,x),O=o(l,y);return F.useEffect(()=>(O.itemMap.set(x,{ref:x,...w}),()=>void O.itemMap.delete(x))),I.jsx(Pl,{[c]:"",ref:S,children:b})});f.displayName=l;function h(p){const m=o(e+"CollectionConsumer",p);return F.useCallback(()=>{const b=m.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((O,E)=>w.indexOf(O.ref.current)-w.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:u,ItemSlot:f},h,r]}var Efe=globalThis?.document?v.useLayoutEffect:()=>{},Ofe=zx.useId||(()=>{}),Afe=0;function Lo(e){const[t,n]=v.useState(Ofe());return Efe(()=>{e||n(r=>r??String(Afe++))},[e]),e||(t?`radix-${t}`:"")}function Vr(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ts({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Pfe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Vr(n),u=v.useCallback(l=>{if(o){const f=typeof l=="function"?l(e):l;f!==e&&s(f)}else i(l)},[o,e,i,s]);return[a,u]}function Pfe({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),o=Vr(t);return v.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var kfe=v.createContext(void 0);function Em(e){const t=v.useContext(kfe);return e||t||"ltr"}var TS="rovingFocusGroup.onEntryFocus",Tfe={bubbles:!1,cancelable:!0},cw="RovingFocusGroup",[hE,wB,Mfe]=oA(cw),[Rfe,fw]=Di(cw,[Mfe]),[Dfe,$fe]=Rfe(cw),_B=v.forwardRef((e,t)=>I.jsx(hE.Provider,{scope:e.__scopeRovingFocusGroup,children:I.jsx(hE.Slot,{scope:e.__scopeRovingFocusGroup,children:I.jsx(Ife,{...e,ref:t})})}));_B.displayName=cw;var Ife=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:c=!1,...f}=e,h=v.useRef(null),p=Nt(t,h),m=Em(o),[y=null,b]=Ts({prop:a,defaultProp:s,onChange:u}),[w,x]=v.useState(!1),S=Vr(l),O=wB(n),E=v.useRef(!1),[C,P]=v.useState(0);return v.useEffect(()=>{const M=h.current;if(M)return M.addEventListener(TS,S),()=>M.removeEventListener(TS,S)},[S]),I.jsx(Dfe,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:y,onItemFocus:v.useCallback(M=>b(M),[b]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>P(M=>M+1),[]),onFocusableItemRemove:v.useCallback(()=>P(M=>M-1),[]),children:I.jsx(gt.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:Ye(e.onMouseDown,()=>{E.current=!0}),onFocus:Ye(e.onFocus,M=>{const N=!E.current;if(M.target===M.currentTarget&&N&&!w){const B=new CustomEvent(TS,Tfe);if(M.currentTarget.dispatchEvent(B),!B.defaultPrevented){const V=O().filter(G=>G.focusable),W=V.find(G=>G.active),ne=V.find(G=>G.id===y),q=[W,ne,...V].filter(Boolean).map(G=>G.ref.current);EB(q,c)}}E.current=!1}),onBlur:Ye(e.onBlur,()=>x(!1))})})}),SB="RovingFocusGroupItem",CB=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...a}=e,s=Lo(),u=o||s,l=$fe(SB,n),c=l.currentTabStopId===u,f=wB(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=l;return v.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),I.jsx(hE.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:I.jsx(gt.span,{tabIndex:c?0:-1,"data-orientation":l.orientation,...a,ref:t,onMouseDown:Ye(e.onMouseDown,m=>{r?l.onItemFocus(u):m.preventDefault()}),onFocus:Ye(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:Ye(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){l.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=Ffe(m,l.orientation,l.dir);if(y!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let w=f().filter(x=>x.focusable).map(x=>x.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const x=w.indexOf(m.currentTarget);w=l.loop?jfe(w,x+1):w.slice(x+1)}setTimeout(()=>EB(w))}})})})});CB.displayName=SB;var Nfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Lfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ffe(e,t,n){const r=Lfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Nfe[r]}function EB(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function jfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OB=_B,AB=CB,On=globalThis?.document?v.useLayoutEffect:()=>{};function Bfe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var PB=e=>{const{present:t,children:n}=e,r=Ufe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,zfe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};PB.displayName="Presence";function Ufe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=Bfe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=sy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=sy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=sy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=sy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function sy(e){return e?.animationName||"none"}function zfe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aA="Tabs",[Wfe,PQe]=Di(aA,[fw]),kB=fw(),[Vfe,sA]=Wfe(aA),TB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:s,activationMode:u="automatic",...l}=e,c=Em(s),[f,h]=Ts({prop:r,onChange:i,defaultProp:o});return I.jsx(Vfe,{scope:n,baseId:Lo(),value:f,onValueChange:h,orientation:a,dir:c,activationMode:u,children:I.jsx(gt.div,{dir:c,"data-orientation":a,...l,ref:t})})});TB.displayName=aA;var MB="TabsList",RB=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=sA(MB,n),a=kB(n);return I.jsx(OB,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:I.jsx(gt.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});RB.displayName=MB;var DB="TabsTrigger",$B=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=sA(DB,n),s=kB(n),u=LB(a.baseId,r),l=FB(a.baseId,r),c=r===a.value;return I.jsx(AB,{asChild:!0,...s,focusable:!i,active:c,children:I.jsx(gt.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":l,"data-state":c?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Ye(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?a.onValueChange(r):f.preventDefault()}),onKeyDown:Ye(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(r)}),onFocus:Ye(e.onFocus,()=>{const f=a.activationMode!=="manual";!c&&!i&&f&&a.onValueChange(r)})})})});$B.displayName=DB;var IB="TabsContent",NB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,s=sA(IB,n),u=LB(s.baseId,r),l=FB(s.baseId,r),c=r===s.value,f=v.useRef(c);return v.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),I.jsx(PB,{present:i||c,children:({present:h})=>I.jsx(gt.div,{"data-state":c?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!h,id:l,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&o})})});NB.displayName=IB;function LB(e,t){return`${e}-trigger-${t}`}function FB(e,t){return`${e}-content-${t}`}var kQe=TB,TQe=RB,MQe=$B,RQe=NB,Ih=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Kc=typeof window>"u"||"Deno"in globalThis;function oa(){}function Hfe(e,t){return typeof e=="function"?e(t):e}function pE(e){return typeof e=="number"&&e>=0&&e!==1/0}function jB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function kd(e,t){return typeof e=="function"?e(t):e}function La(e,t){return typeof e=="function"?e(t):e}function hR(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==uA(a,t.options))return!1}else if(!pg(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function pR(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Gc(t.options.mutationKey)!==Gc(o))return!1}else if(!pg(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function uA(e,t){return(t?.queryKeyHashFn||Gc)(e)}function Gc(e){return JSON.stringify(e,(t,n)=>gE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function pg(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!pg(e[n],t[n])):!1}function BB(e,t){if(e===t)return e;const n=gR(e)&&gR(t);if(n||gE(e)&&gE(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),a=o.length,s=n?[]:{};let u=0;for(let l=0;l{setTimeout(t,e)})}function mE(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?BB(e,t):t}function Kfe(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Gfe(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var lA=Symbol();function UB(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===lA?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Yfe=class extends Ih{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!Kc&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},cA=new Yfe,Zfe=class extends Ih{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!Kc&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},cb=new Zfe;function vE(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function Xfe(e){return Math.min(1e3*2**e,3e4)}function zB(e){return(e??"online")==="online"?cb.isOnline():!0}var WB=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function MS(e){return e instanceof WB}function VB(e){let t=!1,n=0,r=!1,i;const o=vE(),a=y=>{r||(h(new WB(y)),e.abort?.())},s=()=>{t=!0},u=()=>{t=!1},l=()=>cA.isFocused()&&(e.networkMode==="always"||cb.isOnline())&&e.canRun(),c=()=>zB(e.networkMode)&&e.canRun(),f=y=>{r||(r=!0,e.onSuccess?.(y),i?.(),o.resolve(y))},h=y=>{r||(r=!0,e.onError?.(y),i?.(),o.reject(y))},p=()=>new Promise(y=>{i=b=>{(r||l())&&y(b)},e.onPause?.()}).then(()=>{i=void 0,r||e.onContinue?.()}),m=()=>{if(r)return;let y;const b=n===0?e.initialPromise:void 0;try{y=b??e.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(f).catch(w=>{if(r)return;const x=e.retry??(Kc?0:3),S=e.retryDelay??Xfe,O=typeof S=="function"?S(n,w):S,E=x===!0||typeof x=="number"&&nl()?void 0:p()).then(()=>{t?h(w):m()})})};return{promise:o,cancel:a,continue:()=>(i?.(),o),cancelRetry:s,continueRetry:u,canStart:c,start:()=>(c()?m():p().then(m),o)}}function Qfe(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=s=>setTimeout(s,0);const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(u=>{n(u)})})})};return{batch:s=>{let u;t++;try{u=s()}finally{t--,t||a()}return u},batchCalls:s=>(...u)=>{o(()=>{s(...u)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Wr=Qfe(),HB=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pE(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kc?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Jfe=class extends HB{#e;#t;#r;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ede(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=mE(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(oa).catch(oa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>La(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lA||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||!jB(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(u=>u.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,r=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const s=UB(this.options,t),u={queryKey:this.queryKey,meta:this.meta};return r(u),this.#o=!1,this.options.persister?this.options.persister(s,u,this):s(u)},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};r(o),this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#i({type:"fetch",meta:o.fetchOptions?.meta});const a=s=>{MS(s)&&s.silent||this.#i({type:"error",error:s}),MS(s)||(this.#r.config.onError?.(s,this),this.#r.config.onSettled?.(this.state.data,s,this)),this.scheduleGc()};return this.#n=VB({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:s=>{if(s===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(s)}catch(u){a(u);return}this.#r.config.onSuccess?.(s,this),this.#r.config.onSettled?.(s,this.state.error,this),this.scheduleGc()},onError:a,onFail:(s,u)=>{this.#i({type:"failed",failureCount:s,error:u})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#n.start()}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...qB(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return MS(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Wr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function qB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ede(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 tde=class extends Ih{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??uA(r,t);let o=this.get(i);return o||(o=new Jfe({cache:this,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Wr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>hR(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>hR(e,n)):t}notify(e){Wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Wr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},nde=class extends HB{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||KB(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=VB({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,i)=>{this.#n({type:"failed",failureCount:r,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const t=this.state.status==="pending",n=!this.#r.canStart();try{if(!t){this.#n({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);const i=await this.options.onMutate?.(e);i!==this.state.context&&this.#n({type:"pending",context:i,variables:e,isPaused:n})}const r=await this.#r.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#n({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#n({type:"error",error:r})}}finally{this.#t.runNext(this)}}#n(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Wr.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function KB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rde=class extends Ih{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new nde({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=uy(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=uy(e);if(this.#e.has(t)){const n=this.#e.get(t)?.filter(r=>r!==e);n&&(n.length===0?this.#e.delete(t):this.#e.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#e.get(uy(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(uy(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){Wr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#e.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(n=>pR(t,n))}findAll(e={}){return this.getAll().filter(t=>pR(e,t))}notify(e){Wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Wr.batch(()=>Promise.all(e.map(t=>t.continue().catch(oa))))}};function uy(e){return e.options.scope?.id??String(e.mutationId)}function vR(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},u=0;const l=async()=>{let c=!1;const f=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},h=UB(t.options,t.fetchOptions),p=async(m,y,b)=>{if(c)return Promise.reject();if(y==null&&m.pages.length)return Promise.resolve(m);const w={queryKey:t.queryKey,pageParam:y,direction:b?"backward":"forward",meta:t.options.meta};f(w);const x=await h(w),{maxPages:S}=t.options,O=b?Gfe:Kfe;return{pages:O(m.pages,x,S),pageParams:O(m.pageParams,y,S)}};if(i&&o.length){const m=i==="backward",y=m?ide:yR,b={pages:o,pageParams:a},w=y(r,b);s=await p(b,w,m)}else{const m=e??o.length;do{const y=u===0?a[0]??r.initialPageParam:yR(r,s);if(u>0&&y==null)break;s=await p(s,y),u++}while(ut.options.persister?.(l,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function yR(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ide(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var DQe=class{#e;#t;#r;#n;#a;#o;#i;#s;constructor(e={}){this.#e=e.queryCache||new tde,this.#t=e.mutationCache||new rde,this.#r=e.defaultOptions||{},this.#n=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#i=cA.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=cb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(kd(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=Hfe(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Wr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Wr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return Wr.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Wr.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(oa).catch(oa)}invalidateQueries(e,t={}){return Wr.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none")return Promise.resolve();const n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Wr.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(oa)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(oa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(kd(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(oa).catch(oa)}fetchInfiniteQuery(e){return e.behavior=vR(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(oa).catch(oa)}ensureInfiniteQueryData(e){return e.behavior=vR(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cb.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(Gc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()],n={};return t.forEach(r=>{pg(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(Gc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()];let n={};return t.forEach(r=>{pg(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uA(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===lA&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},ode=class extends Ih{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#i=vE(),this.options.experimental_prefetchInRender||this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#n=void 0;#a;#o;#i;#s;#g;#d;#h;#l;#c;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),bR(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yE(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yE(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e,t){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof La(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),n._defaulted&&!lb(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&xR(this.#t,r,this.options,n)&&this.#f(),this.updateResult(t),i&&(this.#t!==r||La(this.options.enabled,this.#t)!==La(n.enabled,this.#t)||kd(this.options.staleTime,this.#t)!==kd(n.staleTime,this.#t))&&this.#m();const o=this.#v();i&&(this.#t!==r||La(this.options.enabled,this.#t)!==La(n.enabled,this.#t)||o!==this.#u)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return sde(this,n)&&(this.#n=n,this.#o=this.options,this.#a=this.#t.state),n}getCurrentResult(){return this.#n}trackResult(e,t){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#f(e){this.#_();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(oa)),t}#m(){this.#x();const e=kd(this.options.staleTime,this.#t);if(Kc||this.#n.isStale||!pE(e))return;const n=jB(this.#n.dataUpdatedAt,e)+1;this.#l=setTimeout(()=>{this.#n.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#u=e,!(Kc||La(this.options.enabled,this.#t)===!1||!pE(this.#u)||this.#u===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||cA.isFocused())&&this.#f()},this.#u))}#b(){this.#m(),this.#y(this.#v())}#x(){this.#l&&(clearTimeout(this.#l),this.#l=void 0)}#w(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#n,o=this.#a,a=this.#o,u=e!==n?e.state:this.#r,{state:l}=e;let c={...l},f=!1,h;if(t._optimisticResults){const P=this.hasListeners(),M=!P&&bR(e,t),N=P&&xR(e,n,t,r);(M||N)&&(c={...c,...qB(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:y}=c;if(t.select&&c.data!==void 0)if(i&&c.data===o?.data&&t.select===this.#g)h=this.#d;else try{this.#g=t.select,h=t.select(c.data),h=mE(i?.data,h,t),this.#d=h,this.#s=null}catch(P){this.#s=P}else h=c.data;if(t.placeholderData!==void 0&&h===void 0&&y==="pending"){let P;if(i?.isPlaceholderData&&t.placeholderData===a?.placeholderData)P=i.data;else if(P=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,t.select&&P!==void 0)try{P=t.select(P),this.#s=null}catch(M){this.#s=M}P!==void 0&&(y="success",h=mE(i?.data,P,t),f=!0)}this.#s&&(p=this.#s,h=this.#d,m=Date.now(),y="error");const b=c.fetchStatus==="fetching",w=y==="pending",x=y==="error",S=w&&b,O=h!==void 0,C={status:y,fetchStatus:c.fetchStatus,isPending:w,isSuccess:y==="success",isError:x,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:c.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:x&&!O,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&O,isStale:fA(e,t),refetch:this.refetch,promise:this.#i};if(this.options.experimental_prefetchInRender){const P=B=>{C.status==="error"?B.reject(C.error):C.data!==void 0&&B.resolve(C.data)},M=()=>{const B=this.#i=C.promise=vE();P(B)},N=this.#i;switch(N.status){case"pending":e.queryHash===n.queryHash&&P(N);break;case"fulfilled":(C.status==="error"||C.data!==N.value)&&M();break;case"rejected":(C.status!=="error"||C.error!==N.reason)&&M();break}}return C}updateResult(e){const t=this.#n,n=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#t),lb(n,t))return;this.#n=n;const r={},i=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!this.#p.size)return!0;const s=new Set(a??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#n).some(u=>{const l=u;return this.#n[l]!==t[l]&&s.has(l)})};e?.listeners!==!1&&i()&&(r.listeners=!0),this.#S({...r,...e})}#_(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){Wr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function ade(e,t){return La(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function bR(e,t){return ade(e,t)||e.state.data!==void 0&&yE(e,t,t.refetchOnMount)}function yE(e,t,n){if(La(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fA(e,t)}return!1}function xR(e,t,n,r){return(e!==t||La(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&fA(e,n)}function fA(e,t){return La(t.enabled,e)!==!1&&e.isStaleByTime(kd(t.staleTime,e))}function sde(e,t){return!lb(e.getCurrentResult(),t)}var ude=class extends Ih{#e;#t=void 0;#r;#n;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),lb(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),n?.mutationKey&&this.options.mutationKey&&Gc(n.mutationKey)!==Gc(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#a(),this.#o()}mutate(t,n){return this.#n=n,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#a(){const t=this.#r?.state??KB();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Wr.batch(()=>{if(this.#n&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context;t?.type==="success"?(this.#n.onSuccess?.(t.data,n,r),this.#n.onSettled?.(t.data,null,n,r)):t?.type==="error"&&(this.#n.onError?.(t.error,n,r),this.#n.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#t)})})}},GB=v.createContext(void 0),YB=e=>{const t=v.useContext(GB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},IQe=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),I.jsx(GB.Provider,{value:e,children:t})),ZB=v.createContext(!1),lde=()=>v.useContext(ZB);ZB.Provider;function cde(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var fde=v.createContext(cde()),dde=()=>v.useContext(fde);function XB(e,t){return typeof e=="function"?e(...t):!!e}function bE(){}var hde=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},pde=e=>{v.useEffect(()=>{e.clearReset()},[e])},gde=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&XB(n,[e.error,r]),mde=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},vde=(e,t)=>e.isLoading&&e.isFetching&&!t,yde=(e,t)=>e?.suspense&&t.isPending,wR=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bde(e,t,n){const r=YB(),i=lde(),o=dde(),a=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=i?"isRestoring":"optimistic",mde(a),hde(a,o),pde(o);const s=!r.getQueryCache().get(a.queryHash),[u]=v.useState(()=>new t(r,a)),l=u.getOptimisticResult(a);if(v.useSyncExternalStore(v.useCallback(c=>{const f=i?bE:u.subscribe(Wr.batchCalls(c));return u.updateResult(),f},[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),v.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),yde(a,l))throw wR(a,u,o);if(gde({result:l,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!Kc&&vde(l,i)&&(s?wR(a,u,o):r.getQueryCache().get(a.queryHash)?.promise)?.catch(bE).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?l:u.trackResult(l)}function NQe(e,t){return bde(e,ode)}function LQe(e,t){const n=YB(),[r]=v.useState(()=>new ude(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(a=>r.subscribe(Wr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((a,s)=>{r.mutate(a,s).catch(bE)},[r]);if(i.error&&XB(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var QB={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(la,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",u="hour",l="day",c="week",f="month",h="quarter",p="year",m="date",y="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var q=["th","st","nd","rd"],G=Z%100;return"["+Z+(q[(G-20)%10]||q[G]||q[0])+"]"}},S=function(Z,q,G){var H=String(Z);return!H||H.length>=q?Z:""+Array(q+1-H.length).join(G)+Z},O={s:S,z:function(Z){var q=-Z.utcOffset(),G=Math.abs(q),H=Math.floor(G/60),j=G%60;return(q<=0?"+":"-")+S(H,2,"0")+":"+S(j,2,"0")},m:function Z(q,G){if(q.date()1)return Z(Y[0])}else{var oe=q.name;C[oe]=q,j=oe}return!H&&j&&(E=j),j||!H&&E},B=function(Z,q){if(M(Z))return Z.clone();var G=typeof q=="object"?q:{};return G.date=Z,G.args=arguments,new W(G)},V=O;V.l=N,V.i=M,V.w=function(Z,q){return B(Z,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var W=function(){function Z(G){this.$L=N(G.locale,null,!0),this.parse(G),this.$x=this.$x||G.x||{},this[P]=!0}var q=Z.prototype;return q.parse=function(G){this.$d=function(H){var j=H.date,K=H.utc;if(j===null)return new Date(NaN);if(V.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var Y=j.match(b);if(Y){var oe=Y[2]-1||0,X=(Y[7]||"0").substring(0,3);return K?new Date(Date.UTC(Y[1],oe,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,X)):new Date(Y[1],oe,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,X)}}return new Date(j)}(G),this.init()},q.init=function(){var G=this.$d;this.$y=G.getFullYear(),this.$M=G.getMonth(),this.$D=G.getDate(),this.$W=G.getDay(),this.$H=G.getHours(),this.$m=G.getMinutes(),this.$s=G.getSeconds(),this.$ms=G.getMilliseconds()},q.$utils=function(){return V},q.isValid=function(){return this.$d.toString()!==y},q.isSame=function(G,H){var j=B(G);return this.startOf(H)<=j&&j<=this.endOf(H)},q.isAfter=function(G,H){return B(G){let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var VM={notify(){},get:()=>[]};function Cue(e,t){let n,r=VM,i=0,o=!1;function a(y){c();const b=r.subscribe(y);let w=!1;return()=>{w||(w=!0,b(),f())}}function s(){r.notify()}function u(){m.onStateChange&&m.onStateChange()}function l(){return o}function c(){i++,n||(n=e.subscribe(u),r=Sue())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=VM)}function h(){o||(o=!0,c())}function p(){o&&(o=!1,f())}const m={addNestedSub:a,notifyNestedSubs:s,handleChangeWrapper:u,isSubscribed:l,trySubscribe:h,tryUnsubscribe:p,getListeners:()=>r};return m}var Eue=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Oue=Eue(),Aue=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Pue=Aue(),kue=()=>Oue||Pue?v.useLayoutEffect:v.useEffect,Tue=kue(),Mue=Symbol.for("react-redux-context"),Rue=typeof globalThis<"u"?globalThis:{};function Due(){if(!v.createContext)return{};const e=Rue[Mue]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var Al=Due();function $ue(e){const{children:t,context:n,serverState:r,store:i}=e,o=v.useMemo(()=>{const u=Cue(i);return{store:i,subscription:u,getServerState:r?()=>r:void 0}},[i,r]),a=v.useMemo(()=>i.getState(),[i]);Tue(()=>{const{subscription:u}=o;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==i.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[o,a]);const s=n||Al;return v.createElement(s.Provider,{value:o},t)}var NXe=$ue;function YO(e=Al){return function(){return v.useContext(e)}}var kj=YO();function Tj(e=Al){const t=e===Al?kj:YO(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var Iue=Tj();function Nue(e=Al){const t=e===Al?Iue:Tj(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var LXe=Nue(),Lue=(e,t)=>e===t;function Fue(e=Al){const t=e===Al?kj:YO(e),n=(r,i={})=>{const{equalityFn:o=Lue}=typeof i=="function"?{equalityFn:i}:i,a=t(),{store:s,subscription:u,getServerState:l}=a;v.useRef(!0);const c=v.useCallback({[r.name](h){return r(h)}}[r.name],[r]),f=wue.useSyncExternalStoreWithSelector(u.addNestedSub,s.getState,l||s.getState,c,o);return v.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var FXe=Fue();function HM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sw(...e){return t=>{let n=!1;const r=e.map(i=>{const o=HM(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:n,...r}=e,i=v.Children.toArray(n),o=i.find(jue);if(o){const a=o.props.children,s=i.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return I.jsx(rE,{...r,ref:t,children:v.isValidElement(a)?v.cloneElement(a,void 0,s):null})}return I.jsx(rE,{...r,ref:t,children:n})});Pl.displayName="Slot";var rE=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const i=Uue(n);return v.cloneElement(n,{...Bue(r,n.props),ref:t?sw(t,i):i})}return v.Children.count(n)>1?v.Children.only(null):null});rE.displayName="SlotClone";var ZO=({children:e})=>I.jsx(I.Fragment,{children:e});function jue(e){return v.isValidElement(e)&&e.type===ZO}function Bue(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Uue(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mj(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,KM=dn,jXe=(e,t)=>n=>{var r;if(t?.variants==null)return KM(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(l=>{const c=n?.[l],f=o?.[l];if(c===null)return null;const h=qM(c)||qM(f);return i[l][h]}),s=n&&Object.entries(n).reduce((l,c)=>{let[f,h]=c;return h===void 0||(l[f]=h),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,c)=>{let{class:f,className:h,...p}=c;return Object.entries(p).every(m=>{let[y,b]=m;return Array.isArray(b)?b.includes({...o,...s}[y]):{...o,...s}[y]===b})?[...l,f,h]:l},[]);return KM(e,a,u,n?.class,n?.className)},XO="-",zue=e=>{const t=Vue(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(XO);return s[0]===""&&s.length!==1&&s.shift(),Rj(s,t)||Wue(a)},getConflictingClassGroupIds:(a,s)=>{const u=n[a]||[];return s&&r[a]?[...u,...r[a]]:u}}},Rj=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Rj(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(XO);return t.validators.find(({validator:a})=>a(o))?.classGroupId},GM=/^\[(.+)\]$/,Wue=e=>{if(GM.test(e)){const t=GM.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Vue=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return que(Object.entries(e.classGroups),n).forEach(([o,a])=>{iE(a,r,o,t)}),r},iE=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:YM(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Hue(i)){iE(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{iE(a,YM(t,o),n,r)})})},YM=(e,t)=>{let n=e;return t.split(XO).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Hue=e=>e.isThemeGetter,que=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,Kue=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},Dj="!",Gue=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const u=[];let l=0,c=0,f;for(let b=0;bc?f-c:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}};return n?s=>n({className:s,parseClassName:a}):a},Yue=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Zue=e=>({cache:Kue(e.cacheSize),parseClassName:Gue(e),...zue(e)}),Xue=/\s+/,Que=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(Xue);let s="";for(let u=a.length-1;u>=0;u-=1){const l=a[u],{modifiers:c,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(l);let m=!!p,y=r(m?h.substring(0,p):h);if(!y){if(!m){s=l+(s.length>0?" "+s:s);continue}if(y=r(h),!y){s=l+(s.length>0?" "+s:s);continue}m=!1}const b=Yue(c).join(":"),w=f?b+Dj:b,x=w+y;if(o.includes(x))continue;o.push(x);const S=i(y,m);for(let O=0;O0?" "+s:s)}return s};function Jue(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rf(c),e());return n=Zue(l),r=n.cache.get,i=n.cache.set,o=s,s(u)}function s(u){const l=r(u);if(l)return l;const c=Que(u,n);return i(u,c),c}return function(){return o(Jue.apply(null,arguments))}}const Jn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ij=/^\[(?:([a-z-]+):)?(.+)\]$/i,tle=/^\d+\/\d+$/,nle=new Set(["px","full","screen"]),rle=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ile=/\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$/,ole=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ale=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sle=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>Ad(e)||nle.has(e)||tle.test(e),Vu=e=>$h(e,"length",gle),Ad=e=>!!e&&!Number.isNaN(Number(e)),ES=e=>$h(e,"number",Ad),Dp=e=>!!e&&Number.isInteger(Number(e)),ule=e=>e.endsWith("%")&&Ad(e.slice(0,-1)),Qt=e=>Ij.test(e),Hu=e=>rle.test(e),lle=new Set(["length","size","percentage"]),cle=e=>$h(e,lle,Nj),fle=e=>$h(e,"position",Nj),dle=new Set(["image","url"]),hle=e=>$h(e,dle,vle),ple=e=>$h(e,"",mle),$p=()=>!0,$h=(e,t,n)=>{const r=Ij.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},gle=e=>ile.test(e)&&!ole.test(e),Nj=()=>!1,mle=e=>ale.test(e),vle=e=>sle.test(e),yle=()=>{const e=Jn("colors"),t=Jn("spacing"),n=Jn("blur"),r=Jn("brightness"),i=Jn("borderColor"),o=Jn("borderRadius"),a=Jn("borderSpacing"),s=Jn("borderWidth"),u=Jn("contrast"),l=Jn("grayscale"),c=Jn("hueRotate"),f=Jn("invert"),h=Jn("gap"),p=Jn("gradientColorStops"),m=Jn("gradientColorStopPositions"),y=Jn("inset"),b=Jn("margin"),w=Jn("opacity"),x=Jn("padding"),S=Jn("saturate"),O=Jn("scale"),E=Jn("sepia"),C=Jn("skew"),P=Jn("space"),M=Jn("translate"),N=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",Qt,t],W=()=>[Qt,t],ne=()=>["",qs,Vu],Z=()=>["auto",Ad,Qt],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Qt],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],oe=()=>[Ad,Qt];return{cacheSize:500,separator:":",theme:{colors:[$p],spacing:[qs,Vu],blur:["none","",Hu,Qt],brightness:oe(),borderColor:[e],borderRadius:["none","","full",Hu,Qt],borderSpacing:W(),borderWidth:ne(),contrast:oe(),grayscale:K(),hueRotate:oe(),invert:K(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[ule,Vu],inset:V(),margin:V(),opacity:oe(),padding:W(),saturate:oe(),scale:oe(),sepia:K(),skew:oe(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",Qt]}],container:["container"],columns:[{columns:[Hu]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"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:[...q(),Qt]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dp,Qt]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Qt]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",Dp,Qt]}],"grid-cols":[{"grid-cols":[$p]}],"col-start-end":[{col:["auto",{span:["full",Dp,Qt]},Qt]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[$p]}],"row-start-end":[{row:["auto",{span:[Dp,Qt]},Qt]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Qt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Qt]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Qt,t]}],"min-w":[{"min-w":[Qt,t,"min","max","fit"]}],"max-w":[{"max-w":[Qt,t,"none","full","min","max","fit","prose",{screen:[Hu]},Hu]}],h:[{h:[Qt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Qt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Qt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Qt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Hu,Vu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ES]}],"font-family":[{font:[$p]}],"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",Qt]}],"line-clamp":[{"line-clamp":["none",Ad,ES]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qs,Qt]}],"list-image":[{"list-image":["none",Qt]}],"list-style-type":[{list:["none","disc","decimal",Qt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qs,Vu]}],"underline-offset":[{"underline-offset":["auto",qs,Qt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qt]}],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",Qt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),fle]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cle]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hle]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:G()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[qs,Qt]}],"outline-w":[{outline:[qs,Vu]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[qs,Vu]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Hu,ple]}],"shadow-color":[{shadow:[$p]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Hu,Qt]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"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",Qt]}],duration:[{duration:oe()}],ease:[{ease:["linear","in","out","in-out",Qt]}],delay:[{delay:oe()}],animate:[{animate:["none","spin","ping","pulse","bounce",Qt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[Dp,Qt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Qt]}],accent:[{accent:["auto",e]}],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",Qt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"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",Qt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[qs,Vu,ES]}],stroke:[{stroke:[e,"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"]}}},BXe=ele(yle);var Lj={exports:{}},ble="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xle=ble,wle=xle;function Fj(){}function jj(){}jj.resetWarningCache=Fj;var _le=function(){function e(r,i,o,a,s,u){if(u!==wle){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:jj,resetWarningCache:Fj};return n.PropTypes=n,n};Lj.exports=_le();var Sle=Lj.exports;const Rt=kn(Sle);var Cle={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"},Ele=Object.defineProperty,Ole=Object.defineProperties,Ale=Object.getOwnPropertyDescriptors,X1=Object.getOwnPropertySymbols,Bj=Object.prototype.hasOwnProperty,Uj=Object.prototype.propertyIsEnumerable,ZM=(e,t,n)=>t in e?Ele(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XM=(e,t)=>{for(var n in t||(t={}))Bj.call(t,n)&&ZM(e,n,t[n]);if(X1)for(var n of X1(t))Uj.call(t,n)&&ZM(e,n,t[n]);return e},Ple=(e,t)=>Ole(e,Ale(t)),kle=(e,t)=>{var n={};for(var r in e)Bj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&X1)for(var r of X1(e))t.indexOf(r)<0&&Uj.call(e,r)&&(n[r]=e[r]);return n},xn=(e,t,n)=>{const r=v.forwardRef((i,o)=>{var a=i,{color:s="currentColor",size:u=24,stroke:l=2,children:c}=a,f=kle(a,["color","size","stroke","children"]);return v.createElement("svg",XM(Ple(XM({ref:o},Cle),{width:u,height:u,stroke:s,strokeWidth:l,className:`tabler-icon tabler-icon-${e}`}),f),[...n.map(([h,p])=>v.createElement(h,p)),...c||[]])});return r.propTypes={color:Rt.string,size:Rt.oneOfType([Rt.string,Rt.number]),stroke:Rt.oneOfType([Rt.string,Rt.number])},r.displayName=`${t}`,r},UXe=xn("adjustments","IconAdjustments",[["path",{d:"M4 10a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M6 4v4",key:"svg-1"}],["path",{d:"M6 12v8",key:"svg-2"}],["path",{d:"M10 16a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-3"}],["path",{d:"M12 4v10",key:"svg-4"}],["path",{d:"M12 18v2",key:"svg-5"}],["path",{d:"M16 7a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-6"}],["path",{d:"M18 4v1",key:"svg-7"}],["path",{d:"M18 9v11",key:"svg-8"}]]),zXe=xn("brand-telegram","IconBrandTelegram",[["path",{d:"M15 10l-4 4l6 6l4 -16l-18 7l4 2l2 6l3 -4",key:"svg-0"}]]),WXe=xn("building-store","IconBuildingStore",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M3 7v1a3 3 0 0 0 6 0v-1m0 1a3 3 0 0 0 6 0v-1m0 1a3 3 0 0 0 6 0v-1h-18l2 -4h14l2 4",key:"svg-1"}],["path",{d:"M5 21l0 -10.15",key:"svg-2"}],["path",{d:"M19 21l0 -10.15",key:"svg-3"}],["path",{d:"M9 21v-4a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v4",key:"svg-4"}]]),VXe=xn("building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]),HXe=xn("cash","IconCash",[["path",{d:"M7 9m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M14 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M17 9v-2a2 2 0 0 0 -2 -2h-10a2 2 0 0 0 -2 2v6a2 2 0 0 0 2 2h2",key:"svg-2"}]]),qXe=xn("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),KXe=xn("chevrons-left","IconChevronsLeft",[["path",{d:"M11 7l-5 5l5 5",key:"svg-0"}],["path",{d:"M17 7l-5 5l5 5",key:"svg-1"}]]),GXe=xn("copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]),YXe=xn("credit-card","IconCreditCard",[["path",{d:"M3 5m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M3 10l18 0",key:"svg-1"}],["path",{d:"M7 15l.01 0",key:"svg-2"}],["path",{d:"M11 15l2 0",key:"svg-3"}]]),ZXe=xn("dashboard","IconDashboard",[["path",{d:"M12 13m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M13.45 11.55l2.05 -2.05",key:"svg-1"}],["path",{d:"M6.4 20a9 9 0 1 1 11.2 0z",key:"svg-2"}]]),XXe=xn("device-desktop","IconDeviceDesktop",[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10z",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}]]),QXe=xn("discount-check","IconDiscountCheck",[["path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]),JXe=xn("eye-off","IconEyeOff",[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]),eQe=xn("eye","IconEye",[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]]),tQe=xn("file-text","IconFileText",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]]),nQe=xn("loader-2","IconLoader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]),rQe=xn("lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]),iQe=xn("mail","IconMail",[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]]),oQe=xn("menu-2","IconMenu2",[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]]),aQe=xn("moon","IconMoon",[["path",{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z",key:"svg-0"}]]),sQe=xn("news","IconNews",[["path",{d:"M16 6h3a1 1 0 0 1 1 1v11a2 2 0 0 1 -4 0v-13a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1v12a3 3 0 0 0 3 3h11",key:"svg-0"}],["path",{d:"M8 8l4 0",key:"svg-1"}],["path",{d:"M8 12l4 0",key:"svg-2"}],["path",{d:"M8 16l4 0",key:"svg-3"}]]),uQe=xn("route","IconRoute",[["path",{d:"M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4z",key:"svg-1"}],["path",{d:"M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5",key:"svg-2"}]]),lQe=xn("server-bolt","IconServerBolt",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M15 20h-9a3 3 0 0 1 -3 -3v-2a3 3 0 0 1 3 -3h12",key:"svg-1"}],["path",{d:"M7 8v.01",key:"svg-2"}],["path",{d:"M7 16v.01",key:"svg-3"}],["path",{d:"M20 15l-2 3h3l-2 3",key:"svg-4"}]]),cQe=xn("server","IconServer",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M3 12m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-1"}],["path",{d:"M7 8l0 .01",key:"svg-2"}],["path",{d:"M7 16l0 .01",key:"svg-3"}]]),fQe=xn("settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]),dQe=xn("sun","IconSun",[["path",{d:"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7",key:"svg-1"}]]),hQe=xn("template","IconTemplate",[["path",{d:"M4 4m0 1a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M4 12m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M14 12l6 0",key:"svg-2"}],["path",{d:"M14 16l6 0",key:"svg-3"}],["path",{d:"M14 20l6 0",key:"svg-4"}]]),pQe=xn("ticket","IconTicket",[["path",{d:"M15 5l0 2",key:"svg-0"}],["path",{d:"M15 11l0 2",key:"svg-1"}],["path",{d:"M15 17l0 2",key:"svg-2"}],["path",{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2",key:"svg-3"}]]),gQe=xn("user-circle","IconUserCircle",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 10m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855",key:"svg-2"}]]),mQe=xn("user","IconUser",[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]]),vQe=xn("users","IconUsers",[["path",{d:"M9 7m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"svg-2"}],["path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85",key:"svg-3"}]]),yQe=xn("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]),Tle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],mt=Tle.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Pl:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function zj(e,t){e&&Au.flushSync(()=>e.dispatchEvent(t))}var Mle="Separator",QM="horizontal",Rle=["horizontal","vertical"],Wj=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=QM,...i}=e,o=Dle(r)?r:QM,s=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return I.jsx(mt.div,{"data-orientation":o,...s,...i,ref:t})});Wj.displayName=Mle;function Dle(e){return Rle.includes(e)}var bQe=Wj,Sm=e=>e.type==="checkbox",_c=e=>e instanceof Date,Bi=e=>e==null;const Vj=e=>typeof e=="object";var Ar=e=>!Bi(e)&&!Array.isArray(e)&&Vj(e)&&!_c(e),Hj=e=>Ar(e)&&e.target?Sm(e.target)?e.target.checked:e.target.value:e,$le=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qj=(e,t)=>e.has($le(t)),Ile=e=>{const t=e.constructor&&e.constructor.prototype;return Ar(t)&&t.hasOwnProperty("isPrototypeOf")},QO=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function to(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(QO&&(e instanceof Blob||r))&&(n||Ar(e)))if(t=n?[]:{},!n&&!Ile(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=to(e[i]));else return e;return t}var uw=e=>Array.isArray(e)?e.filter(Boolean):[],Cr=e=>e===void 0,Xe=(e,t,n)=>{if(!t||!Ar(e))return n;const r=uw(t.split(/[,[\].]+?/)).reduce((i,o)=>Bi(i)?i:i[o],e);return Cr(r)||r===e?Cr(e[t])?n:e[t]:r},aa=e=>typeof e=="boolean",JO=e=>/^\w*$/.test(e),Kj=e=>uw(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pn=(e,t,n)=>{let r=-1;const i=JO(t)?[t]:Kj(t),o=i.length,a=o-1;for(;++rF.useContext(Gj),xQe=e=>{const{children:t,...n}=e;return F.createElement(Gj.Provider,{value:n},t)};var Yj=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Fa.all&&(t._proxyFormState[a]=!r||Fa.all),n&&(n[a]=!0),e[a]}});return i},ro=e=>Ar(e)&&!Object.keys(e).length,Zj=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return ro(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||Fa.all))},_0=e=>Array.isArray(e)?e:[e],Xj=(e,t,n)=>!e||!t||e===t||_0(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function tA(e){const t=F.useRef(e);t.current=e,F.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function Nle(e){const t=eA(),{control:n=t.control,disabled:r,name:i,exact:o}=e,[a,s]=F.useState(n._formState),u=F.useRef(!0),l=F.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=F.useRef(i);return c.current=i,tA({disabled:r,next:f=>u.current&&Xj(c.current,f.name,o)&&Zj(f,l.current,n._updateFormState)&&s({...n._formState,...f}),subject:n._subjects.state}),F.useEffect(()=>(u.current=!0,l.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),F.useMemo(()=>Yj(a,n,l.current,!1),[a,n])}var gs=e=>typeof e=="string",Qj=(e,t,n,r,i)=>gs(e)?(r&&t.watch.add(e),Xe(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Xe(n,o))):(r&&(t.watchAll=!0),n);function Lle(e){const t=eA(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a}=e,s=F.useRef(r);s.current=r,tA({disabled:o,subject:n._subjects.values,next:c=>{Xj(s.current,c.name,a)&&l(to(Qj(s.current,n._names,c.values||n._formValues,!1,i)))}});const[u,l]=F.useState(n._getWatch(r,i));return F.useEffect(()=>n._removeUnmounted()),u}function Fle(e){const t=eA(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o}=e,a=qj(i._names.array,n),s=Lle({control:i,name:n,defaultValue:Xe(i._formValues,n,Xe(i._defaultValues,n,e.defaultValue)),exact:!0}),u=Nle({control:i,name:n,exact:!0}),l=F.useRef(i.register(n,{...e.rules,value:s,...aa(e.disabled)?{disabled:e.disabled}:{}})),c=F.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Xe(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Xe(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Xe(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Xe(u.validatingFields,n)},error:{enumerable:!0,get:()=>Xe(u.errors,n)}}),[u,n]),f=F.useMemo(()=>({name:n,value:s,...aa(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h=>l.current.onChange({target:{value:Hj(h),name:n},type:Q1.CHANGE}),onBlur:()=>l.current.onBlur({target:{value:Xe(i._formValues,n),name:n},type:Q1.BLUR}),ref:h=>{const p=Xe(i._fields,n);p&&h&&(p._f.ref={focus:()=>h.focus(),select:()=>h.select(),setCustomValidity:m=>h.setCustomValidity(m),reportValidity:()=>h.reportValidity()})}}),[n,i._formValues,r,u.disabled,s,i._fields]);return F.useEffect(()=>{const h=i._options.shouldUnregister||o,p=(m,y)=>{const b=Xe(i._fields,m);b&&b._f&&(b._f.mount=y)};if(p(n,!0),h){const m=to(Xe(i._options.defaultValues,n));Pn(i._defaultValues,n,m),Cr(Xe(i._formValues,n))&&Pn(i._formValues,n,m)}return!a&&i.register(n),()=>{(a?h&&!i._state.action:h)?i.unregister(n):p(n,!1)}},[n,i,a,o]),F.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),F.useMemo(()=>({field:f,formState:u,fieldState:c}),[f,u,c])}const wQe=e=>e.render(Fle(e));var Jj=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},JM=e=>({isOnSubmit:!e||e===Fa.onSubmit,isOnBlur:e===Fa.onBlur,isOnChange:e===Fa.onChange,isOnAll:e===Fa.all,isOnTouch:e===Fa.onTouched}),eR=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const S0=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Xe(e,i);if(o){const{_f:a,...s}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(S0(s,t))break}else if(Ar(s)&&S0(s,t))break}}};var jle=(e,t,n)=>{const r=_0(Xe(e,n));return Pn(r,"root",t[n]),Pn(e,n,r),e},nA=e=>e.type==="file",ds=e=>typeof e=="function",J1=e=>{if(!QO)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},f1=e=>gs(e),rA=e=>e.type==="radio",eb=e=>e instanceof RegExp;const tR={value:!1,isValid:!1},nR={value:!0,isValid:!0};var eB=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Cr(e[0].attributes.value)?Cr(e[0].value)||e[0].value===""?nR:{value:e[0].value,isValid:!0}:nR:tR}return tR};const rR={isValid:!1,value:null};var tB=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,rR):rR;function iR(e,t,n="validate"){if(f1(e)||Array.isArray(e)&&e.every(f1)||aa(e)&&!e)return{type:n,message:f1(e)?e:"",ref:t}}var Uf=e=>Ar(e)&&!eb(e)?e:{value:e,message:""},oR=async(e,t,n,r,i,o)=>{const{ref:a,refs:s,required:u,maxLength:l,minLength:c,min:f,max:h,pattern:p,validate:m,name:y,valueAsNumber:b,mount:w}=e._f,x=Xe(n,y);if(!w||t.has(y))return{};const S=s?s[0]:a,O=W=>{i&&S.reportValidity&&(S.setCustomValidity(aa(W)?"":W||""),S.reportValidity())},E={},C=rA(a),P=Sm(a),M=C||P,N=(b||nA(a))&&Cr(a.value)&&Cr(x)||J1(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,B=Jj.bind(null,y,r,E),V=(W,ne,Z,q=Ks.maxLength,G=Ks.minLength)=>{const H=W?ne:Z;E[y]={type:W?q:G,message:H,ref:a,...B(W?q:G,H)}};if(o?!Array.isArray(x)||!x.length:u&&(!M&&(N||Bi(x))||aa(x)&&!x||P&&!eB(s).isValid||C&&!tB(s).isValid)){const{value:W,message:ne}=f1(u)?{value:!!u,message:u}:Uf(u);if(W&&(E[y]={type:Ks.required,message:ne,ref:S,...B(Ks.required,ne)},!r))return O(ne),E}if(!N&&(!Bi(f)||!Bi(h))){let W,ne;const Z=Uf(h),q=Uf(f);if(!Bi(x)&&!isNaN(x)){const G=a.valueAsNumber||x&&+x;Bi(Z.value)||(W=G>Z.value),Bi(q.value)||(ne=Gnew Date(new Date().toDateString()+" "+Y),j=a.type=="time",K=a.type=="week";gs(Z.value)&&x&&(W=j?H(x)>H(Z.value):K?x>Z.value:G>new Date(Z.value)),gs(q.value)&&x&&(ne=j?H(x)+W.value,q=!Bi(ne.value)&&x.length<+ne.value;if((Z||q)&&(V(Z,W.message,ne.message),!r))return O(E[y].message),E}if(p&&!N&&gs(x)){const{value:W,message:ne}=Uf(p);if(eb(W)&&!x.match(W)&&(E[y]={type:Ks.pattern,message:ne,ref:a,...B(Ks.pattern,ne)},!r))return O(ne),E}if(m){if(ds(m)){const W=await m(x,n),ne=iR(W,S);if(ne&&(E[y]={...ne,...B(Ks.validate,ne.message)},!r))return O(ne.message),E}else if(Ar(m)){let W={};for(const ne in m){if(!ro(W)&&!r)break;const Z=iR(await m[ne](x,n),S,ne);Z&&(W={...Z,...B(ne,Z.message)},O(Z.message),r&&(E[y]=W))}if(!ro(W)&&(E[y]={ref:S,...W},!r))return E}}return O(!0),E};function Ble(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},oE=e=>Bi(e)||!Vj(e);function nl(e,t){if(oE(e)||oE(t))return e===t;if(_c(e)&&_c(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const a=t[i];if(_c(o)&&_c(a)||Ar(o)&&Ar(a)||Array.isArray(o)&&Array.isArray(a)?!nl(o,a):o!==a)return!1}}return!0}var nB=e=>e.type==="select-multiple",zle=e=>rA(e)||Sm(e),AS=e=>J1(e)&&e.isConnected,rB=e=>{for(const t in e)if(ds(e[t]))return!0;return!1};function tb(e,t={}){const n=Array.isArray(e);if(Ar(e)||n)for(const r in e)Array.isArray(e[r])||Ar(e[r])&&!rB(e[r])?(t[r]=Array.isArray(e[r])?[]:{},tb(e[r],t[r])):Bi(e[r])||(t[r]=!0);return t}function iB(e,t,n){const r=Array.isArray(e);if(Ar(e)||r)for(const i in e)Array.isArray(e[i])||Ar(e[i])&&!rB(e[i])?Cr(t)||oE(n[i])?n[i]=Array.isArray(e[i])?tb(e[i],[]):{...tb(e[i])}:iB(e[i],Bi(t)?{}:t[i],n[i]):n[i]=!nl(e[i],t[i]);return n}var Ip=(e,t)=>iB(e,t,tb(t)),oB=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Cr(e)?e:t?e===""?NaN:e&&+e:n&&gs(e)?new Date(e):r?r(e):e;function PS(e){const t=e.ref;return nA(t)?t.files:rA(t)?tB(e.refs).value:nB(t)?[...t.selectedOptions].map(({value:n})=>n):Sm(t)?eB(e.refs).value:oB(Cr(t.value)?e.ref.value:t.value,e)}var Wle=(e,t,n,r)=>{const i={};for(const o of e){const a=Xe(t,o);a&&Pn(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Np=e=>Cr(e)?e:eb(e)?e.source:Ar(e)?eb(e.value)?e.value.source:e.value:e;const aR="AsyncFunction";var Vle=e=>!!e&&!!e.validate&&!!(ds(e.validate)&&e.validate.constructor.name===aR||Ar(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===aR)),Hle=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function sR(e,t,n){const r=Xe(e,n);if(r||JO(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Xe(t,o),s=Xe(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(s&&s.type)return{name:o,error:s};i.pop()}return{name:n}}var qle=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,Kle=(e,t)=>!uw(Xe(e,t)).length&&Ur(e,t);const Gle={mode:Fa.onSubmit,reValidateMode:Fa.onChange,shouldFocusError:!0};function Yle(e={}){let t={...Gle,...e},n={submitCount:0,isDirty:!1,isLoading:ds(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=Ar(t.defaultValues)||Ar(t.values)?to(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:to(i),a={action:!1,mount:!1,watch:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,l=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:OS(),array:OS(),state:OS()},h=JM(t.mode),p=JM(t.reValidateMode),m=t.criteriaMode===Fa.all,y=ie=>pe=>{clearTimeout(l),l=setTimeout(ie,pe)},b=async ie=>{if(!t.disabled&&(c.isValid||ie)){const pe=t.resolver?ro((await M()).errors):await B(r,!0);pe!==n.isValid&&f.state.next({isValid:pe})}},w=(ie,pe)=>{!t.disabled&&(c.isValidating||c.validatingFields)&&((ie||Array.from(s.mount)).forEach(ye=>{ye&&(pe?Pn(n.validatingFields,ye,pe):Ur(n.validatingFields,ye))}),f.state.next({validatingFields:n.validatingFields,isValidating:!ro(n.validatingFields)}))},x=(ie,pe=[],ye,ze,je=!0,ke=!0)=>{if(ze&&ye&&!t.disabled){if(a.action=!0,ke&&Array.isArray(Xe(r,ie))){const nt=ye(Xe(r,ie),ze.argA,ze.argB);je&&Pn(r,ie,nt)}if(ke&&Array.isArray(Xe(n.errors,ie))){const nt=ye(Xe(n.errors,ie),ze.argA,ze.argB);je&&Pn(n.errors,ie,nt),Kle(n.errors,ie)}if(c.touchedFields&&ke&&Array.isArray(Xe(n.touchedFields,ie))){const nt=ye(Xe(n.touchedFields,ie),ze.argA,ze.argB);je&&Pn(n.touchedFields,ie,nt)}c.dirtyFields&&(n.dirtyFields=Ip(i,o)),f.state.next({name:ie,isDirty:W(ie,pe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Pn(o,ie,pe)},S=(ie,pe)=>{Pn(n.errors,ie,pe),f.state.next({errors:n.errors})},O=ie=>{n.errors=ie,f.state.next({errors:n.errors,isValid:!1})},E=(ie,pe,ye,ze)=>{const je=Xe(r,ie);if(je){const ke=Xe(o,ie,Cr(ye)?Xe(i,ie):ye);Cr(ke)||ze&&ze.defaultChecked||pe?Pn(o,ie,pe?ke:PS(je._f)):q(ie,ke),a.mount&&b()}},C=(ie,pe,ye,ze,je)=>{let ke=!1,nt=!1;const vt={name:ie};if(!t.disabled){const wn=!!(Xe(r,ie)&&Xe(r,ie)._f&&Xe(r,ie)._f.disabled);if(!ye||ze){c.isDirty&&(nt=n.isDirty,n.isDirty=vt.isDirty=W(),ke=nt!==vt.isDirty);const Kt=wn||nl(Xe(i,ie),pe);nt=!!(!wn&&Xe(n.dirtyFields,ie)),Kt||wn?Ur(n.dirtyFields,ie):Pn(n.dirtyFields,ie,!0),vt.dirtyFields=n.dirtyFields,ke=ke||c.dirtyFields&&nt!==!Kt}if(ye){const Kt=Xe(n.touchedFields,ie);Kt||(Pn(n.touchedFields,ie,ye),vt.touchedFields=n.touchedFields,ke=ke||c.touchedFields&&Kt!==ye)}ke&&je&&f.state.next(vt)}return ke?vt:{}},P=(ie,pe,ye,ze)=>{const je=Xe(n.errors,ie),ke=c.isValid&&aa(pe)&&n.isValid!==pe;if(t.delayError&&ye?(u=y(()=>S(ie,ye)),u(t.delayError)):(clearTimeout(l),u=null,ye?Pn(n.errors,ie,ye):Ur(n.errors,ie)),(ye?!nl(je,ye):je)||!ro(ze)||ke){const nt={...ze,...ke&&aa(pe)?{isValid:pe}:{},errors:n.errors,name:ie};n={...n,...nt},f.state.next(nt)}},M=async ie=>{w(ie,!0);const pe=await t.resolver(o,t.context,Wle(ie||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(ie),pe},N=async ie=>{const{errors:pe}=await M(ie);if(ie)for(const ye of ie){const ze=Xe(pe,ye);ze?Pn(n.errors,ye,ze):Ur(n.errors,ye)}else n.errors=pe;return pe},B=async(ie,pe,ye={valid:!0})=>{for(const ze in ie){const je=ie[ze];if(je){const{_f:ke,...nt}=je;if(ke){const vt=s.array.has(ke.name),wn=je._f&&Vle(je._f);wn&&c.validatingFields&&w([ze],!0);const Kt=await oR(je,s.disabled,o,m,t.shouldUseNativeValidation&&!pe,vt);if(wn&&c.validatingFields&&w([ze]),Kt[ke.name]&&(ye.valid=!1,pe))break;!pe&&(Xe(Kt,ke.name)?vt?jle(n.errors,Kt,ke.name):Pn(n.errors,ke.name,Kt[ke.name]):Ur(n.errors,ke.name))}!ro(nt)&&await B(nt,pe,ye)}}return ye.valid},V=()=>{for(const ie of s.unMount){const pe=Xe(r,ie);pe&&(pe._f.refs?pe._f.refs.every(ye=>!AS(ye)):!AS(pe._f.ref))&&Se(ie)}s.unMount=new Set},W=(ie,pe)=>!t.disabled&&(ie&&pe&&Pn(o,ie,pe),!nl(oe(),i)),ne=(ie,pe,ye)=>Qj(ie,s,{...a.mount?o:Cr(pe)?i:gs(ie)?{[ie]:pe}:pe},ye,pe),Z=ie=>uw(Xe(a.mount?o:i,ie,t.shouldUnregister?Xe(i,ie,[]):[])),q=(ie,pe,ye={})=>{const ze=Xe(r,ie);let je=pe;if(ze){const ke=ze._f;ke&&(!ke.disabled&&Pn(o,ie,oB(pe,ke)),je=J1(ke.ref)&&Bi(pe)?"":pe,nB(ke.ref)?[...ke.ref.options].forEach(nt=>nt.selected=je.includes(nt.value)):ke.refs?Sm(ke.ref)?ke.refs.length>1?ke.refs.forEach(nt=>(!nt.defaultChecked||!nt.disabled)&&(nt.checked=Array.isArray(je)?!!je.find(vt=>vt===nt.value):je===nt.value)):ke.refs[0]&&(ke.refs[0].checked=!!je):ke.refs.forEach(nt=>nt.checked=nt.value===je):nA(ke.ref)?ke.ref.value="":(ke.ref.value=je,ke.ref.type||f.values.next({name:ie,values:{...o}})))}(ye.shouldDirty||ye.shouldTouch)&&C(ie,je,ye.shouldTouch,ye.shouldDirty,!0),ye.shouldValidate&&Y(ie)},G=(ie,pe,ye)=>{for(const ze in pe){const je=pe[ze],ke=`${ie}.${ze}`,nt=Xe(r,ke);(s.array.has(ie)||Ar(je)||nt&&!nt._f)&&!_c(je)?G(ke,je,ye):q(ke,je,ye)}},H=(ie,pe,ye={})=>{const ze=Xe(r,ie),je=s.array.has(ie),ke=to(pe);Pn(o,ie,ke),je?(f.array.next({name:ie,values:{...o}}),(c.isDirty||c.dirtyFields)&&ye.shouldDirty&&f.state.next({name:ie,dirtyFields:Ip(i,o),isDirty:W(ie,ke)})):ze&&!ze._f&&!Bi(ke)?G(ie,ke,ye):q(ie,ke,ye),eR(ie,s)&&f.state.next({...n}),f.values.next({name:a.mount?ie:void 0,values:{...o}})},j=async ie=>{a.mount=!0;const pe=ie.target;let ye=pe.name,ze=!0;const je=Xe(r,ye),ke=()=>pe.type?PS(je._f):Hj(ie),nt=vt=>{ze=Number.isNaN(vt)||_c(vt)&&isNaN(vt.getTime())||nl(vt,Xe(o,ye,vt))};if(je){let vt,wn;const Kt=ke(),_n=ie.type===Q1.BLUR||ie.type===Q1.FOCUS_OUT,$i=!Hle(je._f)&&!t.resolver&&!Xe(n.errors,ye)&&!je._f.deps||qle(_n,Xe(n.touchedFields,ye),n.isSubmitted,p,h),xr=eR(ye,s,_n);Pn(o,ye,Kt),_n?(je._f.onBlur&&je._f.onBlur(ie),u&&u(0)):je._f.onChange&&je._f.onChange(ie);const mi=C(ye,Kt,_n,!1),ur=!ro(mi)||xr;if(!_n&&f.values.next({name:ye,type:ie.type,values:{...o}}),$i)return c.isValid&&(t.mode==="onBlur"&&_n?b():_n||b()),ur&&f.state.next({name:ye,...xr?{}:mi});if(!_n&&xr&&f.state.next({...n}),t.resolver){const{errors:ai}=await M([ye]);if(nt(Kt),ze){const vi=sR(n.errors,r,ye),Dr=sR(ai,r,vi.name||ye);vt=Dr.error,ye=Dr.name,wn=ro(ai)}}else w([ye],!0),vt=(await oR(je,s.disabled,o,m,t.shouldUseNativeValidation))[ye],w([ye]),nt(Kt),ze&&(vt?wn=!1:c.isValid&&(wn=await B(r,!0)));ze&&(je._f.deps&&Y(je._f.deps),P(ye,wn,vt,mi))}},K=(ie,pe)=>{if(Xe(n.errors,pe)&&ie.focus)return ie.focus(),1},Y=async(ie,pe={})=>{let ye,ze;const je=_0(ie);if(t.resolver){const ke=await N(Cr(ie)?ie:je);ye=ro(ke),ze=ie?!je.some(nt=>Xe(ke,nt)):ye}else ie?(ze=(await Promise.all(je.map(async ke=>{const nt=Xe(r,ke);return await B(nt&&nt._f?{[ke]:nt}:nt)}))).every(Boolean),!(!ze&&!n.isValid)&&b()):ze=ye=await B(r);return f.state.next({...!gs(ie)||c.isValid&&ye!==n.isValid?{}:{name:ie},...t.resolver||!ie?{isValid:ye}:{},errors:n.errors}),pe.shouldFocus&&!ze&&S0(r,K,ie?je:s.mount),ze},oe=ie=>{const pe={...a.mount?o:i};return Cr(ie)?pe:gs(ie)?Xe(pe,ie):ie.map(ye=>Xe(pe,ye))},X=(ie,pe)=>({invalid:!!Xe((pe||n).errors,ie),isDirty:!!Xe((pe||n).dirtyFields,ie),error:Xe((pe||n).errors,ie),isValidating:!!Xe(n.validatingFields,ie),isTouched:!!Xe((pe||n).touchedFields,ie)}),Q=ie=>{ie&&_0(ie).forEach(pe=>Ur(n.errors,pe)),f.state.next({errors:ie?n.errors:{}})},ue=(ie,pe,ye)=>{const ze=(Xe(r,ie,{_f:{}})._f||{}).ref,je=Xe(n.errors,ie)||{},{ref:ke,message:nt,type:vt,...wn}=je;Pn(n.errors,ie,{...wn,...pe,ref:ze}),f.state.next({name:ie,errors:n.errors,isValid:!1}),ye&&ye.shouldFocus&&ze&&ze.focus&&ze.focus()},de=(ie,pe)=>ds(ie)?f.values.subscribe({next:ye=>ie(ne(void 0,pe),ye)}):ne(ie,pe,!0),Se=(ie,pe={})=>{for(const ye of ie?_0(ie):s.mount)s.mount.delete(ye),s.array.delete(ye),pe.keepValue||(Ur(r,ye),Ur(o,ye)),!pe.keepError&&Ur(n.errors,ye),!pe.keepDirty&&Ur(n.dirtyFields,ye),!pe.keepTouched&&Ur(n.touchedFields,ye),!pe.keepIsValidating&&Ur(n.validatingFields,ye),!t.shouldUnregister&&!pe.keepDefaultValue&&Ur(i,ye);f.values.next({values:{...o}}),f.state.next({...n,...pe.keepDirty?{isDirty:W()}:{}}),!pe.keepIsValid&&b()},me=({disabled:ie,name:pe,field:ye,fields:ze})=>{(aa(ie)&&a.mount||ie||s.disabled.has(pe))&&(ie?s.disabled.add(pe):s.disabled.delete(pe),C(pe,PS(ye?ye._f:Xe(ze,pe)._f),!1,!1,!0))},Ze=(ie,pe={})=>{let ye=Xe(r,ie);const ze=aa(pe.disabled)||aa(t.disabled);return Pn(r,ie,{...ye||{},_f:{...ye&&ye._f?ye._f:{ref:{name:ie}},name:ie,mount:!0,...pe}}),s.mount.add(ie),ye?me({field:ye,disabled:aa(pe.disabled)?pe.disabled:t.disabled,name:ie}):E(ie,!0,pe.value),{...ze?{disabled:pe.disabled||t.disabled}:{},...t.progressive?{required:!!pe.required,min:Np(pe.min),max:Np(pe.max),minLength:Np(pe.minLength),maxLength:Np(pe.maxLength),pattern:Np(pe.pattern)}:{},name:ie,onChange:j,onBlur:j,ref:je=>{if(je){Ze(ie,pe),ye=Xe(r,ie);const ke=Cr(je.value)&&je.querySelectorAll&&je.querySelectorAll("input,select,textarea")[0]||je,nt=zle(ke),vt=ye._f.refs||[];if(nt?vt.find(wn=>wn===ke):ke===ye._f.ref)return;Pn(r,ie,{_f:{...ye._f,...nt?{refs:[...vt.filter(AS),ke,...Array.isArray(Xe(i,ie))?[{}]:[]],ref:{type:ke.type,name:ie}}:{ref:ke}}}),E(ie,!1,void 0,ke)}else ye=Xe(r,ie,{}),ye._f&&(ye._f.mount=!1),(t.shouldUnregister||pe.shouldUnregister)&&!(qj(s.array,ie)&&a.action)&&s.unMount.add(ie)}}},Ae=()=>t.shouldFocusError&&S0(r,K,s.mount),Le=ie=>{aa(ie)&&(f.state.next({disabled:ie}),S0(r,(pe,ye)=>{const ze=Xe(r,ye);ze&&(pe.disabled=ze._f.disabled||ie,Array.isArray(ze._f.refs)&&ze._f.refs.forEach(je=>{je.disabled=ze._f.disabled||ie}))},0,!1))},$e=(ie,pe)=>async ye=>{let ze;ye&&(ye.preventDefault&&ye.preventDefault(),ye.persist&&ye.persist());let je=to(o);if(s.disabled.size)for(const ke of s.disabled)Pn(je,ke,void 0);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:ke,values:nt}=await M();n.errors=ke,je=nt}else await B(r);if(Ur(n.errors,"root"),ro(n.errors)){f.state.next({errors:{}});try{await ie(je,ye)}catch(ke){ze=ke}}else pe&&await pe({...n.errors},ye),Ae(),setTimeout(Ae);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ro(n.errors)&&!ze,submitCount:n.submitCount+1,errors:n.errors}),ze)throw ze},be=(ie,pe={})=>{Xe(r,ie)&&(Cr(pe.defaultValue)?H(ie,to(Xe(i,ie))):(H(ie,pe.defaultValue),Pn(i,ie,to(pe.defaultValue))),pe.keepTouched||Ur(n.touchedFields,ie),pe.keepDirty||(Ur(n.dirtyFields,ie),n.isDirty=pe.defaultValue?W(ie,to(Xe(i,ie))):W()),pe.keepError||(Ur(n.errors,ie),c.isValid&&b()),f.state.next({...n}))},bt=(ie,pe={})=>{const ye=ie?to(ie):i,ze=to(ye),je=ro(ie),ke=je?i:ze;if(pe.keepDefaultValues||(i=ye),!pe.keepValues){if(pe.keepDirtyValues){const nt=new Set([...s.mount,...Object.keys(Ip(i,o))]);for(const vt of Array.from(nt))Xe(n.dirtyFields,vt)?Pn(ke,vt,Xe(o,vt)):H(vt,Xe(ke,vt))}else{if(QO&&Cr(ie))for(const nt of s.mount){const vt=Xe(r,nt);if(vt&&vt._f){const wn=Array.isArray(vt._f.refs)?vt._f.refs[0]:vt._f.ref;if(J1(wn)){const Kt=wn.closest("form");if(Kt){Kt.reset();break}}}}r={}}o=t.shouldUnregister?pe.keepDefaultValues?to(i):{}:to(ke),f.array.next({values:{...ke}}),f.values.next({values:{...ke}})}s={mount:pe.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!c.isValid||!!pe.keepIsValid||!!pe.keepDirtyValues,a.watch=!!t.shouldUnregister,f.state.next({submitCount:pe.keepSubmitCount?n.submitCount:0,isDirty:je?!1:pe.keepDirty?n.isDirty:!!(pe.keepDefaultValues&&!nl(ie,i)),isSubmitted:pe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:je?{}:pe.keepDirtyValues?pe.keepDefaultValues&&o?Ip(i,o):n.dirtyFields:pe.keepDefaultValues&&ie?Ip(i,ie):pe.keepDirty?n.dirtyFields:{},touchedFields:pe.keepTouched?n.touchedFields:{},errors:pe.keepErrors?n.errors:{},isSubmitSuccessful:pe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},lt=(ie,pe)=>bt(ds(ie)?ie(o):ie,pe);return{control:{register:Ze,unregister:Se,getFieldState:X,handleSubmit:$e,setError:ue,_executeSchema:M,_getWatch:ne,_getDirty:W,_updateValid:b,_removeUnmounted:V,_updateFieldArray:x,_updateDisabledField:me,_getFieldArray:Z,_reset:bt,_resetDefaultValues:()=>ds(t.defaultValues)&&t.defaultValues().then(ie=>{lt(ie,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:ie=>{n={...n,...ie}},_disableForm:Le,_subjects:f,_proxyFormState:c,_setErrors:O,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(ie){a=ie},get _defaultValues(){return i},get _names(){return s},set _names(ie){s=ie},get _formState(){return n},set _formState(ie){n=ie},get _options(){return t},set _options(ie){t={...t,...ie}}},trigger:Y,register:Ze,handleSubmit:$e,watch:de,setValue:H,getValues:oe,reset:lt,resetField:be,clearErrors:Q,unregister:Se,setError:ue,setFocus:(ie,pe={})=>{const ye=Xe(r,ie),ze=ye&&ye._f;if(ze){const je=ze.refs?ze.refs[0]:ze.ref;je.focus&&(je.focus(),pe.shouldSelect&&ds(je.select)&&je.select())}},getFieldState:X}}function _Qe(e={}){const t=F.useRef(void 0),n=F.useRef(void 0),[r,i]=F.useState({isDirty:!1,isValidating:!1,isLoading:ds(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ds(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Yle(e),formState:r});const o=t.current.control;return o._options=e,tA({subject:o._subjects.state,next:a=>{Zj(a,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),F.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),F.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),F.useEffect(()=>{e.values&&!nl(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(a=>({...a}))):o._resetDefaultValues()},[e.values,o]),F.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),F.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),F.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=Yj(r,o),t.current}const uR=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Xe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},aB=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?uR(r.ref,n,e):r.refs&&r.refs.forEach(i=>uR(i,n,e))}},Zle=(e,t)=>{t.shouldUseNativeValidation&&aB(e,t);const n={};for(const r in e){const i=Xe(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(Xle(t.names||Object.keys(e),r)){const a=Object.assign({},Xe(n,r));Pn(a,"root",o),Pn(n,r,a)}else Pn(n,r,o)}return n},Xle=(e,t)=>e.some(n=>n.startsWith(t+"."));var Qle=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[a]={message:s.message,type:s.code}}else n[a]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(c){return c.errors.forEach(function(f){return e.push(f)})}),t){var u=n[a].types,l=u&&u[r.code];n[a]=Jj(a,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n},SQe=function(e,t,n){return n===void 0&&(n={}),function(r,i,o){try{return Promise.resolve(function(a,s){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return o.shouldUseNativeValidation&&aB({},o),{errors:{},values:n.raw?r:l}})}catch(l){return s(l)}return u&&u.then?u.then(void 0,s):u}(0,function(a){if(function(s){return Array.isArray(s?.errors)}(a))return{values:{},errors:Zle(Qle(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},gn;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(gn||(gn={}));var aE;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(aE||(aE={}));const it=gn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nu=e=>{switch(typeof e){case"undefined":return it.undefined;case"string":return it.string;case"number":return isNaN(e)?it.nan:it.number;case"boolean":return it.boolean;case"function":return it.function;case"bigint":return it.bigint;case"symbol":return it.symbol;case"object":return Array.isArray(e)?it.array:e===null?it.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?it.promise:typeof Map<"u"&&e instanceof Map?it.map:typeof Set<"u"&&e instanceof Set?it.set:typeof Date<"u"&&e instanceof Date?it.date:it.object;default:return it.unknown}},We=gn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Jle=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class No extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;un.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}No.create=e=>new No(e);const Gd=(e,t)=>{let n;switch(e.code){case We.invalid_type:e.received===it.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case We.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,gn.jsonStringifyReplacer)}`;break;case We.unrecognized_keys:n=`Unrecognized key(s) in object: ${gn.joinValues(e.keys,", ")}`;break;case We.invalid_union:n="Invalid input";break;case We.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gn.joinValues(e.options)}`;break;case We.invalid_enum_value:n=`Invalid enum value. Expected ${gn.joinValues(e.options)}, received '${e.received}'`;break;case We.invalid_arguments:n="Invalid function arguments";break;case We.invalid_return_type:n="Invalid function return type";break;case We.invalid_date:n="Invalid date";break;case We.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:gn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case We.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case We.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case We.custom:n="Invalid input";break;case We.invalid_intersection_types:n="Intersection results could not be merged";break;case We.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case We.not_finite:n="Number must be finite";break;default:n=t.defaultError,gn.assertNever(e)}return{message:n}};let sB=Gd;function ece(e){sB=e}function nb(){return sB}const rb=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="";const u=r.filter(l=>!!l).slice().reverse();for(const l of u)s=l(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},tce=[];function tt(e,t){const n=nb(),r=rb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Gd?void 0:Gd].filter(i=>!!i)});e.common.issues.push(r)}class Ri{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return $t;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,a=await i.value;r.push({key:o,value:a})}return Ri.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return $t;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const $t=Object.freeze({status:"aborted"}),md=e=>({status:"dirty",value:e}),Vi=e=>({status:"valid",value:e}),sE=e=>e.status==="aborted",uE=e=>e.status==="dirty",Vc=e=>e.status==="valid",tg=e=>typeof Promise<"u"&&e instanceof Promise;function ib(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function uB(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var dt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(dt||(dt={}));var a0,s0;class Ps{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const lR=(e,t)=>{if(Vc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new No(e.common.issues);return this._error=n,this._error}}};function Yt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{var u,l;const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(u=c??r)!==null&&u!==void 0?u:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(l=c??n)!==null&&l!==void 0?l:s.defaultError}},description:i}}class en{get description(){return this._def.description}_getType(t){return nu(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:nu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ri,ctx:{common:t.parent.common,data:t.data,parsedType:nu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(tg(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)},o=this._parseSync({data:t,path:i.path,parent:i});return lR(i,o)}"~validate"(t){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:i});return Vc(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((r=(n=o?.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(o=>Vc(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(tg(i)?i:Promise.resolve(i));return lR(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:We.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Ya({schema:this,typeName:Mt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Cs.create(this,this._def)}nullable(){return Rl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ha.create(this)}promise(){return Zd.create(this,this._def)}or(t){return og.create([this,t],this._def)}and(t){return ag.create(this,t,this._def)}transform(t){return new Ya({...Yt(this._def),schema:this,typeName:Mt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new fg({...Yt(this._def),innerType:this,defaultValue:n,typeName:Mt.ZodDefault})}brand(){return new iA({typeName:Mt.ZodBranded,type:this,...Yt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new dg({...Yt(this._def),innerType:this,catchValue:n,typeName:Mt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Cm.create(this,t)}readonly(){return hg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const nce=/^c[^\s-]{8,}$/i,rce=/^[0-9a-z]+$/,ice=/^[0-9A-HJKMNP-TV-Z]{26}$/i,oce=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ace=/^[a-z0-9_-]{21}$/i,sce=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,uce=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lce=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cce="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kS;const fce=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dce=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,hce=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,pce=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gce=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,mce=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lB="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",vce=new RegExp(`^${lB}$`);function cB(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function yce(e){return new RegExp(`^${cB(e)}$`)}function fB(e){let t=`${lB}T${cB(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function bce(e,t){return!!((t==="v4"||!t)&&fce.test(e)||(t==="v6"||!t)&&hce.test(e))}function xce(e,t){if(!sce.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function wce(e,t){return!!((t==="v4"||!t)&&dce.test(e)||(t==="v6"||!t)&&pce.test(e))}class Ua extends en{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==it.string){const o=this._getOrReturnCtx(t);return tt(o,{code:We.invalid_type,expected:it.string,received:o.parsedType}),$t}const r=new Ri;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:We.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.lengtht.test(i),{validation:n,code:We.invalid_string,...dt.errToObj(r)})}_addCheck(t){return new Ua({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...dt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...dt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...dt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...dt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...dt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...dt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...dt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...dt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...dt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...dt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...dt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...dt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...dt.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...dt.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...dt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...dt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...dt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...dt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...dt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...dt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...dt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...dt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...dt.errToObj(n)})}nonempty(t){return this.min(1,dt.errToObj(t))}trim(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ua({checks:[],typeName:Mt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Yt(e)})};function _ce(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class kl extends en{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==it.number){const o=this._getOrReturnCtx(t);return tt(o,{code:We.invalid_type,expected:it.number,received:o.parsedType}),$t}let r;const i=new Ri;for(const o of this._def.checks)o.kind==="int"?gn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),tt(r,{code:We.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),tt(r,{code:We.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?_ce(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),tt(r,{code:We.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),tt(r,{code:We.not_finite,message:o.message}),i.dirty()):gn.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,dt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,dt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,dt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,dt.toString(n))}setLimit(t,n,r,i){return new kl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:dt.toString(i)}]})}_addCheck(t){return new kl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:dt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:dt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:dt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:dt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:dt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:dt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:dt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:dt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:dt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&gn.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew kl({checks:[],typeName:Mt.ZodNumber,coerce:e?.coerce||!1,...Yt(e)});class Tl extends en{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==it.bigint)return this._getInvalidInput(t);let r;const i=new Ri;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),tt(r,{code:We.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),tt(r,{code:We.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):gn.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return tt(n,{code:We.invalid_type,expected:it.bigint,received:n.parsedType}),$t}gte(t,n){return this.setLimit("min",t,!0,dt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,dt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,dt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,dt.toString(n))}setLimit(t,n,r,i){return new Tl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:dt.toString(i)}]})}_addCheck(t){return new Tl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:dt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:dt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:dt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:dt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:dt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Tl({checks:[],typeName:Mt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Yt(e)})};class ng extends en{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==it.boolean){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.boolean,received:r.parsedType}),$t}return Vi(t.data)}}ng.create=e=>new ng({typeName:Mt.ZodBoolean,coerce:e?.coerce||!1,...Yt(e)});class Hc extends en{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==it.date){const o=this._getOrReturnCtx(t);return tt(o,{code:We.invalid_type,expected:it.date,received:o.parsedType}),$t}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return tt(o,{code:We.invalid_date}),$t}const r=new Ri;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:We.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):gn.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Hc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:dt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:dt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Hc({checks:[],coerce:e?.coerce||!1,typeName:Mt.ZodDate,...Yt(e)});class ob extends en{_parse(t){if(this._getType(t)!==it.symbol){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.symbol,received:r.parsedType}),$t}return Vi(t.data)}}ob.create=e=>new ob({typeName:Mt.ZodSymbol,...Yt(e)});class rg extends en{_parse(t){if(this._getType(t)!==it.undefined){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.undefined,received:r.parsedType}),$t}return Vi(t.data)}}rg.create=e=>new rg({typeName:Mt.ZodUndefined,...Yt(e)});class ig extends en{_parse(t){if(this._getType(t)!==it.null){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.null,received:r.parsedType}),$t}return Vi(t.data)}}ig.create=e=>new ig({typeName:Mt.ZodNull,...Yt(e)});class Yd extends en{constructor(){super(...arguments),this._any=!0}_parse(t){return Vi(t.data)}}Yd.create=e=>new Yd({typeName:Mt.ZodAny,...Yt(e)});class Mc extends en{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vi(t.data)}}Mc.create=e=>new Mc({typeName:Mt.ZodUnknown,...Yt(e)});class yu extends en{_parse(t){const n=this._getOrReturnCtx(t);return tt(n,{code:We.invalid_type,expected:it.never,received:n.parsedType}),$t}}yu.create=e=>new yu({typeName:Mt.ZodNever,...Yt(e)});class ab extends en{_parse(t){if(this._getType(t)!==it.undefined){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.void,received:r.parsedType}),$t}return Vi(t.data)}}ab.create=e=>new ab({typeName:Mt.ZodVoid,...Yt(e)});class Ha extends en{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==it.array)return tt(n,{code:We.invalid_type,expected:it.array,received:n.parsedType}),$t;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.lengthi.maxLength.value&&(tt(n,{code:We.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new Ps(n,a,n.path,s)))).then(a=>Ri.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new Ps(n,a,n.path,s)));return Ri.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Ha({...this._def,minLength:{value:t,message:dt.toString(n)}})}max(t,n){return new Ha({...this._def,maxLength:{value:t,message:dt.toString(n)}})}length(t,n){return new Ha({...this._def,exactLength:{value:t,message:dt.toString(n)}})}nonempty(t){return this.min(1,t)}}Ha.create=(e,t)=>new Ha({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Mt.ZodArray,...Yt(t)});function td(e){if(e instanceof fr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Cs.create(td(r))}return new fr({...e._def,shape:()=>t})}else return e instanceof Ha?new Ha({...e._def,type:td(e.element)}):e instanceof Cs?Cs.create(td(e.unwrap())):e instanceof Rl?Rl.create(td(e.unwrap())):e instanceof ks?ks.create(e.items.map(t=>td(t))):e}class fr extends en{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=gn.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==it.object){const l=this._getOrReturnCtx(t);return tt(l,{code:We.invalid_type,expected:it.object,received:l.parsedType}),$t}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof yu&&this._def.unknownKeys==="strip"))for(const l in i.data)a.includes(l)||s.push(l);const u=[];for(const l of a){const c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Ps(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof yu){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")s.length>0&&(tt(i,{code:We.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of s){const f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Ps(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of u){const f=await c.key,h=await c.value;l.push({key:f,value:h,alwaysSet:c.alwaysSet})}return l}).then(l=>Ri.mergeObjectSync(r,l)):Ri.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return dt.errToObj,new fr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const u=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=dt.errToObj(t).message)!==null&&s!==void 0?s:u}:{message:u}}}:{}})}strip(){return new fr({...this._def,unknownKeys:"strip"})}passthrough(){return new fr({...this._def,unknownKeys:"passthrough"})}extend(t){return new fr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new fr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Mt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new fr({...this._def,catchall:t})}pick(t){const n={};return gn.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new fr({...this._def,shape:()=>n})}omit(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new fr({...this._def,shape:()=>n})}deepPartial(){return td(this)}partial(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new fr({...this._def,shape:()=>n})}required(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Cs;)o=o._def.innerType;n[r]=o}}),new fr({...this._def,shape:()=>n})}keyof(){return dB(gn.objectKeys(this.shape))}}fr.create=(e,t)=>new fr({shape:()=>e,unknownKeys:"strip",catchall:yu.create(),typeName:Mt.ZodObject,...Yt(t)});fr.strictCreate=(e,t)=>new fr({shape:()=>e,unknownKeys:"strict",catchall:yu.create(),typeName:Mt.ZodObject,...Yt(t)});fr.lazycreate=(e,t)=>new fr({shape:e,unknownKeys:"strip",catchall:yu.create(),typeName:Mt.ZodObject,...Yt(t)});class og extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new No(s.ctx.common.issues));return tt(n,{code:We.invalid_union,unionErrors:a}),$t}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const u of r){const l={...n,common:{...n.common,issues:[]},parent:null},c=u._parseSync({data:n.data,path:n.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(u=>new No(u));return tt(n,{code:We.invalid_union,unionErrors:s}),$t}}get options(){return this._def.options}}og.create=(e,t)=>new og({options:e,typeName:Mt.ZodUnion,...Yt(t)});const Zs=e=>e instanceof ug?Zs(e.schema):e instanceof Ya?Zs(e.innerType()):e instanceof lg?[e.value]:e instanceof Ml?e.options:e instanceof cg?gn.objectValues(e.enum):e instanceof fg?Zs(e._def.innerType):e instanceof rg?[void 0]:e instanceof ig?[null]:e instanceof Cs?[void 0,...Zs(e.unwrap())]:e instanceof Rl?[null,...Zs(e.unwrap())]:e instanceof iA||e instanceof hg?Zs(e.unwrap()):e instanceof dg?Zs(e._def.innerType):[];class lw extends en{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==it.object)return tt(n,{code:We.invalid_type,expected:it.object,received:n.parsedType}),$t;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(tt(n,{code:We.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),$t)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=Zs(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new lw({typeName:Mt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Yt(r)})}}function lE(e,t){const n=nu(e),r=nu(t);if(e===t)return{valid:!0,data:e};if(n===it.object&&r===it.object){const i=gn.objectKeys(t),o=gn.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const u=lE(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(n===it.array&&r===it.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o{if(sE(o)||sE(a))return $t;const s=lE(o.value,a.value);return s.valid?((uE(o)||uE(a))&&n.dirty(),{status:n.value,value:s.data}):(tt(r,{code:We.invalid_intersection_types}),$t)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ag.create=(e,t,n)=>new ag({left:e,right:t,typeName:Mt.ZodIntersection,...Yt(n)});class ks extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.array)return tt(r,{code:We.invalid_type,expected:it.array,received:r.parsedType}),$t;if(r.data.lengththis._def.items.length&&(tt(r,{code:We.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const u=this._def.items[s]||this._def.rest;return u?u._parse(new Ps(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Ri.mergeArray(n,a)):Ri.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ks({...this._def,rest:t})}}ks.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ks({items:e,typeName:Mt.ZodTuple,rest:null,...Yt(t)})};class sg extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.object)return tt(r,{code:We.invalid_type,expected:it.object,received:r.parsedType}),$t;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new Ps(r,s,r.path,s)),value:a._parse(new Ps(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?Ri.mergeObjectAsync(n,i):Ri.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof en?new sg({keyType:t,valueType:n,typeName:Mt.ZodRecord,...Yt(r)}):new sg({keyType:Ua.create(),valueType:t,typeName:Mt.ZodRecord,...Yt(n)})}}class sb extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.map)return tt(r,{code:We.invalid_type,expected:it.map,received:r.parsedType}),$t;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,u],l)=>({key:i._parse(new Ps(r,s,r.path,[l,"key"])),value:o._parse(new Ps(r,u,r.path,[l,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const u of a){const l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return $t;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const u of a){const l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return $t;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}}}}sb.create=(e,t,n)=>new sb({valueType:t,keyType:e,typeName:Mt.ZodMap,...Yt(n)});class qc extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.set)return tt(r,{code:We.invalid_type,expected:it.set,received:r.parsedType}),$t;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(tt(r,{code:We.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(u){const l=new Set;for(const c of u){if(c.status==="aborted")return $t;c.status==="dirty"&&n.dirty(),l.add(c.value)}return{status:n.value,value:l}}const s=[...r.data.values()].map((u,l)=>o._parse(new Ps(r,u,r.path,l)));return r.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,n){return new qc({...this._def,minSize:{value:t,message:dt.toString(n)}})}max(t,n){return new qc({...this._def,maxSize:{value:t,message:dt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}qc.create=(e,t)=>new qc({valueType:e,minSize:null,maxSize:null,typeName:Mt.ZodSet,...Yt(t)});class Pd extends en{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==it.function)return tt(n,{code:We.invalid_type,expected:it.function,received:n.parsedType}),$t;function r(s,u){return rb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,nb(),Gd].filter(l=>!!l),issueData:{code:We.invalid_arguments,argumentsError:u}})}function i(s,u){return rb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,nb(),Gd].filter(l=>!!l),issueData:{code:We.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Zd){const s=this;return Vi(async function(...u){const l=new No([]),c=await s._def.args.parseAsync(u,o).catch(p=>{throw l.addIssue(r(u,p)),l}),f=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(f,o).catch(p=>{throw l.addIssue(i(f,p)),l})})}else{const s=this;return Vi(function(...u){const l=s._def.args.safeParse(u,o);if(!l.success)throw new No([r(u,l.error)]);const c=Reflect.apply(a,this,l.data),f=s._def.returns.safeParse(c,o);if(!f.success)throw new No([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Pd({...this._def,args:ks.create(t).rest(Mc.create())})}returns(t){return new Pd({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Pd({args:t||ks.create([]).rest(Mc.create()),returns:n||Mc.create(),typeName:Mt.ZodFunction,...Yt(r)})}}class ug extends en{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ug.create=(e,t)=>new ug({getter:e,typeName:Mt.ZodLazy,...Yt(t)});class lg extends en{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return tt(n,{received:n.data,code:We.invalid_literal,expected:this._def.value}),$t}return{status:"valid",value:t.data}}get value(){return this._def.value}}lg.create=(e,t)=>new lg({value:e,typeName:Mt.ZodLiteral,...Yt(t)});function dB(e,t){return new Ml({values:e,typeName:Mt.ZodEnum,...Yt(t)})}class Ml extends en{constructor(){super(...arguments),a0.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return tt(n,{expected:gn.joinValues(r),received:n.parsedType,code:We.invalid_type}),$t}if(ib(this,a0)||uB(this,a0,new Set(this._def.values)),!ib(this,a0).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return tt(n,{received:n.data,code:We.invalid_enum_value,options:r}),$t}return Vi(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Ml.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ml.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}a0=new WeakMap;Ml.create=dB;class cg extends en{constructor(){super(...arguments),s0.set(this,void 0)}_parse(t){const n=gn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==it.string&&r.parsedType!==it.number){const i=gn.objectValues(n);return tt(r,{expected:gn.joinValues(i),received:r.parsedType,code:We.invalid_type}),$t}if(ib(this,s0)||uB(this,s0,new Set(gn.getValidEnumValues(this._def.values))),!ib(this,s0).has(t.data)){const i=gn.objectValues(n);return tt(r,{received:r.data,code:We.invalid_enum_value,options:i}),$t}return Vi(t.data)}get enum(){return this._def.values}}s0=new WeakMap;cg.create=(e,t)=>new cg({values:e,typeName:Mt.ZodNativeEnum,...Yt(t)});class Zd extends en{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==it.promise&&n.common.async===!1)return tt(n,{code:We.invalid_type,expected:it.promise,received:n.parsedType}),$t;const r=n.parsedType===it.promise?n.data:Promise.resolve(n.data);return Vi(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Zd.create=(e,t)=>new Zd({type:e,typeName:Mt.ZodPromise,...Yt(t)});class Ya extends en{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{tt(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return $t;const u=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return u.status==="aborted"?$t:u.status==="dirty"||n.value==="dirty"?md(u.value):u});{if(n.value==="aborted")return $t;const s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?$t:s.status==="dirty"||n.value==="dirty"?md(s.value):s}}if(i.type==="refinement"){const a=s=>{const u=i.refinement(s,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?$t:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?$t:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Vc(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Vc(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);gn.assertNever(i)}}Ya.create=(e,t,n)=>new Ya({schema:e,typeName:Mt.ZodEffects,effect:t,...Yt(n)});Ya.createWithPreprocess=(e,t,n)=>new Ya({schema:t,effect:{type:"preprocess",transform:e},typeName:Mt.ZodEffects,...Yt(n)});class Cs extends en{_parse(t){return this._getType(t)===it.undefined?Vi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Cs.create=(e,t)=>new Cs({innerType:e,typeName:Mt.ZodOptional,...Yt(t)});class Rl extends en{_parse(t){return this._getType(t)===it.null?Vi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Rl.create=(e,t)=>new Rl({innerType:e,typeName:Mt.ZodNullable,...Yt(t)});class fg extends en{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===it.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}fg.create=(e,t)=>new fg({innerType:e,typeName:Mt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Yt(t)});class dg extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return tg(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new No(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new No(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}dg.create=(e,t)=>new dg({innerType:e,typeName:Mt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Yt(t)});class ub extends en{_parse(t){if(this._getType(t)!==it.nan){const r=this._getOrReturnCtx(t);return tt(r,{code:We.invalid_type,expected:it.nan,received:r.parsedType}),$t}return{status:"valid",value:t.data}}}ub.create=e=>new ub({typeName:Mt.ZodNaN,...Yt(e)});const Sce=Symbol("zod_brand");class iA extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Cm extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?$t:o.status==="dirty"?(n.dirty(),md(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?$t:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Cm({in:t,out:n,typeName:Mt.ZodPipeline})}}class hg extends en{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Vc(i)&&(i.value=Object.freeze(i.value)),i);return tg(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}hg.create=(e,t)=>new hg({innerType:e,typeName:Mt.ZodReadonly,...Yt(t)});function hB(e,t={},n){return e?Yd.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,l=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...l,fatal:u})}}):Yd.create()}const Cce={object:fr.lazycreate};var Mt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Mt||(Mt={}));const Ece=(e,t={message:`Input not instance of ${e.name}`})=>hB(n=>n instanceof e,t),pB=Ua.create,gB=kl.create,Oce=ub.create,Ace=Tl.create,mB=ng.create,Pce=Hc.create,kce=ob.create,Tce=rg.create,Mce=ig.create,Rce=Yd.create,Dce=Mc.create,$ce=yu.create,Ice=ab.create,Nce=Ha.create,Lce=fr.create,Fce=fr.strictCreate,jce=og.create,Bce=lw.create,Uce=ag.create,zce=ks.create,Wce=sg.create,Vce=sb.create,Hce=qc.create,qce=Pd.create,Kce=ug.create,Gce=lg.create,Yce=Ml.create,Zce=cg.create,Xce=Zd.create,cR=Ya.create,Qce=Cs.create,Jce=Rl.create,efe=Ya.createWithPreprocess,tfe=Cm.create,nfe=()=>pB().optional(),rfe=()=>gB().optional(),ife=()=>mB().optional(),ofe={string:e=>Ua.create({...e,coerce:!0}),number:e=>kl.create({...e,coerce:!0}),boolean:e=>ng.create({...e,coerce:!0}),bigint:e=>Tl.create({...e,coerce:!0}),date:e=>Hc.create({...e,coerce:!0})},afe=$t;var CQe=Object.freeze({__proto__:null,defaultErrorMap:Gd,setErrorMap:ece,getErrorMap:nb,makeIssue:rb,EMPTY_PATH:tce,addIssueToContext:tt,ParseStatus:Ri,INVALID:$t,DIRTY:md,OK:Vi,isAborted:sE,isDirty:uE,isValid:Vc,isAsync:tg,get util(){return gn},get objectUtil(){return aE},ZodParsedType:it,getParsedType:nu,ZodType:en,datetimeRegex:fB,ZodString:Ua,ZodNumber:kl,ZodBigInt:Tl,ZodBoolean:ng,ZodDate:Hc,ZodSymbol:ob,ZodUndefined:rg,ZodNull:ig,ZodAny:Yd,ZodUnknown:Mc,ZodNever:yu,ZodVoid:ab,ZodArray:Ha,ZodObject:fr,ZodUnion:og,ZodDiscriminatedUnion:lw,ZodIntersection:ag,ZodTuple:ks,ZodRecord:sg,ZodMap:sb,ZodSet:qc,ZodFunction:Pd,ZodLazy:ug,ZodLiteral:lg,ZodEnum:Ml,ZodNativeEnum:cg,ZodPromise:Zd,ZodEffects:Ya,ZodTransformer:Ya,ZodOptional:Cs,ZodNullable:Rl,ZodDefault:fg,ZodCatch:dg,ZodNaN:ub,BRAND:Sce,ZodBranded:iA,ZodPipeline:Cm,ZodReadonly:hg,custom:hB,Schema:en,ZodSchema:en,late:Cce,get ZodFirstPartyTypeKind(){return Mt},coerce:ofe,any:Rce,array:Nce,bigint:Ace,boolean:mB,date:Pce,discriminatedUnion:Bce,effect:cR,enum:Yce,function:qce,instanceof:Ece,intersection:Uce,lazy:Kce,literal:Gce,map:Vce,nan:Oce,nativeEnum:Zce,never:$ce,null:Mce,nullable:Jce,number:gB,object:Lce,oboolean:ife,onumber:rfe,optional:Qce,ostring:nfe,pipeline:tfe,preprocess:efe,promise:Xce,record:Wce,set:Hce,strictObject:Fce,string:pB,symbol:kce,transformer:cR,tuple:zce,undefined:Tce,union:jce,unknown:Dce,void:Ice,NEVER:afe,ZodIssueCode:We,quotelessJson:Jle,ZodError:No});const sfe=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);Rc(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},fR={},cE=(e,t,n,r)=>{Rc(n)&&fR[n]||(Rc(n)&&(fR[n]=new Date),sfe(e,t,n,r))},vB=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},fE=(e,t,n)=>{e.loadNamespaces(t,vB(e,n))},dR=(e,t,n,r)=>{if(Rc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return fE(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,vB(e,r))},ufe=(e,t,n={})=>!t.languages||!t.languages.length?(cE(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n?.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Rc=e=>typeof e=="string",lfe=e=>typeof e=="object"&&e!==null,cfe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ffe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},dfe=e=>ffe[e],hfe=e=>e.replace(cfe,dfe);let dE={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:hfe};const pfe=(e={})=>{dE={...dE,...e}},gfe=()=>dE;let yB;const mfe=e=>{yB=e},vfe=()=>yB,EQe={type:"3rdParty",init(e){pfe(e.options.react),mfe(e)}},yfe=v.createContext();class bfe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const xfe=(e,t)=>{const n=v.useRef();return v.useEffect(()=>{n.current=e},[e,t]),n.current},bB=(e,t,n,r)=>e.getFixedT(t,n,r),wfe=(e,t,n,r)=>v.useCallback(bB(e,t,n,r),[e,t,n,r]),OQe=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=v.useContext(yfe)||{},o=n||r||vfe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new bfe),!o){cE(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const O=(C,P)=>Rc(P)?P:lfe(P)&&Rc(P.defaultValue)?P.defaultValue:Array.isArray(C)?C[C.length-1]:C,E=[O,{},!1];return E.t=O,E.i18n={},E.ready=!1,E}o.options.react?.wait&&cE(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...gfe(),...o.options.react,...t},{useSuspense:s,keyPrefix:u}=a;let l=e||i||o.options?.defaultNS;l=Rc(l)?[l]:l||["translation"],o.reportNamespaces.addUsedNamespaces?.(l);const c=(o.isInitialized||o.initializedStoreOnce)&&l.every(O=>ufe(O,o,a)),f=wfe(o,t.lng||null,a.nsMode==="fallback"?l:l[0],u),h=()=>f,p=()=>bB(o,t.lng||null,a.nsMode==="fallback"?l:l[0],u),[m,y]=v.useState(h);let b=l.join();t.lng&&(b=`${t.lng}${b}`);const w=xfe(b),x=v.useRef(!0);v.useEffect(()=>{const{bindI18n:O,bindI18nStore:E}=a;x.current=!0,!c&&!s&&(t.lng?dR(o,t.lng,l,()=>{x.current&&y(p)}):fE(o,l,()=>{x.current&&y(p)})),c&&w&&w!==b&&x.current&&y(p);const C=()=>{x.current&&y(p)};return O&&o?.on(O,C),E&&o?.store.on(E,C),()=>{x.current=!1,o&&O?.split(" ").forEach(P=>o.off(P,C)),E&&o&&E.split(" ").forEach(P=>o.store.off(P,C))}},[o,b]),v.useEffect(()=>{x.current&&c&&y(h)},[o,u,c]);const S=[m,o,c];if(S.t=m,S.i18n=o,S.ready=c,c||!c&&!s)return S;throw new Promise(O=>{t.lng?dR(o,t.lng,l,()=>O()):fE(o,l,()=>O())})};var _fe="Label",xB=v.forwardRef((e,t)=>I.jsx(mt.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));xB.displayName=_fe;var AQe=xB;function Ye(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Sfe(e,t){const n=v.createContext(t),r=o=>{const{children:a,...s}=o,u=v.useMemo(()=>s,Object.values(s));return I.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function i(o){const a=v.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Di(e,t=[]){let n=[];function r(o,a){const s=v.createContext(a),u=n.length;n=[...n,a];const l=f=>{const{scope:h,children:p,...m}=f,y=h?.[e]?.[u]||s,b=v.useMemo(()=>m,Object.values(m));return I.jsx(y.Provider,{value:b,children:p})};l.displayName=o+"Provider";function c(f,h){const p=h?.[e]?.[u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,Cfe(i,...t)]}function Cfe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function oA(e){const t=e+"CollectionProvider",[n,r]=Di(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:y}=p,b=F.useRef(null),w=F.useRef(new Map).current;return I.jsx(i,{scope:m,itemMap:w,collectionRef:b,children:y})};a.displayName=t;const s=e+"CollectionSlot",u=F.forwardRef((p,m)=>{const{scope:y,children:b}=p,w=o(s,y),x=Nt(m,w.collectionRef);return I.jsx(Pl,{ref:x,children:b})});u.displayName=s;const l=e+"CollectionItemSlot",c="data-radix-collection-item",f=F.forwardRef((p,m)=>{const{scope:y,children:b,...w}=p,x=F.useRef(null),S=Nt(m,x),O=o(l,y);return F.useEffect(()=>(O.itemMap.set(x,{ref:x,...w}),()=>void O.itemMap.delete(x))),I.jsx(Pl,{[c]:"",ref:S,children:b})});f.displayName=l;function h(p){const m=o(e+"CollectionConsumer",p);return F.useCallback(()=>{const b=m.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((O,E)=>w.indexOf(O.ref.current)-w.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:u,ItemSlot:f},h,r]}var Efe=globalThis?.document?v.useLayoutEffect:()=>{},Ofe=zx.useId||(()=>{}),Afe=0;function Lo(e){const[t,n]=v.useState(Ofe());return Efe(()=>{e||n(r=>r??String(Afe++))},[e]),e||(t?`radix-${t}`:"")}function Vr(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ts({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Pfe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Vr(n),u=v.useCallback(l=>{if(o){const f=typeof l=="function"?l(e):l;f!==e&&s(f)}else i(l)},[o,e,i,s]);return[a,u]}function Pfe({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),o=Vr(t);return v.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var kfe=v.createContext(void 0);function Em(e){const t=v.useContext(kfe);return e||t||"ltr"}var TS="rovingFocusGroup.onEntryFocus",Tfe={bubbles:!1,cancelable:!0},cw="RovingFocusGroup",[hE,wB,Mfe]=oA(cw),[Rfe,fw]=Di(cw,[Mfe]),[Dfe,$fe]=Rfe(cw),_B=v.forwardRef((e,t)=>I.jsx(hE.Provider,{scope:e.__scopeRovingFocusGroup,children:I.jsx(hE.Slot,{scope:e.__scopeRovingFocusGroup,children:I.jsx(Ife,{...e,ref:t})})}));_B.displayName=cw;var Ife=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:c=!1,...f}=e,h=v.useRef(null),p=Nt(t,h),m=Em(o),[y=null,b]=Ts({prop:a,defaultProp:s,onChange:u}),[w,x]=v.useState(!1),S=Vr(l),O=wB(n),E=v.useRef(!1),[C,P]=v.useState(0);return v.useEffect(()=>{const M=h.current;if(M)return M.addEventListener(TS,S),()=>M.removeEventListener(TS,S)},[S]),I.jsx(Dfe,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:y,onItemFocus:v.useCallback(M=>b(M),[b]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>P(M=>M+1),[]),onFocusableItemRemove:v.useCallback(()=>P(M=>M-1),[]),children:I.jsx(mt.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:Ye(e.onMouseDown,()=>{E.current=!0}),onFocus:Ye(e.onFocus,M=>{const N=!E.current;if(M.target===M.currentTarget&&N&&!w){const B=new CustomEvent(TS,Tfe);if(M.currentTarget.dispatchEvent(B),!B.defaultPrevented){const V=O().filter(G=>G.focusable),W=V.find(G=>G.active),ne=V.find(G=>G.id===y),q=[W,ne,...V].filter(Boolean).map(G=>G.ref.current);EB(q,c)}}E.current=!1}),onBlur:Ye(e.onBlur,()=>x(!1))})})}),SB="RovingFocusGroupItem",CB=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...a}=e,s=Lo(),u=o||s,l=$fe(SB,n),c=l.currentTabStopId===u,f=wB(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=l;return v.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),I.jsx(hE.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:I.jsx(mt.span,{tabIndex:c?0:-1,"data-orientation":l.orientation,...a,ref:t,onMouseDown:Ye(e.onMouseDown,m=>{r?l.onItemFocus(u):m.preventDefault()}),onFocus:Ye(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:Ye(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){l.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=Ffe(m,l.orientation,l.dir);if(y!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let w=f().filter(x=>x.focusable).map(x=>x.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const x=w.indexOf(m.currentTarget);w=l.loop?jfe(w,x+1):w.slice(x+1)}setTimeout(()=>EB(w))}})})})});CB.displayName=SB;var Nfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Lfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ffe(e,t,n){const r=Lfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Nfe[r]}function EB(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function jfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OB=_B,AB=CB,On=globalThis?.document?v.useLayoutEffect:()=>{};function Bfe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var PB=e=>{const{present:t,children:n}=e,r=Ufe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,zfe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};PB.displayName="Presence";function Ufe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=Bfe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=sy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=sy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=sy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=sy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function sy(e){return e?.animationName||"none"}function zfe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aA="Tabs",[Wfe,PQe]=Di(aA,[fw]),kB=fw(),[Vfe,sA]=Wfe(aA),TB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:s,activationMode:u="automatic",...l}=e,c=Em(s),[f,h]=Ts({prop:r,onChange:i,defaultProp:o});return I.jsx(Vfe,{scope:n,baseId:Lo(),value:f,onValueChange:h,orientation:a,dir:c,activationMode:u,children:I.jsx(mt.div,{dir:c,"data-orientation":a,...l,ref:t})})});TB.displayName=aA;var MB="TabsList",RB=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=sA(MB,n),a=kB(n);return I.jsx(OB,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:I.jsx(mt.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});RB.displayName=MB;var DB="TabsTrigger",$B=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=sA(DB,n),s=kB(n),u=LB(a.baseId,r),l=FB(a.baseId,r),c=r===a.value;return I.jsx(AB,{asChild:!0,...s,focusable:!i,active:c,children:I.jsx(mt.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":l,"data-state":c?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Ye(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?a.onValueChange(r):f.preventDefault()}),onKeyDown:Ye(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(r)}),onFocus:Ye(e.onFocus,()=>{const f=a.activationMode!=="manual";!c&&!i&&f&&a.onValueChange(r)})})})});$B.displayName=DB;var IB="TabsContent",NB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,s=sA(IB,n),u=LB(s.baseId,r),l=FB(s.baseId,r),c=r===s.value,f=v.useRef(c);return v.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),I.jsx(PB,{present:i||c,children:({present:h})=>I.jsx(mt.div,{"data-state":c?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!h,id:l,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&o})})});NB.displayName=IB;function LB(e,t){return`${e}-trigger-${t}`}function FB(e,t){return`${e}-content-${t}`}var kQe=TB,TQe=RB,MQe=$B,RQe=NB,Ih=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Kc=typeof window>"u"||"Deno"in globalThis;function oa(){}function Hfe(e,t){return typeof e=="function"?e(t):e}function pE(e){return typeof e=="number"&&e>=0&&e!==1/0}function jB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function kd(e,t){return typeof e=="function"?e(t):e}function La(e,t){return typeof e=="function"?e(t):e}function hR(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==uA(a,t.options))return!1}else if(!pg(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function pR(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Gc(t.options.mutationKey)!==Gc(o))return!1}else if(!pg(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function uA(e,t){return(t?.queryKeyHashFn||Gc)(e)}function Gc(e){return JSON.stringify(e,(t,n)=>gE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function pg(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!pg(e[n],t[n])):!1}function BB(e,t){if(e===t)return e;const n=gR(e)&&gR(t);if(n||gE(e)&&gE(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),a=o.length,s=n?[]:{};let u=0;for(let l=0;l{setTimeout(t,e)})}function mE(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?BB(e,t):t}function Kfe(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Gfe(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var lA=Symbol();function UB(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===lA?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Yfe=class extends Ih{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!Kc&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},cA=new Yfe,Zfe=class extends Ih{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!Kc&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},cb=new Zfe;function vE(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function Xfe(e){return Math.min(1e3*2**e,3e4)}function zB(e){return(e??"online")==="online"?cb.isOnline():!0}var WB=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function MS(e){return e instanceof WB}function VB(e){let t=!1,n=0,r=!1,i;const o=vE(),a=y=>{r||(h(new WB(y)),e.abort?.())},s=()=>{t=!0},u=()=>{t=!1},l=()=>cA.isFocused()&&(e.networkMode==="always"||cb.isOnline())&&e.canRun(),c=()=>zB(e.networkMode)&&e.canRun(),f=y=>{r||(r=!0,e.onSuccess?.(y),i?.(),o.resolve(y))},h=y=>{r||(r=!0,e.onError?.(y),i?.(),o.reject(y))},p=()=>new Promise(y=>{i=b=>{(r||l())&&y(b)},e.onPause?.()}).then(()=>{i=void 0,r||e.onContinue?.()}),m=()=>{if(r)return;let y;const b=n===0?e.initialPromise:void 0;try{y=b??e.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(f).catch(w=>{if(r)return;const x=e.retry??(Kc?0:3),S=e.retryDelay??Xfe,O=typeof S=="function"?S(n,w):S,E=x===!0||typeof x=="number"&&nl()?void 0:p()).then(()=>{t?h(w):m()})})};return{promise:o,cancel:a,continue:()=>(i?.(),o),cancelRetry:s,continueRetry:u,canStart:c,start:()=>(c()?m():p().then(m),o)}}function Qfe(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=s=>setTimeout(s,0);const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(u=>{n(u)})})})};return{batch:s=>{let u;t++;try{u=s()}finally{t--,t||a()}return u},batchCalls:s=>(...u)=>{o(()=>{s(...u)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Wr=Qfe(),HB=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pE(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kc?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Jfe=class extends HB{#e;#t;#r;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ede(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=mE(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(oa).catch(oa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>La(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lA||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||!jB(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(u=>u.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,r=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const s=UB(this.options,t),u={queryKey:this.queryKey,meta:this.meta};return r(u),this.#o=!1,this.options.persister?this.options.persister(s,u,this):s(u)},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};r(o),this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#i({type:"fetch",meta:o.fetchOptions?.meta});const a=s=>{MS(s)&&s.silent||this.#i({type:"error",error:s}),MS(s)||(this.#r.config.onError?.(s,this),this.#r.config.onSettled?.(this.state.data,s,this)),this.scheduleGc()};return this.#n=VB({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:s=>{if(s===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(s)}catch(u){a(u);return}this.#r.config.onSuccess?.(s,this),this.#r.config.onSettled?.(s,this.state.error,this),this.scheduleGc()},onError:a,onFail:(s,u)=>{this.#i({type:"failed",failureCount:s,error:u})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#n.start()}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...qB(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return MS(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Wr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function qB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ede(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 tde=class extends Ih{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??uA(r,t);let o=this.get(i);return o||(o=new Jfe({cache:this,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Wr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>hR(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>hR(e,n)):t}notify(e){Wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Wr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},nde=class extends HB{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||KB(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=VB({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,i)=>{this.#n({type:"failed",failureCount:r,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const t=this.state.status==="pending",n=!this.#r.canStart();try{if(!t){this.#n({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);const i=await this.options.onMutate?.(e);i!==this.state.context&&this.#n({type:"pending",context:i,variables:e,isPaused:n})}const r=await this.#r.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#n({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#n({type:"error",error:r})}}finally{this.#t.runNext(this)}}#n(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Wr.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function KB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rde=class extends Ih{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new nde({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=uy(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=uy(e);if(this.#e.has(t)){const n=this.#e.get(t)?.filter(r=>r!==e);n&&(n.length===0?this.#e.delete(t):this.#e.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#e.get(uy(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(uy(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){Wr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#e.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(n=>pR(t,n))}findAll(e={}){return this.getAll().filter(t=>pR(e,t))}notify(e){Wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Wr.batch(()=>Promise.all(e.map(t=>t.continue().catch(oa))))}};function uy(e){return e.options.scope?.id??String(e.mutationId)}function vR(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},u=0;const l=async()=>{let c=!1;const f=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},h=UB(t.options,t.fetchOptions),p=async(m,y,b)=>{if(c)return Promise.reject();if(y==null&&m.pages.length)return Promise.resolve(m);const w={queryKey:t.queryKey,pageParam:y,direction:b?"backward":"forward",meta:t.options.meta};f(w);const x=await h(w),{maxPages:S}=t.options,O=b?Gfe:Kfe;return{pages:O(m.pages,x,S),pageParams:O(m.pageParams,y,S)}};if(i&&o.length){const m=i==="backward",y=m?ide:yR,b={pages:o,pageParams:a},w=y(r,b);s=await p(b,w,m)}else{const m=e??o.length;do{const y=u===0?a[0]??r.initialPageParam:yR(r,s);if(u>0&&y==null)break;s=await p(s,y),u++}while(ut.options.persister?.(l,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function yR(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ide(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var DQe=class{#e;#t;#r;#n;#a;#o;#i;#s;constructor(e={}){this.#e=e.queryCache||new tde,this.#t=e.mutationCache||new rde,this.#r=e.defaultOptions||{},this.#n=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#i=cA.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=cb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(kd(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=Hfe(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Wr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Wr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return Wr.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Wr.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(oa).catch(oa)}invalidateQueries(e,t={}){return Wr.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none")return Promise.resolve();const n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Wr.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(oa)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(oa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(kd(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(oa).catch(oa)}fetchInfiniteQuery(e){return e.behavior=vR(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(oa).catch(oa)}ensureInfiniteQueryData(e){return e.behavior=vR(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cb.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(Gc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()],n={};return t.forEach(r=>{pg(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(Gc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()];let n={};return t.forEach(r=>{pg(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uA(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===lA&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},ode=class extends Ih{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#i=vE(),this.options.experimental_prefetchInRender||this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#n=void 0;#a;#o;#i;#s;#g;#d;#h;#l;#c;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),bR(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yE(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yE(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e,t){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof La(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),n._defaulted&&!lb(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&xR(this.#t,r,this.options,n)&&this.#f(),this.updateResult(t),i&&(this.#t!==r||La(this.options.enabled,this.#t)!==La(n.enabled,this.#t)||kd(this.options.staleTime,this.#t)!==kd(n.staleTime,this.#t))&&this.#m();const o=this.#v();i&&(this.#t!==r||La(this.options.enabled,this.#t)!==La(n.enabled,this.#t)||o!==this.#u)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return sde(this,n)&&(this.#n=n,this.#o=this.options,this.#a=this.#t.state),n}getCurrentResult(){return this.#n}trackResult(e,t){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#f(e){this.#_();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(oa)),t}#m(){this.#x();const e=kd(this.options.staleTime,this.#t);if(Kc||this.#n.isStale||!pE(e))return;const n=jB(this.#n.dataUpdatedAt,e)+1;this.#l=setTimeout(()=>{this.#n.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#u=e,!(Kc||La(this.options.enabled,this.#t)===!1||!pE(this.#u)||this.#u===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||cA.isFocused())&&this.#f()},this.#u))}#b(){this.#m(),this.#y(this.#v())}#x(){this.#l&&(clearTimeout(this.#l),this.#l=void 0)}#w(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#n,o=this.#a,a=this.#o,u=e!==n?e.state:this.#r,{state:l}=e;let c={...l},f=!1,h;if(t._optimisticResults){const P=this.hasListeners(),M=!P&&bR(e,t),N=P&&xR(e,n,t,r);(M||N)&&(c={...c,...qB(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:y}=c;if(t.select&&c.data!==void 0)if(i&&c.data===o?.data&&t.select===this.#g)h=this.#d;else try{this.#g=t.select,h=t.select(c.data),h=mE(i?.data,h,t),this.#d=h,this.#s=null}catch(P){this.#s=P}else h=c.data;if(t.placeholderData!==void 0&&h===void 0&&y==="pending"){let P;if(i?.isPlaceholderData&&t.placeholderData===a?.placeholderData)P=i.data;else if(P=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,t.select&&P!==void 0)try{P=t.select(P),this.#s=null}catch(M){this.#s=M}P!==void 0&&(y="success",h=mE(i?.data,P,t),f=!0)}this.#s&&(p=this.#s,h=this.#d,m=Date.now(),y="error");const b=c.fetchStatus==="fetching",w=y==="pending",x=y==="error",S=w&&b,O=h!==void 0,C={status:y,fetchStatus:c.fetchStatus,isPending:w,isSuccess:y==="success",isError:x,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:c.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:x&&!O,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&O,isStale:fA(e,t),refetch:this.refetch,promise:this.#i};if(this.options.experimental_prefetchInRender){const P=B=>{C.status==="error"?B.reject(C.error):C.data!==void 0&&B.resolve(C.data)},M=()=>{const B=this.#i=C.promise=vE();P(B)},N=this.#i;switch(N.status){case"pending":e.queryHash===n.queryHash&&P(N);break;case"fulfilled":(C.status==="error"||C.data!==N.value)&&M();break;case"rejected":(C.status!=="error"||C.error!==N.reason)&&M();break}}return C}updateResult(e){const t=this.#n,n=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#t),lb(n,t))return;this.#n=n;const r={},i=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!this.#p.size)return!0;const s=new Set(a??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#n).some(u=>{const l=u;return this.#n[l]!==t[l]&&s.has(l)})};e?.listeners!==!1&&i()&&(r.listeners=!0),this.#S({...r,...e})}#_(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){Wr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function ade(e,t){return La(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function bR(e,t){return ade(e,t)||e.state.data!==void 0&&yE(e,t,t.refetchOnMount)}function yE(e,t,n){if(La(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fA(e,t)}return!1}function xR(e,t,n,r){return(e!==t||La(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&fA(e,n)}function fA(e,t){return La(t.enabled,e)!==!1&&e.isStaleByTime(kd(t.staleTime,e))}function sde(e,t){return!lb(e.getCurrentResult(),t)}var ude=class extends Ih{#e;#t=void 0;#r;#n;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),lb(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),n?.mutationKey&&this.options.mutationKey&&Gc(n.mutationKey)!==Gc(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#a(),this.#o()}mutate(t,n){return this.#n=n,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#a(){const t=this.#r?.state??KB();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Wr.batch(()=>{if(this.#n&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context;t?.type==="success"?(this.#n.onSuccess?.(t.data,n,r),this.#n.onSettled?.(t.data,null,n,r)):t?.type==="error"&&(this.#n.onError?.(t.error,n,r),this.#n.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#t)})})}},GB=v.createContext(void 0),YB=e=>{const t=v.useContext(GB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},IQe=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),I.jsx(GB.Provider,{value:e,children:t})),ZB=v.createContext(!1),lde=()=>v.useContext(ZB);ZB.Provider;function cde(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var fde=v.createContext(cde()),dde=()=>v.useContext(fde);function XB(e,t){return typeof e=="function"?e(...t):!!e}function bE(){}var hde=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},pde=e=>{v.useEffect(()=>{e.clearReset()},[e])},gde=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&XB(n,[e.error,r]),mde=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},vde=(e,t)=>e.isLoading&&e.isFetching&&!t,yde=(e,t)=>e?.suspense&&t.isPending,wR=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bde(e,t,n){const r=YB(),i=lde(),o=dde(),a=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=i?"isRestoring":"optimistic",mde(a),hde(a,o),pde(o);const s=!r.getQueryCache().get(a.queryHash),[u]=v.useState(()=>new t(r,a)),l=u.getOptimisticResult(a);if(v.useSyncExternalStore(v.useCallback(c=>{const f=i?bE:u.subscribe(Wr.batchCalls(c));return u.updateResult(),f},[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),v.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),yde(a,l))throw wR(a,u,o);if(gde({result:l,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!Kc&&vde(l,i)&&(s?wR(a,u,o):r.getQueryCache().get(a.queryHash)?.promise)?.catch(bE).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?l:u.trackResult(l)}function NQe(e,t){return bde(e,ode)}function LQe(e,t){const n=YB(),[r]=v.useState(()=>new ude(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(a=>r.subscribe(Wr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((a,s)=>{r.mutate(a,s).catch(bE)},[r]);if(i.error&&XB(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var QB={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(la,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",u="hour",l="day",c="week",f="month",h="quarter",p="year",m="date",y="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var q=["th","st","nd","rd"],G=Z%100;return"["+Z+(q[(G-20)%10]||q[G]||q[0])+"]"}},S=function(Z,q,G){var H=String(Z);return!H||H.length>=q?Z:""+Array(q+1-H.length).join(G)+Z},O={s:S,z:function(Z){var q=-Z.utcOffset(),G=Math.abs(q),H=Math.floor(G/60),j=G%60;return(q<=0?"+":"-")+S(H,2,"0")+":"+S(j,2,"0")},m:function Z(q,G){if(q.date()1)return Z(Y[0])}else{var oe=q.name;C[oe]=q,j=oe}return!H&&j&&(E=j),j||!H&&E},B=function(Z,q){if(M(Z))return Z.clone();var G=typeof q=="object"?q:{};return G.date=Z,G.args=arguments,new W(G)},V=O;V.l=N,V.i=M,V.w=function(Z,q){return B(Z,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var W=function(){function Z(G){this.$L=N(G.locale,null,!0),this.parse(G),this.$x=this.$x||G.x||{},this[P]=!0}var q=Z.prototype;return q.parse=function(G){this.$d=function(H){var j=H.date,K=H.utc;if(j===null)return new Date(NaN);if(V.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var Y=j.match(b);if(Y){var oe=Y[2]-1||0,X=(Y[7]||"0").substring(0,3);return K?new Date(Date.UTC(Y[1],oe,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,X)):new Date(Y[1],oe,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,X)}}return new Date(j)}(G),this.init()},q.init=function(){var G=this.$d;this.$y=G.getFullYear(),this.$M=G.getMonth(),this.$D=G.getDate(),this.$W=G.getDay(),this.$H=G.getHours(),this.$m=G.getMinutes(),this.$s=G.getSeconds(),this.$ms=G.getMilliseconds()},q.$utils=function(){return V},q.isValid=function(){return this.$d.toString()!==y},q.isSame=function(G,H){var j=B(G);return this.startOf(H)<=j&&j<=this.endOf(H)},q.isAfter=function(G,H){return B(G){vw[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const IR={};vw.transitional=function(t,n,r){function i(o,a){return"[Axios v"+_U+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,s)=>{if(t===!1)throw new Gt(i(a," has been removed"+(n?" in "+n:"")),Gt.ERR_DEPRECATED);return n&&!IR[a]&&(IR[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,s):!0}};vw.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Ghe(e,t,n){if(typeof e!="object")throw new Gt("options must be an object",Gt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const s=e[o],u=s===void 0||a(s,o,e);if(u!==!0)throw new Gt("option "+o+" must be "+u,Gt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Gt("Unknown option "+o,Gt.ERR_BAD_OPTION)}}const p1={assertOptions:Ghe,validators:vw},us=p1.validators;class Dc{constructor(t){this.defaults=t,this.interceptors={request:new OR,response:new OR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Yc(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&p1.assertOptions(r,{silentJSONParsing:us.transitional(us.boolean),forcedJSONParsing:us.transitional(us.boolean),clarifyTimeoutError:us.transitional(us.boolean)},!1),i!=null&&(_e.isFunction(i)?n.paramsSerializer={serialize:i}:p1.assertOptions(i,{encode:us.function,serialize:us.function},!0)),p1.assertOptions(n,{baseUrl:us.spelling("baseURL"),withXsrfToken:us.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&_e.merge(o.common,o[n.method]);o&&_e.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),n.headers=fo.concat(a,o);const s=[];let u=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(u=u&&y.synchronous,s.unshift(y.fulfilled,y.rejected))});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let c,f=0,h;if(!u){const m=[$R.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,l),h=m.length,c=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,s){r.reason||(r.reason=new Lh(o,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new gA(function(i){t=i}),cancel:t}}}function Yhe(e){return function(n){return e.apply(null,n)}}function Zhe(e){return _e.isObject(e)&&e.isAxiosError===!0}const EE={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(EE).forEach(([e,t])=>{EE[t]=e});function SU(e){const t=new Dc(e),n=eU(Dc.prototype.request,t);return _e.extend(n,Dc.prototype,t,{allOwnKeys:!0}),_e.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return SU(Yc(e,i))},n}const Gr=SU(Am);Gr.Axios=Dc;Gr.CanceledError=Lh;Gr.CancelToken=gA;Gr.isCancel=gU;Gr.VERSION=_U;Gr.toFormData=gw;Gr.AxiosError=Gt;Gr.Cancel=Gr.CanceledError;Gr.all=function(t){return Promise.all(t)};Gr.spread=Yhe;Gr.isAxiosError=Zhe;Gr.mergeConfig=Yc;Gr.AxiosHeaders=fo;Gr.formToJSON=e=>pU(_e.isHTMLForm(e)?new FormData(e):e);Gr.getAdapter=wU.getAdapter;Gr.HttpStatusCode=EE;Gr.default=Gr;var Xhe=e=>{switch(e){case"success":return epe;case"info":return npe;case"warning":return tpe;case"error":return rpe;default:return null}},Qhe=Array(12).fill(0),Jhe=({visible:e,className:t})=>F.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},F.createElement("div",{className:"sonner-spinner"},Qhe.map((n,r)=>F.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),epe=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),tpe=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),npe=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),rpe=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ipe=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},F.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),F.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ope=()=>{let[e,t]=F.useState(document.hidden);return F.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},OE=1,ape=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:OE++,o=this.toasts.find(s=>s.id===i),a=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...e,id:i,title:n}),{...s,...e,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,a=r.then(async u=>{if(o=["resolve",u],F.isValidElement(u))i=!1,this.create({id:n,type:"default",message:u});else if(upe(u)&&!u.ok){i=!1;let l=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,c=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description;this.create({id:n,type:"error",message:l,description:c})}else if(t.success!==void 0){i=!1;let l=typeof t.success=="function"?await t.success(u):t.success,c=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"success",message:l,description:c})}}).catch(async u=>{if(o=["reject",u],t.error!==void 0){i=!1;let l=typeof t.error=="function"?await t.error(u):t.error,c=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"error",message:l,description:c})}}).finally(()=>{var u;i&&(this.dismiss(n),n=void 0),(u=t.finally)==null||u.call(t)}),s=()=>new Promise((u,l)=>a.then(()=>o[0]==="reject"?l(o[1]):u(o[1])).catch(l));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||OE++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Ao=new ape,spe=(e,t)=>{let n=t?.id||OE++;return Ao.addToast({title:e,...t,id:n}),n},upe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lpe=spe,cpe=()=>Ao.toasts,BQe=Object.assign(lpe,{success:Ao.success,info:Ao.info,warning:Ao.warning,error:Ao.error,custom:Ao.custom,message:Ao.message,promise:Ao.promise,dismiss:Ao.dismiss,loading:Ao.loading},{getHistory:cpe});function fpe(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}fpe(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);function ly(e){return e.label!==void 0}var dpe=3,hpe="32px",NR=4e3,ppe=356,gpe=14,mpe=20,vpe=200;function ype(...e){return e.filter(Boolean).join(" ")}var bpe=e=>{var t,n,r,i,o,a,s,u,l,c,f;let{invert:h,toast:p,unstyled:m,interacting:y,setHeights:b,visibleToasts:w,heights:x,index:S,toasts:O,expanded:E,removeToast:C,defaultRichColors:P,closeButton:M,style:N,cancelButtonStyle:B,actionButtonStyle:V,className:W="",descriptionClassName:ne="",duration:Z,position:q,gap:G,loadingIcon:H,expandByDefault:j,classNames:K,icons:Y,closeButtonAriaLabel:oe="Close toast",pauseWhenPageIsHidden:X,cn:Q}=e,[ue,de]=F.useState(!1),[Se,me]=F.useState(!1),[Ze,Ae]=F.useState(!1),[Le,$e]=F.useState(!1),[be,bt]=F.useState(!1),[lt,Ft]=F.useState(0),[yn,nn]=F.useState(0),ie=F.useRef(p.duration||Z||NR),pe=F.useRef(null),ye=F.useRef(null),ze=S===0,je=S+1<=w,ke=p.type,nt=p.dismissible!==!1,mt=p.className||"",wn=p.descriptionClassName||"",Kt=F.useMemo(()=>x.findIndex(St=>St.toastId===p.id)||0,[x,p.id]),_n=F.useMemo(()=>{var St;return(St=p.closeButton)!=null?St:M},[p.closeButton,M]);F.useMemo(()=>p.duration||Z||NR,[p.duration,Z]);let $i=F.useRef(0),xr=F.useRef(0),mi=F.useRef(0),ur=F.useRef(null),[ai,vi]=q.split("-"),Dr=F.useMemo(()=>x.reduce((St,hn,Sn)=>Sn>=Kt?St:St+hn.height,0),[x,Kt]),Zi=ope(),vo=p.invert||h,yi=ke==="loading";xr.current=F.useMemo(()=>Kt*G+Dr,[Kt,Dr]),F.useEffect(()=>{de(!0)},[]),F.useEffect(()=>{let St=ye.current;if(St){let hn=St.getBoundingClientRect().height;return nn(hn),b(Sn=>[{toastId:p.id,height:hn,position:p.position},...Sn]),()=>b(Sn=>Sn.filter(Gn=>Gn.toastId!==p.id))}},[b,p.id]),F.useLayoutEffect(()=>{if(!ue)return;let St=ye.current,hn=St.style.height;St.style.height="auto";let Sn=St.getBoundingClientRect().height;St.style.height=hn,nn(Sn),b(Gn=>Gn.find(lr=>lr.toastId===p.id)?Gn.map(lr=>lr.toastId===p.id?{...lr,height:Sn}:lr):[{toastId:p.id,height:Sn,position:p.position},...Gn])},[ue,p.title,p.description,b,p.id]);let $r=F.useCallback(()=>{me(!0),Ft(xr.current),b(St=>St.filter(hn=>hn.toastId!==p.id)),setTimeout(()=>{C(p)},vpe)},[p,C,b,xr]);F.useEffect(()=>{if(p.promise&&ke==="loading"||p.duration===1/0||p.type==="loading")return;let St;return E||y||X&&Zi?(()=>{if(mi.current<$i.current){let hn=new Date().getTime()-$i.current;ie.current=ie.current-hn}mi.current=new Date().getTime()})():ie.current!==1/0&&($i.current=new Date().getTime(),St=setTimeout(()=>{var hn;(hn=p.onAutoClose)==null||hn.call(p,p),$r()},ie.current)),()=>clearTimeout(St)},[E,y,p,ke,X,Zi,$r]),F.useEffect(()=>{p.delete&&$r()},[$r,p.delete]);function Sa(){var St,hn,Sn;return Y!=null&&Y.loading?F.createElement("div",{className:Q(K?.loader,(St=p?.classNames)==null?void 0:St.loader,"sonner-loader"),"data-visible":ke==="loading"},Y.loading):H?F.createElement("div",{className:Q(K?.loader,(hn=p?.classNames)==null?void 0:hn.loader,"sonner-loader"),"data-visible":ke==="loading"},H):F.createElement(Jhe,{className:Q(K?.loader,(Sn=p?.classNames)==null?void 0:Sn.loader),visible:ke==="loading"})}return F.createElement("li",{tabIndex:0,ref:ye,className:Q(W,mt,K?.toast,(t=p?.classNames)==null?void 0:t.toast,K?.default,K?.[ke],(n=p?.classNames)==null?void 0:n[ke]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:P,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":ue,"data-promise":!!p.promise,"data-swiped":be,"data-removed":Se,"data-visible":je,"data-y-position":ai,"data-x-position":vi,"data-index":S,"data-front":ze,"data-swiping":Ze,"data-dismissible":nt,"data-type":ke,"data-invert":vo,"data-swipe-out":Le,"data-expanded":!!(E||j&&ue),style:{"--index":S,"--toasts-before":S,"--z-index":O.length-S,"--offset":`${Se?lt:xr.current}px`,"--initial-height":j?"auto":`${yn}px`,...N,...p.style},onPointerDown:St=>{yi||!nt||(pe.current=new Date,Ft(xr.current),St.target.setPointerCapture(St.pointerId),St.target.tagName!=="BUTTON"&&(Ae(!0),ur.current={x:St.clientX,y:St.clientY}))},onPointerUp:()=>{var St,hn,Sn,Gn;if(Le||!nt)return;ur.current=null;let lr=Number(((St=ye.current)==null?void 0:St.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Xr=new Date().getTime()-((hn=pe.current)==null?void 0:hn.getTime()),yo=Math.abs(lr)/Xr;if(Math.abs(lr)>=mpe||yo>.11){Ft(xr.current),(Sn=p.onDismiss)==null||Sn.call(p,p),$r(),$e(!0),bt(!1);return}(Gn=ye.current)==null||Gn.style.setProperty("--swipe-amount","0px"),Ae(!1)},onPointerMove:St=>{var hn,Sn;if(!ur.current||!nt)return;let Gn=St.clientY-ur.current.y,lr=((hn=window.getSelection())==null?void 0:hn.toString().length)>0,Xr=ai==="top"?Math.min(0,Gn):Math.max(0,Gn);Math.abs(Xr)>0&&bt(!0),!lr&&((Sn=ye.current)==null||Sn.style.setProperty("--swipe-amount",`${Xr}px`))}},_n&&!p.jsx?F.createElement("button",{"aria-label":oe,"data-disabled":yi,"data-close-button":!0,onClick:yi||!nt?()=>{}:()=>{var St;$r(),(St=p.onDismiss)==null||St.call(p,p)},className:Q(K?.closeButton,(i=p?.classNames)==null?void 0:i.closeButton)},(o=Y?.close)!=null?o:ipe):null,p.jsx||F.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:F.createElement(F.Fragment,null,ke||p.icon||p.promise?F.createElement("div",{"data-icon":"",className:Q(K?.icon,(a=p?.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Sa():null,p.type!=="loading"?p.icon||Y?.[ke]||Xhe(ke):null):null,F.createElement("div",{"data-content":"",className:Q(K?.content,(s=p?.classNames)==null?void 0:s.content)},F.createElement("div",{"data-title":"",className:Q(K?.title,(u=p?.classNames)==null?void 0:u.title)},typeof p.title=="function"?p.title():p.title),p.description?F.createElement("div",{"data-description":"",className:Q(ne,wn,K?.description,(l=p?.classNames)==null?void 0:l.description)},typeof p.description=="function"?p.description():p.description):null),F.isValidElement(p.cancel)?p.cancel:p.cancel&&ly(p.cancel)?F.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||B,onClick:St=>{var hn,Sn;ly(p.cancel)&&nt&&((Sn=(hn=p.cancel).onClick)==null||Sn.call(hn,St),$r())},className:Q(K?.cancelButton,(c=p?.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,F.isValidElement(p.action)?p.action:p.action&&ly(p.action)?F.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||V,onClick:St=>{var hn,Sn;ly(p.action)&&((Sn=(hn=p.action).onClick)==null||Sn.call(hn,St),!St.defaultPrevented&&$r())},className:Q(K?.actionButton,(f=p?.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function LR(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var UQe=v.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:u,theme:l="light",richColors:c,duration:f,style:h,visibleToasts:p=dpe,toastOptions:m,dir:y=LR(),gap:b=gpe,loadingIcon:w,icons:x,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:O,cn:E=ype}=e,[C,P]=F.useState([]),M=F.useMemo(()=>Array.from(new Set([r].concat(C.filter(X=>X.position).map(X=>X.position)))),[C,r]),[N,B]=F.useState([]),[V,W]=F.useState(!1),[ne,Z]=F.useState(!1),[q,G]=F.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=F.useRef(null),j=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=F.useRef(null),Y=F.useRef(!1),oe=F.useCallback(X=>{P(Q=>{var ue;return(ue=Q.find(de=>de.id===X.id))!=null&&ue.delete||Ao.dismiss(X.id),Q.filter(({id:de})=>de!==X.id)})},[]);return F.useEffect(()=>Ao.subscribe(X=>{if(X.dismiss){P(Q=>Q.map(ue=>ue.id===X.id?{...ue,delete:!0}:ue));return}setTimeout(()=>{iw.flushSync(()=>{P(Q=>{let ue=Q.findIndex(de=>de.id===X.id);return ue!==-1?[...Q.slice(0,ue),{...Q[ue],...X},...Q.slice(ue+1)]:[X,...Q]})})})}),[]),F.useEffect(()=>{if(l!=="system"){G(l);return}if(l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:Q})=>{G(Q?"dark":"light")})}catch{X.addListener(({matches:ue})=>{try{G(ue?"dark":"light")}catch(de){console.error(de)}})}},[l]),F.useEffect(()=>{C.length<=1&&W(!1)},[C]),F.useEffect(()=>{let X=Q=>{var ue,de;i.every(Se=>Q[Se]||Q.code===Se)&&(W(!0),(ue=H.current)==null||ue.focus()),Q.code==="Escape"&&(document.activeElement===H.current||(de=H.current)!=null&&de.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[i]),F.useEffect(()=>{if(H.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,Y.current=!1)}},[H.current]),F.createElement("section",{"aria-label":`${S} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},M.map((X,Q)=>{var ue;let[de,Se]=X.split("-");return C.length?F.createElement("ol",{key:X,dir:y==="auto"?LR():y,tabIndex:-1,ref:H,className:s,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":de,"data-lifted":V&&C.length>1&&!o,"data-x-position":Se,style:{"--front-toast-height":`${((ue=N[0])==null?void 0:ue.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||hpe,"--width":`${ppe}px`,"--gap":`${b}px`,...h},onBlur:me=>{Y.current&&!me.currentTarget.contains(me.relatedTarget)&&(Y.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,K.current=me.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{ne||W(!1)},onPointerDown:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},C.filter(me=>!me.position&&Q===0||me.position===X).map((me,Ze)=>{var Ae,Le;return F.createElement(bpe,{key:me.id,icons:x,index:Ze,toast:me,defaultRichColors:c,duration:(Ae=m?.duration)!=null?Ae:f,className:m?.className,descriptionClassName:m?.descriptionClassName,invert:n,visibleToasts:p,closeButton:(Le=m?.closeButton)!=null?Le:a,interacting:ne,position:X,style:m?.style,unstyled:m?.unstyled,classNames:m?.classNames,cancelButtonStyle:m?.cancelButtonStyle,actionButtonStyle:m?.actionButtonStyle,removeToast:oe,toasts:C.filter($e=>$e.position==me.position),heights:N.filter($e=>$e.position==me.position),setHeights:B,expandByDefault:o,gap:b,loadingIcon:w,expanded:V,pauseWhenPageIsHidden:O,cn:E})})):null}))}),hb={exports:{}};/** +`);function ly(e){return e.label!==void 0}var dpe=3,hpe="32px",NR=4e3,ppe=356,gpe=14,mpe=20,vpe=200;function ype(...e){return e.filter(Boolean).join(" ")}var bpe=e=>{var t,n,r,i,o,a,s,u,l,c,f;let{invert:h,toast:p,unstyled:m,interacting:y,setHeights:b,visibleToasts:w,heights:x,index:S,toasts:O,expanded:E,removeToast:C,defaultRichColors:P,closeButton:M,style:N,cancelButtonStyle:B,actionButtonStyle:V,className:W="",descriptionClassName:ne="",duration:Z,position:q,gap:G,loadingIcon:H,expandByDefault:j,classNames:K,icons:Y,closeButtonAriaLabel:oe="Close toast",pauseWhenPageIsHidden:X,cn:Q}=e,[ue,de]=F.useState(!1),[Se,me]=F.useState(!1),[Ze,Ae]=F.useState(!1),[Le,$e]=F.useState(!1),[be,bt]=F.useState(!1),[lt,Ft]=F.useState(0),[yn,nn]=F.useState(0),ie=F.useRef(p.duration||Z||NR),pe=F.useRef(null),ye=F.useRef(null),ze=S===0,je=S+1<=w,ke=p.type,nt=p.dismissible!==!1,vt=p.className||"",wn=p.descriptionClassName||"",Kt=F.useMemo(()=>x.findIndex(St=>St.toastId===p.id)||0,[x,p.id]),_n=F.useMemo(()=>{var St;return(St=p.closeButton)!=null?St:M},[p.closeButton,M]);F.useMemo(()=>p.duration||Z||NR,[p.duration,Z]);let $i=F.useRef(0),xr=F.useRef(0),mi=F.useRef(0),ur=F.useRef(null),[ai,vi]=q.split("-"),Dr=F.useMemo(()=>x.reduce((St,hn,Sn)=>Sn>=Kt?St:St+hn.height,0),[x,Kt]),Zi=ope(),vo=p.invert||h,yi=ke==="loading";xr.current=F.useMemo(()=>Kt*G+Dr,[Kt,Dr]),F.useEffect(()=>{de(!0)},[]),F.useEffect(()=>{let St=ye.current;if(St){let hn=St.getBoundingClientRect().height;return nn(hn),b(Sn=>[{toastId:p.id,height:hn,position:p.position},...Sn]),()=>b(Sn=>Sn.filter(Gn=>Gn.toastId!==p.id))}},[b,p.id]),F.useLayoutEffect(()=>{if(!ue)return;let St=ye.current,hn=St.style.height;St.style.height="auto";let Sn=St.getBoundingClientRect().height;St.style.height=hn,nn(Sn),b(Gn=>Gn.find(lr=>lr.toastId===p.id)?Gn.map(lr=>lr.toastId===p.id?{...lr,height:Sn}:lr):[{toastId:p.id,height:Sn,position:p.position},...Gn])},[ue,p.title,p.description,b,p.id]);let $r=F.useCallback(()=>{me(!0),Ft(xr.current),b(St=>St.filter(hn=>hn.toastId!==p.id)),setTimeout(()=>{C(p)},vpe)},[p,C,b,xr]);F.useEffect(()=>{if(p.promise&&ke==="loading"||p.duration===1/0||p.type==="loading")return;let St;return E||y||X&&Zi?(()=>{if(mi.current<$i.current){let hn=new Date().getTime()-$i.current;ie.current=ie.current-hn}mi.current=new Date().getTime()})():ie.current!==1/0&&($i.current=new Date().getTime(),St=setTimeout(()=>{var hn;(hn=p.onAutoClose)==null||hn.call(p,p),$r()},ie.current)),()=>clearTimeout(St)},[E,y,p,ke,X,Zi,$r]),F.useEffect(()=>{p.delete&&$r()},[$r,p.delete]);function Sa(){var St,hn,Sn;return Y!=null&&Y.loading?F.createElement("div",{className:Q(K?.loader,(St=p?.classNames)==null?void 0:St.loader,"sonner-loader"),"data-visible":ke==="loading"},Y.loading):H?F.createElement("div",{className:Q(K?.loader,(hn=p?.classNames)==null?void 0:hn.loader,"sonner-loader"),"data-visible":ke==="loading"},H):F.createElement(Jhe,{className:Q(K?.loader,(Sn=p?.classNames)==null?void 0:Sn.loader),visible:ke==="loading"})}return F.createElement("li",{tabIndex:0,ref:ye,className:Q(W,vt,K?.toast,(t=p?.classNames)==null?void 0:t.toast,K?.default,K?.[ke],(n=p?.classNames)==null?void 0:n[ke]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:P,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":ue,"data-promise":!!p.promise,"data-swiped":be,"data-removed":Se,"data-visible":je,"data-y-position":ai,"data-x-position":vi,"data-index":S,"data-front":ze,"data-swiping":Ze,"data-dismissible":nt,"data-type":ke,"data-invert":vo,"data-swipe-out":Le,"data-expanded":!!(E||j&&ue),style:{"--index":S,"--toasts-before":S,"--z-index":O.length-S,"--offset":`${Se?lt:xr.current}px`,"--initial-height":j?"auto":`${yn}px`,...N,...p.style},onPointerDown:St=>{yi||!nt||(pe.current=new Date,Ft(xr.current),St.target.setPointerCapture(St.pointerId),St.target.tagName!=="BUTTON"&&(Ae(!0),ur.current={x:St.clientX,y:St.clientY}))},onPointerUp:()=>{var St,hn,Sn,Gn;if(Le||!nt)return;ur.current=null;let lr=Number(((St=ye.current)==null?void 0:St.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Xr=new Date().getTime()-((hn=pe.current)==null?void 0:hn.getTime()),yo=Math.abs(lr)/Xr;if(Math.abs(lr)>=mpe||yo>.11){Ft(xr.current),(Sn=p.onDismiss)==null||Sn.call(p,p),$r(),$e(!0),bt(!1);return}(Gn=ye.current)==null||Gn.style.setProperty("--swipe-amount","0px"),Ae(!1)},onPointerMove:St=>{var hn,Sn;if(!ur.current||!nt)return;let Gn=St.clientY-ur.current.y,lr=((hn=window.getSelection())==null?void 0:hn.toString().length)>0,Xr=ai==="top"?Math.min(0,Gn):Math.max(0,Gn);Math.abs(Xr)>0&&bt(!0),!lr&&((Sn=ye.current)==null||Sn.style.setProperty("--swipe-amount",`${Xr}px`))}},_n&&!p.jsx?F.createElement("button",{"aria-label":oe,"data-disabled":yi,"data-close-button":!0,onClick:yi||!nt?()=>{}:()=>{var St;$r(),(St=p.onDismiss)==null||St.call(p,p)},className:Q(K?.closeButton,(i=p?.classNames)==null?void 0:i.closeButton)},(o=Y?.close)!=null?o:ipe):null,p.jsx||F.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:F.createElement(F.Fragment,null,ke||p.icon||p.promise?F.createElement("div",{"data-icon":"",className:Q(K?.icon,(a=p?.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Sa():null,p.type!=="loading"?p.icon||Y?.[ke]||Xhe(ke):null):null,F.createElement("div",{"data-content":"",className:Q(K?.content,(s=p?.classNames)==null?void 0:s.content)},F.createElement("div",{"data-title":"",className:Q(K?.title,(u=p?.classNames)==null?void 0:u.title)},typeof p.title=="function"?p.title():p.title),p.description?F.createElement("div",{"data-description":"",className:Q(ne,wn,K?.description,(l=p?.classNames)==null?void 0:l.description)},typeof p.description=="function"?p.description():p.description):null),F.isValidElement(p.cancel)?p.cancel:p.cancel&&ly(p.cancel)?F.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||B,onClick:St=>{var hn,Sn;ly(p.cancel)&&nt&&((Sn=(hn=p.cancel).onClick)==null||Sn.call(hn,St),$r())},className:Q(K?.cancelButton,(c=p?.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,F.isValidElement(p.action)?p.action:p.action&&ly(p.action)?F.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||V,onClick:St=>{var hn,Sn;ly(p.action)&&((Sn=(hn=p.action).onClick)==null||Sn.call(hn,St),!St.defaultPrevented&&$r())},className:Q(K?.actionButton,(f=p?.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function LR(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var UQe=v.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:u,theme:l="light",richColors:c,duration:f,style:h,visibleToasts:p=dpe,toastOptions:m,dir:y=LR(),gap:b=gpe,loadingIcon:w,icons:x,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:O,cn:E=ype}=e,[C,P]=F.useState([]),M=F.useMemo(()=>Array.from(new Set([r].concat(C.filter(X=>X.position).map(X=>X.position)))),[C,r]),[N,B]=F.useState([]),[V,W]=F.useState(!1),[ne,Z]=F.useState(!1),[q,G]=F.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=F.useRef(null),j=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=F.useRef(null),Y=F.useRef(!1),oe=F.useCallback(X=>{P(Q=>{var ue;return(ue=Q.find(de=>de.id===X.id))!=null&&ue.delete||Ao.dismiss(X.id),Q.filter(({id:de})=>de!==X.id)})},[]);return F.useEffect(()=>Ao.subscribe(X=>{if(X.dismiss){P(Q=>Q.map(ue=>ue.id===X.id?{...ue,delete:!0}:ue));return}setTimeout(()=>{iw.flushSync(()=>{P(Q=>{let ue=Q.findIndex(de=>de.id===X.id);return ue!==-1?[...Q.slice(0,ue),{...Q[ue],...X},...Q.slice(ue+1)]:[X,...Q]})})})}),[]),F.useEffect(()=>{if(l!=="system"){G(l);return}if(l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:Q})=>{G(Q?"dark":"light")})}catch{X.addListener(({matches:ue})=>{try{G(ue?"dark":"light")}catch(de){console.error(de)}})}},[l]),F.useEffect(()=>{C.length<=1&&W(!1)},[C]),F.useEffect(()=>{let X=Q=>{var ue,de;i.every(Se=>Q[Se]||Q.code===Se)&&(W(!0),(ue=H.current)==null||ue.focus()),Q.code==="Escape"&&(document.activeElement===H.current||(de=H.current)!=null&&de.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[i]),F.useEffect(()=>{if(H.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,Y.current=!1)}},[H.current]),F.createElement("section",{"aria-label":`${S} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},M.map((X,Q)=>{var ue;let[de,Se]=X.split("-");return C.length?F.createElement("ol",{key:X,dir:y==="auto"?LR():y,tabIndex:-1,ref:H,className:s,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":de,"data-lifted":V&&C.length>1&&!o,"data-x-position":Se,style:{"--front-toast-height":`${((ue=N[0])==null?void 0:ue.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||hpe,"--width":`${ppe}px`,"--gap":`${b}px`,...h},onBlur:me=>{Y.current&&!me.currentTarget.contains(me.relatedTarget)&&(Y.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,K.current=me.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{ne||W(!1)},onPointerDown:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},C.filter(me=>!me.position&&Q===0||me.position===X).map((me,Ze)=>{var Ae,Le;return F.createElement(bpe,{key:me.id,icons:x,index:Ze,toast:me,defaultRichColors:c,duration:(Ae=m?.duration)!=null?Ae:f,className:m?.className,descriptionClassName:m?.descriptionClassName,invert:n,visibleToasts:p,closeButton:(Le=m?.closeButton)!=null?Le:a,interacting:ne,position:X,style:m?.style,unstyled:m?.unstyled,classNames:m?.classNames,cancelButtonStyle:m?.cancelButtonStyle,actionButtonStyle:m?.actionButtonStyle,removeToast:oe,toasts:C.filter($e=>$e.position==me.position),heights:N.filter($e=>$e.position==me.position),setHeights:B,expandByDefault:o,gap:b,loadingIcon:w,expanded:V,pauseWhenPageIsHidden:O,cn:E})})):null}))}),hb={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 - */hb.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",f=1,h=2,p=4,m=1,y=2,b=1,w=2,x=4,S=8,O=16,E=32,C=64,P=128,M=256,N=512,B=30,V="...",W=800,ne=16,Z=1,q=2,G=3,H=1/0,j=9007199254740991,K=17976931348623157e292,Y=NaN,oe=4294967295,X=oe-1,Q=oe>>>1,ue=[["ary",P],["bind",b],["bindKey",w],["curry",S],["curryRight",O],["flip",N],["partial",E],["partialRight",C],["rearg",M]],de="[object Arguments]",Se="[object Array]",me="[object AsyncFunction]",Ze="[object Boolean]",Ae="[object Date]",Le="[object DOMException]",$e="[object Error]",be="[object Function]",bt="[object GeneratorFunction]",lt="[object Map]",Ft="[object Number]",yn="[object Null]",nn="[object Object]",ie="[object Promise]",pe="[object Proxy]",ye="[object RegExp]",ze="[object Set]",je="[object String]",ke="[object Symbol]",nt="[object Undefined]",mt="[object WeakMap]",wn="[object WeakSet]",Kt="[object ArrayBuffer]",_n="[object DataView]",$i="[object Float32Array]",xr="[object Float64Array]",mi="[object Int8Array]",ur="[object Int16Array]",ai="[object Int32Array]",vi="[object Uint8Array]",Dr="[object Uint8ClampedArray]",Zi="[object Uint16Array]",vo="[object Uint32Array]",yi=/\b__p \+= '';/g,$r=/\b(__p \+=) '' \+/g,Sa=/(__e\(.*?\)|\b__t\)) \+\n'';/g,St=/&(?:amp|lt|gt|quot|#39);/g,hn=/[&<>"']/g,Sn=RegExp(St.source),Gn=RegExp(hn.source),lr=/<%-([\s\S]+?)%>/g,Xr=/<%([\s\S]+?)%>/g,yo=/<%=([\s\S]+?)%>/g,Xl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cf=/^\w*$/,ae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,le=/[\\^$.*+?()[\]{}|]/g,xe=RegExp(le.source),T=/^\s+/,D=/\s/,$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,A=/\{\n\/\* \[wrapped with (.+)\] \*/,L=/,? & /,ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,re=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,Ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Be=/\w*$/,He=/^[-+]0x[0-9a-f]+$/i,ct=/^0b[01]+$/i,Ne=/^\[object .+?Constructor\]$/,rt=/^0o[0-7]+$/i,xt=/^(?:0|[1-9]\d*)$/,At=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pt=/($^)/,ht=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",_t="\\u0300-\\u036f",Je="\\ufe20-\\ufe2f",ut="\\u20d0-\\u20ff",Qe=_t+Je+ut,Fe="\\u2700-\\u27bf",qe="a-z\\xdf-\\xf6\\xf8-\\xff",Ge="\\xac\\xb1\\xd7\\xf7",ve="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ge="\\u2000-\\u206f",De=" \\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",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",Ue=Ge+ve+ge+De,vt="['’]",jt="["+wt+"]",Bt="["+Ue+"]",It="["+Qe+"]",te="\\d+",Zt="["+Fe+"]",sn="["+qe+"]",un="[^"+wt+Ue+te+Fe+qe+Pe+"]",Ut="\\ud83c[\\udffb-\\udfff]",ln="(?:"+It+"|"+Ut+")",rn="[^"+wt+"]",Yn="(?:\\ud83c[\\udde6-\\uddff]){2}",mn="[\\ud800-\\udbff][\\udc00-\\udfff]",Tn="["+Pe+"]",Zn="\\u200d",Xn="(?:"+sn+"|"+un+")",wr="(?:"+Tn+"|"+un+")",Ir="(?:"+vt+"(?:d|ll|m|re|s|t|ve))?",Nr="(?:"+vt+"(?:D|LL|M|RE|S|T|VE))?",Lr=ln+"?",n8="["+Te+"]?",cX="(?:"+Zn+"(?:"+[rn,Yn,mn].join("|")+")"+n8+Lr+")*",fX="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",dX="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",r8=n8+Lr+cX,hX="(?:"+[Zt,Yn,mn].join("|")+")"+r8,pX="(?:"+[rn+It+"?",It,Yn,mn,jt].join("|")+")",gX=RegExp(vt,"g"),mX=RegExp(It,"g"),V2=RegExp(Ut+"(?="+Ut+")|"+pX+r8,"g"),vX=RegExp([Tn+"?"+sn+"+"+Ir+"(?="+[Bt,Tn,"$"].join("|")+")",wr+"+"+Nr+"(?="+[Bt,Tn+Xn,"$"].join("|")+")",Tn+"?"+Xn+"+"+Ir,Tn+"+"+Nr,dX,fX,te,hX].join("|"),"g"),yX=RegExp("["+Zn+wt+Qe+Te+"]"),bX=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xX=["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"],wX=-1,Qn={};Qn[$i]=Qn[xr]=Qn[mi]=Qn[ur]=Qn[ai]=Qn[vi]=Qn[Dr]=Qn[Zi]=Qn[vo]=!0,Qn[de]=Qn[Se]=Qn[Kt]=Qn[Ze]=Qn[_n]=Qn[Ae]=Qn[$e]=Qn[be]=Qn[lt]=Qn[Ft]=Qn[nn]=Qn[ye]=Qn[ze]=Qn[je]=Qn[mt]=!1;var Wn={};Wn[de]=Wn[Se]=Wn[Kt]=Wn[_n]=Wn[Ze]=Wn[Ae]=Wn[$i]=Wn[xr]=Wn[mi]=Wn[ur]=Wn[ai]=Wn[lt]=Wn[Ft]=Wn[nn]=Wn[ye]=Wn[ze]=Wn[je]=Wn[ke]=Wn[vi]=Wn[Dr]=Wn[Zi]=Wn[vo]=!0,Wn[$e]=Wn[be]=Wn[mt]=!1;var _X={À:"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"},SX={"&":"&","<":"<",">":">",'"':""","'":"'"},CX={"&":"&","<":"<",">":">",""":'"',"'":"'"},EX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},OX=parseFloat,AX=parseInt,i8=typeof la=="object"&&la&&la.Object===Object&&la,PX=typeof self=="object"&&self&&self.Object===Object&&self,si=i8||PX||Function("return this")(),H2=t&&!t.nodeType&&t,Ql=H2&&!0&&e&&!e.nodeType&&e,o8=Ql&&Ql.exports===H2,q2=o8&&i8.process,Ko=function(){try{var ce=Ql&&Ql.require&&Ql.require("util").types;return ce||q2&&q2.binding&&q2.binding("util")}catch{}}(),a8=Ko&&Ko.isArrayBuffer,s8=Ko&&Ko.isDate,u8=Ko&&Ko.isMap,l8=Ko&&Ko.isRegExp,c8=Ko&&Ko.isSet,f8=Ko&&Ko.isTypedArray;function bo(ce,Oe,we){switch(we.length){case 0:return ce.call(Oe);case 1:return ce.call(Oe,we[0]);case 2:return ce.call(Oe,we[0],we[1]);case 3:return ce.call(Oe,we[0],we[1],we[2])}return ce.apply(Oe,we)}function kX(ce,Oe,we,ot){for(var zt=-1,Cn=ce==null?0:ce.length;++zt-1}function K2(ce,Oe,we){for(var ot=-1,zt=ce==null?0:ce.length;++ot-1;);return we}function b8(ce,Oe){for(var we=ce.length;we--&&Ef(Oe,ce[we],0)>-1;);return we}function FX(ce,Oe){for(var we=ce.length,ot=0;we--;)ce[we]===Oe&&++ot;return ot}var jX=X2(_X),BX=X2(SX);function UX(ce){return"\\"+EX[ce]}function zX(ce,Oe){return ce==null?n:ce[Oe]}function Of(ce){return yX.test(ce)}function WX(ce){return bX.test(ce)}function VX(ce){for(var Oe,we=[];!(Oe=ce.next()).done;)we.push(Oe.value);return we}function t_(ce){var Oe=-1,we=Array(ce.size);return ce.forEach(function(ot,zt){we[++Oe]=[zt,ot]}),we}function x8(ce,Oe){return function(we){return ce(Oe(we))}}function Nu(ce,Oe){for(var we=-1,ot=ce.length,zt=0,Cn=[];++we-1}function MQ(d,g){var _=this.__data__,k=wv(_,d);return k<0?(++this.size,_.push([d,g])):_[k][1]=g,this}Ls.prototype.clear=AQ,Ls.prototype.delete=PQ,Ls.prototype.get=kQ,Ls.prototype.has=TQ,Ls.prototype.set=MQ;function Fs(d){var g=-1,_=d==null?0:d.length;for(this.clear();++g<_;){var k=d[g];this.set(k[0],k[1])}}function RQ(){this.size=0,this.__data__={hash:new ec,map:new(lp||Ls),string:new ec}}function DQ(d){var g=Dv(this,d).delete(d);return this.size-=g?1:0,g}function $Q(d){return Dv(this,d).get(d)}function IQ(d){return Dv(this,d).has(d)}function NQ(d,g){var _=Dv(this,d),k=_.size;return _.set(d,g),this.size+=_.size==k?0:1,this}Fs.prototype.clear=RQ,Fs.prototype.delete=DQ,Fs.prototype.get=$Q,Fs.prototype.has=IQ,Fs.prototype.set=NQ;function tc(d){var g=-1,_=d==null?0:d.length;for(this.__data__=new Fs;++g<_;)this.add(d[g])}function LQ(d){return this.__data__.set(d,u),this}function FQ(d){return this.__data__.has(d)}tc.prototype.add=tc.prototype.push=LQ,tc.prototype.has=FQ;function Ea(d){var g=this.__data__=new Ls(d);this.size=g.size}function jQ(){this.__data__=new Ls,this.size=0}function BQ(d){var g=this.__data__,_=g.delete(d);return this.size=g.size,_}function UQ(d){return this.__data__.get(d)}function zQ(d){return this.__data__.has(d)}function WQ(d,g){var _=this.__data__;if(_ instanceof Ls){var k=_.__data__;if(!lp||k.length=g?d:g)),d}function Xo(d,g,_,k,R,z){var J,se=g&f,fe=g&h,Me=g&p;if(_&&(J=R?_(d,k,R,z):_(d)),J!==n)return J;if(!cr(d))return d;var Re=Ht(d);if(Re){if(J=IJ(d),!se)return Xi(d,J)}else{var Ie=xi(d),et=Ie==be||Ie==bt;if(zu(d))return nk(d,se);if(Ie==nn||Ie==de||et&&!R){if(J=fe||et?{}:wk(d),!se)return fe?CJ(d,KQ(J,d)):SJ(d,R8(J,d))}else{if(!Wn[Ie])return R?d:{};J=NJ(d,Ie,se)}}z||(z=new Ea);var ft=z.get(d);if(ft)return ft;z.set(d,J),Zk(d)?d.forEach(function(kt){J.add(Xo(kt,g,_,kt,d,z))}):Gk(d)&&d.forEach(function(kt,on){J.set(on,Xo(kt,g,_,on,d,z))});var Pt=Me?fe?A_:O_:fe?Ji:Qr,Jt=Re?n:Pt(d);return Go(Jt||d,function(kt,on){Jt&&(on=kt,kt=d[on]),hp(J,on,Xo(kt,g,_,on,d,z))}),J}function GQ(d){var g=Qr(d);return function(_){return D8(_,d,g)}}function D8(d,g,_){var k=_.length;if(d==null)return!k;for(d=Bn(d);k--;){var R=_[k],z=g[R],J=d[R];if(J===n&&!(R in d)||!z(J))return!1}return!0}function $8(d,g,_){if(typeof d!="function")throw new Yo(a);return xp(function(){d.apply(n,_)},g)}function pp(d,g,_,k){var R=-1,z=iv,J=!0,se=d.length,fe=[],Me=g.length;if(!se)return fe;_&&(g=ir(g,xo(_))),k?(z=K2,J=!1):g.length>=i&&(z=sp,J=!1,g=new tc(g));e:for(;++RR?0:R+_),k=k===n||k>R?R:Xt(k),k<0&&(k+=R),k=_>k?0:Qk(k);_0&&_(se)?g>1?ui(se,g-1,_,k,R):Iu(R,se):k||(R[R.length]=se)}return R}var u_=uk(),L8=uk(!0);function is(d,g){return d&&u_(d,g,Qr)}function l_(d,g){return d&&L8(d,g,Qr)}function Sv(d,g){return $u(g,function(_){return Ws(d[_])})}function rc(d,g){g=Bu(g,d);for(var _=0,k=g.length;d!=null&&_g}function XQ(d,g){return d!=null&&Mn.call(d,g)}function QQ(d,g){return d!=null&&g in Bn(d)}function JQ(d,g,_){return d>=bi(g,_)&&d=120&&Re.length>=120)?new tc(J&&Re):n}Re=d[0];var Ie=-1,et=se[0];e:for(;++Ie-1;)se!==d&&pv.call(se,fe,1),pv.call(d,fe,1);return d}function G8(d,g){for(var _=d?g.length:0,k=_-1;_--;){var R=g[_];if(_==k||R!==z){var z=R;zs(R)?pv.call(d,R,1):b_(d,R)}}return d}function m_(d,g){return d+vv(P8()*(g-d+1))}function dJ(d,g,_,k){for(var R=-1,z=jr(mv((g-d)/(_||1)),0),J=we(z);z--;)J[k?z:++R]=d,d+=_;return J}function v_(d,g){var _="";if(!d||g<1||g>j)return _;do g%2&&(_+=d),g=vv(g/2),g&&(d+=d);while(g);return _}function tn(d,g){return $_(Ck(d,g,eo),d+"")}function hJ(d){return M8(Lf(d))}function pJ(d,g){var _=Lf(d);return $v(_,nc(g,0,_.length))}function vp(d,g,_,k){if(!cr(d))return d;g=Bu(g,d);for(var R=-1,z=g.length,J=z-1,se=d;se!=null&&++RR?0:R+g),_=_>R?R:_,_<0&&(_+=R),R=g>_?0:_-g>>>0,g>>>=0;for(var z=we(R);++k>>1,J=d[z];J!==null&&!_o(J)&&(_?J<=g:J=i){var Me=g?null:PJ(d);if(Me)return av(Me);J=!1,R=sp,fe=new tc}else fe=g?[]:se;e:for(;++k=k?d:Qo(d,g,_)}var tk=oQ||function(d){return si.clearTimeout(d)};function nk(d,g){if(g)return d.slice();var _=d.length,k=S8?S8(_):new d.constructor(_);return d.copy(k),k}function S_(d){var g=new d.constructor(d.byteLength);return new dv(g).set(new dv(d)),g}function bJ(d,g){var _=g?S_(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.byteLength)}function xJ(d){var g=new d.constructor(d.source,Be.exec(d));return g.lastIndex=d.lastIndex,g}function wJ(d){return dp?Bn(dp.call(d)):{}}function rk(d,g){var _=g?S_(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.length)}function ik(d,g){if(d!==g){var _=d!==n,k=d===null,R=d===d,z=_o(d),J=g!==n,se=g===null,fe=g===g,Me=_o(g);if(!se&&!Me&&!z&&d>g||z&&J&&fe&&!se&&!Me||k&&J&&fe||!_&&fe||!R)return 1;if(!k&&!z&&!Me&&d=se)return fe;var Me=_[k];return fe*(Me=="desc"?-1:1)}}return d.index-g.index}function ok(d,g,_,k){for(var R=-1,z=d.length,J=_.length,se=-1,fe=g.length,Me=jr(z-J,0),Re=we(fe+Me),Ie=!k;++se1?_[R-1]:n,J=R>2?_[2]:n;for(z=d.length>3&&typeof z=="function"?(R--,z):n,J&&Ni(_[0],_[1],J)&&(z=R<3?n:z,R=1),g=Bn(g);++k-1?R[z?g[J]:J]:n}}function fk(d){return Us(function(g){var _=g.length,k=_,R=Zo.prototype.thru;for(d&&g.reverse();k--;){var z=g[k];if(typeof z!="function")throw new Yo(a);if(R&&!J&&Rv(z)=="wrapper")var J=new Zo([],!0)}for(k=J?k:_;++k<_;){z=g[k];var se=Rv(z),fe=se=="wrapper"?P_(z):n;fe&&R_(fe[0])&&fe[1]==(P|S|E|M)&&!fe[4].length&&fe[9]==1?J=J[Rv(fe[0])].apply(J,fe[3]):J=z.length==1&&R_(z)?J[se]():J.thru(z)}return function(){var Me=arguments,Re=Me[0];if(J&&Me.length==1&&Ht(Re))return J.plant(Re).value();for(var Ie=0,et=_?g[Ie].apply(this,Me):Re;++Ie<_;)et=g[Ie].call(this,et);return et}})}function Pv(d,g,_,k,R,z,J,se,fe,Me){var Re=g&P,Ie=g&b,et=g&w,ft=g&(S|O),Pt=g&N,Jt=et?n:yp(d);function kt(){for(var on=arguments.length,pn=we(on),So=on;So--;)pn[So]=arguments[So];if(ft)var Li=If(kt),Co=FX(pn,Li);if(k&&(pn=ok(pn,k,R,ft)),z&&(pn=ak(pn,z,J,ft)),on-=Co,ft&&on1&&pn.reverse(),Re&&fese))return!1;var Me=z.get(d),Re=z.get(g);if(Me&&Re)return Me==g&&Re==d;var Ie=-1,et=!0,ft=_&y?new tc:n;for(z.set(d,g),z.set(g,d);++Ie1?"& ":"")+g[k],g=g.join(_>2?", ":" "),d.replace($,`{ + */hb.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",f=1,h=2,p=4,m=1,y=2,b=1,w=2,x=4,S=8,O=16,E=32,C=64,P=128,M=256,N=512,B=30,V="...",W=800,ne=16,Z=1,q=2,G=3,H=1/0,j=9007199254740991,K=17976931348623157e292,Y=NaN,oe=4294967295,X=oe-1,Q=oe>>>1,ue=[["ary",P],["bind",b],["bindKey",w],["curry",S],["curryRight",O],["flip",N],["partial",E],["partialRight",C],["rearg",M]],de="[object Arguments]",Se="[object Array]",me="[object AsyncFunction]",Ze="[object Boolean]",Ae="[object Date]",Le="[object DOMException]",$e="[object Error]",be="[object Function]",bt="[object GeneratorFunction]",lt="[object Map]",Ft="[object Number]",yn="[object Null]",nn="[object Object]",ie="[object Promise]",pe="[object Proxy]",ye="[object RegExp]",ze="[object Set]",je="[object String]",ke="[object Symbol]",nt="[object Undefined]",vt="[object WeakMap]",wn="[object WeakSet]",Kt="[object ArrayBuffer]",_n="[object DataView]",$i="[object Float32Array]",xr="[object Float64Array]",mi="[object Int8Array]",ur="[object Int16Array]",ai="[object Int32Array]",vi="[object Uint8Array]",Dr="[object Uint8ClampedArray]",Zi="[object Uint16Array]",vo="[object Uint32Array]",yi=/\b__p \+= '';/g,$r=/\b(__p \+=) '' \+/g,Sa=/(__e\(.*?\)|\b__t\)) \+\n'';/g,St=/&(?:amp|lt|gt|quot|#39);/g,hn=/[&<>"']/g,Sn=RegExp(St.source),Gn=RegExp(hn.source),lr=/<%-([\s\S]+?)%>/g,Xr=/<%([\s\S]+?)%>/g,yo=/<%=([\s\S]+?)%>/g,Xl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cf=/^\w*$/,ae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,le=/[\\^$.*+?()[\]{}|]/g,xe=RegExp(le.source),T=/^\s+/,D=/\s/,$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,A=/\{\n\/\* \[wrapped with (.+)\] \*/,L=/,? & /,ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,re=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,Ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Be=/\w*$/,He=/^[-+]0x[0-9a-f]+$/i,ct=/^0b[01]+$/i,Ne=/^\[object .+?Constructor\]$/,rt=/^0o[0-7]+$/i,xt=/^(?:0|[1-9]\d*)$/,At=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pt=/($^)/,ht=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",_t="\\u0300-\\u036f",Je="\\ufe20-\\ufe2f",ut="\\u20d0-\\u20ff",Qe=_t+Je+ut,Fe="\\u2700-\\u27bf",qe="a-z\\xdf-\\xf6\\xf8-\\xff",Ge="\\xac\\xb1\\xd7\\xf7",ve="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ge="\\u2000-\\u206f",De=" \\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",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",Ue=Ge+ve+ge+De,yt="['’]",jt="["+wt+"]",Bt="["+Ue+"]",It="["+Qe+"]",te="\\d+",Zt="["+Fe+"]",sn="["+qe+"]",un="[^"+wt+Ue+te+Fe+qe+Pe+"]",Ut="\\ud83c[\\udffb-\\udfff]",ln="(?:"+It+"|"+Ut+")",rn="[^"+wt+"]",Yn="(?:\\ud83c[\\udde6-\\uddff]){2}",mn="[\\ud800-\\udbff][\\udc00-\\udfff]",Tn="["+Pe+"]",Zn="\\u200d",Xn="(?:"+sn+"|"+un+")",wr="(?:"+Tn+"|"+un+")",Ir="(?:"+yt+"(?:d|ll|m|re|s|t|ve))?",Nr="(?:"+yt+"(?:D|LL|M|RE|S|T|VE))?",Lr=ln+"?",n8="["+Te+"]?",cX="(?:"+Zn+"(?:"+[rn,Yn,mn].join("|")+")"+n8+Lr+")*",fX="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",dX="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",r8=n8+Lr+cX,hX="(?:"+[Zt,Yn,mn].join("|")+")"+r8,pX="(?:"+[rn+It+"?",It,Yn,mn,jt].join("|")+")",gX=RegExp(yt,"g"),mX=RegExp(It,"g"),V2=RegExp(Ut+"(?="+Ut+")|"+pX+r8,"g"),vX=RegExp([Tn+"?"+sn+"+"+Ir+"(?="+[Bt,Tn,"$"].join("|")+")",wr+"+"+Nr+"(?="+[Bt,Tn+Xn,"$"].join("|")+")",Tn+"?"+Xn+"+"+Ir,Tn+"+"+Nr,dX,fX,te,hX].join("|"),"g"),yX=RegExp("["+Zn+wt+Qe+Te+"]"),bX=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xX=["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"],wX=-1,Qn={};Qn[$i]=Qn[xr]=Qn[mi]=Qn[ur]=Qn[ai]=Qn[vi]=Qn[Dr]=Qn[Zi]=Qn[vo]=!0,Qn[de]=Qn[Se]=Qn[Kt]=Qn[Ze]=Qn[_n]=Qn[Ae]=Qn[$e]=Qn[be]=Qn[lt]=Qn[Ft]=Qn[nn]=Qn[ye]=Qn[ze]=Qn[je]=Qn[vt]=!1;var Wn={};Wn[de]=Wn[Se]=Wn[Kt]=Wn[_n]=Wn[Ze]=Wn[Ae]=Wn[$i]=Wn[xr]=Wn[mi]=Wn[ur]=Wn[ai]=Wn[lt]=Wn[Ft]=Wn[nn]=Wn[ye]=Wn[ze]=Wn[je]=Wn[ke]=Wn[vi]=Wn[Dr]=Wn[Zi]=Wn[vo]=!0,Wn[$e]=Wn[be]=Wn[vt]=!1;var _X={À:"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"},SX={"&":"&","<":"<",">":">",'"':""","'":"'"},CX={"&":"&","<":"<",">":">",""":'"',"'":"'"},EX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},OX=parseFloat,AX=parseInt,i8=typeof la=="object"&&la&&la.Object===Object&&la,PX=typeof self=="object"&&self&&self.Object===Object&&self,si=i8||PX||Function("return this")(),H2=t&&!t.nodeType&&t,Ql=H2&&!0&&e&&!e.nodeType&&e,o8=Ql&&Ql.exports===H2,q2=o8&&i8.process,Ko=function(){try{var ce=Ql&&Ql.require&&Ql.require("util").types;return ce||q2&&q2.binding&&q2.binding("util")}catch{}}(),a8=Ko&&Ko.isArrayBuffer,s8=Ko&&Ko.isDate,u8=Ko&&Ko.isMap,l8=Ko&&Ko.isRegExp,c8=Ko&&Ko.isSet,f8=Ko&&Ko.isTypedArray;function bo(ce,Oe,we){switch(we.length){case 0:return ce.call(Oe);case 1:return ce.call(Oe,we[0]);case 2:return ce.call(Oe,we[0],we[1]);case 3:return ce.call(Oe,we[0],we[1],we[2])}return ce.apply(Oe,we)}function kX(ce,Oe,we,ot){for(var zt=-1,Cn=ce==null?0:ce.length;++zt-1}function K2(ce,Oe,we){for(var ot=-1,zt=ce==null?0:ce.length;++ot-1;);return we}function b8(ce,Oe){for(var we=ce.length;we--&&Ef(Oe,ce[we],0)>-1;);return we}function FX(ce,Oe){for(var we=ce.length,ot=0;we--;)ce[we]===Oe&&++ot;return ot}var jX=X2(_X),BX=X2(SX);function UX(ce){return"\\"+EX[ce]}function zX(ce,Oe){return ce==null?n:ce[Oe]}function Of(ce){return yX.test(ce)}function WX(ce){return bX.test(ce)}function VX(ce){for(var Oe,we=[];!(Oe=ce.next()).done;)we.push(Oe.value);return we}function t_(ce){var Oe=-1,we=Array(ce.size);return ce.forEach(function(ot,zt){we[++Oe]=[zt,ot]}),we}function x8(ce,Oe){return function(we){return ce(Oe(we))}}function Nu(ce,Oe){for(var we=-1,ot=ce.length,zt=0,Cn=[];++we-1}function MQ(d,g){var _=this.__data__,k=wv(_,d);return k<0?(++this.size,_.push([d,g])):_[k][1]=g,this}Ls.prototype.clear=AQ,Ls.prototype.delete=PQ,Ls.prototype.get=kQ,Ls.prototype.has=TQ,Ls.prototype.set=MQ;function Fs(d){var g=-1,_=d==null?0:d.length;for(this.clear();++g<_;){var k=d[g];this.set(k[0],k[1])}}function RQ(){this.size=0,this.__data__={hash:new ec,map:new(lp||Ls),string:new ec}}function DQ(d){var g=Dv(this,d).delete(d);return this.size-=g?1:0,g}function $Q(d){return Dv(this,d).get(d)}function IQ(d){return Dv(this,d).has(d)}function NQ(d,g){var _=Dv(this,d),k=_.size;return _.set(d,g),this.size+=_.size==k?0:1,this}Fs.prototype.clear=RQ,Fs.prototype.delete=DQ,Fs.prototype.get=$Q,Fs.prototype.has=IQ,Fs.prototype.set=NQ;function tc(d){var g=-1,_=d==null?0:d.length;for(this.__data__=new Fs;++g<_;)this.add(d[g])}function LQ(d){return this.__data__.set(d,u),this}function FQ(d){return this.__data__.has(d)}tc.prototype.add=tc.prototype.push=LQ,tc.prototype.has=FQ;function Ea(d){var g=this.__data__=new Ls(d);this.size=g.size}function jQ(){this.__data__=new Ls,this.size=0}function BQ(d){var g=this.__data__,_=g.delete(d);return this.size=g.size,_}function UQ(d){return this.__data__.get(d)}function zQ(d){return this.__data__.has(d)}function WQ(d,g){var _=this.__data__;if(_ instanceof Ls){var k=_.__data__;if(!lp||k.length=g?d:g)),d}function Xo(d,g,_,k,R,z){var J,se=g&f,fe=g&h,Me=g&p;if(_&&(J=R?_(d,k,R,z):_(d)),J!==n)return J;if(!cr(d))return d;var Re=Ht(d);if(Re){if(J=IJ(d),!se)return Xi(d,J)}else{var Ie=xi(d),et=Ie==be||Ie==bt;if(zu(d))return nk(d,se);if(Ie==nn||Ie==de||et&&!R){if(J=fe||et?{}:wk(d),!se)return fe?CJ(d,KQ(J,d)):SJ(d,R8(J,d))}else{if(!Wn[Ie])return R?d:{};J=NJ(d,Ie,se)}}z||(z=new Ea);var ft=z.get(d);if(ft)return ft;z.set(d,J),Zk(d)?d.forEach(function(kt){J.add(Xo(kt,g,_,kt,d,z))}):Gk(d)&&d.forEach(function(kt,on){J.set(on,Xo(kt,g,_,on,d,z))});var Pt=Me?fe?A_:O_:fe?Ji:Qr,Jt=Re?n:Pt(d);return Go(Jt||d,function(kt,on){Jt&&(on=kt,kt=d[on]),hp(J,on,Xo(kt,g,_,on,d,z))}),J}function GQ(d){var g=Qr(d);return function(_){return D8(_,d,g)}}function D8(d,g,_){var k=_.length;if(d==null)return!k;for(d=Bn(d);k--;){var R=_[k],z=g[R],J=d[R];if(J===n&&!(R in d)||!z(J))return!1}return!0}function $8(d,g,_){if(typeof d!="function")throw new Yo(a);return xp(function(){d.apply(n,_)},g)}function pp(d,g,_,k){var R=-1,z=iv,J=!0,se=d.length,fe=[],Me=g.length;if(!se)return fe;_&&(g=ir(g,xo(_))),k?(z=K2,J=!1):g.length>=i&&(z=sp,J=!1,g=new tc(g));e:for(;++RR?0:R+_),k=k===n||k>R?R:Xt(k),k<0&&(k+=R),k=_>k?0:Qk(k);_0&&_(se)?g>1?ui(se,g-1,_,k,R):Iu(R,se):k||(R[R.length]=se)}return R}var u_=uk(),L8=uk(!0);function is(d,g){return d&&u_(d,g,Qr)}function l_(d,g){return d&&L8(d,g,Qr)}function Sv(d,g){return $u(g,function(_){return Ws(d[_])})}function rc(d,g){g=Bu(g,d);for(var _=0,k=g.length;d!=null&&_g}function XQ(d,g){return d!=null&&Mn.call(d,g)}function QQ(d,g){return d!=null&&g in Bn(d)}function JQ(d,g,_){return d>=bi(g,_)&&d=120&&Re.length>=120)?new tc(J&&Re):n}Re=d[0];var Ie=-1,et=se[0];e:for(;++Ie-1;)se!==d&&pv.call(se,fe,1),pv.call(d,fe,1);return d}function G8(d,g){for(var _=d?g.length:0,k=_-1;_--;){var R=g[_];if(_==k||R!==z){var z=R;zs(R)?pv.call(d,R,1):b_(d,R)}}return d}function m_(d,g){return d+vv(P8()*(g-d+1))}function dJ(d,g,_,k){for(var R=-1,z=jr(mv((g-d)/(_||1)),0),J=we(z);z--;)J[k?z:++R]=d,d+=_;return J}function v_(d,g){var _="";if(!d||g<1||g>j)return _;do g%2&&(_+=d),g=vv(g/2),g&&(d+=d);while(g);return _}function tn(d,g){return $_(Ck(d,g,eo),d+"")}function hJ(d){return M8(Lf(d))}function pJ(d,g){var _=Lf(d);return $v(_,nc(g,0,_.length))}function vp(d,g,_,k){if(!cr(d))return d;g=Bu(g,d);for(var R=-1,z=g.length,J=z-1,se=d;se!=null&&++RR?0:R+g),_=_>R?R:_,_<0&&(_+=R),R=g>_?0:_-g>>>0,g>>>=0;for(var z=we(R);++k>>1,J=d[z];J!==null&&!_o(J)&&(_?J<=g:J=i){var Me=g?null:PJ(d);if(Me)return av(Me);J=!1,R=sp,fe=new tc}else fe=g?[]:se;e:for(;++k=k?d:Qo(d,g,_)}var tk=oQ||function(d){return si.clearTimeout(d)};function nk(d,g){if(g)return d.slice();var _=d.length,k=S8?S8(_):new d.constructor(_);return d.copy(k),k}function S_(d){var g=new d.constructor(d.byteLength);return new dv(g).set(new dv(d)),g}function bJ(d,g){var _=g?S_(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.byteLength)}function xJ(d){var g=new d.constructor(d.source,Be.exec(d));return g.lastIndex=d.lastIndex,g}function wJ(d){return dp?Bn(dp.call(d)):{}}function rk(d,g){var _=g?S_(d.buffer):d.buffer;return new d.constructor(_,d.byteOffset,d.length)}function ik(d,g){if(d!==g){var _=d!==n,k=d===null,R=d===d,z=_o(d),J=g!==n,se=g===null,fe=g===g,Me=_o(g);if(!se&&!Me&&!z&&d>g||z&&J&&fe&&!se&&!Me||k&&J&&fe||!_&&fe||!R)return 1;if(!k&&!z&&!Me&&d=se)return fe;var Me=_[k];return fe*(Me=="desc"?-1:1)}}return d.index-g.index}function ok(d,g,_,k){for(var R=-1,z=d.length,J=_.length,se=-1,fe=g.length,Me=jr(z-J,0),Re=we(fe+Me),Ie=!k;++se1?_[R-1]:n,J=R>2?_[2]:n;for(z=d.length>3&&typeof z=="function"?(R--,z):n,J&&Ni(_[0],_[1],J)&&(z=R<3?n:z,R=1),g=Bn(g);++k-1?R[z?g[J]:J]:n}}function fk(d){return Us(function(g){var _=g.length,k=_,R=Zo.prototype.thru;for(d&&g.reverse();k--;){var z=g[k];if(typeof z!="function")throw new Yo(a);if(R&&!J&&Rv(z)=="wrapper")var J=new Zo([],!0)}for(k=J?k:_;++k<_;){z=g[k];var se=Rv(z),fe=se=="wrapper"?P_(z):n;fe&&R_(fe[0])&&fe[1]==(P|S|E|M)&&!fe[4].length&&fe[9]==1?J=J[Rv(fe[0])].apply(J,fe[3]):J=z.length==1&&R_(z)?J[se]():J.thru(z)}return function(){var Me=arguments,Re=Me[0];if(J&&Me.length==1&&Ht(Re))return J.plant(Re).value();for(var Ie=0,et=_?g[Ie].apply(this,Me):Re;++Ie<_;)et=g[Ie].call(this,et);return et}})}function Pv(d,g,_,k,R,z,J,se,fe,Me){var Re=g&P,Ie=g&b,et=g&w,ft=g&(S|O),Pt=g&N,Jt=et?n:yp(d);function kt(){for(var on=arguments.length,pn=we(on),So=on;So--;)pn[So]=arguments[So];if(ft)var Li=If(kt),Co=FX(pn,Li);if(k&&(pn=ok(pn,k,R,ft)),z&&(pn=ak(pn,z,J,ft)),on-=Co,ft&&on1&&pn.reverse(),Re&&fese))return!1;var Me=z.get(d),Re=z.get(g);if(Me&&Re)return Me==g&&Re==d;var Ie=-1,et=!0,ft=_&y?new tc:n;for(z.set(d,g),z.set(g,d);++Ie1?"& ":"")+g[k],g=g.join(_>2?", ":" "),d.replace($,`{ /* [wrapped with `+g+`] */ -`)}function FJ(d){return Ht(d)||ac(d)||!!(O8&&d&&d[O8])}function zs(d,g){var _=typeof d;return g=g??j,!!g&&(_=="number"||_!="symbol"&&xt.test(d))&&d>-1&&d%1==0&&d0){if(++g>=W)return arguments[0]}else g=0;return d.apply(n,arguments)}}function $v(d,g){var _=-1,k=d.length,R=k-1;for(g=g===n?k:g;++_1?d[g-1]:n;return _=typeof _=="function"?(d.pop(),_):n,Nk(d,_)});function Lk(d){var g=U(d);return g.__chain__=!0,g}function Yee(d,g){return g(d),d}function Iv(d,g){return g(d)}var Zee=Us(function(d){var g=d.length,_=g?d[0]:0,k=this.__wrapped__,R=function(z){return s_(z,d)};return g>1||this.__actions__.length||!(k instanceof cn)||!zs(_)?this.thru(R):(k=k.slice(_,+_+(g?1:0)),k.__actions__.push({func:Iv,args:[R],thisArg:n}),new Zo(k,this.__chain__).thru(function(z){return g&&!z.length&&z.push(n),z}))});function Xee(){return Lk(this)}function Qee(){return new Zo(this.value(),this.__chain__)}function Jee(){this.__values__===n&&(this.__values__=Xk(this.value()));var d=this.__index__>=this.__values__.length,g=d?n:this.__values__[this.__index__++];return{done:d,value:g}}function ete(){return this}function tte(d){for(var g,_=this;_ instanceof xv;){var k=Tk(_);k.__index__=0,k.__values__=n,g?R.__wrapped__=k:g=k;var R=k;_=_.__wrapped__}return R.__wrapped__=d,g}function nte(){var d=this.__wrapped__;if(d instanceof cn){var g=d;return this.__actions__.length&&(g=new cn(this)),g=g.reverse(),g.__actions__.push({func:Iv,args:[I_],thisArg:n}),new Zo(g,this.__chain__)}return this.thru(I_)}function rte(){return J8(this.__wrapped__,this.__actions__)}var ite=Av(function(d,g,_){Mn.call(d,_)?++d[_]:js(d,_,1)});function ote(d,g,_){var k=Ht(d)?d8:YQ;return _&&Ni(d,g,_)&&(g=n),k(d,Ot(g,3))}function ate(d,g){var _=Ht(d)?$u:N8;return _(d,Ot(g,3))}var ste=ck(Mk),ute=ck(Rk);function lte(d,g){return ui(Nv(d,g),1)}function cte(d,g){return ui(Nv(d,g),H)}function fte(d,g,_){return _=_===n?1:Xt(_),ui(Nv(d,g),_)}function Fk(d,g){var _=Ht(d)?Go:Fu;return _(d,Ot(g,3))}function jk(d,g){var _=Ht(d)?TX:I8;return _(d,Ot(g,3))}var dte=Av(function(d,g,_){Mn.call(d,_)?d[_].push(g):js(d,_,[g])});function hte(d,g,_,k){d=Qi(d)?d:Lf(d),_=_&&!k?Xt(_):0;var R=d.length;return _<0&&(_=jr(R+_,0)),Uv(d)?_<=R&&d.indexOf(g,_)>-1:!!R&&Ef(d,g,_)>-1}var pte=tn(function(d,g,_){var k=-1,R=typeof g=="function",z=Qi(d)?we(d.length):[];return Fu(d,function(J){z[++k]=R?bo(g,J,_):gp(J,g,_)}),z}),gte=Av(function(d,g,_){js(d,_,g)});function Nv(d,g){var _=Ht(d)?ir:z8;return _(d,Ot(g,3))}function mte(d,g,_,k){return d==null?[]:(Ht(g)||(g=g==null?[]:[g]),_=k?n:_,Ht(_)||(_=_==null?[]:[_]),q8(d,g,_))}var vte=Av(function(d,g,_){d[_?0:1].push(g)},function(){return[[],[]]});function yte(d,g,_){var k=Ht(d)?G2:m8,R=arguments.length<3;return k(d,Ot(g,4),_,R,Fu)}function bte(d,g,_){var k=Ht(d)?MX:m8,R=arguments.length<3;return k(d,Ot(g,4),_,R,I8)}function xte(d,g){var _=Ht(d)?$u:N8;return _(d,jv(Ot(g,3)))}function wte(d){var g=Ht(d)?M8:hJ;return g(d)}function _te(d,g,_){(_?Ni(d,g,_):g===n)?g=1:g=Xt(g);var k=Ht(d)?VQ:pJ;return k(d,g)}function Ste(d){var g=Ht(d)?HQ:mJ;return g(d)}function Cte(d){if(d==null)return 0;if(Qi(d))return Uv(d)?Af(d):d.length;var g=xi(d);return g==lt||g==ze?d.size:h_(d).length}function Ete(d,g,_){var k=Ht(d)?Y2:vJ;return _&&Ni(d,g,_)&&(g=n),k(d,Ot(g,3))}var Ote=tn(function(d,g){if(d==null)return[];var _=g.length;return _>1&&Ni(d,g[0],g[1])?g=[]:_>2&&Ni(g[0],g[1],g[2])&&(g=[g[0]]),q8(d,ui(g,1),[])}),Lv=aQ||function(){return si.Date.now()};function Ate(d,g){if(typeof g!="function")throw new Yo(a);return d=Xt(d),function(){if(--d<1)return g.apply(this,arguments)}}function Bk(d,g,_){return g=_?n:g,g=d&&g==null?d.length:g,Bs(d,P,n,n,n,n,g)}function Uk(d,g){var _;if(typeof g!="function")throw new Yo(a);return d=Xt(d),function(){return--d>0&&(_=g.apply(this,arguments)),d<=1&&(g=n),_}}var L_=tn(function(d,g,_){var k=b;if(_.length){var R=Nu(_,If(L_));k|=E}return Bs(d,k,g,_,R)}),zk=tn(function(d,g,_){var k=b|w;if(_.length){var R=Nu(_,If(zk));k|=E}return Bs(g,k,d,_,R)});function Wk(d,g,_){g=_?n:g;var k=Bs(d,S,n,n,n,n,n,g);return k.placeholder=Wk.placeholder,k}function Vk(d,g,_){g=_?n:g;var k=Bs(d,O,n,n,n,n,n,g);return k.placeholder=Vk.placeholder,k}function Hk(d,g,_){var k,R,z,J,se,fe,Me=0,Re=!1,Ie=!1,et=!0;if(typeof d!="function")throw new Yo(a);g=ea(g)||0,cr(_)&&(Re=!!_.leading,Ie="maxWait"in _,z=Ie?jr(ea(_.maxWait)||0,g):z,et="trailing"in _?!!_.trailing:et);function ft(Sr){var Aa=k,Hs=R;return k=R=n,Me=Sr,J=d.apply(Hs,Aa),J}function Pt(Sr){return Me=Sr,se=xp(on,g),Re?ft(Sr):J}function Jt(Sr){var Aa=Sr-fe,Hs=Sr-Me,cT=g-Aa;return Ie?bi(cT,z-Hs):cT}function kt(Sr){var Aa=Sr-fe,Hs=Sr-Me;return fe===n||Aa>=g||Aa<0||Ie&&Hs>=z}function on(){var Sr=Lv();if(kt(Sr))return pn(Sr);se=xp(on,Jt(Sr))}function pn(Sr){return se=n,et&&k?ft(Sr):(k=R=n,J)}function So(){se!==n&&tk(se),Me=0,k=fe=R=se=n}function Li(){return se===n?J:pn(Lv())}function Co(){var Sr=Lv(),Aa=kt(Sr);if(k=arguments,R=this,fe=Sr,Aa){if(se===n)return Pt(fe);if(Ie)return tk(se),se=xp(on,g),ft(fe)}return se===n&&(se=xp(on,g)),J}return Co.cancel=So,Co.flush=Li,Co}var Pte=tn(function(d,g){return $8(d,1,g)}),kte=tn(function(d,g,_){return $8(d,ea(g)||0,_)});function Tte(d){return Bs(d,N)}function Fv(d,g){if(typeof d!="function"||g!=null&&typeof g!="function")throw new Yo(a);var _=function(){var k=arguments,R=g?g.apply(this,k):k[0],z=_.cache;if(z.has(R))return z.get(R);var J=d.apply(this,k);return _.cache=z.set(R,J)||z,J};return _.cache=new(Fv.Cache||Fs),_}Fv.Cache=Fs;function jv(d){if(typeof d!="function")throw new Yo(a);return function(){var g=arguments;switch(g.length){case 0:return!d.call(this);case 1:return!d.call(this,g[0]);case 2:return!d.call(this,g[0],g[1]);case 3:return!d.call(this,g[0],g[1],g[2])}return!d.apply(this,g)}}function Mte(d){return Uk(2,d)}var Rte=yJ(function(d,g){g=g.length==1&&Ht(g[0])?ir(g[0],xo(Ot())):ir(ui(g,1),xo(Ot()));var _=g.length;return tn(function(k){for(var R=-1,z=bi(k.length,_);++R=g}),ac=j8(function(){return arguments}())?j8:function(d){return gr(d)&&Mn.call(d,"callee")&&!E8.call(d,"callee")},Ht=we.isArray,Kte=a8?xo(a8):tJ;function Qi(d){return d!=null&&Bv(d.length)&&!Ws(d)}function _r(d){return gr(d)&&Qi(d)}function Gte(d){return d===!0||d===!1||gr(d)&&Ii(d)==Ze}var zu=uQ||Y_,Yte=s8?xo(s8):nJ;function Zte(d){return gr(d)&&d.nodeType===1&&!wp(d)}function Xte(d){if(d==null)return!0;if(Qi(d)&&(Ht(d)||typeof d=="string"||typeof d.splice=="function"||zu(d)||Nf(d)||ac(d)))return!d.length;var g=xi(d);if(g==lt||g==ze)return!d.size;if(bp(d))return!h_(d).length;for(var _ in d)if(Mn.call(d,_))return!1;return!0}function Qte(d,g){return mp(d,g)}function Jte(d,g,_){_=typeof _=="function"?_:n;var k=_?_(d,g):n;return k===n?mp(d,g,n,_):!!k}function j_(d){if(!gr(d))return!1;var g=Ii(d);return g==$e||g==Le||typeof d.message=="string"&&typeof d.name=="string"&&!wp(d)}function ene(d){return typeof d=="number"&&A8(d)}function Ws(d){if(!cr(d))return!1;var g=Ii(d);return g==be||g==bt||g==me||g==pe}function Kk(d){return typeof d=="number"&&d==Xt(d)}function Bv(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=j}function cr(d){var g=typeof d;return d!=null&&(g=="object"||g=="function")}function gr(d){return d!=null&&typeof d=="object"}var Gk=u8?xo(u8):iJ;function tne(d,g){return d===g||d_(d,g,k_(g))}function nne(d,g,_){return _=typeof _=="function"?_:n,d_(d,g,k_(g),_)}function rne(d){return Yk(d)&&d!=+d}function ine(d){if(UJ(d))throw new zt(o);return B8(d)}function one(d){return d===null}function ane(d){return d==null}function Yk(d){return typeof d=="number"||gr(d)&&Ii(d)==Ft}function wp(d){if(!gr(d)||Ii(d)!=nn)return!1;var g=hv(d);if(g===null)return!0;var _=Mn.call(g,"constructor")&&g.constructor;return typeof _=="function"&&_ instanceof _&&lv.call(_)==nQ}var B_=l8?xo(l8):oJ;function sne(d){return Kk(d)&&d>=-j&&d<=j}var Zk=c8?xo(c8):aJ;function Uv(d){return typeof d=="string"||!Ht(d)&&gr(d)&&Ii(d)==je}function _o(d){return typeof d=="symbol"||gr(d)&&Ii(d)==ke}var Nf=f8?xo(f8):sJ;function une(d){return d===n}function lne(d){return gr(d)&&xi(d)==mt}function cne(d){return gr(d)&&Ii(d)==wn}var fne=Mv(p_),dne=Mv(function(d,g){return d<=g});function Xk(d){if(!d)return[];if(Qi(d))return Uv(d)?Ca(d):Xi(d);if(up&&d[up])return VX(d[up]());var g=xi(d),_=g==lt?t_:g==ze?av:Lf;return _(d)}function Vs(d){if(!d)return d===0?d:0;if(d=ea(d),d===H||d===-H){var g=d<0?-1:1;return g*K}return d===d?d:0}function Xt(d){var g=Vs(d),_=g%1;return g===g?_?g-_:g:0}function Qk(d){return d?nc(Xt(d),0,oe):0}function ea(d){if(typeof d=="number")return d;if(_o(d))return Y;if(cr(d)){var g=typeof d.valueOf=="function"?d.valueOf():d;d=cr(g)?g+"":g}if(typeof d!="string")return d===0?d:+d;d=v8(d);var _=ct.test(d);return _||rt.test(d)?AX(d.slice(2),_?2:8):He.test(d)?Y:+d}function Jk(d){return os(d,Ji(d))}function hne(d){return d?nc(Xt(d),-j,j):d===0?d:0}function An(d){return d==null?"":wo(d)}var pne=Df(function(d,g){if(bp(g)||Qi(g)){os(g,Qr(g),d);return}for(var _ in g)Mn.call(g,_)&&hp(d,_,g[_])}),eT=Df(function(d,g){os(g,Ji(g),d)}),zv=Df(function(d,g,_,k){os(g,Ji(g),d,k)}),gne=Df(function(d,g,_,k){os(g,Qr(g),d,k)}),mne=Us(s_);function vne(d,g){var _=Rf(d);return g==null?_:R8(_,g)}var yne=tn(function(d,g){d=Bn(d);var _=-1,k=g.length,R=k>2?g[2]:n;for(R&&Ni(g[0],g[1],R)&&(k=1);++_1),z}),os(d,A_(d),_),k&&(_=Xo(_,f|h|p,kJ));for(var R=g.length;R--;)b_(_,g[R]);return _});function Nne(d,g){return nT(d,jv(Ot(g)))}var Lne=Us(function(d,g){return d==null?{}:cJ(d,g)});function nT(d,g){if(d==null)return{};var _=ir(A_(d),function(k){return[k]});return g=Ot(g),K8(d,_,function(k,R){return g(k,R[0])})}function Fne(d,g,_){g=Bu(g,d);var k=-1,R=g.length;for(R||(R=1,d=n);++kg){var k=d;d=g,g=k}if(_||d%1||g%1){var R=P8();return bi(d+R*(g-d+OX("1e-"+((R+"").length-1))),g)}return m_(d,g)}var Yne=$f(function(d,g,_){return g=g.toLowerCase(),d+(_?oT(g):g)});function oT(d){return W_(An(d).toLowerCase())}function aT(d){return d=An(d),d&&d.replace(At,jX).replace(mX,"")}function Zne(d,g,_){d=An(d),g=wo(g);var k=d.length;_=_===n?k:nc(Xt(_),0,k);var R=_;return _-=g.length,_>=0&&d.slice(_,R)==g}function Xne(d){return d=An(d),d&&Gn.test(d)?d.replace(hn,BX):d}function Qne(d){return d=An(d),d&&xe.test(d)?d.replace(le,"\\$&"):d}var Jne=$f(function(d,g,_){return d+(_?"-":"")+g.toLowerCase()}),ere=$f(function(d,g,_){return d+(_?" ":"")+g.toLowerCase()}),tre=lk("toLowerCase");function nre(d,g,_){d=An(d),g=Xt(g);var k=g?Af(d):0;if(!g||k>=g)return d;var R=(g-k)/2;return Tv(vv(R),_)+d+Tv(mv(R),_)}function rre(d,g,_){d=An(d),g=Xt(g);var k=g?Af(d):0;return g&&k>>0,_?(d=An(d),d&&(typeof g=="string"||g!=null&&!B_(g))&&(g=wo(g),!g&&Of(d))?Uu(Ca(d),0,_):d.split(g,_)):[]}var cre=$f(function(d,g,_){return d+(_?" ":"")+W_(g)});function fre(d,g,_){return d=An(d),_=_==null?0:nc(Xt(_),0,d.length),g=wo(g),d.slice(_,_+g.length)==g}function dre(d,g,_){var k=U.templateSettings;_&&Ni(d,g,_)&&(g=n),d=An(d),g=zv({},g,k,mk);var R=zv({},g.imports,k.imports,mk),z=Qr(R),J=e_(R,z),se,fe,Me=0,Re=g.interpolate||pt,Ie="__p += '",et=n_((g.escape||pt).source+"|"+Re.source+"|"+(Re===yo?Ce:pt).source+"|"+(g.evaluate||pt).source+"|$","g"),ft="//# sourceURL="+(Mn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wX+"]")+` +`)}function FJ(d){return Ht(d)||ac(d)||!!(O8&&d&&d[O8])}function zs(d,g){var _=typeof d;return g=g??j,!!g&&(_=="number"||_!="symbol"&&xt.test(d))&&d>-1&&d%1==0&&d0){if(++g>=W)return arguments[0]}else g=0;return d.apply(n,arguments)}}function $v(d,g){var _=-1,k=d.length,R=k-1;for(g=g===n?k:g;++_1?d[g-1]:n;return _=typeof _=="function"?(d.pop(),_):n,Nk(d,_)});function Lk(d){var g=U(d);return g.__chain__=!0,g}function Yee(d,g){return g(d),d}function Iv(d,g){return g(d)}var Zee=Us(function(d){var g=d.length,_=g?d[0]:0,k=this.__wrapped__,R=function(z){return s_(z,d)};return g>1||this.__actions__.length||!(k instanceof cn)||!zs(_)?this.thru(R):(k=k.slice(_,+_+(g?1:0)),k.__actions__.push({func:Iv,args:[R],thisArg:n}),new Zo(k,this.__chain__).thru(function(z){return g&&!z.length&&z.push(n),z}))});function Xee(){return Lk(this)}function Qee(){return new Zo(this.value(),this.__chain__)}function Jee(){this.__values__===n&&(this.__values__=Xk(this.value()));var d=this.__index__>=this.__values__.length,g=d?n:this.__values__[this.__index__++];return{done:d,value:g}}function ete(){return this}function tte(d){for(var g,_=this;_ instanceof xv;){var k=Tk(_);k.__index__=0,k.__values__=n,g?R.__wrapped__=k:g=k;var R=k;_=_.__wrapped__}return R.__wrapped__=d,g}function nte(){var d=this.__wrapped__;if(d instanceof cn){var g=d;return this.__actions__.length&&(g=new cn(this)),g=g.reverse(),g.__actions__.push({func:Iv,args:[I_],thisArg:n}),new Zo(g,this.__chain__)}return this.thru(I_)}function rte(){return J8(this.__wrapped__,this.__actions__)}var ite=Av(function(d,g,_){Mn.call(d,_)?++d[_]:js(d,_,1)});function ote(d,g,_){var k=Ht(d)?d8:YQ;return _&&Ni(d,g,_)&&(g=n),k(d,Ot(g,3))}function ate(d,g){var _=Ht(d)?$u:N8;return _(d,Ot(g,3))}var ste=ck(Mk),ute=ck(Rk);function lte(d,g){return ui(Nv(d,g),1)}function cte(d,g){return ui(Nv(d,g),H)}function fte(d,g,_){return _=_===n?1:Xt(_),ui(Nv(d,g),_)}function Fk(d,g){var _=Ht(d)?Go:Fu;return _(d,Ot(g,3))}function jk(d,g){var _=Ht(d)?TX:I8;return _(d,Ot(g,3))}var dte=Av(function(d,g,_){Mn.call(d,_)?d[_].push(g):js(d,_,[g])});function hte(d,g,_,k){d=Qi(d)?d:Lf(d),_=_&&!k?Xt(_):0;var R=d.length;return _<0&&(_=jr(R+_,0)),Uv(d)?_<=R&&d.indexOf(g,_)>-1:!!R&&Ef(d,g,_)>-1}var pte=tn(function(d,g,_){var k=-1,R=typeof g=="function",z=Qi(d)?we(d.length):[];return Fu(d,function(J){z[++k]=R?bo(g,J,_):gp(J,g,_)}),z}),gte=Av(function(d,g,_){js(d,_,g)});function Nv(d,g){var _=Ht(d)?ir:z8;return _(d,Ot(g,3))}function mte(d,g,_,k){return d==null?[]:(Ht(g)||(g=g==null?[]:[g]),_=k?n:_,Ht(_)||(_=_==null?[]:[_]),q8(d,g,_))}var vte=Av(function(d,g,_){d[_?0:1].push(g)},function(){return[[],[]]});function yte(d,g,_){var k=Ht(d)?G2:m8,R=arguments.length<3;return k(d,Ot(g,4),_,R,Fu)}function bte(d,g,_){var k=Ht(d)?MX:m8,R=arguments.length<3;return k(d,Ot(g,4),_,R,I8)}function xte(d,g){var _=Ht(d)?$u:N8;return _(d,jv(Ot(g,3)))}function wte(d){var g=Ht(d)?M8:hJ;return g(d)}function _te(d,g,_){(_?Ni(d,g,_):g===n)?g=1:g=Xt(g);var k=Ht(d)?VQ:pJ;return k(d,g)}function Ste(d){var g=Ht(d)?HQ:mJ;return g(d)}function Cte(d){if(d==null)return 0;if(Qi(d))return Uv(d)?Af(d):d.length;var g=xi(d);return g==lt||g==ze?d.size:h_(d).length}function Ete(d,g,_){var k=Ht(d)?Y2:vJ;return _&&Ni(d,g,_)&&(g=n),k(d,Ot(g,3))}var Ote=tn(function(d,g){if(d==null)return[];var _=g.length;return _>1&&Ni(d,g[0],g[1])?g=[]:_>2&&Ni(g[0],g[1],g[2])&&(g=[g[0]]),q8(d,ui(g,1),[])}),Lv=aQ||function(){return si.Date.now()};function Ate(d,g){if(typeof g!="function")throw new Yo(a);return d=Xt(d),function(){if(--d<1)return g.apply(this,arguments)}}function Bk(d,g,_){return g=_?n:g,g=d&&g==null?d.length:g,Bs(d,P,n,n,n,n,g)}function Uk(d,g){var _;if(typeof g!="function")throw new Yo(a);return d=Xt(d),function(){return--d>0&&(_=g.apply(this,arguments)),d<=1&&(g=n),_}}var L_=tn(function(d,g,_){var k=b;if(_.length){var R=Nu(_,If(L_));k|=E}return Bs(d,k,g,_,R)}),zk=tn(function(d,g,_){var k=b|w;if(_.length){var R=Nu(_,If(zk));k|=E}return Bs(g,k,d,_,R)});function Wk(d,g,_){g=_?n:g;var k=Bs(d,S,n,n,n,n,n,g);return k.placeholder=Wk.placeholder,k}function Vk(d,g,_){g=_?n:g;var k=Bs(d,O,n,n,n,n,n,g);return k.placeholder=Vk.placeholder,k}function Hk(d,g,_){var k,R,z,J,se,fe,Me=0,Re=!1,Ie=!1,et=!0;if(typeof d!="function")throw new Yo(a);g=ea(g)||0,cr(_)&&(Re=!!_.leading,Ie="maxWait"in _,z=Ie?jr(ea(_.maxWait)||0,g):z,et="trailing"in _?!!_.trailing:et);function ft(Sr){var Aa=k,Hs=R;return k=R=n,Me=Sr,J=d.apply(Hs,Aa),J}function Pt(Sr){return Me=Sr,se=xp(on,g),Re?ft(Sr):J}function Jt(Sr){var Aa=Sr-fe,Hs=Sr-Me,cT=g-Aa;return Ie?bi(cT,z-Hs):cT}function kt(Sr){var Aa=Sr-fe,Hs=Sr-Me;return fe===n||Aa>=g||Aa<0||Ie&&Hs>=z}function on(){var Sr=Lv();if(kt(Sr))return pn(Sr);se=xp(on,Jt(Sr))}function pn(Sr){return se=n,et&&k?ft(Sr):(k=R=n,J)}function So(){se!==n&&tk(se),Me=0,k=fe=R=se=n}function Li(){return se===n?J:pn(Lv())}function Co(){var Sr=Lv(),Aa=kt(Sr);if(k=arguments,R=this,fe=Sr,Aa){if(se===n)return Pt(fe);if(Ie)return tk(se),se=xp(on,g),ft(fe)}return se===n&&(se=xp(on,g)),J}return Co.cancel=So,Co.flush=Li,Co}var Pte=tn(function(d,g){return $8(d,1,g)}),kte=tn(function(d,g,_){return $8(d,ea(g)||0,_)});function Tte(d){return Bs(d,N)}function Fv(d,g){if(typeof d!="function"||g!=null&&typeof g!="function")throw new Yo(a);var _=function(){var k=arguments,R=g?g.apply(this,k):k[0],z=_.cache;if(z.has(R))return z.get(R);var J=d.apply(this,k);return _.cache=z.set(R,J)||z,J};return _.cache=new(Fv.Cache||Fs),_}Fv.Cache=Fs;function jv(d){if(typeof d!="function")throw new Yo(a);return function(){var g=arguments;switch(g.length){case 0:return!d.call(this);case 1:return!d.call(this,g[0]);case 2:return!d.call(this,g[0],g[1]);case 3:return!d.call(this,g[0],g[1],g[2])}return!d.apply(this,g)}}function Mte(d){return Uk(2,d)}var Rte=yJ(function(d,g){g=g.length==1&&Ht(g[0])?ir(g[0],xo(Ot())):ir(ui(g,1),xo(Ot()));var _=g.length;return tn(function(k){for(var R=-1,z=bi(k.length,_);++R=g}),ac=j8(function(){return arguments}())?j8:function(d){return gr(d)&&Mn.call(d,"callee")&&!E8.call(d,"callee")},Ht=we.isArray,Kte=a8?xo(a8):tJ;function Qi(d){return d!=null&&Bv(d.length)&&!Ws(d)}function _r(d){return gr(d)&&Qi(d)}function Gte(d){return d===!0||d===!1||gr(d)&&Ii(d)==Ze}var zu=uQ||Y_,Yte=s8?xo(s8):nJ;function Zte(d){return gr(d)&&d.nodeType===1&&!wp(d)}function Xte(d){if(d==null)return!0;if(Qi(d)&&(Ht(d)||typeof d=="string"||typeof d.splice=="function"||zu(d)||Nf(d)||ac(d)))return!d.length;var g=xi(d);if(g==lt||g==ze)return!d.size;if(bp(d))return!h_(d).length;for(var _ in d)if(Mn.call(d,_))return!1;return!0}function Qte(d,g){return mp(d,g)}function Jte(d,g,_){_=typeof _=="function"?_:n;var k=_?_(d,g):n;return k===n?mp(d,g,n,_):!!k}function j_(d){if(!gr(d))return!1;var g=Ii(d);return g==$e||g==Le||typeof d.message=="string"&&typeof d.name=="string"&&!wp(d)}function ene(d){return typeof d=="number"&&A8(d)}function Ws(d){if(!cr(d))return!1;var g=Ii(d);return g==be||g==bt||g==me||g==pe}function Kk(d){return typeof d=="number"&&d==Xt(d)}function Bv(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=j}function cr(d){var g=typeof d;return d!=null&&(g=="object"||g=="function")}function gr(d){return d!=null&&typeof d=="object"}var Gk=u8?xo(u8):iJ;function tne(d,g){return d===g||d_(d,g,k_(g))}function nne(d,g,_){return _=typeof _=="function"?_:n,d_(d,g,k_(g),_)}function rne(d){return Yk(d)&&d!=+d}function ine(d){if(UJ(d))throw new zt(o);return B8(d)}function one(d){return d===null}function ane(d){return d==null}function Yk(d){return typeof d=="number"||gr(d)&&Ii(d)==Ft}function wp(d){if(!gr(d)||Ii(d)!=nn)return!1;var g=hv(d);if(g===null)return!0;var _=Mn.call(g,"constructor")&&g.constructor;return typeof _=="function"&&_ instanceof _&&lv.call(_)==nQ}var B_=l8?xo(l8):oJ;function sne(d){return Kk(d)&&d>=-j&&d<=j}var Zk=c8?xo(c8):aJ;function Uv(d){return typeof d=="string"||!Ht(d)&&gr(d)&&Ii(d)==je}function _o(d){return typeof d=="symbol"||gr(d)&&Ii(d)==ke}var Nf=f8?xo(f8):sJ;function une(d){return d===n}function lne(d){return gr(d)&&xi(d)==vt}function cne(d){return gr(d)&&Ii(d)==wn}var fne=Mv(p_),dne=Mv(function(d,g){return d<=g});function Xk(d){if(!d)return[];if(Qi(d))return Uv(d)?Ca(d):Xi(d);if(up&&d[up])return VX(d[up]());var g=xi(d),_=g==lt?t_:g==ze?av:Lf;return _(d)}function Vs(d){if(!d)return d===0?d:0;if(d=ea(d),d===H||d===-H){var g=d<0?-1:1;return g*K}return d===d?d:0}function Xt(d){var g=Vs(d),_=g%1;return g===g?_?g-_:g:0}function Qk(d){return d?nc(Xt(d),0,oe):0}function ea(d){if(typeof d=="number")return d;if(_o(d))return Y;if(cr(d)){var g=typeof d.valueOf=="function"?d.valueOf():d;d=cr(g)?g+"":g}if(typeof d!="string")return d===0?d:+d;d=v8(d);var _=ct.test(d);return _||rt.test(d)?AX(d.slice(2),_?2:8):He.test(d)?Y:+d}function Jk(d){return os(d,Ji(d))}function hne(d){return d?nc(Xt(d),-j,j):d===0?d:0}function An(d){return d==null?"":wo(d)}var pne=Df(function(d,g){if(bp(g)||Qi(g)){os(g,Qr(g),d);return}for(var _ in g)Mn.call(g,_)&&hp(d,_,g[_])}),eT=Df(function(d,g){os(g,Ji(g),d)}),zv=Df(function(d,g,_,k){os(g,Ji(g),d,k)}),gne=Df(function(d,g,_,k){os(g,Qr(g),d,k)}),mne=Us(s_);function vne(d,g){var _=Rf(d);return g==null?_:R8(_,g)}var yne=tn(function(d,g){d=Bn(d);var _=-1,k=g.length,R=k>2?g[2]:n;for(R&&Ni(g[0],g[1],R)&&(k=1);++_1),z}),os(d,A_(d),_),k&&(_=Xo(_,f|h|p,kJ));for(var R=g.length;R--;)b_(_,g[R]);return _});function Nne(d,g){return nT(d,jv(Ot(g)))}var Lne=Us(function(d,g){return d==null?{}:cJ(d,g)});function nT(d,g){if(d==null)return{};var _=ir(A_(d),function(k){return[k]});return g=Ot(g),K8(d,_,function(k,R){return g(k,R[0])})}function Fne(d,g,_){g=Bu(g,d);var k=-1,R=g.length;for(R||(R=1,d=n);++kg){var k=d;d=g,g=k}if(_||d%1||g%1){var R=P8();return bi(d+R*(g-d+OX("1e-"+((R+"").length-1))),g)}return m_(d,g)}var Yne=$f(function(d,g,_){return g=g.toLowerCase(),d+(_?oT(g):g)});function oT(d){return W_(An(d).toLowerCase())}function aT(d){return d=An(d),d&&d.replace(At,jX).replace(mX,"")}function Zne(d,g,_){d=An(d),g=wo(g);var k=d.length;_=_===n?k:nc(Xt(_),0,k);var R=_;return _-=g.length,_>=0&&d.slice(_,R)==g}function Xne(d){return d=An(d),d&&Gn.test(d)?d.replace(hn,BX):d}function Qne(d){return d=An(d),d&&xe.test(d)?d.replace(le,"\\$&"):d}var Jne=$f(function(d,g,_){return d+(_?"-":"")+g.toLowerCase()}),ere=$f(function(d,g,_){return d+(_?" ":"")+g.toLowerCase()}),tre=lk("toLowerCase");function nre(d,g,_){d=An(d),g=Xt(g);var k=g?Af(d):0;if(!g||k>=g)return d;var R=(g-k)/2;return Tv(vv(R),_)+d+Tv(mv(R),_)}function rre(d,g,_){d=An(d),g=Xt(g);var k=g?Af(d):0;return g&&k>>0,_?(d=An(d),d&&(typeof g=="string"||g!=null&&!B_(g))&&(g=wo(g),!g&&Of(d))?Uu(Ca(d),0,_):d.split(g,_)):[]}var cre=$f(function(d,g,_){return d+(_?" ":"")+W_(g)});function fre(d,g,_){return d=An(d),_=_==null?0:nc(Xt(_),0,d.length),g=wo(g),d.slice(_,_+g.length)==g}function dre(d,g,_){var k=U.templateSettings;_&&Ni(d,g,_)&&(g=n),d=An(d),g=zv({},g,k,mk);var R=zv({},g.imports,k.imports,mk),z=Qr(R),J=e_(R,z),se,fe,Me=0,Re=g.interpolate||pt,Ie="__p += '",et=n_((g.escape||pt).source+"|"+Re.source+"|"+(Re===yo?Ce:pt).source+"|"+(g.evaluate||pt).source+"|$","g"),ft="//# sourceURL="+(Mn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wX+"]")+` `;d.replace(et,function(kt,on,pn,So,Li,Co){return pn||(pn=So),Ie+=d.slice(Me,Co).replace(ht,UX),on&&(se=!0,Ie+=`' + __e(`+on+`) + '`),Li&&(fe=!0,Ie+=`'; @@ -120,7 +120,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho monaco.config({ paths: { vs: '...' } }) For more please check the link https://github.com/suren-atoyan/monaco-loader#config - `},WR=Vpe(Gpe)(CU),Ype={config:qpe},Zpe=function(){for(var t=arguments.length,n=new Array(t),r=0;r{r.current=!1}:e,t)}var Mo=g0e;function C0(){}function vd(e,t,n,r){return m0e(e,r)||v0e(e,t,n,r)}function m0e(e,t){return e.editor.getModel(MU(e,t))}function v0e(e,t,n,r){return e.editor.createModel(t,n,r?MU(e,r):void 0)}function MU(e,t){return e.Uri.parse(t)}function y0e({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:u=!1,theme:l="light",loading:c="Loading...",options:f={},height:h="100%",width:p="100%",className:m,wrapperProps:y={},beforeMount:b=C0,onMount:w=C0}){let[x,S]=v.useState(!1),[O,E]=v.useState(!0),C=v.useRef(null),P=v.useRef(null),M=v.useRef(null),N=v.useRef(w),B=v.useRef(b),V=v.useRef(!1);TU(()=>{let q=PU.init();return q.then(G=>(P.current=G)&&E(!1)).catch(G=>G?.type!=="cancelation"&&console.error("Monaco initialization: error:",G)),()=>C.current?Z():q.cancel()}),Mo(()=>{if(C.current&&P.current){let q=C.current.getOriginalEditor(),G=vd(P.current,e||"",r||n||"text",o||"");G!==q.getModel()&&q.setModel(G)}},[o],x),Mo(()=>{if(C.current&&P.current){let q=C.current.getModifiedEditor(),G=vd(P.current,t||"",i||n||"text",a||"");G!==q.getModel()&&q.setModel(G)}},[a],x),Mo(()=>{let q=C.current.getModifiedEditor();q.getOption(P.current.editor.EditorOption.readOnly)?q.setValue(t||""):t!==q.getValue()&&(q.executeEdits("",[{range:q.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),q.pushUndoStop())},[t],x),Mo(()=>{C.current?.getModel()?.original.setValue(e||"")},[e],x),Mo(()=>{let{original:q,modified:G}=C.current.getModel();P.current.editor.setModelLanguage(q,r||n||"text"),P.current.editor.setModelLanguage(G,i||n||"text")},[n,r,i],x),Mo(()=>{P.current?.editor.setTheme(l)},[l],x),Mo(()=>{C.current?.updateOptions(f)},[f],x);let W=v.useCallback(()=>{if(!P.current)return;B.current(P.current);let q=vd(P.current,e||"",r||n||"text",o||""),G=vd(P.current,t||"",i||n||"text",a||"");C.current?.setModel({original:q,modified:G})},[n,t,i,e,r,o,a]),ne=v.useCallback(()=>{!V.current&&M.current&&(C.current=P.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...f}),W(),P.current?.editor.setTheme(l),S(!0),V.current=!0)},[f,l,W]);v.useEffect(()=>{x&&N.current(C.current,P.current)},[x]),v.useEffect(()=>{!O&&!x&&ne()},[O,x,ne]);function Z(){let q=C.current?.getModel();s||q?.original?.dispose(),u||q?.modified?.dispose(),C.current?.dispose()}return F.createElement(kU,{width:p,height:h,isEditorReady:x,loading:c,_ref:M,className:m,wrapperProps:y})}var b0e=y0e;v.memo(b0e);function x0e(e){let t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}var w0e=x0e,fy=new Map;function _0e({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:s,loading:u="Loading...",options:l={},overrideServices:c={},saveViewState:f=!0,keepCurrentModel:h=!1,width:p="100%",height:m="100%",className:y,wrapperProps:b={},beforeMount:w=C0,onMount:x=C0,onChange:S,onValidate:O=C0}){let[E,C]=v.useState(!1),[P,M]=v.useState(!0),N=v.useRef(null),B=v.useRef(null),V=v.useRef(null),W=v.useRef(x),ne=v.useRef(w),Z=v.useRef(),q=v.useRef(r),G=w0e(o),H=v.useRef(!1),j=v.useRef(!1);TU(()=>{let oe=PU.init();return oe.then(X=>(N.current=X)&&M(!1)).catch(X=>X?.type!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>B.current?Y():oe.cancel()}),Mo(()=>{let oe=vd(N.current,e||r||"",t||i||"",o||n||"");oe!==B.current?.getModel()&&(f&&fy.set(G,B.current?.saveViewState()),B.current?.setModel(oe),f&&B.current?.restoreViewState(fy.get(o)))},[o],E),Mo(()=>{B.current?.updateOptions(l)},[l],E),Mo(()=>{!B.current||r===void 0||(B.current.getOption(N.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(j.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),j.current=!1))},[r],E),Mo(()=>{let oe=B.current?.getModel();oe&&i&&N.current?.editor.setModelLanguage(oe,i)},[i],E),Mo(()=>{s!==void 0&&B.current?.revealLine(s)},[s],E),Mo(()=>{N.current?.editor.setTheme(a)},[a],E);let K=v.useCallback(()=>{if(!(!V.current||!N.current)&&!H.current){ne.current(N.current);let oe=o||n,X=vd(N.current,r||e||"",t||i||"",oe||"");B.current=N.current?.editor.create(V.current,{model:X,automaticLayout:!0,...l},c),f&&B.current.restoreViewState(fy.get(oe)),N.current.editor.setTheme(a),s!==void 0&&B.current.revealLine(s),C(!0),H.current=!0}},[e,t,n,r,i,o,l,c,f,a,s]);v.useEffect(()=>{E&&W.current(B.current,N.current)},[E]),v.useEffect(()=>{!P&&!E&&K()},[P,E,K]),q.current=r,v.useEffect(()=>{E&&S&&(Z.current?.dispose(),Z.current=B.current?.onDidChangeModelContent(oe=>{j.current||S(B.current.getValue(),oe)}))},[E,S]),v.useEffect(()=>{if(E){let oe=N.current.editor.onDidChangeMarkers(X=>{let Q=B.current.getModel()?.uri;if(Q&&X.find(ue=>ue.path===Q.path)){let ue=N.current.editor.getModelMarkers({resource:Q});O?.(ue)}});return()=>{oe?.dispose()}}return()=>{}},[E,O]);function Y(){Z.current?.dispose(),h?f&&fy.set(o,B.current.saveViewState()):B.current.getModel()?.dispose(),B.current.dispose()}return F.createElement(kU,{width:p,height:m,isEditorReady:E,loading:u,_ref:V,className:y,wrapperProps:b})}var S0e=_0e,WQe=v.memo(S0e);function ci(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var C0e=typeof Symbol=="function"&&Symbol.observable||"@@observable",VR=C0e,jS=()=>Math.random().toString(36).substring(7).split("").join("."),E0e={INIT:`@@redux/INIT${jS()}`,REPLACE:`@@redux/REPLACE${jS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${jS()}`},gb=E0e;function mA(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function RU(e,t,n){if(typeof e!="function")throw new Error(ci(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ci(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ci(1));return n(RU)(e,t)}let r=e,i=t,o=new Map,a=o,s=0,u=!1;function l(){a===o&&(a=new Map,o.forEach((b,w)=>{a.set(w,b)}))}function c(){if(u)throw new Error(ci(3));return i}function f(b){if(typeof b!="function")throw new Error(ci(4));if(u)throw new Error(ci(5));let w=!0;l();const x=s++;return a.set(x,b),function(){if(w){if(u)throw new Error(ci(6));w=!1,l(),a.delete(x),o=null}}}function h(b){if(!mA(b))throw new Error(ci(7));if(typeof b.type>"u")throw new Error(ci(8));if(typeof b.type!="string")throw new Error(ci(17));if(u)throw new Error(ci(9));try{u=!0,i=r(i,b)}finally{u=!1}return(o=a).forEach(x=>{x()}),b}function p(b){if(typeof b!="function")throw new Error(ci(10));r=b,h({type:gb.REPLACE})}function m(){const b=f;return{subscribe(w){if(typeof w!="object"||w===null)throw new Error(ci(11));function x(){const O=w;O.next&&O.next(c())}return x(),{unsubscribe:b(x)}},[VR](){return this}}}return h({type:gb.INIT}),{dispatch:h,subscribe:f,getState:c,replaceReducer:p,[VR]:m}}function O0e(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:gb.INIT})>"u")throw new Error(ci(12));if(typeof n(void 0,{type:gb.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ci(13))})}function A0e(e){const t=Object.keys(e),n={};for(let o=0;o"u")throw s&&s.type,new Error(ci(14));l[f]=m,u=u||m!==p}return u=u||r.length!==Object.keys(a).length,u?l:a}}function mb(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function P0e(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(ci(15))};const a={getState:i.getState,dispatch:(u,...l)=>o(u,...l)},s=e.map(u=>u(a));return o=mb(...s)(i.dispatch),{...i,dispatch:o}}}function k0e(e){return mA(e)&&"type"in e&&typeof e.type=="string"}var DU=Symbol.for("immer-nothing"),HR=Symbol.for("immer-draftable"),Uo=Symbol.for("immer-state");function ja(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Xd=Object.getPrototypeOf;function Zc(e){return!!e&&!!e[Uo]}function bu(e){return e?$U(e)||Array.isArray(e)||!!e[HR]||!!e.constructor?.[HR]||xw(e)||ww(e):!1}var T0e=Object.prototype.constructor.toString();function $U(e){if(!e||typeof e!="object")return!1;const t=Xd(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===T0e}function vb(e,t){bw(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function bw(e){const t=e[Uo];return t?t.type_:Array.isArray(e)?1:xw(e)?2:ww(e)?3:0}function AE(e,t){return bw(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function IU(e,t,n){const r=bw(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function M0e(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xw(e){return e instanceof Map}function ww(e){return e instanceof Set}function cc(e){return e.copy_||e.base_}function PE(e,t){if(xw(e))return new Map(e);if(ww(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&$U(e))return Xd(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[Uo];let r=Reflect.ownKeys(n);for(let i=0;i1&&(e.set=e.add=e.clear=e.delete=R0e),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>vA(r,!0))),e}function R0e(){ja(2)}function _w(e){return Object.isFrozen(e)}var D0e={};function Xc(e){const t=D0e[e];return t||ja(0,e),t}var vg;function NU(){return vg}function $0e(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function qR(e,t){t&&(Xc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function kE(e){TE(e),e.drafts_.forEach(I0e),e.drafts_=null}function TE(e){e===vg&&(vg=e.parent_)}function KR(e){return vg=$0e(vg,e)}function I0e(e){const t=e[Uo];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function GR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Uo].modified_&&(kE(t),ja(4)),bu(e)&&(e=yb(t,e),t.parent_||bb(t,e)),t.patches_&&Xc("Patches").generateReplacementPatches_(n[Uo].base_,e,t.patches_,t.inversePatches_)):e=yb(t,n,[]),kE(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==DU?e:void 0}function yb(e,t,n){if(_w(t))return t;const r=t[Uo];if(!r)return vb(t,(i,o)=>YR(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return bb(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,a=!1;r.type_===3&&(o=new Set(i),i.clear(),a=!0),vb(o,(s,u)=>YR(e,r,i,s,u,n,a)),bb(e,i,!1),n&&e.patches_&&Xc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function YR(e,t,n,r,i,o,a){if(Zc(i)){const s=o&&t&&t.type_!==3&&!AE(t.assigned_,r)?o.concat(r):void 0,u=yb(e,i,s);if(IU(n,r,u),Zc(u))e.canAutoFreeze_=!1;else return}else a&&n.add(i);if(bu(i)&&!_w(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;yb(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&bb(e,i)}}function bb(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&vA(t,n)}function N0e(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:NU(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=yA;n&&(i=[r],o=yg);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,s}var yA={get(e,t){if(t===Uo)return e;const n=cc(e);if(!AE(n,t))return L0e(e,n,t);const r=n[t];return e.finalized_||!bu(r)?r:r===BS(e.base_,t)?(US(e),e.copy_[t]=RE(r,e)):r},has(e,t){return t in cc(e)},ownKeys(e){return Reflect.ownKeys(cc(e))},set(e,t,n){const r=LU(cc(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=BS(cc(e),t),o=i?.[Uo];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(M0e(n,i)&&(n!==void 0||AE(e.base_,t)))return!0;US(e),ME(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return BS(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,US(e),ME(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=cc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ja(11)},getPrototypeOf(e){return Xd(e.base_)},setPrototypeOf(){ja(12)}},yg={};vb(yA,(e,t)=>{yg[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});yg.deleteProperty=function(e,t){return yg.set.call(this,e,t,void 0)};yg.set=function(e,t,n){return yA.set.call(this,e[0],t,n,e[0])};function BS(e,t){const n=e[Uo];return(n?cc(n):e)[t]}function L0e(e,t,n){const r=LU(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function LU(e,t){if(!(t in e))return;let n=Xd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Xd(n)}}function ME(e){e.modified_||(e.modified_=!0,e.parent_&&ME(e.parent_))}function US(e){e.copy_||(e.copy_=PE(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var F0e=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const a=this;return function(u=o,...l){return a.produce(u,c=>n.call(this,c,...l))}}typeof n!="function"&&ja(6),r!==void 0&&typeof r!="function"&&ja(7);let i;if(bu(t)){const o=KR(this),a=RE(t,void 0);let s=!0;try{i=n(a),s=!1}finally{s?kE(o):TE(o)}return qR(o,r),GR(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===DU&&(i=void 0),this.autoFreeze_&&vA(i,!0),r){const o=[],a=[];Xc("Patches").generateReplacementPatches_(t,i,o,a),r(o,a)}return i}else ja(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,u=>t(u,...s));let r,i;return[this.produce(t,n,(a,s)=>{r=a,i=s}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){bu(e)||ja(8),Zc(e)&&(e=j0e(e));const t=KR(this),n=RE(e,void 0);return n[Uo].isManual_=!0,TE(t),n}finishDraft(e,t){const n=e&&e[Uo];(!n||!n.isManual_)&&ja(9);const{scope_:r}=n;return qR(r,t),GR(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Xc("Patches").applyPatches_;return Zc(e)?r(e,t):this.produce(e,i=>r(i,t))}};function RE(e,t){const n=xw(e)?Xc("MapSet").proxyMap_(e,t):ww(e)?Xc("MapSet").proxySet_(e,t):N0e(e,t);return(t?t.scope_:NU()).drafts_.push(n),n}function j0e(e){return Zc(e)||ja(10,e),FU(e)}function FU(e){if(!bu(e)||_w(e))return e;const t=e[Uo];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=PE(e,t.scope_.immer_.useStrictShallowCopy_)}else n=PE(e,!0);return vb(n,(r,i)=>{IU(n,r,FU(i))}),t&&(t.finalized_=!1),n}var zo=new F0e,jU=zo.produce;zo.produceWithPatches.bind(zo);zo.setAutoFreeze.bind(zo);zo.setUseStrictShallowCopy.bind(zo);zo.applyPatches.bind(zo);zo.createDraft.bind(zo);zo.finishDraft.bind(zo);function B0e(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function U0e(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function z0e(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var ZR=e=>Array.isArray(e)?e:[e];function W0e(e){const t=Array.isArray(e[0])?e[0]:e;return z0e(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function V0e(e,t){const n=[],{length:r}=e;for(let i=0;i{n=dy(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function G0e(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,a=0,s,u={},l=i.pop();typeof l=="object"&&(u=l,l=i.pop()),B0e(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const c={...n,...u},{memoize:f,memoizeOptions:h=[],argsMemoize:p=BU,argsMemoizeOptions:m=[],devModeChecks:y={}}=c,b=ZR(h),w=ZR(m),x=W0e(i),S=f(function(){return o++,l.apply(null,arguments)},...b),O=p(function(){a++;const C=V0e(x,arguments);return s=S.apply(null,C),s},...w);return Object.assign(O,{resultFunc:l,memoizedResultFunc:S,dependencies:x,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:f,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var Y0e=G0e(BU),Z0e=Object.assign((e,t=Y0e)=>{U0e(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((a,s,u)=>(a[n[u]]=s,a),{}))},{withTypes:()=>Z0e});function UU(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var X0e=UU(),Q0e=UU,J0e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?mb:mb.apply(null,arguments)},ege=e=>e&&typeof e.match=="function";function E0(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(cu(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>k0e(r)&&r.type===e,n}var zU=class l0 extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,l0.prototype)}static get[Symbol.species](){return l0}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new l0(...t[0].concat(this)):new l0(...t.concat(this))}};function QR(e){return bu(e)?jU(e,()=>{}):e}function JR(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function tge(e){return typeof e=="boolean"}var nge=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let a=new zU;return n&&(tge(n)?a.push(X0e):a.push(Q0e(n.extraArgument))),a},rge="RTK_autoBatch",eD=e=>t=>{setTimeout(t,e)},ige=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,a=!1;const s=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:eD(10):e.type==="callback"?e.queueNotification:eD(e.timeout),l=()=>{a=!1,o&&(o=!1,s.forEach(c=>c()))};return Object.assign({},r,{subscribe(c){const f=()=>i&&c(),h=r.subscribe(f);return s.add(c),()=>{h(),s.delete(c)}},dispatch(c){try{return i=!c?.meta?.[rge],o=!i,o&&(a||(a=!0,u(l))),r.dispatch(c)}finally{i=!0}}})},oge=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new zU(e);return r&&i.push(ige(typeof r=="object"?r:void 0)),i};function VQe(e){const t=nge(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:o=void 0,enhancers:a=void 0}=e;let s;if(typeof n=="function")s=n;else if(mA(n))s=A0e(n);else throw new Error(cu(1));let u;typeof r=="function"?u=r(t):u=t();let l=mb;i&&(l=J0e({trace:!1,...typeof i=="object"&&i}));const c=P0e(...u),f=oge(c);let h=typeof a=="function"?a(f):f();const p=l(...h);return RU(s,o,p)}function WU(e){const t={},n=[];let r;const i={addCase(o,a){const s=typeof o=="string"?o:o.type;if(!s)throw new Error(cu(28));if(s in t)throw new Error(cu(29));return t[s]=a,i},addMatcher(o,a){return n.push({matcher:o,reducer:a}),i},addDefaultCase(o){return r=o,i}};return e(i),[t,n,r]}function age(e){return typeof e=="function"}function sge(e,t){let[n,r,i]=WU(t),o;if(age(e))o=()=>QR(e());else{const s=QR(e);o=()=>s}function a(s=o(),u){let l=[n[u.type],...r.filter(({matcher:c})=>c(u)).map(({reducer:c})=>c)];return l.filter(c=>!!c).length===0&&(l=[i]),l.reduce((c,f)=>{if(f)if(Zc(c)){const p=f(c,u);return p===void 0?c:p}else{if(bu(c))return jU(c,h=>f(h,u));{const h=f(c,u);if(h===void 0){if(c===null)return c;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return c},s)}return a.getInitialState=o,a}var uge=(e,t)=>ege(e)?e.match(t):e(t);function lge(...e){return t=>e.some(n=>uge(n,t))}var cge="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",fge=(e=21)=>{let t="",n=e;for(;n--;)t+=cge[Math.random()*64|0];return t},dge=["name","message","stack","code"],zS=class{constructor(e,t){this.payload=e,this.meta=t}_type},tD=class{constructor(e,t){this.payload=e,this.meta=t}_type},hge=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of dge)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},HQe=(()=>{function e(t,n,r){const i=E0(t+"/fulfilled",(u,l,c,f)=>({payload:u,meta:{...f||{},arg:c,requestId:l,requestStatus:"fulfilled"}})),o=E0(t+"/pending",(u,l,c)=>({payload:void 0,meta:{...c||{},arg:l,requestId:u,requestStatus:"pending"}})),a=E0(t+"/rejected",(u,l,c,f,h)=>({payload:f,error:(r&&r.serializeError||hge)(u||"Rejected"),meta:{...h||{},arg:c,requestId:l,rejectedWithValue:!!f,requestStatus:"rejected",aborted:u?.name==="AbortError",condition:u?.name==="ConditionError"}}));function s(u){return(l,c,f)=>{const h=r?.idGenerator?r.idGenerator(u):fge(),p=new AbortController;let m,y;function b(x){y=x,p.abort()}const w=async function(){let x;try{let O=r?.condition?.(u,{getState:c,extra:f});if(gge(O)&&(O=await O),O===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const E=new Promise((C,P)=>{m=()=>{P({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",m)});l(o(h,u,r?.getPendingMeta?.({requestId:h,arg:u},{getState:c,extra:f}))),x=await Promise.race([E,Promise.resolve(n(u,{dispatch:l,getState:c,extra:f,requestId:h,signal:p.signal,abort:b,rejectWithValue:(C,P)=>new zS(C,P),fulfillWithValue:(C,P)=>new tD(C,P)})).then(C=>{if(C instanceof zS)throw C;return C instanceof tD?i(C.payload,h,u,C.meta):i(C,h,u)})])}catch(O){x=O instanceof zS?a(null,h,u,O.payload,O.meta):a(O,h,u)}finally{m&&p.signal.removeEventListener("abort",m)}return r&&!r.dispatchConditionRejection&&a.match(x)&&x.meta.condition||l(x),x}();return Object.assign(w,{abort:b,requestId:h,arg:u,unwrap(){return w.then(pge)}})}}return Object.assign(s,{pending:o,rejected:a,fulfilled:i,settled:lge(a,i),typePrefix:t})}return e.withTypes=()=>e,e})();function pge(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function gge(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var mge=Symbol.for("rtk-slice-createasyncthunk");function vge(e,t){return`${e}/${t}`}function yge({creators:e}={}){const t=e?.asyncThunk?.[mge];return function(r){const{name:i,reducerPath:o=i}=r;if(!i)throw new Error(cu(11));const a=(typeof r.reducers=="function"?r.reducers(xge()):r.reducers)||{},s=Object.keys(a),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(x,S){const O=typeof x=="string"?x:x.type;if(!O)throw new Error(cu(12));if(O in u.sliceCaseReducersByType)throw new Error(cu(13));return u.sliceCaseReducersByType[O]=S,l},addMatcher(x,S){return u.sliceMatchers.push({matcher:x,reducer:S}),l},exposeAction(x,S){return u.actionCreators[x]=S,l},exposeCaseReducer(x,S){return u.sliceCaseReducersByName[x]=S,l}};s.forEach(x=>{const S=a[x],O={reducerName:x,type:vge(i,x),createNotation:typeof r.reducers=="function"};_ge(S)?Cge(O,S,l,t):wge(O,S,l)});function c(){const[x={},S=[],O=void 0]=typeof r.extraReducers=="function"?WU(r.extraReducers):[r.extraReducers],E={...x,...u.sliceCaseReducersByType};return sge(r.initialState,C=>{for(let P in E)C.addCase(P,E[P]);for(let P of u.sliceMatchers)C.addMatcher(P.matcher,P.reducer);for(let P of S)C.addMatcher(P.matcher,P.reducer);O&&C.addDefaultCase(O)})}const f=x=>x,h=new Map;let p;function m(x,S){return p||(p=c()),p(x,S)}function y(){return p||(p=c()),p.getInitialState()}function b(x,S=!1){function O(C){let P=C[x];return typeof P>"u"&&S&&(P=y()),P}function E(C=f){const P=JR(h,S,()=>new WeakMap);return JR(P,C,()=>{const M={};for(const[N,B]of Object.entries(r.selectors??{}))M[N]=bge(B,C,y,S);return M})}return{reducerPath:x,getSelectors:E,get selectors(){return E(O)},selectSlice:O}}const w={name:i,reducer:m,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:y,...b(o),injectInto(x,{reducerPath:S,...O}={}){const E=S??o;return x.inject({reducerPath:E,reducer:m},O),{...w,...b(E,!0)}}};return w}}function bge(e,t,n,r){function i(o,...a){let s=t(o);return typeof s>"u"&&r&&(s=n()),e(s,...a)}return i.unwrapped=e,i}var qQe=yge();function xge(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function wge({type:e,reducerName:t,createNotation:n},r,i){let o,a;if("reducer"in r){if(n&&!Sge(r))throw new Error(cu(17));o=r.reducer,a=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,a?E0(e,a):E0(e))}function _ge(e){return e._reducerDefinitionType==="asyncThunk"}function Sge(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Cge({type:e,reducerName:t},n,r,i){if(!i)throw new Error(cu(18));const{payloadCreator:o,fulfilled:a,pending:s,rejected:u,settled:l,options:c}=n,f=i(e,o,c);r.exposeAction(t,f),a&&r.addCase(f.fulfilled,a),s&&r.addCase(f.pending,s),u&&r.addCase(f.rejected,u),l&&r.addMatcher(f.settled,l),r.exposeCaseReducer(t,{fulfilled:a||hy,pending:s||hy,rejected:u||hy,settled:l||hy})}function hy(){}function cu(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const Lt=e=>typeof e=="string",Fp=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},nD=e=>e==null?"":""+e,Ege=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Oge=/###/g,rD=e=>e&&e.indexOf("###")>-1?e.replace(Oge,"."):e,iD=e=>!e||Lt(e),O0=(e,t,n)=>{const r=Lt(t)?t.split("."):t;let i=0;for(;i{const{obj:r,k:i}=O0(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=O0(e,a,Object);for(;s.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=O0(e,a,Object),s?.obj&&typeof s.obj[`${s.k}.${o}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},Age=(e,t,n,r)=>{const{obj:i,k:o}=O0(e,t,Object);i[o]=i[o]||[],i[o].push(n)},xb=(e,t)=>{const{obj:n,k:r}=O0(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Pge=(e,t,n)=>{const r=xb(e,n);return r!==void 0?r:xb(t,n)},VU=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Lt(e[r])||e[r]instanceof String||Lt(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):VU(e[r],t[r],n):e[r]=t[r]);return e},zf=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var kge={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Tge=e=>Lt(e)?e.replace(/[&<>"'\/]/g,t=>kge[t]):e;class Mge{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Rge=[" ",",","?","!",";"],Dge=new Mge(20),$ge=(e,t,n)=>{t=t||"",n=n||"";const r=Rge.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=Dge.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},DE=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o-1&&ue?.replace("_","-"),Ige={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};let Nge=class $E{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Ige,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i{let[s,u]=a;for(let l=0;l{let[s,u]=a;for(let l=0;l1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):Lt(r)&&o?s.push(...r.split(o)):s.push(r)));const u=xb(this.data,s);return!u&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),u||!a||!Lt(r)?u:DE(this.data?.[t]?.[n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),oD(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(Lt(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let u=xb(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?VU(u,r,o):u={...u,...r},oD(this.data,s,u),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var HU={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,i)??t}),t}};const sD={};class _b extends Sw{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Ege(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ms.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!$ge(t,r,i);if(a&&!s){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:Lt(o)?[o]:o};const l=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),t=l.join(i)}return{key:t,namespaces:Lt(o)?[o]:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),u=s[s.length-1],l=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l?.toLowerCase()==="cimode"){if(c){const O=n.nsSeparator||this.options.nsSeparator;return i?{res:`${u}${O}${a}`,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${O}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:a}const f=this.resolve(t,n);let h=f?.res;const p=f?.usedKey||a,m=f?.exactUsedKey||a,y=Object.prototype.toString.apply(h),b=["[object Number]","[object Function]","[object RegExp]"],w=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,S=!Lt(h)&&typeof h!="boolean"&&typeof h!="number";if(x&&h&&S&&b.indexOf(y)<0&&!(Lt(w)&&Array.isArray(h))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const O=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(f.res=O,f.usedParams=this.getUsedParamsDetails(n),f):O}if(o){const O=Array.isArray(h),E=O?[]:{},C=O?m:p;for(const P in h)if(Object.prototype.hasOwnProperty.call(h,P)){const M=`${C}${o}${P}`;E[P]=this.translate(M,{...n,joinArrays:!1,ns:s}),E[P]===M&&(E[P]=h[P])}h=E}}else if(x&&Lt(w)&&Array.isArray(h))h=h.join(w),h&&(h=this.extendTranslation(h,t,n,r));else{let O=!1,E=!1;const C=n.count!==void 0&&!Lt(n.count),P=_b.hasDefaultValue(n),M=C?this.pluralResolver.getSuffix(l,n.count,n):"",N=n.ordinal&&C?this.pluralResolver.getSuffix(l,n.count,{ordinal:!1}):"",B=C&&!n.ordinal&&n.count===0,V=B&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${M}`]||n[`defaultValue${N}`]||n.defaultValue;!this.isValidLookup(h)&&P&&(O=!0,h=V),this.isValidLookup(h)||(E=!0,h=a);const ne=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&E?void 0:h,Z=P&&V!==h&&this.options.updateMissing;if(E||O||Z){if(this.logger.log(Z?"updateKey":"missingKey",l,u,a,Z?V:h),o){const j=this.resolve(a,{...n,keySeparator:!1});j&&j.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 q=[];const G=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&G&&G[0])for(let j=0;j{const oe=P&&Y!==h?Y:ne;this.options.missingKeyHandler?this.options.missingKeyHandler(j,u,K,oe,Z,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(j,u,K,oe,Z,n),this.emit("missingKey",j,u,K,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?q.forEach(j=>{const K=this.pluralResolver.getSuffixes(j,n);B&&n[`defaultValue${this.options.pluralSeparator}zero`]&&K.indexOf(`${this.options.pluralSeparator}zero`)<0&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(Y=>{H([j],a+Y,n[`defaultValue${Y}`]||V)})}):H(q,a,V))}h=this.extendTranslation(h,t,n,f,r),E&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${u}:${a}`),(E||O)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,O?h:void 0))}return i?(f.res=h,f.usedParams=this.getUsedParamsDetails(n),f):h}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const l=Lt(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(l){const h=t.match(this.interpolator.nestingRegexp);c=h&&h.length}let f=r.replace&&!Lt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language||i.usedLng,r),l){const h=t.match(this.interpolator.nestingRegexp),p=h&&h.length;c1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,a,s;return Lt(t)&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(r))return;const l=this.extractFromKey(u,n),c=l.key;i=c;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Lt(n.count),p=h&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(Lt(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(b=>{this.isValidLookup(r)||(s=b,!sD[`${y[0]}-${b}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(sD[`${y[0]}-${b}`]=!0,this.logger.warn(`key "${i}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" 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!!!")),y.forEach(w=>{if(this.isValidLookup(r))return;a=w;const x=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,c,w,b,n);else{let O;h&&(O=this.pluralResolver.getSuffix(w,n.count,n));const E=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(x.push(c+O),n.ordinal&&O.indexOf(C)===0&&x.push(c+O.replace(C,this.options.pluralSeparator)),p&&x.push(c+E)),m){const P=`${c}${this.options.contextSeparator}${n.context}`;x.push(P),h&&(x.push(P+O),n.ordinal&&O.indexOf(C)===0&&x.push(P+O.replace(C,this.options.pluralSeparator)),p&&x.push(P+E))}}let S;for(;S=x.pop();)this.isValidLookup(r)||(o=S,r=this.getResource(w,b,S,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=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=t.replace&&!Lt(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class uD{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ms.create("languageUtils")}getScriptPartFromCode(t){if(t=wb(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=wb(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Lt(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Lt(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return Lt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Lt(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const lD={zero:0,one:1,two:2,few:3,many:4,other:5},cD={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Lge{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=ms.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=wb(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),cD;if(!t.match(/-|_/))return cD;const u=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(u,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>lD[i]-lD[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const fD=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Pge(e,t,n);return!o&&i&&Lt(n)&&(o=DE(e,n,r),o===void 0&&(o=DE(t,n,r))),o},WS=e=>e.replace(/\$/g,"$$$$");class Fge{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ms.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:u,formatSeparator:l,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:m,nestingSuffixEscaped:y,nestingOptionsSeparator:b,maxReplaces:w,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:Tge,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?zf(o):a||"{{",this.suffix=s?zf(s):u||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=h?zf(h):p||zf("$t("),this.nestingSuffix=m?zf(m):y||zf(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=w||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,a,s;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=p=>{if(p.indexOf(this.formatSeparator)<0){const w=fD(n,u,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,r,{...i,...n,interpolationkey:p}):w}const m=p.split(this.formatSeparator),y=m.shift().trim(),b=m.join(this.formatSeparator).trim();return this.format(fD(n,u,y,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:y})};this.resetRegExp();const c=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>WS(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?WS(this.escape(p)):WS(p)}].forEach(p=>{for(s=0;o=p.regex.exec(t);){const m=o[1].trim();if(a=l(m),a===void 0)if(typeof c=="function"){const b=c(t,o,i);a=Lt(b)?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(f){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),a="";else!Lt(a)&&!this.useRawValueToEscape&&(a=nD(a));const y=p.safeValue(a);if(t=t.replace(o[0],y),f?(p.regex.lastIndex+=a.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;const s=(u,l)=>{const c=this.nestingOptionsSeparator;if(u.indexOf(c)<0)return u;const f=u.split(new RegExp(`${c}[ ]*{`));let h=`{${f[1]}`;u=f[0],h=this.interpolate(h,a);const p=h.match(/'/g),m=h.match(/"/g);((p?.length??0)%2===0&&!m||m.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),l&&(a={...l,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,y),`${u}${c}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;i=this.nestingRegexp.exec(t);){let u=[];a={...r},a=a.replace&&!Lt(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let l=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const c=i[1].split(this.formatSeparator).map(f=>f.trim());i[1]=c.shift(),u=c,l=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&!Lt(o))return o;Lt(o)||(o=nD(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),l&&(o=u.reduce((c,f)=>this.format(c,f,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const jge=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[s,...u]=a.split(":"),l=u.join(":").trim().replace(/^'+|'+$/g,""),c=s.trim();n[c]||(n[c]=l),l==="false"&&(n[c]=!1),l==="true"&&(n[c]=!0),isNaN(l)||(n[c]=parseInt(l,10))}})}return{formatName:t,formatOptions:n}},Wf=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(wb(r),i),t[a]=s),s(n)}};class Bge{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ms.create("formatter"),this.options=t,this.formats={number:Wf((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:Wf((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:Wf((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:Wf((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:Wf((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Wf(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(s=>s.indexOf(")")>-1)){const s=o.findIndex(u=>u.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,s)].join(this.formatSeparator)}return o.reduce((s,u)=>{const{formatName:l,formatOptions:c}=jge(u);if(this.formats[l]){let f=s;try{const h=i?.formatParams?.[i.interpolationkey]||{},p=h.locale||h.lng||i.locale||i.lng||r;f=this.formats[l](s,p,{...c,...i,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${l}`);return s},t)}}const Uge=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class zge extends Sw{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=ms.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},u={};return t.forEach(l=>{let c=!0;n.forEach(f=>{const h=`${l}|${f}`;!r.reload&&this.store.hasResourceBundle(l,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,c=!1,a[h]===void 0&&(a[h]=!0),o[h]===void 0&&(o[h]=!0),u[f]===void 0&&(u[f]=!0)))}),c||(s[l]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(u=>{Age(u.loaded,[o],a),Uge(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(l=>{s[l]||(s[l]={});const c=u.loaded[l];c.length&&c.forEach(f=>{s[l][f]===void 0&&(s[l][f]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(l,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&c&&i{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(l,c)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const l=u(t,n);l&&typeof l.then=="function"?l.then(c=>s(null,c)).catch(s):s(null,l)}catch(l){s(l)}return}return u(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();Lt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Lt(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(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?.create){const u={...a,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let c;l.length===5?c=l(t,n,r,i,u):c=l(t,n,r,i),c&&typeof c.then=="function"?c.then(f=>s(null,f)).catch(s):s(null,c)}catch(c){s(c)}else l(t,n,r,i,s,u)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const dD=()=>({debug:!1,initAsync:!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:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Lt(e[1])&&(t.defaultValue=e[1]),Lt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),hD=e=>(Lt(e.ns)&&(e.ns=[e.ns]),Lt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Lt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),py=()=>{},Wge=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};let qU=class IE extends Sw{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=hD(t),this.services={},this.logger=ms,this.modules={external:[]},Wge(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=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==null&&n.ns&&(Lt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=dD();this.options={...i,...this.options,...hD(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?ms.init(o(this.modules.logger),this.options):ms.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Bge;const f=new uD(this.options);this.store=new aD(this.options.resources,this.options);const h=this.services;h.logger=ms,h.resourceStore=this.store,h.languageUtils=f,h.pluralResolver=new Lge(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(h.formatter=o(c),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Fge(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new zge(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(p){for(var m=arguments.length,y=new Array(m>1?m-1:0),b=1;b1?m-1:0),b=1;b{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=py),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[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(c=>{this[c]=function(){return t.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return t.store[c](...arguments),t}});const u=Fp(),l=()=>{const c=(f,h)=>{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),u.resolve(h),r(f,h)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),u}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:py;const i=Lt(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(l=>{l!=="cimode"&&o.indexOf(l)<0&&o.push(l)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload?.forEach?.(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=Fp();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=py),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&HU.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Fp();this.emit("languageChanging",t);const o=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},a=(u,l)=>{l?(o(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(u,function(){return r.t(...arguments)})},s=u=>{!t&&!u&&this.services.languageDetector&&(u=[]);const l=Lt(u)?u:this.services.languageUtils.getBestMatchFromCodes(u);l&&(this.language||o(l),this.translator.language||this.translator.changeLanguage(l),this.services.languageDetector?.cacheUserLanguage?.(l)),this.loadResources(l,c=>{a(c,l)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let u;if(typeof s!="object"){for(var l=arguments.length,c=new Array(l>2?l-2:0),f=2;f`${u.keyPrefix}${h}${m}`):p=u.keyPrefix?`${u.keyPrefix}${h}${a}`:a,i.t(p,u)};return Lt(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){for(var t=arguments.length,n=new Array(t),r=0;r1&&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],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,u)=>{const l=this.services.backendConnector.state[`${s}|${u}`];return l===-1||l===0||l===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=Fp();return this.options.ns?(Lt(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Fp();Lt(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)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?.languageUtils||new uD(dD());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new IE(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:py;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new IE(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const s=Object.keys(this.store.data).reduce((u,l)=>(u[l]={...this.store.data[l]},Object.keys(u[l]).reduce((c,f)=>(c[f]={...u[l][f]},c),{})),{});o.store=new aD(s,i),o.services.resourceStore=o.store}return o.translator=new _b(o.services,i),o.translator.on("*",function(s){for(var u=arguments.length,l=new Array(u>1?u-1:0),c=1;c{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}const pD=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Kge=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!pD.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!pD.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o},gD={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Kge(e,encodeURIComponent(t),i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let a=0;a0&&o[a].substring(0,s)===t&&(n=o[a].substring(s+1))}}return n}};let jp=null;const mD=()=>{if(jp!==null)return jp;try{jp=window!=="undefined"&&window.localStorage!==null;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{jp=!1}return jp};var Zge={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&mD())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&mD()&&window.localStorage.setItem(n,e)}};let Bp=null;const vD=()=>{if(Bp!==null)return Bp;try{Bp=window!=="undefined"&&window.sessionStorage!==null;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Bp=!1}return Bp};var Xge={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&vD())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&vD()&&window.sessionStorage.setItem(n,e)}},Qge={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o0?t:void 0}},Jge={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},eme={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof t=="number"?t:0]?.replace("/",""):void 0}},tme={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let KU=!1;try{document.cookie,KU=!0}catch{}const GU=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];KU||GU.splice(1,1);const nme=()=>({order:GU,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class rme{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=qge(n,this.options||{},nme()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Gge),this.addDetector(Yge),this.addDetector(Zge),this.addDetector(Xge),this.addDetector(Qge),this.addDetector(Jge),this.addDetector(eme),this.addDetector(tme)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}rme.type="languageDetector";function ime(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function ome(e,t=globalThis?.document){const n=ime(e);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ame="DismissableLayer",NE="dismissableLayer.update",sme="dismissableLayer.pointerDownOutside",ume="dismissableLayer.focusOutside",yD,YU=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fh=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...u}=e,l=v.useContext(YU),[c,f]=v.useState(null),h=c?.ownerDocument??globalThis?.document,[,p]=v.useState({}),m=Nt(t,P=>f(P)),y=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),w=y.indexOf(b),x=c?y.indexOf(c):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,O=x>=w,E=fme(P=>{const M=P.target,N=[...l.branches].some(B=>B.contains(M));!O||N||(i?.(P),a?.(P),P.defaultPrevented||s?.())},h),C=dme(P=>{const M=P.target;[...l.branches].some(B=>B.contains(M))||(o?.(P),a?.(P),P.defaultPrevented||s?.())},h);return ome(P=>{x===l.layers.size-1&&(r?.(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},h),v.useEffect(()=>{if(c)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(yD=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),bD(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=yD)}},[c,h,n,l]),v.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),bD())},[c,l]),v.useEffect(()=>{const P=()=>p({});return document.addEventListener(NE,P),()=>document.removeEventListener(NE,P)},[]),I.jsx(gt.div,{...u,ref:m,style:{pointerEvents:S?O?"auto":"none":void 0,...e.style},onFocusCapture:Ye(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ye(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ye(e.onPointerDownCapture,E.onPointerDownCapture)})});Fh.displayName=ame;var lme="DismissableLayerBranch",cme=v.forwardRef((e,t)=>{const n=v.useContext(YU),r=v.useRef(null),i=Nt(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),I.jsx(gt.div,{...e,ref:i})});cme.displayName=lme;function fme(e,t=globalThis?.document){const n=Vr(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){ZU(sme,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function dme(e,t=globalThis?.document){const n=Vr(e),r=v.useRef(!1);return v.useEffect(()=>{const i=o=>{o.target&&!r.current&&ZU(ume,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function bD(){const e=new CustomEvent(NE);document.dispatchEvent(e)}function ZU(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?zj(i,o):i.dispatchEvent(o)}var VS="focusScope.autoFocusOnMount",HS="focusScope.autoFocusOnUnmount",xD={bubbles:!1,cancelable:!0},hme="FocusScope",km=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,u]=v.useState(null),l=Vr(i),c=Vr(o),f=v.useRef(null),h=Nt(t,y=>u(y)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let y=function(S){if(p.paused||!s)return;const O=S.target;s.contains(O)?f.current=O:Gu(f.current,{select:!0})},b=function(S){if(p.paused||!s)return;const O=S.relatedTarget;O!==null&&(s.contains(O)||Gu(f.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Gu(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",b);const x=new MutationObserver(w);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b),x.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){_D.add(p);const y=document.activeElement;if(!s.contains(y)){const w=new CustomEvent(VS,xD);s.addEventListener(VS,l),s.dispatchEvent(w),w.defaultPrevented||(pme(bme(XU(s)),{select:!0}),document.activeElement===y&&Gu(s))}return()=>{s.removeEventListener(VS,l),setTimeout(()=>{const w=new CustomEvent(HS,xD);s.addEventListener(HS,c),s.dispatchEvent(w),w.defaultPrevented||Gu(y??document.body,{select:!0}),s.removeEventListener(HS,c),_D.remove(p)},0)}}},[s,l,c,p]);const m=v.useCallback(y=>{if(!n&&!r||p.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(b&&w){const x=y.currentTarget,[S,O]=gme(x);S&&O?!y.shiftKey&&w===O?(y.preventDefault(),n&&Gu(S,{select:!0})):y.shiftKey&&w===S&&(y.preventDefault(),n&&Gu(O,{select:!0})):w===x&&y.preventDefault()}},[n,r,p.paused]);return I.jsx(gt.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});km.displayName=hme;function pme(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Gu(r,{select:t}),document.activeElement!==n)return}function gme(e){const t=XU(e),n=wD(t,e),r=wD(t.reverse(),e);return[n,r]}function XU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wD(e,t){for(const n of e)if(!mme(n,{upTo:t}))return n}function mme(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function vme(e){return e instanceof HTMLInputElement&&"select"in e}function Gu(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vme(e)&&t&&e.select()}}var _D=yme();function yme(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=SD(e,t),e.unshift(t)},remove(t){e=SD(e,t),e[0]?.resume()}}}function SD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bme(e){return e.filter(t=>t.tagName!=="A")}var xme="Portal",jh=v.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=v.useState(!1);On(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?iw.createPortal(I.jsx(gt.div,{...r,ref:t}),a):null});jh.displayName=xme;function wme(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Cw=e=>{const{present:t,children:n}=e,r=_me(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,Sme(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};Cw.displayName="Presence";function _me(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=wme(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=gy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=gy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=gy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=gy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function gy(e){return e?.animationName||"none"}function Sme(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qS=0;function Ew(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??CD()),document.body.insertAdjacentElement("beforeend",e[1]??CD()),qS++,()=>{qS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qS--}},[])}function CD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ti=function(){return Ti=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return Lme;var t=Fme(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Bme=Nme(),Td="data-scroll-locked",Ume=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` + `},WR=Vpe(Gpe)(CU),Ype={config:qpe},Zpe=function(){for(var t=arguments.length,n=new Array(t),r=0;r{r.current=!1}:e,t)}var Mo=g0e;function C0(){}function vd(e,t,n,r){return m0e(e,r)||v0e(e,t,n,r)}function m0e(e,t){return e.editor.getModel(MU(e,t))}function v0e(e,t,n,r){return e.editor.createModel(t,n,r?MU(e,r):void 0)}function MU(e,t){return e.Uri.parse(t)}function y0e({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:u=!1,theme:l="light",loading:c="Loading...",options:f={},height:h="100%",width:p="100%",className:m,wrapperProps:y={},beforeMount:b=C0,onMount:w=C0}){let[x,S]=v.useState(!1),[O,E]=v.useState(!0),C=v.useRef(null),P=v.useRef(null),M=v.useRef(null),N=v.useRef(w),B=v.useRef(b),V=v.useRef(!1);TU(()=>{let q=PU.init();return q.then(G=>(P.current=G)&&E(!1)).catch(G=>G?.type!=="cancelation"&&console.error("Monaco initialization: error:",G)),()=>C.current?Z():q.cancel()}),Mo(()=>{if(C.current&&P.current){let q=C.current.getOriginalEditor(),G=vd(P.current,e||"",r||n||"text",o||"");G!==q.getModel()&&q.setModel(G)}},[o],x),Mo(()=>{if(C.current&&P.current){let q=C.current.getModifiedEditor(),G=vd(P.current,t||"",i||n||"text",a||"");G!==q.getModel()&&q.setModel(G)}},[a],x),Mo(()=>{let q=C.current.getModifiedEditor();q.getOption(P.current.editor.EditorOption.readOnly)?q.setValue(t||""):t!==q.getValue()&&(q.executeEdits("",[{range:q.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),q.pushUndoStop())},[t],x),Mo(()=>{C.current?.getModel()?.original.setValue(e||"")},[e],x),Mo(()=>{let{original:q,modified:G}=C.current.getModel();P.current.editor.setModelLanguage(q,r||n||"text"),P.current.editor.setModelLanguage(G,i||n||"text")},[n,r,i],x),Mo(()=>{P.current?.editor.setTheme(l)},[l],x),Mo(()=>{C.current?.updateOptions(f)},[f],x);let W=v.useCallback(()=>{if(!P.current)return;B.current(P.current);let q=vd(P.current,e||"",r||n||"text",o||""),G=vd(P.current,t||"",i||n||"text",a||"");C.current?.setModel({original:q,modified:G})},[n,t,i,e,r,o,a]),ne=v.useCallback(()=>{!V.current&&M.current&&(C.current=P.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...f}),W(),P.current?.editor.setTheme(l),S(!0),V.current=!0)},[f,l,W]);v.useEffect(()=>{x&&N.current(C.current,P.current)},[x]),v.useEffect(()=>{!O&&!x&&ne()},[O,x,ne]);function Z(){let q=C.current?.getModel();s||q?.original?.dispose(),u||q?.modified?.dispose(),C.current?.dispose()}return F.createElement(kU,{width:p,height:h,isEditorReady:x,loading:c,_ref:M,className:m,wrapperProps:y})}var b0e=y0e;v.memo(b0e);function x0e(e){let t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}var w0e=x0e,fy=new Map;function _0e({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:s,loading:u="Loading...",options:l={},overrideServices:c={},saveViewState:f=!0,keepCurrentModel:h=!1,width:p="100%",height:m="100%",className:y,wrapperProps:b={},beforeMount:w=C0,onMount:x=C0,onChange:S,onValidate:O=C0}){let[E,C]=v.useState(!1),[P,M]=v.useState(!0),N=v.useRef(null),B=v.useRef(null),V=v.useRef(null),W=v.useRef(x),ne=v.useRef(w),Z=v.useRef(),q=v.useRef(r),G=w0e(o),H=v.useRef(!1),j=v.useRef(!1);TU(()=>{let oe=PU.init();return oe.then(X=>(N.current=X)&&M(!1)).catch(X=>X?.type!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>B.current?Y():oe.cancel()}),Mo(()=>{let oe=vd(N.current,e||r||"",t||i||"",o||n||"");oe!==B.current?.getModel()&&(f&&fy.set(G,B.current?.saveViewState()),B.current?.setModel(oe),f&&B.current?.restoreViewState(fy.get(o)))},[o],E),Mo(()=>{B.current?.updateOptions(l)},[l],E),Mo(()=>{!B.current||r===void 0||(B.current.getOption(N.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(j.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),j.current=!1))},[r],E),Mo(()=>{let oe=B.current?.getModel();oe&&i&&N.current?.editor.setModelLanguage(oe,i)},[i],E),Mo(()=>{s!==void 0&&B.current?.revealLine(s)},[s],E),Mo(()=>{N.current?.editor.setTheme(a)},[a],E);let K=v.useCallback(()=>{if(!(!V.current||!N.current)&&!H.current){ne.current(N.current);let oe=o||n,X=vd(N.current,r||e||"",t||i||"",oe||"");B.current=N.current?.editor.create(V.current,{model:X,automaticLayout:!0,...l},c),f&&B.current.restoreViewState(fy.get(oe)),N.current.editor.setTheme(a),s!==void 0&&B.current.revealLine(s),C(!0),H.current=!0}},[e,t,n,r,i,o,l,c,f,a,s]);v.useEffect(()=>{E&&W.current(B.current,N.current)},[E]),v.useEffect(()=>{!P&&!E&&K()},[P,E,K]),q.current=r,v.useEffect(()=>{E&&S&&(Z.current?.dispose(),Z.current=B.current?.onDidChangeModelContent(oe=>{j.current||S(B.current.getValue(),oe)}))},[E,S]),v.useEffect(()=>{if(E){let oe=N.current.editor.onDidChangeMarkers(X=>{let Q=B.current.getModel()?.uri;if(Q&&X.find(ue=>ue.path===Q.path)){let ue=N.current.editor.getModelMarkers({resource:Q});O?.(ue)}});return()=>{oe?.dispose()}}return()=>{}},[E,O]);function Y(){Z.current?.dispose(),h?f&&fy.set(o,B.current.saveViewState()):B.current.getModel()?.dispose(),B.current.dispose()}return F.createElement(kU,{width:p,height:m,isEditorReady:E,loading:u,_ref:V,className:y,wrapperProps:b})}var S0e=_0e,WQe=v.memo(S0e);function ci(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var C0e=typeof Symbol=="function"&&Symbol.observable||"@@observable",VR=C0e,jS=()=>Math.random().toString(36).substring(7).split("").join("."),E0e={INIT:`@@redux/INIT${jS()}`,REPLACE:`@@redux/REPLACE${jS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${jS()}`},gb=E0e;function mA(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function RU(e,t,n){if(typeof e!="function")throw new Error(ci(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ci(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ci(1));return n(RU)(e,t)}let r=e,i=t,o=new Map,a=o,s=0,u=!1;function l(){a===o&&(a=new Map,o.forEach((b,w)=>{a.set(w,b)}))}function c(){if(u)throw new Error(ci(3));return i}function f(b){if(typeof b!="function")throw new Error(ci(4));if(u)throw new Error(ci(5));let w=!0;l();const x=s++;return a.set(x,b),function(){if(w){if(u)throw new Error(ci(6));w=!1,l(),a.delete(x),o=null}}}function h(b){if(!mA(b))throw new Error(ci(7));if(typeof b.type>"u")throw new Error(ci(8));if(typeof b.type!="string")throw new Error(ci(17));if(u)throw new Error(ci(9));try{u=!0,i=r(i,b)}finally{u=!1}return(o=a).forEach(x=>{x()}),b}function p(b){if(typeof b!="function")throw new Error(ci(10));r=b,h({type:gb.REPLACE})}function m(){const b=f;return{subscribe(w){if(typeof w!="object"||w===null)throw new Error(ci(11));function x(){const O=w;O.next&&O.next(c())}return x(),{unsubscribe:b(x)}},[VR](){return this}}}return h({type:gb.INIT}),{dispatch:h,subscribe:f,getState:c,replaceReducer:p,[VR]:m}}function O0e(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:gb.INIT})>"u")throw new Error(ci(12));if(typeof n(void 0,{type:gb.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ci(13))})}function A0e(e){const t=Object.keys(e),n={};for(let o=0;o"u")throw s&&s.type,new Error(ci(14));l[f]=m,u=u||m!==p}return u=u||r.length!==Object.keys(a).length,u?l:a}}function mb(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function P0e(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(ci(15))};const a={getState:i.getState,dispatch:(u,...l)=>o(u,...l)},s=e.map(u=>u(a));return o=mb(...s)(i.dispatch),{...i,dispatch:o}}}function k0e(e){return mA(e)&&"type"in e&&typeof e.type=="string"}var DU=Symbol.for("immer-nothing"),HR=Symbol.for("immer-draftable"),Uo=Symbol.for("immer-state");function ja(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Xd=Object.getPrototypeOf;function Zc(e){return!!e&&!!e[Uo]}function bu(e){return e?$U(e)||Array.isArray(e)||!!e[HR]||!!e.constructor?.[HR]||xw(e)||ww(e):!1}var T0e=Object.prototype.constructor.toString();function $U(e){if(!e||typeof e!="object")return!1;const t=Xd(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===T0e}function vb(e,t){bw(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function bw(e){const t=e[Uo];return t?t.type_:Array.isArray(e)?1:xw(e)?2:ww(e)?3:0}function AE(e,t){return bw(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function IU(e,t,n){const r=bw(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function M0e(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xw(e){return e instanceof Map}function ww(e){return e instanceof Set}function cc(e){return e.copy_||e.base_}function PE(e,t){if(xw(e))return new Map(e);if(ww(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&$U(e))return Xd(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[Uo];let r=Reflect.ownKeys(n);for(let i=0;i1&&(e.set=e.add=e.clear=e.delete=R0e),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>vA(r,!0))),e}function R0e(){ja(2)}function _w(e){return Object.isFrozen(e)}var D0e={};function Xc(e){const t=D0e[e];return t||ja(0,e),t}var vg;function NU(){return vg}function $0e(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function qR(e,t){t&&(Xc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function kE(e){TE(e),e.drafts_.forEach(I0e),e.drafts_=null}function TE(e){e===vg&&(vg=e.parent_)}function KR(e){return vg=$0e(vg,e)}function I0e(e){const t=e[Uo];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function GR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Uo].modified_&&(kE(t),ja(4)),bu(e)&&(e=yb(t,e),t.parent_||bb(t,e)),t.patches_&&Xc("Patches").generateReplacementPatches_(n[Uo].base_,e,t.patches_,t.inversePatches_)):e=yb(t,n,[]),kE(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==DU?e:void 0}function yb(e,t,n){if(_w(t))return t;const r=t[Uo];if(!r)return vb(t,(i,o)=>YR(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return bb(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,a=!1;r.type_===3&&(o=new Set(i),i.clear(),a=!0),vb(o,(s,u)=>YR(e,r,i,s,u,n,a)),bb(e,i,!1),n&&e.patches_&&Xc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function YR(e,t,n,r,i,o,a){if(Zc(i)){const s=o&&t&&t.type_!==3&&!AE(t.assigned_,r)?o.concat(r):void 0,u=yb(e,i,s);if(IU(n,r,u),Zc(u))e.canAutoFreeze_=!1;else return}else a&&n.add(i);if(bu(i)&&!_w(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;yb(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&bb(e,i)}}function bb(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&vA(t,n)}function N0e(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:NU(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=yA;n&&(i=[r],o=yg);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,s}var yA={get(e,t){if(t===Uo)return e;const n=cc(e);if(!AE(n,t))return L0e(e,n,t);const r=n[t];return e.finalized_||!bu(r)?r:r===BS(e.base_,t)?(US(e),e.copy_[t]=RE(r,e)):r},has(e,t){return t in cc(e)},ownKeys(e){return Reflect.ownKeys(cc(e))},set(e,t,n){const r=LU(cc(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=BS(cc(e),t),o=i?.[Uo];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(M0e(n,i)&&(n!==void 0||AE(e.base_,t)))return!0;US(e),ME(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return BS(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,US(e),ME(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=cc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ja(11)},getPrototypeOf(e){return Xd(e.base_)},setPrototypeOf(){ja(12)}},yg={};vb(yA,(e,t)=>{yg[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});yg.deleteProperty=function(e,t){return yg.set.call(this,e,t,void 0)};yg.set=function(e,t,n){return yA.set.call(this,e[0],t,n,e[0])};function BS(e,t){const n=e[Uo];return(n?cc(n):e)[t]}function L0e(e,t,n){const r=LU(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function LU(e,t){if(!(t in e))return;let n=Xd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Xd(n)}}function ME(e){e.modified_||(e.modified_=!0,e.parent_&&ME(e.parent_))}function US(e){e.copy_||(e.copy_=PE(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var F0e=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const a=this;return function(u=o,...l){return a.produce(u,c=>n.call(this,c,...l))}}typeof n!="function"&&ja(6),r!==void 0&&typeof r!="function"&&ja(7);let i;if(bu(t)){const o=KR(this),a=RE(t,void 0);let s=!0;try{i=n(a),s=!1}finally{s?kE(o):TE(o)}return qR(o,r),GR(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===DU&&(i=void 0),this.autoFreeze_&&vA(i,!0),r){const o=[],a=[];Xc("Patches").generateReplacementPatches_(t,i,o,a),r(o,a)}return i}else ja(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,u=>t(u,...s));let r,i;return[this.produce(t,n,(a,s)=>{r=a,i=s}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){bu(e)||ja(8),Zc(e)&&(e=j0e(e));const t=KR(this),n=RE(e,void 0);return n[Uo].isManual_=!0,TE(t),n}finishDraft(e,t){const n=e&&e[Uo];(!n||!n.isManual_)&&ja(9);const{scope_:r}=n;return qR(r,t),GR(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Xc("Patches").applyPatches_;return Zc(e)?r(e,t):this.produce(e,i=>r(i,t))}};function RE(e,t){const n=xw(e)?Xc("MapSet").proxyMap_(e,t):ww(e)?Xc("MapSet").proxySet_(e,t):N0e(e,t);return(t?t.scope_:NU()).drafts_.push(n),n}function j0e(e){return Zc(e)||ja(10,e),FU(e)}function FU(e){if(!bu(e)||_w(e))return e;const t=e[Uo];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=PE(e,t.scope_.immer_.useStrictShallowCopy_)}else n=PE(e,!0);return vb(n,(r,i)=>{IU(n,r,FU(i))}),t&&(t.finalized_=!1),n}var zo=new F0e,jU=zo.produce;zo.produceWithPatches.bind(zo);zo.setAutoFreeze.bind(zo);zo.setUseStrictShallowCopy.bind(zo);zo.applyPatches.bind(zo);zo.createDraft.bind(zo);zo.finishDraft.bind(zo);function B0e(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function U0e(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function z0e(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var ZR=e=>Array.isArray(e)?e:[e];function W0e(e){const t=Array.isArray(e[0])?e[0]:e;return z0e(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function V0e(e,t){const n=[],{length:r}=e;for(let i=0;i{n=dy(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function G0e(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,a=0,s,u={},l=i.pop();typeof l=="object"&&(u=l,l=i.pop()),B0e(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const c={...n,...u},{memoize:f,memoizeOptions:h=[],argsMemoize:p=BU,argsMemoizeOptions:m=[],devModeChecks:y={}}=c,b=ZR(h),w=ZR(m),x=W0e(i),S=f(function(){return o++,l.apply(null,arguments)},...b),O=p(function(){a++;const C=V0e(x,arguments);return s=S.apply(null,C),s},...w);return Object.assign(O,{resultFunc:l,memoizedResultFunc:S,dependencies:x,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:f,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var Y0e=G0e(BU),Z0e=Object.assign((e,t=Y0e)=>{U0e(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((a,s,u)=>(a[n[u]]=s,a),{}))},{withTypes:()=>Z0e});function UU(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var X0e=UU(),Q0e=UU,J0e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?mb:mb.apply(null,arguments)},ege=e=>e&&typeof e.match=="function";function E0(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(cu(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>k0e(r)&&r.type===e,n}var zU=class l0 extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,l0.prototype)}static get[Symbol.species](){return l0}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new l0(...t[0].concat(this)):new l0(...t.concat(this))}};function QR(e){return bu(e)?jU(e,()=>{}):e}function JR(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function tge(e){return typeof e=="boolean"}var nge=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let a=new zU;return n&&(tge(n)?a.push(X0e):a.push(Q0e(n.extraArgument))),a},rge="RTK_autoBatch",e9=e=>t=>{setTimeout(t,e)},ige=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,a=!1;const s=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:e9(10):e.type==="callback"?e.queueNotification:e9(e.timeout),l=()=>{a=!1,o&&(o=!1,s.forEach(c=>c()))};return Object.assign({},r,{subscribe(c){const f=()=>i&&c(),h=r.subscribe(f);return s.add(c),()=>{h(),s.delete(c)}},dispatch(c){try{return i=!c?.meta?.[rge],o=!i,o&&(a||(a=!0,u(l))),r.dispatch(c)}finally{i=!0}}})},oge=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new zU(e);return r&&i.push(ige(typeof r=="object"?r:void 0)),i};function VQe(e){const t=nge(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:o=void 0,enhancers:a=void 0}=e;let s;if(typeof n=="function")s=n;else if(mA(n))s=A0e(n);else throw new Error(cu(1));let u;typeof r=="function"?u=r(t):u=t();let l=mb;i&&(l=J0e({trace:!1,...typeof i=="object"&&i}));const c=P0e(...u),f=oge(c);let h=typeof a=="function"?a(f):f();const p=l(...h);return RU(s,o,p)}function WU(e){const t={},n=[];let r;const i={addCase(o,a){const s=typeof o=="string"?o:o.type;if(!s)throw new Error(cu(28));if(s in t)throw new Error(cu(29));return t[s]=a,i},addMatcher(o,a){return n.push({matcher:o,reducer:a}),i},addDefaultCase(o){return r=o,i}};return e(i),[t,n,r]}function age(e){return typeof e=="function"}function sge(e,t){let[n,r,i]=WU(t),o;if(age(e))o=()=>QR(e());else{const s=QR(e);o=()=>s}function a(s=o(),u){let l=[n[u.type],...r.filter(({matcher:c})=>c(u)).map(({reducer:c})=>c)];return l.filter(c=>!!c).length===0&&(l=[i]),l.reduce((c,f)=>{if(f)if(Zc(c)){const p=f(c,u);return p===void 0?c:p}else{if(bu(c))return jU(c,h=>f(h,u));{const h=f(c,u);if(h===void 0){if(c===null)return c;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return c},s)}return a.getInitialState=o,a}var uge=(e,t)=>ege(e)?e.match(t):e(t);function lge(...e){return t=>e.some(n=>uge(n,t))}var cge="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",fge=(e=21)=>{let t="",n=e;for(;n--;)t+=cge[Math.random()*64|0];return t},dge=["name","message","stack","code"],zS=class{constructor(e,t){this.payload=e,this.meta=t}_type},t9=class{constructor(e,t){this.payload=e,this.meta=t}_type},hge=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of dge)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},HQe=(()=>{function e(t,n,r){const i=E0(t+"/fulfilled",(u,l,c,f)=>({payload:u,meta:{...f||{},arg:c,requestId:l,requestStatus:"fulfilled"}})),o=E0(t+"/pending",(u,l,c)=>({payload:void 0,meta:{...c||{},arg:l,requestId:u,requestStatus:"pending"}})),a=E0(t+"/rejected",(u,l,c,f,h)=>({payload:f,error:(r&&r.serializeError||hge)(u||"Rejected"),meta:{...h||{},arg:c,requestId:l,rejectedWithValue:!!f,requestStatus:"rejected",aborted:u?.name==="AbortError",condition:u?.name==="ConditionError"}}));function s(u){return(l,c,f)=>{const h=r?.idGenerator?r.idGenerator(u):fge(),p=new AbortController;let m,y;function b(x){y=x,p.abort()}const w=async function(){let x;try{let O=r?.condition?.(u,{getState:c,extra:f});if(gge(O)&&(O=await O),O===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const E=new Promise((C,P)=>{m=()=>{P({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",m)});l(o(h,u,r?.getPendingMeta?.({requestId:h,arg:u},{getState:c,extra:f}))),x=await Promise.race([E,Promise.resolve(n(u,{dispatch:l,getState:c,extra:f,requestId:h,signal:p.signal,abort:b,rejectWithValue:(C,P)=>new zS(C,P),fulfillWithValue:(C,P)=>new t9(C,P)})).then(C=>{if(C instanceof zS)throw C;return C instanceof t9?i(C.payload,h,u,C.meta):i(C,h,u)})])}catch(O){x=O instanceof zS?a(null,h,u,O.payload,O.meta):a(O,h,u)}finally{m&&p.signal.removeEventListener("abort",m)}return r&&!r.dispatchConditionRejection&&a.match(x)&&x.meta.condition||l(x),x}();return Object.assign(w,{abort:b,requestId:h,arg:u,unwrap(){return w.then(pge)}})}}return Object.assign(s,{pending:o,rejected:a,fulfilled:i,settled:lge(a,i),typePrefix:t})}return e.withTypes=()=>e,e})();function pge(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function gge(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var mge=Symbol.for("rtk-slice-createasyncthunk");function vge(e,t){return`${e}/${t}`}function yge({creators:e}={}){const t=e?.asyncThunk?.[mge];return function(r){const{name:i,reducerPath:o=i}=r;if(!i)throw new Error(cu(11));const a=(typeof r.reducers=="function"?r.reducers(xge()):r.reducers)||{},s=Object.keys(a),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(x,S){const O=typeof x=="string"?x:x.type;if(!O)throw new Error(cu(12));if(O in u.sliceCaseReducersByType)throw new Error(cu(13));return u.sliceCaseReducersByType[O]=S,l},addMatcher(x,S){return u.sliceMatchers.push({matcher:x,reducer:S}),l},exposeAction(x,S){return u.actionCreators[x]=S,l},exposeCaseReducer(x,S){return u.sliceCaseReducersByName[x]=S,l}};s.forEach(x=>{const S=a[x],O={reducerName:x,type:vge(i,x),createNotation:typeof r.reducers=="function"};_ge(S)?Cge(O,S,l,t):wge(O,S,l)});function c(){const[x={},S=[],O=void 0]=typeof r.extraReducers=="function"?WU(r.extraReducers):[r.extraReducers],E={...x,...u.sliceCaseReducersByType};return sge(r.initialState,C=>{for(let P in E)C.addCase(P,E[P]);for(let P of u.sliceMatchers)C.addMatcher(P.matcher,P.reducer);for(let P of S)C.addMatcher(P.matcher,P.reducer);O&&C.addDefaultCase(O)})}const f=x=>x,h=new Map;let p;function m(x,S){return p||(p=c()),p(x,S)}function y(){return p||(p=c()),p.getInitialState()}function b(x,S=!1){function O(C){let P=C[x];return typeof P>"u"&&S&&(P=y()),P}function E(C=f){const P=JR(h,S,()=>new WeakMap);return JR(P,C,()=>{const M={};for(const[N,B]of Object.entries(r.selectors??{}))M[N]=bge(B,C,y,S);return M})}return{reducerPath:x,getSelectors:E,get selectors(){return E(O)},selectSlice:O}}const w={name:i,reducer:m,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:y,...b(o),injectInto(x,{reducerPath:S,...O}={}){const E=S??o;return x.inject({reducerPath:E,reducer:m},O),{...w,...b(E,!0)}}};return w}}function bge(e,t,n,r){function i(o,...a){let s=t(o);return typeof s>"u"&&r&&(s=n()),e(s,...a)}return i.unwrapped=e,i}var qQe=yge();function xge(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function wge({type:e,reducerName:t,createNotation:n},r,i){let o,a;if("reducer"in r){if(n&&!Sge(r))throw new Error(cu(17));o=r.reducer,a=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,a?E0(e,a):E0(e))}function _ge(e){return e._reducerDefinitionType==="asyncThunk"}function Sge(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Cge({type:e,reducerName:t},n,r,i){if(!i)throw new Error(cu(18));const{payloadCreator:o,fulfilled:a,pending:s,rejected:u,settled:l,options:c}=n,f=i(e,o,c);r.exposeAction(t,f),a&&r.addCase(f.fulfilled,a),s&&r.addCase(f.pending,s),u&&r.addCase(f.rejected,u),l&&r.addMatcher(f.settled,l),r.exposeCaseReducer(t,{fulfilled:a||hy,pending:s||hy,rejected:u||hy,settled:l||hy})}function hy(){}function cu(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const Lt=e=>typeof e=="string",Fp=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},n9=e=>e==null?"":""+e,Ege=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Oge=/###/g,r9=e=>e&&e.indexOf("###")>-1?e.replace(Oge,"."):e,i9=e=>!e||Lt(e),O0=(e,t,n)=>{const r=Lt(t)?t.split("."):t;let i=0;for(;i{const{obj:r,k:i}=O0(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=O0(e,a,Object);for(;s.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=O0(e,a,Object),s?.obj&&typeof s.obj[`${s.k}.${o}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},Age=(e,t,n,r)=>{const{obj:i,k:o}=O0(e,t,Object);i[o]=i[o]||[],i[o].push(n)},xb=(e,t)=>{const{obj:n,k:r}=O0(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Pge=(e,t,n)=>{const r=xb(e,n);return r!==void 0?r:xb(t,n)},VU=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Lt(e[r])||e[r]instanceof String||Lt(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):VU(e[r],t[r],n):e[r]=t[r]);return e},zf=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var kge={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Tge=e=>Lt(e)?e.replace(/[&<>"'\/]/g,t=>kge[t]):e;class Mge{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Rge=[" ",",","?","!",";"],Dge=new Mge(20),$ge=(e,t,n)=>{t=t||"",n=n||"";const r=Rge.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=Dge.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},DE=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o-1&&ue?.replace("_","-"),Ige={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};let Nge=class $E{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Ige,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i{let[s,u]=a;for(let l=0;l{let[s,u]=a;for(let l=0;l1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):Lt(r)&&o?s.push(...r.split(o)):s.push(r)));const u=xb(this.data,s);return!u&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),u||!a||!Lt(r)?u:DE(this.data?.[t]?.[n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),o9(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(Lt(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let u=xb(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?VU(u,r,o):u={...u,...r},o9(this.data,s,u),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var HU={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,i)??t}),t}};const s9={};class _b extends Sw{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Ege(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ms.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!$ge(t,r,i);if(a&&!s){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:Lt(o)?[o]:o};const l=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),t=l.join(i)}return{key:t,namespaces:Lt(o)?[o]:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),u=s[s.length-1],l=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l?.toLowerCase()==="cimode"){if(c){const O=n.nsSeparator||this.options.nsSeparator;return i?{res:`${u}${O}${a}`,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${O}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:a}const f=this.resolve(t,n);let h=f?.res;const p=f?.usedKey||a,m=f?.exactUsedKey||a,y=Object.prototype.toString.apply(h),b=["[object Number]","[object Function]","[object RegExp]"],w=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,S=!Lt(h)&&typeof h!="boolean"&&typeof h!="number";if(x&&h&&S&&b.indexOf(y)<0&&!(Lt(w)&&Array.isArray(h))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const O=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(f.res=O,f.usedParams=this.getUsedParamsDetails(n),f):O}if(o){const O=Array.isArray(h),E=O?[]:{},C=O?m:p;for(const P in h)if(Object.prototype.hasOwnProperty.call(h,P)){const M=`${C}${o}${P}`;E[P]=this.translate(M,{...n,joinArrays:!1,ns:s}),E[P]===M&&(E[P]=h[P])}h=E}}else if(x&&Lt(w)&&Array.isArray(h))h=h.join(w),h&&(h=this.extendTranslation(h,t,n,r));else{let O=!1,E=!1;const C=n.count!==void 0&&!Lt(n.count),P=_b.hasDefaultValue(n),M=C?this.pluralResolver.getSuffix(l,n.count,n):"",N=n.ordinal&&C?this.pluralResolver.getSuffix(l,n.count,{ordinal:!1}):"",B=C&&!n.ordinal&&n.count===0,V=B&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${M}`]||n[`defaultValue${N}`]||n.defaultValue;!this.isValidLookup(h)&&P&&(O=!0,h=V),this.isValidLookup(h)||(E=!0,h=a);const ne=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&E?void 0:h,Z=P&&V!==h&&this.options.updateMissing;if(E||O||Z){if(this.logger.log(Z?"updateKey":"missingKey",l,u,a,Z?V:h),o){const j=this.resolve(a,{...n,keySeparator:!1});j&&j.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 q=[];const G=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&G&&G[0])for(let j=0;j{const oe=P&&Y!==h?Y:ne;this.options.missingKeyHandler?this.options.missingKeyHandler(j,u,K,oe,Z,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(j,u,K,oe,Z,n),this.emit("missingKey",j,u,K,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?q.forEach(j=>{const K=this.pluralResolver.getSuffixes(j,n);B&&n[`defaultValue${this.options.pluralSeparator}zero`]&&K.indexOf(`${this.options.pluralSeparator}zero`)<0&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(Y=>{H([j],a+Y,n[`defaultValue${Y}`]||V)})}):H(q,a,V))}h=this.extendTranslation(h,t,n,f,r),E&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${u}:${a}`),(E||O)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,O?h:void 0))}return i?(f.res=h,f.usedParams=this.getUsedParamsDetails(n),f):h}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const l=Lt(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(l){const h=t.match(this.interpolator.nestingRegexp);c=h&&h.length}let f=r.replace&&!Lt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language||i.usedLng,r),l){const h=t.match(this.interpolator.nestingRegexp),p=h&&h.length;c1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,a,s;return Lt(t)&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(r))return;const l=this.extractFromKey(u,n),c=l.key;i=c;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Lt(n.count),p=h&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(Lt(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(b=>{this.isValidLookup(r)||(s=b,!s9[`${y[0]}-${b}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(s9[`${y[0]}-${b}`]=!0,this.logger.warn(`key "${i}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" 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!!!")),y.forEach(w=>{if(this.isValidLookup(r))return;a=w;const x=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,c,w,b,n);else{let O;h&&(O=this.pluralResolver.getSuffix(w,n.count,n));const E=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(x.push(c+O),n.ordinal&&O.indexOf(C)===0&&x.push(c+O.replace(C,this.options.pluralSeparator)),p&&x.push(c+E)),m){const P=`${c}${this.options.contextSeparator}${n.context}`;x.push(P),h&&(x.push(P+O),n.ordinal&&O.indexOf(C)===0&&x.push(P+O.replace(C,this.options.pluralSeparator)),p&&x.push(P+E))}}let S;for(;S=x.pop();)this.isValidLookup(r)||(o=S,r=this.getResource(w,b,S,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=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=t.replace&&!Lt(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class u9{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ms.create("languageUtils")}getScriptPartFromCode(t){if(t=wb(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=wb(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Lt(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Lt(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return Lt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Lt(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const l9={zero:0,one:1,two:2,few:3,many:4,other:5},c9={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Lge{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=ms.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=wb(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),c9;if(!t.match(/-|_/))return c9;const u=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(u,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>l9[i]-l9[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const f9=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Pge(e,t,n);return!o&&i&&Lt(n)&&(o=DE(e,n,r),o===void 0&&(o=DE(t,n,r))),o},WS=e=>e.replace(/\$/g,"$$$$");class Fge{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ms.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:u,formatSeparator:l,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:m,nestingSuffixEscaped:y,nestingOptionsSeparator:b,maxReplaces:w,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:Tge,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?zf(o):a||"{{",this.suffix=s?zf(s):u||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=h?zf(h):p||zf("$t("),this.nestingSuffix=m?zf(m):y||zf(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=w||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,a,s;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=p=>{if(p.indexOf(this.formatSeparator)<0){const w=f9(n,u,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,r,{...i,...n,interpolationkey:p}):w}const m=p.split(this.formatSeparator),y=m.shift().trim(),b=m.join(this.formatSeparator).trim();return this.format(f9(n,u,y,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:y})};this.resetRegExp();const c=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>WS(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?WS(this.escape(p)):WS(p)}].forEach(p=>{for(s=0;o=p.regex.exec(t);){const m=o[1].trim();if(a=l(m),a===void 0)if(typeof c=="function"){const b=c(t,o,i);a=Lt(b)?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(f){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),a="";else!Lt(a)&&!this.useRawValueToEscape&&(a=n9(a));const y=p.safeValue(a);if(t=t.replace(o[0],y),f?(p.regex.lastIndex+=a.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;const s=(u,l)=>{const c=this.nestingOptionsSeparator;if(u.indexOf(c)<0)return u;const f=u.split(new RegExp(`${c}[ ]*{`));let h=`{${f[1]}`;u=f[0],h=this.interpolate(h,a);const p=h.match(/'/g),m=h.match(/"/g);((p?.length??0)%2===0&&!m||m.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),l&&(a={...l,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,y),`${u}${c}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;i=this.nestingRegexp.exec(t);){let u=[];a={...r},a=a.replace&&!Lt(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let l=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const c=i[1].split(this.formatSeparator).map(f=>f.trim());i[1]=c.shift(),u=c,l=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&!Lt(o))return o;Lt(o)||(o=n9(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),l&&(o=u.reduce((c,f)=>this.format(c,f,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const jge=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[s,...u]=a.split(":"),l=u.join(":").trim().replace(/^'+|'+$/g,""),c=s.trim();n[c]||(n[c]=l),l==="false"&&(n[c]=!1),l==="true"&&(n[c]=!0),isNaN(l)||(n[c]=parseInt(l,10))}})}return{formatName:t,formatOptions:n}},Wf=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(wb(r),i),t[a]=s),s(n)}};class Bge{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ms.create("formatter"),this.options=t,this.formats={number:Wf((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:Wf((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:Wf((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:Wf((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:Wf((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Wf(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(s=>s.indexOf(")")>-1)){const s=o.findIndex(u=>u.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,s)].join(this.formatSeparator)}return o.reduce((s,u)=>{const{formatName:l,formatOptions:c}=jge(u);if(this.formats[l]){let f=s;try{const h=i?.formatParams?.[i.interpolationkey]||{},p=h.locale||h.lng||i.locale||i.lng||r;f=this.formats[l](s,p,{...c,...i,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${l}`);return s},t)}}const Uge=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class zge extends Sw{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=ms.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},u={};return t.forEach(l=>{let c=!0;n.forEach(f=>{const h=`${l}|${f}`;!r.reload&&this.store.hasResourceBundle(l,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,c=!1,a[h]===void 0&&(a[h]=!0),o[h]===void 0&&(o[h]=!0),u[f]===void 0&&(u[f]=!0)))}),c||(s[l]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(u=>{Age(u.loaded,[o],a),Uge(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(l=>{s[l]||(s[l]={});const c=u.loaded[l];c.length&&c.forEach(f=>{s[l][f]===void 0&&(s[l][f]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(l,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&c&&i{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(l,c)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const l=u(t,n);l&&typeof l.then=="function"?l.then(c=>s(null,c)).catch(s):s(null,l)}catch(l){s(l)}return}return u(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();Lt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Lt(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(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?.create){const u={...a,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let c;l.length===5?c=l(t,n,r,i,u):c=l(t,n,r,i),c&&typeof c.then=="function"?c.then(f=>s(null,f)).catch(s):s(null,c)}catch(c){s(c)}else l(t,n,r,i,s,u)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const d9=()=>({debug:!1,initAsync:!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:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Lt(e[1])&&(t.defaultValue=e[1]),Lt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),h9=e=>(Lt(e.ns)&&(e.ns=[e.ns]),Lt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Lt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),py=()=>{},Wge=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};let qU=class IE extends Sw{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=h9(t),this.services={},this.logger=ms,this.modules={external:[]},Wge(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=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==null&&n.ns&&(Lt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=d9();this.options={...i,...this.options,...h9(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?ms.init(o(this.modules.logger),this.options):ms.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Bge;const f=new u9(this.options);this.store=new a9(this.options.resources,this.options);const h=this.services;h.logger=ms,h.resourceStore=this.store,h.languageUtils=f,h.pluralResolver=new Lge(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(h.formatter=o(c),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Fge(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new zge(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(p){for(var m=arguments.length,y=new Array(m>1?m-1:0),b=1;b1?m-1:0),b=1;b{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=py),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[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(c=>{this[c]=function(){return t.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return t.store[c](...arguments),t}});const u=Fp(),l=()=>{const c=(f,h)=>{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),u.resolve(h),r(f,h)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),u}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:py;const i=Lt(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(l=>{l!=="cimode"&&o.indexOf(l)<0&&o.push(l)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload?.forEach?.(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=Fp();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=py),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&HU.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Fp();this.emit("languageChanging",t);const o=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},a=(u,l)=>{l?(o(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(u,function(){return r.t(...arguments)})},s=u=>{!t&&!u&&this.services.languageDetector&&(u=[]);const l=Lt(u)?u:this.services.languageUtils.getBestMatchFromCodes(u);l&&(this.language||o(l),this.translator.language||this.translator.changeLanguage(l),this.services.languageDetector?.cacheUserLanguage?.(l)),this.loadResources(l,c=>{a(c,l)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let u;if(typeof s!="object"){for(var l=arguments.length,c=new Array(l>2?l-2:0),f=2;f`${u.keyPrefix}${h}${m}`):p=u.keyPrefix?`${u.keyPrefix}${h}${a}`:a,i.t(p,u)};return Lt(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){for(var t=arguments.length,n=new Array(t),r=0;r1&&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],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,u)=>{const l=this.services.backendConnector.state[`${s}|${u}`];return l===-1||l===0||l===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=Fp();return this.options.ns?(Lt(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Fp();Lt(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)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?.languageUtils||new u9(d9());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new IE(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:py;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new IE(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const s=Object.keys(this.store.data).reduce((u,l)=>(u[l]={...this.store.data[l]},Object.keys(u[l]).reduce((c,f)=>(c[f]={...u[l][f]},c),{})),{});o.store=new a9(s,i),o.services.resourceStore=o.store}return o.translator=new _b(o.services,i),o.translator.on("*",function(s){for(var u=arguments.length,l=new Array(u>1?u-1:0),c=1;c{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}const p9=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Kge=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!p9.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!p9.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o},g9={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Kge(e,encodeURIComponent(t),i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let a=0;a0&&o[a].substring(0,s)===t&&(n=o[a].substring(s+1))}}return n}};let jp=null;const m9=()=>{if(jp!==null)return jp;try{jp=window!=="undefined"&&window.localStorage!==null;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{jp=!1}return jp};var Zge={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&m9())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&m9()&&window.localStorage.setItem(n,e)}};let Bp=null;const v9=()=>{if(Bp!==null)return Bp;try{Bp=window!=="undefined"&&window.sessionStorage!==null;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Bp=!1}return Bp};var Xge={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&v9())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&v9()&&window.sessionStorage.setItem(n,e)}},Qge={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o0?t:void 0}},Jge={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},eme={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof t=="number"?t:0]?.replace("/",""):void 0}},tme={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let KU=!1;try{document.cookie,KU=!0}catch{}const GU=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];KU||GU.splice(1,1);const nme=()=>({order:GU,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class rme{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=qge(n,this.options||{},nme()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Gge),this.addDetector(Yge),this.addDetector(Zge),this.addDetector(Xge),this.addDetector(Qge),this.addDetector(Jge),this.addDetector(eme),this.addDetector(tme)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}rme.type="languageDetector";function ime(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function ome(e,t=globalThis?.document){const n=ime(e);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ame="DismissableLayer",NE="dismissableLayer.update",sme="dismissableLayer.pointerDownOutside",ume="dismissableLayer.focusOutside",y9,YU=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fh=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...u}=e,l=v.useContext(YU),[c,f]=v.useState(null),h=c?.ownerDocument??globalThis?.document,[,p]=v.useState({}),m=Nt(t,P=>f(P)),y=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),w=y.indexOf(b),x=c?y.indexOf(c):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,O=x>=w,E=fme(P=>{const M=P.target,N=[...l.branches].some(B=>B.contains(M));!O||N||(i?.(P),a?.(P),P.defaultPrevented||s?.())},h),C=dme(P=>{const M=P.target;[...l.branches].some(B=>B.contains(M))||(o?.(P),a?.(P),P.defaultPrevented||s?.())},h);return ome(P=>{x===l.layers.size-1&&(r?.(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},h),v.useEffect(()=>{if(c)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(y9=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),b9(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=y9)}},[c,h,n,l]),v.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),b9())},[c,l]),v.useEffect(()=>{const P=()=>p({});return document.addEventListener(NE,P),()=>document.removeEventListener(NE,P)},[]),I.jsx(mt.div,{...u,ref:m,style:{pointerEvents:S?O?"auto":"none":void 0,...e.style},onFocusCapture:Ye(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ye(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ye(e.onPointerDownCapture,E.onPointerDownCapture)})});Fh.displayName=ame;var lme="DismissableLayerBranch",cme=v.forwardRef((e,t)=>{const n=v.useContext(YU),r=v.useRef(null),i=Nt(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),I.jsx(mt.div,{...e,ref:i})});cme.displayName=lme;function fme(e,t=globalThis?.document){const n=Vr(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){ZU(sme,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function dme(e,t=globalThis?.document){const n=Vr(e),r=v.useRef(!1);return v.useEffect(()=>{const i=o=>{o.target&&!r.current&&ZU(ume,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function b9(){const e=new CustomEvent(NE);document.dispatchEvent(e)}function ZU(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?zj(i,o):i.dispatchEvent(o)}var VS="focusScope.autoFocusOnMount",HS="focusScope.autoFocusOnUnmount",x9={bubbles:!1,cancelable:!0},hme="FocusScope",km=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,u]=v.useState(null),l=Vr(i),c=Vr(o),f=v.useRef(null),h=Nt(t,y=>u(y)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let y=function(S){if(p.paused||!s)return;const O=S.target;s.contains(O)?f.current=O:Gu(f.current,{select:!0})},b=function(S){if(p.paused||!s)return;const O=S.relatedTarget;O!==null&&(s.contains(O)||Gu(f.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Gu(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",b);const x=new MutationObserver(w);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b),x.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){_9.add(p);const y=document.activeElement;if(!s.contains(y)){const w=new CustomEvent(VS,x9);s.addEventListener(VS,l),s.dispatchEvent(w),w.defaultPrevented||(pme(bme(XU(s)),{select:!0}),document.activeElement===y&&Gu(s))}return()=>{s.removeEventListener(VS,l),setTimeout(()=>{const w=new CustomEvent(HS,x9);s.addEventListener(HS,c),s.dispatchEvent(w),w.defaultPrevented||Gu(y??document.body,{select:!0}),s.removeEventListener(HS,c),_9.remove(p)},0)}}},[s,l,c,p]);const m=v.useCallback(y=>{if(!n&&!r||p.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(b&&w){const x=y.currentTarget,[S,O]=gme(x);S&&O?!y.shiftKey&&w===O?(y.preventDefault(),n&&Gu(S,{select:!0})):y.shiftKey&&w===S&&(y.preventDefault(),n&&Gu(O,{select:!0})):w===x&&y.preventDefault()}},[n,r,p.paused]);return I.jsx(mt.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});km.displayName=hme;function pme(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Gu(r,{select:t}),document.activeElement!==n)return}function gme(e){const t=XU(e),n=w9(t,e),r=w9(t.reverse(),e);return[n,r]}function XU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function w9(e,t){for(const n of e)if(!mme(n,{upTo:t}))return n}function mme(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function vme(e){return e instanceof HTMLInputElement&&"select"in e}function Gu(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vme(e)&&t&&e.select()}}var _9=yme();function yme(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=S9(e,t),e.unshift(t)},remove(t){e=S9(e,t),e[0]?.resume()}}}function S9(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bme(e){return e.filter(t=>t.tagName!=="A")}var xme="Portal",jh=v.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=v.useState(!1);On(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?iw.createPortal(I.jsx(mt.div,{...r,ref:t}),a):null});jh.displayName=xme;function wme(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Cw=e=>{const{present:t,children:n}=e,r=_me(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,Sme(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};Cw.displayName="Presence";function _me(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=wme(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=gy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=gy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=gy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=gy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function gy(e){return e?.animationName||"none"}function Sme(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qS=0;function Ew(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??C9()),document.body.insertAdjacentElement("beforeend",e[1]??C9()),qS++,()=>{qS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qS--}},[])}function C9(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ti=function(){return Ti=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return Lme;var t=Fme(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Bme=Nme(),Td="data-scroll-locked",Ume=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(Cme,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; @@ -157,14 +157,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho body[`).concat(Td,`] { `).concat(Eme,": ").concat(s,`px; } -`)},OD=function(){var e=parseInt(document.body.getAttribute(Td)||"0",10);return isFinite(e)?e:0},zme=function(){v.useEffect(function(){return document.body.setAttribute(Td,(OD()+1).toString()),function(){var e=OD()-1;e<=0?document.body.removeAttribute(Td):document.body.setAttribute(Td,e.toString())}},[])},Wme=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;zme();var o=v.useMemo(function(){return jme(i)},[i]);return v.createElement(Bme,{styles:Ume(o,!t,i,n?"":"!important")})};function Vme(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rz();return t&&e.setAttribute("nonce",t),e}function Hme(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qme(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Kme=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vme())&&(Hme(t,n),qme(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gme=function(){var e=Kme();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xA=function(){var e=Gme(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},LE=!1;if(typeof window<"u")try{var my=Object.defineProperty({},"passive",{get:function(){return LE=!0,!0}});window.addEventListener("test",my,my),window.removeEventListener("test",my,my)}catch{LE=!1}var Vf=LE?{passive:!1}:!1,Yme=function(e){return e.tagName==="TEXTAREA"},iz=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Yme(e)&&n[t]==="visible")},Zme=function(e){return iz(e,"overflowY")},Xme=function(e){return iz(e,"overflowX")},AD=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=oz(e,r);if(i){var o=az(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qme=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Jme=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},oz=function(e,t){return e==="v"?Zme(t):Xme(t)},az=function(e,t){return e==="v"?Qme(t):Jme(t)},eve=function(e,t){return e==="h"&&t==="rtl"?-1:1},tve=function(e,t,n,r,i){var o=eve(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,u=t.contains(s),l=!1,c=a>0,f=0,h=0;do{var p=az(e,s),m=p[0],y=p[1],b=p[2],w=y-b-o*m;(m||w)&&oz(e,s)&&(f+=w,h+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(c&&(Math.abs(f)<1||!i)||!c&&(Math.abs(h)<1||!i))&&(l=!0),l},vy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},PD=function(e){return[e.deltaX,e.deltaY]},kD=function(e){return e&&"current"in e?e.current:e},nve=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rve=function(e){return` +`)},O9=function(){var e=parseInt(document.body.getAttribute(Td)||"0",10);return isFinite(e)?e:0},zme=function(){v.useEffect(function(){return document.body.setAttribute(Td,(O9()+1).toString()),function(){var e=O9()-1;e<=0?document.body.removeAttribute(Td):document.body.setAttribute(Td,e.toString())}},[])},Wme=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;zme();var o=v.useMemo(function(){return jme(i)},[i]);return v.createElement(Bme,{styles:Ume(o,!t,i,n?"":"!important")})};function Vme(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rz();return t&&e.setAttribute("nonce",t),e}function Hme(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qme(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Kme=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vme())&&(Hme(t,n),qme(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gme=function(){var e=Kme();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xA=function(){var e=Gme(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},LE=!1;if(typeof window<"u")try{var my=Object.defineProperty({},"passive",{get:function(){return LE=!0,!0}});window.addEventListener("test",my,my),window.removeEventListener("test",my,my)}catch{LE=!1}var Vf=LE?{passive:!1}:!1,Yme=function(e){return e.tagName==="TEXTAREA"},iz=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Yme(e)&&n[t]==="visible")},Zme=function(e){return iz(e,"overflowY")},Xme=function(e){return iz(e,"overflowX")},A9=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=oz(e,r);if(i){var o=az(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qme=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Jme=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},oz=function(e,t){return e==="v"?Zme(t):Xme(t)},az=function(e,t){return e==="v"?Qme(t):Jme(t)},eve=function(e,t){return e==="h"&&t==="rtl"?-1:1},tve=function(e,t,n,r,i){var o=eve(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,u=t.contains(s),l=!1,c=a>0,f=0,h=0;do{var p=az(e,s),m=p[0],y=p[1],b=p[2],w=y-b-o*m;(m||w)&&oz(e,s)&&(f+=w,h+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(c&&(Math.abs(f)<1||!i)||!c&&(Math.abs(h)<1||!i))&&(l=!0),l},vy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},P9=function(e){return[e.deltaX,e.deltaY]},k9=function(e){return e&&"current"in e?e.current:e},nve=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rve=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},ive=0,Hf=[];function ove(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(ive++)[0],o=v.useState(xA)[0],a=v.useRef(e);v.useEffect(function(){a.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=QU([e.lockRef.current],(e.shards||[]).map(kD),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(y,b){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var w=vy(y),x=n.current,S="deltaX"in y?y.deltaX:x[0]-w[0],O="deltaY"in y?y.deltaY:x[1]-w[1],E,C=y.target,P=Math.abs(S)>Math.abs(O)?"h":"v";if("touches"in y&&P==="h"&&C.type==="range")return!1;var M=AD(P,C);if(!M)return!0;if(M?E=P:(E=P==="v"?"h":"v",M=AD(P,C)),!M)return!1;if(!r.current&&"changedTouches"in y&&(S||O)&&(r.current=E),!E)return!0;var N=r.current||E;return tve(N,b,y,N==="h"?S:O,!0)},[]),u=v.useCallback(function(y){var b=y;if(!(!Hf.length||Hf[Hf.length-1]!==o)){var w="deltaY"in b?PD(b):vy(b),x=t.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&nve(E.delta,w)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var S=(a.current.shards||[]).map(kD).filter(Boolean).filter(function(E){return E.contains(b.target)}),O=S.length>0?s(b,S[0]):!a.current.noIsolation;O&&b.cancelable&&b.preventDefault()}}},[]),l=v.useCallback(function(y,b,w,x){var S={name:y,delta:b,target:w,should:x,shadowParent:ave(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(O){return O!==S})},1)},[]),c=v.useCallback(function(y){n.current=vy(y),r.current=void 0},[]),f=v.useCallback(function(y){l(y.type,PD(y),y.target,s(y,e.lockRef.current))},[]),h=v.useCallback(function(y){l(y.type,vy(y),y.target,s(y,e.lockRef.current))},[]);v.useEffect(function(){return Hf.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Vf),document.addEventListener("touchmove",u,Vf),document.addEventListener("touchstart",c,Vf),function(){Hf=Hf.filter(function(y){return y!==o}),document.removeEventListener("wheel",u,Vf),document.removeEventListener("touchmove",u,Vf),document.removeEventListener("touchstart",c,Vf)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(o,{styles:rve(i)}):null,p?v.createElement(Wme,{gapMode:e.gapMode}):null)}function ave(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sve=tz(nz,ove);var Tm=v.forwardRef(function(e,t){return v.createElement(Ow,Ti({},e,{ref:t,sideCar:sve}))});Tm.classNames=Ow.classNames;var uve=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qf=new WeakMap,yy=new WeakMap,by={},ZS=0,sz=function(e){return e&&(e.host||sz(e.parentNode))},lve=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=sz(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},cve=function(e,t,n,r){var i=lve(t,Array.isArray(e)?e:[e]);by[n]||(by[n]=new WeakMap);var o=by[n],a=[],s=new Set,u=new Set(i),l=function(f){!f||s.has(f)||(s.add(f),l(f.parentNode))};i.forEach(l);var c=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(h){if(s.has(h))c(h);else try{var p=h.getAttribute(r),m=p!==null&&p!=="false",y=(qf.get(h)||0)+1,b=(o.get(h)||0)+1;qf.set(h,y),o.set(h,b),a.push(h),y===1&&m&&yy.set(h,!0),b===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return c(t),s.clear(),ZS++,function(){a.forEach(function(f){var h=qf.get(f)-1,p=o.get(f)-1;qf.set(f,h),o.set(f,p),h||(yy.has(f)||f.removeAttribute(r),yy.delete(f)),p||f.removeAttribute(n)}),ZS--,ZS||(qf=new WeakMap,qf=new WeakMap,yy=new WeakMap,by={})}},Mm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=uve(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),cve(r,i,n,"aria-hidden")):function(){return null}},wA="Dialog",[uz,lz]=Di(wA),[fve,ts]=uz(wA),cz=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=v.useRef(null),u=v.useRef(null),[l=!1,c]=Ts({prop:r,defaultProp:i,onChange:o});return I.jsx(fve,{scope:t,triggerRef:s,contentRef:u,contentId:Lo(),titleId:Lo(),descriptionId:Lo(),open:l,onOpenChange:c,onOpenToggle:v.useCallback(()=>c(f=>!f),[c]),modal:a,children:n})};cz.displayName=wA;var fz="DialogTrigger",dz=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ts(fz,n),o=Nt(t,i.triggerRef);return I.jsx(gt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":CA(i.open),...r,ref:o,onClick:Ye(e.onClick,i.onOpenToggle)})});dz.displayName=fz;var _A="DialogPortal",[dve,hz]=uz(_A,{forceMount:void 0}),pz=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=ts(_A,t);return I.jsx(dve,{scope:t,forceMount:n,children:v.Children.map(r,a=>I.jsx(Cw,{present:n||o.open,children:I.jsx(jh,{asChild:!0,container:i,children:a})}))})};pz.displayName=_A;var Sb="DialogOverlay",gz=v.forwardRef((e,t)=>{const n=hz(Sb,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=ts(Sb,e.__scopeDialog);return o.modal?I.jsx(Cw,{present:r||o.open,children:I.jsx(hve,{...i,ref:t})}):null});gz.displayName=Sb;var hve=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ts(Sb,n);return I.jsx(Tm,{as:Pl,allowPinchZoom:!0,shards:[i.contentRef],children:I.jsx(gt.div,{"data-state":CA(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Qc="DialogContent",mz=v.forwardRef((e,t)=>{const n=hz(Qc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=ts(Qc,e.__scopeDialog);return I.jsx(Cw,{present:r||o.open,children:o.modal?I.jsx(pve,{...i,ref:t}):I.jsx(gve,{...i,ref:t})})});mz.displayName=Qc;var pve=v.forwardRef((e,t)=>{const n=ts(Qc,e.__scopeDialog),r=v.useRef(null),i=Nt(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Mm(o)},[]),I.jsx(vz,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ye(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ye(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Ye(e.onFocusOutside,o=>o.preventDefault())})}),gve=v.forwardRef((e,t)=>{const n=ts(Qc,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return I.jsx(vz,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),vz=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=ts(Qc,n),u=v.useRef(null),l=Nt(t,u);return Ew(),I.jsxs(I.Fragment,{children:[I.jsx(km,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:I.jsx(Fh,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":CA(s.open),...a,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),I.jsxs(I.Fragment,{children:[I.jsx(vve,{titleId:s.titleId}),I.jsx(bve,{contentRef:u,descriptionId:s.descriptionId})]})]})}),SA="DialogTitle",yz=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ts(SA,n);return I.jsx(gt.h2,{id:i.titleId,...r,ref:t})});yz.displayName=SA;var bz="DialogDescription",xz=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ts(bz,n);return I.jsx(gt.p,{id:i.descriptionId,...r,ref:t})});xz.displayName=bz;var wz="DialogClose",_z=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ts(wz,n);return I.jsx(gt.button,{type:"button",...r,ref:t,onClick:Ye(e.onClick,()=>i.onOpenChange(!1))})});_z.displayName=wz;function CA(e){return e?"open":"closed"}var Sz="DialogTitleWarning",[mve,Cz]=Sfe(Sz,{contentName:Qc,titleName:SA,docsSlug:"dialog"}),vve=({titleId:e})=>{const t=Cz(Sz),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. +`)},ive=0,Hf=[];function ove(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(ive++)[0],o=v.useState(xA)[0],a=v.useRef(e);v.useEffect(function(){a.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=QU([e.lockRef.current],(e.shards||[]).map(k9),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(y,b){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var w=vy(y),x=n.current,S="deltaX"in y?y.deltaX:x[0]-w[0],O="deltaY"in y?y.deltaY:x[1]-w[1],E,C=y.target,P=Math.abs(S)>Math.abs(O)?"h":"v";if("touches"in y&&P==="h"&&C.type==="range")return!1;var M=A9(P,C);if(!M)return!0;if(M?E=P:(E=P==="v"?"h":"v",M=A9(P,C)),!M)return!1;if(!r.current&&"changedTouches"in y&&(S||O)&&(r.current=E),!E)return!0;var N=r.current||E;return tve(N,b,y,N==="h"?S:O,!0)},[]),u=v.useCallback(function(y){var b=y;if(!(!Hf.length||Hf[Hf.length-1]!==o)){var w="deltaY"in b?P9(b):vy(b),x=t.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&nve(E.delta,w)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var S=(a.current.shards||[]).map(k9).filter(Boolean).filter(function(E){return E.contains(b.target)}),O=S.length>0?s(b,S[0]):!a.current.noIsolation;O&&b.cancelable&&b.preventDefault()}}},[]),l=v.useCallback(function(y,b,w,x){var S={name:y,delta:b,target:w,should:x,shadowParent:ave(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(O){return O!==S})},1)},[]),c=v.useCallback(function(y){n.current=vy(y),r.current=void 0},[]),f=v.useCallback(function(y){l(y.type,P9(y),y.target,s(y,e.lockRef.current))},[]),h=v.useCallback(function(y){l(y.type,vy(y),y.target,s(y,e.lockRef.current))},[]);v.useEffect(function(){return Hf.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Vf),document.addEventListener("touchmove",u,Vf),document.addEventListener("touchstart",c,Vf),function(){Hf=Hf.filter(function(y){return y!==o}),document.removeEventListener("wheel",u,Vf),document.removeEventListener("touchmove",u,Vf),document.removeEventListener("touchstart",c,Vf)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(o,{styles:rve(i)}):null,p?v.createElement(Wme,{gapMode:e.gapMode}):null)}function ave(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sve=tz(nz,ove);var Tm=v.forwardRef(function(e,t){return v.createElement(Ow,Ti({},e,{ref:t,sideCar:sve}))});Tm.classNames=Ow.classNames;var uve=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qf=new WeakMap,yy=new WeakMap,by={},ZS=0,sz=function(e){return e&&(e.host||sz(e.parentNode))},lve=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=sz(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},cve=function(e,t,n,r){var i=lve(t,Array.isArray(e)?e:[e]);by[n]||(by[n]=new WeakMap);var o=by[n],a=[],s=new Set,u=new Set(i),l=function(f){!f||s.has(f)||(s.add(f),l(f.parentNode))};i.forEach(l);var c=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(h){if(s.has(h))c(h);else try{var p=h.getAttribute(r),m=p!==null&&p!=="false",y=(qf.get(h)||0)+1,b=(o.get(h)||0)+1;qf.set(h,y),o.set(h,b),a.push(h),y===1&&m&&yy.set(h,!0),b===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return c(t),s.clear(),ZS++,function(){a.forEach(function(f){var h=qf.get(f)-1,p=o.get(f)-1;qf.set(f,h),o.set(f,p),h||(yy.has(f)||f.removeAttribute(r),yy.delete(f)),p||f.removeAttribute(n)}),ZS--,ZS||(qf=new WeakMap,qf=new WeakMap,yy=new WeakMap,by={})}},Mm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=uve(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),cve(r,i,n,"aria-hidden")):function(){return null}},wA="Dialog",[uz,lz]=Di(wA),[fve,ts]=uz(wA),cz=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=v.useRef(null),u=v.useRef(null),[l=!1,c]=Ts({prop:r,defaultProp:i,onChange:o});return I.jsx(fve,{scope:t,triggerRef:s,contentRef:u,contentId:Lo(),titleId:Lo(),descriptionId:Lo(),open:l,onOpenChange:c,onOpenToggle:v.useCallback(()=>c(f=>!f),[c]),modal:a,children:n})};cz.displayName=wA;var fz="DialogTrigger",dz=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ts(fz,n),o=Nt(t,i.triggerRef);return I.jsx(mt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":CA(i.open),...r,ref:o,onClick:Ye(e.onClick,i.onOpenToggle)})});dz.displayName=fz;var _A="DialogPortal",[dve,hz]=uz(_A,{forceMount:void 0}),pz=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=ts(_A,t);return I.jsx(dve,{scope:t,forceMount:n,children:v.Children.map(r,a=>I.jsx(Cw,{present:n||o.open,children:I.jsx(jh,{asChild:!0,container:i,children:a})}))})};pz.displayName=_A;var Sb="DialogOverlay",gz=v.forwardRef((e,t)=>{const n=hz(Sb,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=ts(Sb,e.__scopeDialog);return o.modal?I.jsx(Cw,{present:r||o.open,children:I.jsx(hve,{...i,ref:t})}):null});gz.displayName=Sb;var hve=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ts(Sb,n);return I.jsx(Tm,{as:Pl,allowPinchZoom:!0,shards:[i.contentRef],children:I.jsx(mt.div,{"data-state":CA(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Qc="DialogContent",mz=v.forwardRef((e,t)=>{const n=hz(Qc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=ts(Qc,e.__scopeDialog);return I.jsx(Cw,{present:r||o.open,children:o.modal?I.jsx(pve,{...i,ref:t}):I.jsx(gve,{...i,ref:t})})});mz.displayName=Qc;var pve=v.forwardRef((e,t)=>{const n=ts(Qc,e.__scopeDialog),r=v.useRef(null),i=Nt(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Mm(o)},[]),I.jsx(vz,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ye(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ye(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Ye(e.onFocusOutside,o=>o.preventDefault())})}),gve=v.forwardRef((e,t)=>{const n=ts(Qc,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return I.jsx(vz,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),vz=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=ts(Qc,n),u=v.useRef(null),l=Nt(t,u);return Ew(),I.jsxs(I.Fragment,{children:[I.jsx(km,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:I.jsx(Fh,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":CA(s.open),...a,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),I.jsxs(I.Fragment,{children:[I.jsx(vve,{titleId:s.titleId}),I.jsx(bve,{contentRef:u,descriptionId:s.descriptionId})]})]})}),SA="DialogTitle",yz=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ts(SA,n);return I.jsx(mt.h2,{id:i.titleId,...r,ref:t})});yz.displayName=SA;var bz="DialogDescription",xz=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ts(bz,n);return I.jsx(mt.p,{id:i.descriptionId,...r,ref:t})});xz.displayName=bz;var wz="DialogClose",_z=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ts(wz,n);return I.jsx(mt.button,{type:"button",...r,ref:t,onClick:Ye(e.onClick,()=>i.onOpenChange(!1))})});_z.displayName=wz;function CA(e){return e?"open":"closed"}var Sz="DialogTitleWarning",[mve,Cz]=Sfe(Sz,{contentName:Qc,titleName:SA,docsSlug:"dialog"}),vve=({titleId:e})=>{const t=Cz(Sz),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},yve="DialogDescriptionWarning",bve=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Cz(yve).contentName}}.`;return v.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},xve=cz,wve=dz,_ve=pz,Sve=gz,Cve=mz,Eve=yz,Ove=xz,Ez=_z;function Yr(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var Ave=["color"],GQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Ave);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Pve=["color"],YQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Pve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),kve=["color"],ZQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,kve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Tve=["color"],XQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Tve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Mve=["color"],QQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Mve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Rve=["color"],JQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Rve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Dve=["color"],eJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Dve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M0.877075 7.49991C0.877075 3.84222 3.84222 0.877075 7.49991 0.877075C11.1576 0.877075 14.1227 3.84222 14.1227 7.49991C14.1227 11.1576 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1576 0.877075 7.49991ZM7.49991 1.82708C4.36689 1.82708 1.82708 4.36689 1.82708 7.49991C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49991C13.1727 4.36689 10.6329 1.82708 7.49991 1.82708Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),$ve=["color"],tJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,$ve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Ive=["color"],nJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Ive);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704ZM9.85358 5.14644C10.0488 5.3417 10.0488 5.65829 9.85358 5.85355L8.20713 7.49999L9.85358 9.14644C10.0488 9.3417 10.0488 9.65829 9.85358 9.85355C9.65832 10.0488 9.34173 10.0488 9.14647 9.85355L7.50002 8.2071L5.85358 9.85355C5.65832 10.0488 5.34173 10.0488 5.14647 9.85355C4.95121 9.65829 4.95121 9.3417 5.14647 9.14644L6.79292 7.49999L5.14647 5.85355C4.95121 5.65829 4.95121 5.3417 5.14647 5.14644C5.34173 4.95118 5.65832 4.95118 5.85358 5.14644L7.50002 6.79289L9.14647 5.14644C9.34173 4.95118 9.65832 4.95118 9.85358 5.14644Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Nve=["color"],rJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Nve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),Lve=["color"],iJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Lve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Fve=["color"],oJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Fve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),jve=["color"],aJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,jve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M5.5 4.625C6.12132 4.625 6.625 4.12132 6.625 3.5C6.625 2.87868 6.12132 2.375 5.5 2.375C4.87868 2.375 4.375 2.87868 4.375 3.5C4.375 4.12132 4.87868 4.625 5.5 4.625ZM9.5 4.625C10.1213 4.625 10.625 4.12132 10.625 3.5C10.625 2.87868 10.1213 2.375 9.5 2.375C8.87868 2.375 8.375 2.87868 8.375 3.5C8.375 4.12132 8.87868 4.625 9.5 4.625ZM10.625 7.5C10.625 8.12132 10.1213 8.625 9.5 8.625C8.87868 8.625 8.375 8.12132 8.375 7.5C8.375 6.87868 8.87868 6.375 9.5 6.375C10.1213 6.375 10.625 6.87868 10.625 7.5ZM5.5 8.625C6.12132 8.625 6.625 8.12132 6.625 7.5C6.625 6.87868 6.12132 6.375 5.5 6.375C4.87868 6.375 4.375 6.87868 4.375 7.5C4.375 8.12132 4.87868 8.625 5.5 8.625ZM10.625 11.5C10.625 12.1213 10.1213 12.625 9.5 12.625C8.87868 12.625 8.375 12.1213 8.375 11.5C8.375 10.8787 8.87868 10.375 9.5 10.375C10.1213 10.375 10.625 10.8787 10.625 11.5ZM5.5 12.625C6.12132 12.625 6.625 12.1213 6.625 11.5C6.625 10.8787 6.12132 10.375 5.5 10.375C4.87868 10.375 4.375 10.8787 4.375 11.5C4.375 12.1213 4.87868 12.625 5.5 12.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Bve=["color"],sJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Bve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Uve=["color"],uJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Uve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M5.5 3C4.67157 3 4 3.67157 4 4.5C4 5.32843 4.67157 6 5.5 6C6.32843 6 7 5.32843 7 4.5C7 3.67157 6.32843 3 5.5 3ZM3 5C3.01671 5 3.03323 4.99918 3.04952 4.99758C3.28022 6.1399 4.28967 7 5.5 7C6.71033 7 7.71978 6.1399 7.95048 4.99758C7.96677 4.99918 7.98329 5 8 5H13.5C13.7761 5 14 4.77614 14 4.5C14 4.22386 13.7761 4 13.5 4H8C7.98329 4 7.96677 4.00082 7.95048 4.00242C7.71978 2.86009 6.71033 2 5.5 2C4.28967 2 3.28022 2.86009 3.04952 4.00242C3.03323 4.00082 3.01671 4 3 4H1.5C1.22386 4 1 4.22386 1 4.5C1 4.77614 1.22386 5 1.5 5H3ZM11.9505 10.9976C11.7198 12.1399 10.7103 13 9.5 13C8.28967 13 7.28022 12.1399 7.04952 10.9976C7.03323 10.9992 7.01671 11 7 11H1.5C1.22386 11 1 10.7761 1 10.5C1 10.2239 1.22386 10 1.5 10H7C7.01671 10 7.03323 10.0008 7.04952 10.0024C7.28022 8.8601 8.28967 8 9.5 8C10.7103 8 11.7198 8.8601 11.9505 10.0024C11.9668 10.0008 11.9833 10 12 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H12C11.9833 11 11.9668 10.9992 11.9505 10.9976ZM8 10.5C8 9.67157 8.67157 9 9.5 9C10.3284 9 11 9.67157 11 10.5C11 11.3284 10.3284 12 9.5 12C8.67157 12 8 11.3284 8 10.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),zve=["color"],lJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,zve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M12.1464 1.14645C12.3417 0.951184 12.6583 0.951184 12.8535 1.14645L14.8535 3.14645C15.0488 3.34171 15.0488 3.65829 14.8535 3.85355L10.9109 7.79618C10.8349 7.87218 10.7471 7.93543 10.651 7.9835L6.72359 9.94721C6.53109 10.0435 6.29861 10.0057 6.14643 9.85355C5.99425 9.70137 5.95652 9.46889 6.05277 9.27639L8.01648 5.34897C8.06455 5.25283 8.1278 5.16507 8.2038 5.08907L12.1464 1.14645ZM12.5 2.20711L8.91091 5.79618L7.87266 7.87267L8.12731 8.12732L10.2038 7.08907L13.7929 3.5L12.5 2.20711ZM9.99998 2L8.99998 3H4.9C4.47171 3 4.18056 3.00039 3.95552 3.01877C3.73631 3.03668 3.62421 3.06915 3.54601 3.10899C3.35785 3.20487 3.20487 3.35785 3.10899 3.54601C3.06915 3.62421 3.03669 3.73631 3.01878 3.95552C3.00039 4.18056 3 4.47171 3 4.9V11.1C3 11.5283 3.00039 11.8194 3.01878 12.0445C3.03669 12.2637 3.06915 12.3758 3.10899 12.454C3.20487 12.6422 3.35785 12.7951 3.54601 12.891C3.62421 12.9309 3.73631 12.9633 3.95552 12.9812C4.18056 12.9996 4.47171 13 4.9 13H11.1C11.5283 13 11.8194 12.9996 12.0445 12.9812C12.2637 12.9633 12.3758 12.9309 12.454 12.891C12.6422 12.7951 12.7951 12.6422 12.891 12.454C12.9309 12.3758 12.9633 12.2637 12.9812 12.0445C12.9996 11.8194 13 11.5283 13 11.1V6.99998L14 5.99998V11.1V11.1207C14 11.5231 14 11.8553 13.9779 12.1259C13.9549 12.407 13.9057 12.6653 13.782 12.908C13.5903 13.2843 13.2843 13.5903 12.908 13.782C12.6653 13.9057 12.407 13.9549 12.1259 13.9779C11.8553 14 11.5231 14 11.1207 14H11.1H4.9H4.87934C4.47686 14 4.14468 14 3.87409 13.9779C3.59304 13.9549 3.33469 13.9057 3.09202 13.782C2.7157 13.5903 2.40973 13.2843 2.21799 12.908C2.09434 12.6653 2.04506 12.407 2.0221 12.1259C1.99999 11.8553 1.99999 11.5231 2 11.1207V11.1206V11.1V4.9V4.87935V4.87932V4.87931C1.99999 4.47685 1.99999 4.14468 2.0221 3.87409C2.04506 3.59304 2.09434 3.33469 2.21799 3.09202C2.40973 2.71569 2.7157 2.40973 3.09202 2.21799C3.33469 2.09434 3.59304 2.04506 3.87409 2.0221C4.14468 1.99999 4.47685 1.99999 4.87932 2H4.87935H4.9H9.99998Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Wve=["color"],cJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Wve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM7.50003 4C7.77617 4 8.00003 4.22386 8.00003 4.5V7H10.5C10.7762 7 11 7.22386 11 7.5C11 7.77614 10.7762 8 10.5 8H8.00003V10.5C8.00003 10.7761 7.77617 11 7.50003 11C7.22389 11 7.00003 10.7761 7.00003 10.5V8H4.50003C4.22389 8 4.00003 7.77614 4.00003 7.5C4.00003 7.22386 4.22389 7 4.50003 7H7.00003V4.5C7.00003 4.22386 7.22389 4 7.50003 4Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Vve=["color"],fJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Vve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Hve=["color"],dJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Hve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M5.49998 0.5C5.49998 0.223858 5.72383 0 5.99998 0H7.49998H8.99998C9.27612 0 9.49998 0.223858 9.49998 0.5C9.49998 0.776142 9.27612 1 8.99998 1H7.99998V2.11922C9.09832 2.20409 10.119 2.56622 10.992 3.13572C11.0116 3.10851 11.0336 3.08252 11.058 3.05806L11.858 2.25806C12.1021 2.01398 12.4978 2.01398 12.7419 2.25806C12.986 2.50214 12.986 2.89786 12.7419 3.14194L11.967 3.91682C13.1595 5.07925 13.9 6.70314 13.9 8.49998C13.9 12.0346 11.0346 14.9 7.49998 14.9C3.96535 14.9 1.09998 12.0346 1.09998 8.49998C1.09998 5.13362 3.69904 2.3743 6.99998 2.11922V1H5.99998C5.72383 1 5.49998 0.776142 5.49998 0.5ZM2.09998 8.49998C2.09998 5.51764 4.51764 3.09998 7.49998 3.09998C10.4823 3.09998 12.9 5.51764 12.9 8.49998C12.9 11.4823 10.4823 13.9 7.49998 13.9C4.51764 13.9 2.09998 11.4823 2.09998 8.49998ZM7.99998 4.5C7.99998 4.22386 7.77612 4 7.49998 4C7.22383 4 6.99998 4.22386 6.99998 4.5V9.5C6.99998 9.77614 7.22383 10 7.49998 10C7.77612 10 7.99998 9.77614 7.99998 9.5V4.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),qve=["title"],Kve=["title"],Gve=["title"];function bg(){return bg=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yve(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var hJe=function(t){var n=t.title,r=EA(t,qve);return F.createElement("svg",bg({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},r),n&&F.createElement("title",null,n),F.createElement("path",{fill:"#D80027",d:"M0 0h513v342H0z"}),F.createElement("path",{d:"m226.8 239.2-9.7-15.6-17.9 4.4 11.9-14.1-9.7-15.6 17.1 6.9 11.8-14.1-1.3 18.4 17.1 6.9-17.9 4.4zM290.6 82l-10.1 15.4 11.6 14.3-17.7-4.8-10.1 15.5-1-18.4-17.7-4.8 17.2-6.6-1-18.4 11.6 14.3zm-54.4-56.6-2 18.3 16.8 7.6-18 3.8-2 18.3-9.2-16-17.9 3.8 12.3-13.7-9.2-15.9 16.8 7.5zm56.6 136.4-14.9 10.9 5.8 17.5-14.9-10.8-14.9 11 5.6-17.6-14.9-10.7 18.4-.1 5.6-17.6 5.8 17.5zM115 46.3l17.3 53.5h56.2l-45.4 32.9 17.3 53.5-45.4-33-45.5 33 17.4-53.5-45.5-32.9h56.3z",fill:"#FFDA44"}))},pJe=function(t){var n=t.title,r=EA(t,Kve);return F.createElement("svg",bg({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},r),n&&F.createElement("title",null,n),F.createElement("g",{fill:"#FFF"},F.createElement("path",{d:"M0 0h513v341.3H0V0z"}),F.createElement("path",{d:"M311.7 230 513 341.3v-31.5L369.3 230h-57.6zM200.3 111.3 0 0v31.5l143.7 79.8h56.6z"})),F.createElement("path",{d:"M393.8 230 513 295.7V230H393.8zm-82.1 0L513 341.3v-31.5L369.3 230h-57.6zm146.9 111.3-147-81.7v81.7h147zM90.3 230 0 280.2V230h90.3zm110 14.2v97.2H25.5l174.8-97.2zm-82.1-132.9L0 45.6v65.7h118.2zm82.1 0L0 0v31.5l143.7 79.8h56.6zM53.4 0l147 81.7V0h-147zm368.3 111.3L513 61.1v50.2h-91.3zm-110-14.2V0h174.9L311.7 97.1z",fill:"#0052B4"}),F.createElement("g",{fill:"#D80027"},F.createElement("path",{d:"M288 0h-64v138.7H0v64h224v138.7h64V202.7h224v-64H288V0z"}),F.createElement("path",{d:"M311.7 230 513 341.3v-31.5L369.3 230h-57.6zm-168 0L0 309.9v31.5L200.3 230h-56.6zm56.6-118.7L0 0v31.5l143.7 79.8h56.6zm168 0L513 31.5V0L311.7 111.3h56.6z"})))},gJe=function(t){var n=t.title,r=EA(t,Gve);return F.createElement("svg",bg({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 900 600"},r),n&&F.createElement("title",null,n),F.createElement("path",{fill:"#FFF",d:"M0 0h900v600H0z"}),F.createElement("g",{transform:"rotate(-56.31)"},F.createElement("path",{d:"M-75 228.3H75m-150 37.5H75m-150 37.5H75m-150 475H75m-150 37.5H75m-150 37.5H75",stroke:"#000",strokeWidth:25}),F.createElement("path",{stroke:"#FFF",strokeWidth:12.5,d:"M0 753.3v125"}),F.createElement("circle",{fill:"#ca163a",cy:540.8,r:150}),F.createElement("path",{fill:"#0e4896",d:"M0 390.8c-41.4 0-75 33.6-75 75s33.6 75 75 75 75 33.6 75 75-33.6 75-75 75c-82.8 0-150-67.2-150-150s67.2-150 150-150z"})),F.createElement("path",{d:"m231.56 535.73-83.205-124.808M262.76 514.928l-83.205-124.807m114.407 104.006-83.205-124.808m478.43-138.675-83.205-124.807M720.39 209.843 637.184 85.036m114.407 104.006L668.386 64.234",stroke:"#000",strokeWidth:25}),F.createElement("path",{stroke:"#FFF",strokeWidth:12.5,d:"m205.6 462.897 31.202-20.8m389.981-259.989 36.444-24.296m31.202-20.801 31.202-20.801"}))};const Zve=["top","right","bottom","left"],Dl=Math.min,Ro=Math.max,Cb=Math.round,xy=Math.floor,$l=e=>({x:e,y:e}),Xve={left:"right",right:"left",bottom:"top",top:"bottom"},Qve={start:"end",end:"start"};function FE(e,t,n){return Ro(e,Dl(t,n))}function xu(e,t){return typeof e=="function"?e(t):e}function wu(e){return e.split("-")[0]}function Bh(e){return e.split("-")[1]}function OA(e){return e==="x"?"y":"x"}function AA(e){return e==="y"?"height":"width"}function Uh(e){return["top","bottom"].includes(wu(e))?"y":"x"}function PA(e){return OA(Uh(e))}function Jve(e,t,n){n===void 0&&(n=!1);const r=Bh(e),i=PA(e),o=AA(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Eb(a)),[a,Eb(a)]}function eye(e){const t=Eb(e);return[jE(e),t,jE(t)]}function jE(e){return e.replace(/start|end/g,t=>Qve[t])}function tye(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function nye(e,t,n,r){const i=Bh(e);let o=tye(wu(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(jE)))),o}function Eb(e){return e.replace(/left|right|bottom|top/g,t=>Xve[t])}function rye(e){return{top:0,right:0,bottom:0,left:0,...e}}function Oz(e){return typeof e!="number"?rye(e):{top:e,right:e,bottom:e,left:e}}function Ob(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function TD(e,t,n){let{reference:r,floating:i}=e;const o=Uh(t),a=PA(t),s=AA(a),u=wu(t),l=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let p;switch(u){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Bh(t)){case"start":p[a]-=h*(n&&l?-1:1);break;case"end":p[a]+=h*(n&&l?-1:1);break}return p}const iye=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=TD(l,r,u),h=r,p={},m=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:u}=t,{element:l,padding:c=0}=xu(e,t)||{};if(l==null)return{};const f=Oz(c),h={x:n,y:r},p=PA(i),m=AA(p),y=await a.getDimensions(l),b=p==="y",w=b?"top":"left",x=b?"bottom":"right",S=b?"clientHeight":"clientWidth",O=o.reference[m]+o.reference[p]-h[p]-o.floating[m],E=h[p]-o.reference[p],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let P=C?C[S]:0;(!P||!await(a.isElement==null?void 0:a.isElement(C)))&&(P=s.floating[S]||o.floating[m]);const M=O/2-E/2,N=P/2-y[m]/2-1,B=Dl(f[w],N),V=Dl(f[x],N),W=B,ne=P-y[m]-V,Z=P/2-y[m]/2+M,q=FE(W,Z,ne),G=!u.arrow&&Bh(i)!=null&&Z!==q&&o.reference[m]/2-(ZW<=0)){var N,B;const W=(((N=o.flip)==null?void 0:N.index)||0)+1,ne=E[W];if(ne)return{data:{index:W,overflows:M},reset:{placement:ne}};let Z=(B=M.filter(q=>q.overflows[0]<=0).sort((q,G)=>q.overflows[1]-G.overflows[1])[0])==null?void 0:B.placement;if(!Z)switch(p){case"bestFit":{var V;const q=(V=M.map(G=>[G.placement,G.overflows.filter(H=>H>0).reduce((H,j)=>H+j,0)]).sort((G,H)=>G[1]-H[1])[0])==null?void 0:V[0];q&&(Z=q);break}case"initialPlacement":Z=s;break}if(i!==Z)return{reset:{placement:Z}}}return{}}}};function MD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function RD(e){return Zve.some(t=>e[t]>=0)}const sye=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=xu(e,t);switch(r){case"referenceHidden":{const o=await xg(t,{...i,elementContext:"reference"}),a=MD(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:RD(a)}}}case"escaped":{const o=await xg(t,{...i,altBoundary:!0}),a=MD(o,n.floating);return{data:{escapedOffsets:a,escaped:RD(a)}}}default:return{}}}}};async function uye(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=wu(n),s=Bh(n),u=Uh(n)==="y",l=["left","top"].includes(a)?-1:1,c=o&&u?-1:1,f=xu(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),u?{x:p*c,y:h*l}:{x:h*l,y:p*c}}const lye=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,u=await uye(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},cye=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:b=>{let{x:w,y:x}=b;return{x:w,y:x}}},...u}=xu(e,t),l={x:n,y:r},c=await xg(t,u),f=Uh(wu(i)),h=OA(f);let p=l[h],m=l[f];if(o){const b=h==="y"?"top":"left",w=h==="y"?"bottom":"right",x=p+c[b],S=p-c[w];p=FE(x,p,S)}if(a){const b=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=m+c[b],S=m-c[w];m=FE(x,m,S)}const y=s.fn({...t,[h]:p,[f]:m});return{...y,data:{x:y.x-n,y:y.y-r}}}}},fye=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=xu(e,t),c={x:n,y:r},f=Uh(i),h=OA(f);let p=c[h],m=c[f];const y=xu(s,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){const S=h==="y"?"height":"width",O=o.reference[h]-o.floating[S]+b.mainAxis,E=o.reference[h]+o.reference[S]-b.mainAxis;pE&&(p=E)}if(l){var w,x;const S=h==="y"?"width":"height",O=["top","left"].includes(wu(i)),E=o.reference[f]-o.floating[S]+(O&&((w=a.offset)==null?void 0:w[f])||0)+(O?0:b.crossAxis),C=o.reference[f]+o.reference[S]+(O?0:((x=a.offset)==null?void 0:x[f])||0)-(O?b.crossAxis:0);mC&&(m=C)}return{[h]:p,[f]:m}}}},dye=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:a=()=>{},...s}=xu(e,t),u=await xg(t,s),l=wu(n),c=Bh(n),f=Uh(n)==="y",{width:h,height:p}=r.floating;let m,y;l==="top"||l==="bottom"?(m=l,y=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(y=l,m=c==="end"?"top":"bottom");const b=p-u[m],w=h-u[y],x=!t.middlewareData.shift;let S=b,O=w;if(f){const C=h-u.left-u.right;O=c||x?Dl(w,C):C}else{const C=p-u.top-u.bottom;S=c||x?Dl(b,C):C}if(x&&!c){const C=Ro(u.left,0),P=Ro(u.right,0),M=Ro(u.top,0),N=Ro(u.bottom,0);f?O=h-2*(C!==0||P!==0?C+P:Ro(u.left,u.right)):S=p-2*(M!==0||N!==0?M+N:Ro(u.top,u.bottom))}await a({...t,availableWidth:O,availableHeight:S});const E=await i.getDimensions(o.floating);return h!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function Il(e){return Az(e)?(e.nodeName||"").toLowerCase():"#document"}function jo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ku(e){var t;return(t=(Az(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Az(e){return e instanceof Node||e instanceof jo(e).Node}function _u(e){return e instanceof Element||e instanceof jo(e).Element}function Ms(e){return e instanceof HTMLElement||e instanceof jo(e).HTMLElement}function DD(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jo(e).ShadowRoot}function Rm(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=va(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function hye(e){return["table","td","th"].includes(Il(e))}function kA(e){const t=TA(),n=va(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(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 pye(e){let t=Qd(e);for(;Ms(t)&&!Aw(t);){if(kA(t))return t;t=Qd(t)}return null}function TA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Aw(e){return["html","body","#document"].includes(Il(e))}function va(e){return jo(e).getComputedStyle(e)}function Pw(e){return _u(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Qd(e){if(Il(e)==="html")return e;const t=e.assignedSlot||e.parentNode||DD(e)&&e.host||ku(e);return DD(t)?t.host:t}function Pz(e){const t=Qd(e);return Aw(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ms(t)&&Rm(t)?t:Pz(t)}function wg(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Pz(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=jo(i);return o?t.concat(a,a.visualViewport||[],Rm(i)?i:[],a.frameElement&&n?wg(a.frameElement):[]):t.concat(i,wg(i,[],n))}function kz(e){const t=va(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ms(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Cb(n)!==o||Cb(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function MA(e){return _u(e)?e:e.contextElement}function Md(e){const t=MA(e);if(!Ms(t))return $l(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=kz(t);let a=(o?Cb(n.width):n.width)/r,s=(o?Cb(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const gye=$l(0);function Tz(e){const t=jo(e);return!TA()||!t.visualViewport?gye:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mye(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jo(e)?!1:t}function Jc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=MA(e);let a=$l(1);t&&(r?_u(r)&&(a=Md(r)):a=Md(e));const s=mye(o,n,r)?Tz(o):$l(0);let u=(i.left+s.x)/a.x,l=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const h=jo(o),p=r&&_u(r)?jo(r):r;let m=h,y=m.frameElement;for(;y&&r&&p!==m;){const b=Md(y),w=y.getBoundingClientRect(),x=va(y),S=w.left+(y.clientLeft+parseFloat(x.paddingLeft))*b.x,O=w.top+(y.clientTop+parseFloat(x.paddingTop))*b.y;u*=b.x,l*=b.y,c*=b.x,f*=b.y,u+=S,l+=O,m=jo(y),y=m.frameElement}}return Ob({width:c,height:f,x:u,y:l})}const vye=[":popover-open",":modal"];function Mz(e){return vye.some(t=>{try{return e.matches(t)}catch{return!1}})}function yye(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=ku(r),s=t?Mz(t.floating):!1;if(r===a||s&&o)return n;let u={scrollLeft:0,scrollTop:0},l=$l(1);const c=$l(0),f=Ms(r);if((f||!f&&!o)&&((Il(r)!=="body"||Rm(a))&&(u=Pw(r)),Ms(r))){const h=Jc(r);l=Md(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+c.x,y:n.y*l.y-u.scrollTop*l.y+c.y}}function bye(e){return Array.from(e.getClientRects())}function Rz(e){return Jc(ku(e)).left+Pw(e).scrollLeft}function xye(e){const t=ku(e),n=Pw(e),r=e.ownerDocument.body,i=Ro(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ro(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Rz(e);const s=-n.scrollTop;return va(r).direction==="rtl"&&(a+=Ro(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function wye(e,t){const n=jo(e),r=ku(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const l=TA();(!l||l&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}function _ye(e,t){const n=Jc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Ms(e)?Md(e):$l(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,l=r*o.y;return{width:a,height:s,x:u,y:l}}function $D(e,t,n){let r;if(t==="viewport")r=wye(e,n);else if(t==="document")r=xye(ku(e));else if(_u(t))r=_ye(t,n);else{const i=Tz(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Ob(r)}function Dz(e,t){const n=Qd(e);return n===t||!_u(n)||Aw(n)?!1:va(n).position==="fixed"||Dz(n,t)}function Sye(e,t){const n=t.get(e);if(n)return n;let r=wg(e,[],!1).filter(s=>_u(s)&&Il(s)!=="body"),i=null;const o=va(e).position==="fixed";let a=o?Qd(e):e;for(;_u(a)&&!Aw(a);){const s=va(a),u=kA(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Rm(a)&&!u&&Dz(e,a))?r=r.filter(c=>c!==a):i=s,a=Qd(a)}return t.set(e,r),r}function Cye(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Sye(t,this._c):[].concat(n),r],s=a[0],u=a.reduce((l,c)=>{const f=$D(t,c,i);return l.top=Ro(f.top,l.top),l.right=Dl(f.right,l.right),l.bottom=Dl(f.bottom,l.bottom),l.left=Ro(f.left,l.left),l},$D(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Eye(e){const{width:t,height:n}=kz(e);return{width:t,height:n}}function Oye(e,t,n){const r=Ms(t),i=ku(t),o=n==="fixed",a=Jc(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const u=$l(0);if(r||!r&&!o)if((Il(t)!=="body"||Rm(i))&&(s=Pw(t)),r){const f=Jc(t,!0,o,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else i&&(u.x=Rz(i));const l=a.left+s.scrollLeft-u.x,c=a.top+s.scrollTop-u.y;return{x:l,y:c,width:a.width,height:a.height}}function ID(e,t){return!Ms(e)||va(e).position==="fixed"?null:t?t(e):e.offsetParent}function $z(e,t){const n=jo(e);if(!Ms(e)||Mz(e))return n;let r=ID(e,t);for(;r&&hye(r)&&va(r).position==="static";)r=ID(r,t);return r&&(Il(r)==="html"||Il(r)==="body"&&va(r).position==="static"&&!kA(r))?n:r||pye(e)||n}const Aye=async function(e){const t=this.getOffsetParent||$z,n=this.getDimensions;return{reference:Oye(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function Pye(e){return va(e).direction==="rtl"}const kye={convertOffsetParentRelativeRectToViewportRelativeRect:yye,getDocumentElement:ku,getClippingRect:Cye,getOffsetParent:$z,getElementRects:Aye,getClientRects:bye,getDimensions:Eye,getScale:Md,isElement:_u,isRTL:Pye};function Tye(e,t){let n=null,r;const i=ku(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const{left:l,top:c,width:f,height:h}=e.getBoundingClientRect();if(s||t(),!f||!h)return;const p=xy(c),m=xy(i.clientWidth-(l+f)),y=xy(i.clientHeight-(c+h)),b=xy(l),x={rootMargin:-p+"px "+-m+"px "+-y+"px "+-b+"px",threshold:Ro(0,Dl(1,u))||1};let S=!0;function O(E){const C=E[0].intersectionRatio;if(C!==u){if(!S)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(O,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,x)}n.observe(e)}return a(!0),o}function Mye(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=MA(e),c=i||o?[...l?wg(l):[],...wg(t)]:[];c.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const f=l&&s?Tye(l,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(w=>{let[x]=w;x&&x.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),l&&!u&&p.observe(l),p.observe(t));let m,y=u?Jc(e):null;u&&b();function b(){const w=Jc(e);y&&(w.x!==y.x||w.y!==y.y||w.width!==y.width||w.height!==y.height)&&n(),y=w,m=requestAnimationFrame(b)}return n(),()=>{var w;c.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),f?.(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(m)}}const Rye=cye,Dye=aye,$ye=dye,Iye=sye,ND=oye,Nye=fye,Lye=(e,t,n)=>{const r=new Map,i={platform:kye,...n},o={...i.platform,_c:r};return iye(e,t,{...i,platform:o})},Fye=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ND({element:r.current,padding:i}).fn(n):{}:r?ND({element:r,padding:i}).fn(n):{}}}};var v1=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Ab(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ab(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Ab(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Iz(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function LD(e,t){const n=Iz(e);return Math.round(t*n)/n}function FD(e){const t=v.useRef(e);return v1(()=>{t.current=e}),t}function jye(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:u,open:l}=e,[c,f]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=v.useState(r);Ab(h,r)||p(r);const[m,y]=v.useState(null),[b,w]=v.useState(null),x=v.useCallback(H=>{H!==C.current&&(C.current=H,y(H))},[]),S=v.useCallback(H=>{H!==P.current&&(P.current=H,w(H))},[]),O=o||m,E=a||b,C=v.useRef(null),P=v.useRef(null),M=v.useRef(c),N=u!=null,B=FD(u),V=FD(i),W=v.useCallback(()=>{if(!C.current||!P.current)return;const H={placement:t,strategy:n,middleware:h};V.current&&(H.platform=V.current),Lye(C.current,P.current,H).then(j=>{const K={...j,isPositioned:!0};ne.current&&!Ab(M.current,K)&&(M.current=K,Au.flushSync(()=>{f(K)}))})},[h,t,n,V]);v1(()=>{l===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,f(H=>({...H,isPositioned:!1})))},[l]);const ne=v.useRef(!1);v1(()=>(ne.current=!0,()=>{ne.current=!1}),[]),v1(()=>{if(O&&(C.current=O),E&&(P.current=E),O&&E){if(B.current)return B.current(O,E,W);W()}},[O,E,W,B,N]);const Z=v.useMemo(()=>({reference:C,floating:P,setReference:x,setFloating:S}),[x,S]),q=v.useMemo(()=>({reference:O,floating:E}),[O,E]),G=v.useMemo(()=>{const H={position:n,left:0,top:0};if(!q.floating)return H;const j=LD(q.floating,c.x),K=LD(q.floating,c.y);return s?{...H,transform:"translate("+j+"px, "+K+"px)",...Iz(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:K}},[n,s,q.floating,c.x,c.y]);return v.useMemo(()=>({...c,update:W,refs:Z,elements:q,floatingStyles:G}),[c,W,Z,q,G])}var Bye="Arrow",Nz=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return I.jsx(gt.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:I.jsx("polygon",{points:"0,0 30,0 15,10"})})});Nz.displayName=Bye;var Uye=Nz;function zye(e){const[t,n]=v.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var RA="Popper",[Lz,zl]=Di(RA),[Wye,Fz]=Lz(RA),jz=e=>{const{__scopePopper:t,children:n}=e,[r,i]=v.useState(null);return I.jsx(Wye,{scope:t,anchor:r,onAnchorChange:i,children:n})};jz.displayName=RA;var Bz="PopperAnchor",Uz=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Fz(Bz,n),a=v.useRef(null),s=Nt(t,a);return v.useEffect(()=>{o.onAnchorChange(r?.current||a.current)}),r?null:I.jsx(gt.div,{...i,ref:s})});Uz.displayName=Bz;var DA="PopperContent",[Vye,Hye]=Lz(DA),zz=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:c=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...y}=e,b=Fz(DA,n),[w,x]=v.useState(null),S=Nt(t,me=>x(me)),[O,E]=v.useState(null),C=zye(O),P=C?.width??0,M=C?.height??0,N=r+(o!=="center"?"-"+o:""),B=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},V=Array.isArray(l)?l:[l],W=V.length>0,ne={padding:B,boundary:V.filter(Kye),altBoundary:W},{refs:Z,floatingStyles:q,placement:G,isPositioned:H,middlewareData:j}=jye({strategy:"fixed",placement:N,whileElementsMounted:(...me)=>Mye(...me,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[lye({mainAxis:i+M,alignmentAxis:a}),u&&Rye({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Nye():void 0,...ne}),u&&Dye({...ne}),$ye({...ne,apply:({elements:me,rects:Ze,availableWidth:Ae,availableHeight:Le})=>{const{width:$e,height:be}=Ze.reference,bt=me.floating.style;bt.setProperty("--radix-popper-available-width",`${Ae}px`),bt.setProperty("--radix-popper-available-height",`${Le}px`),bt.setProperty("--radix-popper-anchor-width",`${$e}px`),bt.setProperty("--radix-popper-anchor-height",`${be}px`)}}),O&&Fye({element:O,padding:s}),Gye({arrowWidth:P,arrowHeight:M}),h&&Iye({strategy:"referenceHidden",...ne})]}),[K,Y]=Hz(G),oe=Vr(m);On(()=>{H&&oe?.()},[H,oe]);const X=j.arrow?.x,Q=j.arrow?.y,ue=j.arrow?.centerOffset!==0,[de,Se]=v.useState();return On(()=>{w&&Se(window.getComputedStyle(w).zIndex)},[w]),I.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:H?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:I.jsx(Vye,{scope:n,placedSide:K,onArrowChange:E,arrowX:X,arrowY:Q,shouldHideArrow:ue,children:I.jsx(gt.div,{"data-side":K,"data-align":Y,...y,ref:S,style:{...y.style,animation:H?void 0:"none"}})})})});zz.displayName=DA;var Wz="PopperArrow",qye={top:"bottom",right:"left",bottom:"top",left:"right"},Vz=v.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Hye(Wz,r),a=qye[o.placedSide];return I.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:I.jsx(Uye,{...i,ref:n,style:{...i.style,display:"block"}})})});Vz.displayName=Wz;function Kye(e){return e!==null}var Gye=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,c]=Hz(n),f={start:"0%",center:"50%",end:"100%"}[c],h=(i.arrow?.x??0)+s/2,p=(i.arrow?.y??0)+u/2;let m="",y="";return l==="bottom"?(m=a?f:`${h}px`,y=`${-u}px`):l==="top"?(m=a?f:`${h}px`,y=`${r.floating.height+u}px`):l==="right"?(m=`${-u}px`,y=a?f:`${p}px`):l==="left"&&(m=`${r.floating.width+u}px`,y=a?f:`${p}px`),{data:{x:m,y}}}});function Hz(e){const[t,n="center"]=e.split("-");return[t,n]}var kw=jz,Dm=Uz,Tw=zz,Mw=Vz;function Yye(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var $m=e=>{const{present:t,children:n}=e,r=Zye(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,Xye(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};$m.displayName="Presence";function Zye(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=Yye(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=wy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=wy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=wy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=wy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function wy(e){return e?.animationName||"none"}function Xye(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var BE=["Enter"," "],Qye=["ArrowDown","PageUp","Home"],qz=["ArrowUp","PageDown","End"],Jye=[...Qye,...qz],e1e={ltr:[...BE,"ArrowRight"],rtl:[...BE,"ArrowLeft"]},t1e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Im="Menu",[_g,n1e,r1e]=oA(Im),[pf,Kz]=Di(Im,[r1e,zl,fw]),Rw=zl(),Gz=fw(),[i1e,gf]=pf(Im),[o1e,Nm]=pf(Im),Yz=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=Rw(t),[u,l]=v.useState(null),c=v.useRef(!1),f=Vr(o),h=Em(i);return v.useEffect(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),I.jsx(kw,{...s,children:I.jsx(i1e,{scope:t,open:n,onOpenChange:f,content:u,onContentChange:l,children:I.jsx(o1e,{scope:t,onClose:v.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:h,modal:a,children:r})})})};Yz.displayName=Im;var a1e="MenuAnchor",$A=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Rw(n);return I.jsx(Dm,{...i,...r,ref:t})});$A.displayName=a1e;var IA="MenuPortal",[s1e,Zz]=pf(IA,{forceMount:void 0}),Xz=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=gf(IA,t);return I.jsx(s1e,{scope:t,forceMount:n,children:I.jsx($m,{present:n||o.open,children:I.jsx(jh,{asChild:!0,container:i,children:r})})})};Xz.displayName=IA;var ha="MenuContent",[u1e,NA]=pf(ha),Qz=v.forwardRef((e,t)=>{const n=Zz(ha,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=gf(ha,e.__scopeMenu),a=Nm(ha,e.__scopeMenu);return I.jsx(_g.Provider,{scope:e.__scopeMenu,children:I.jsx($m,{present:r||o.open,children:I.jsx(_g.Slot,{scope:e.__scopeMenu,children:a.modal?I.jsx(l1e,{...i,ref:t}):I.jsx(c1e,{...i,ref:t})})})})}),l1e=v.forwardRef((e,t)=>{const n=gf(ha,e.__scopeMenu),r=v.useRef(null),i=Nt(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Mm(o)},[]),I.jsx(LA,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ye(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),c1e=v.forwardRef((e,t)=>{const n=gf(ha,e.__scopeMenu);return I.jsx(LA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),LA=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:m,...y}=e,b=gf(ha,n),w=Nm(ha,n),x=Rw(n),S=Gz(n),O=n1e(n),[E,C]=v.useState(null),P=v.useRef(null),M=Nt(t,P,b.onContentChange),N=v.useRef(0),B=v.useRef(""),V=v.useRef(0),W=v.useRef(null),ne=v.useRef("right"),Z=v.useRef(0),q=m?Tm:v.Fragment,G=m?{as:Pl,allowPinchZoom:!0}:void 0,H=K=>{const Y=B.current+K,oe=O().filter(me=>!me.disabled),X=document.activeElement,Q=oe.find(me=>me.ref.current===X)?.textValue,ue=oe.map(me=>me.textValue),de=_1e(ue,Y,Q),Se=oe.find(me=>me.textValue===de)?.ref.current;(function me(Ze){B.current=Ze,window.clearTimeout(N.current),Ze!==""&&(N.current=window.setTimeout(()=>me(""),1e3))})(Y),Se&&setTimeout(()=>Se.focus())};v.useEffect(()=>()=>window.clearTimeout(N.current),[]),Ew();const j=v.useCallback(K=>ne.current===W.current?.side&&C1e(K,W.current?.area),[]);return I.jsx(u1e,{scope:n,searchRef:B,onItemEnter:v.useCallback(K=>{j(K)&&K.preventDefault()},[j]),onItemLeave:v.useCallback(K=>{j(K)||(P.current?.focus(),C(null))},[j]),onTriggerLeave:v.useCallback(K=>{j(K)&&K.preventDefault()},[j]),pointerGraceTimerRef:V,onPointerGraceIntentChange:v.useCallback(K=>{W.current=K},[]),children:I.jsx(q,{...G,children:I.jsx(km,{asChild:!0,trapped:i,onMountAutoFocus:Ye(o,K=>{K.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:I.jsx(OB,{asChild:!0,...S,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:Ye(u,K=>{w.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:I.jsx(Tw,{role:"menu","aria-orientation":"vertical","data-state":pW(b.open),"data-radix-menu-content":"",dir:w.dir,...x,...y,ref:M,style:{outline:"none",...y.style},onKeyDown:Ye(y.onKeyDown,K=>{const oe=K.target.closest("[data-radix-menu-content]")===K.currentTarget,X=K.ctrlKey||K.altKey||K.metaKey,Q=K.key.length===1;oe&&(K.key==="Tab"&&K.preventDefault(),!X&&Q&&H(K.key));const ue=P.current;if(K.target!==ue||!Jye.includes(K.key))return;K.preventDefault();const Se=O().filter(me=>!me.disabled).map(me=>me.ref.current);qz.includes(K.key)&&Se.reverse(),x1e(Se)}),onBlur:Ye(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(N.current),B.current="")}),onPointerMove:Ye(e.onPointerMove,Sg(K=>{const Y=K.target,oe=Z.current!==K.clientX;if(K.currentTarget.contains(Y)&&oe){const X=K.clientX>Z.current?"right":"left";ne.current=X,Z.current=K.clientX}}))})})})})})})});Qz.displayName=ha;var f1e="MenuGroup",FA=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return I.jsx(gt.div,{role:"group",...r,ref:t})});FA.displayName=f1e;var d1e="MenuLabel",Jz=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return I.jsx(gt.div,{...r,ref:t})});Jz.displayName=d1e;var Pb="MenuItem",jD="menu.itemSelect",Dw=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=v.useRef(null),a=Nm(Pb,e.__scopeMenu),s=NA(Pb,e.__scopeMenu),u=Nt(t,o),l=v.useRef(!1),c=()=>{const f=o.current;if(!n&&f){const h=new CustomEvent(jD,{bubbles:!0,cancelable:!0});f.addEventListener(jD,p=>r?.(p),{once:!0}),zj(f,h),h.defaultPrevented?l.current=!1:a.onClose()}};return I.jsx(eW,{...i,ref:u,disabled:n,onClick:Ye(e.onClick,c),onPointerDown:f=>{e.onPointerDown?.(f),l.current=!0},onPointerUp:Ye(e.onPointerUp,f=>{l.current||f.currentTarget?.click()}),onKeyDown:Ye(e.onKeyDown,f=>{const h=s.searchRef.current!=="";n||h&&f.key===" "||BE.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Dw.displayName=Pb;var eW=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=NA(Pb,n),s=Gz(n),u=v.useRef(null),l=Nt(t,u),[c,f]=v.useState(!1),[h,p]=v.useState("");return v.useEffect(()=>{const m=u.current;m&&p((m.textContent??"").trim())},[o.children]),I.jsx(_g.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:I.jsx(AB,{asChild:!0,...s,focusable:!r,children:I.jsx(gt.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:l,onPointerMove:Ye(e.onPointerMove,Sg(m=>{r?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ye(e.onPointerLeave,Sg(m=>a.onItemLeave(m))),onFocus:Ye(e.onFocus,()=>f(!0)),onBlur:Ye(e.onBlur,()=>f(!1))})})})}),h1e="MenuCheckboxItem",tW=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return I.jsx(aW,{scope:e.__scopeMenu,checked:n,children:I.jsx(Dw,{role:"menuitemcheckbox","aria-checked":kb(n)?"mixed":n,...i,ref:t,"data-state":BA(n),onSelect:Ye(i.onSelect,()=>r?.(kb(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tW.displayName=h1e;var nW="MenuRadioGroup",[p1e,g1e]=pf(nW,{value:void 0,onValueChange:()=>{}}),rW=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Vr(r);return I.jsx(p1e,{scope:e.__scopeMenu,value:n,onValueChange:o,children:I.jsx(FA,{...i,ref:t})})});rW.displayName=nW;var iW="MenuRadioItem",oW=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=g1e(iW,e.__scopeMenu),o=n===i.value;return I.jsx(aW,{scope:e.__scopeMenu,checked:o,children:I.jsx(Dw,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":BA(o),onSelect:Ye(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});oW.displayName=iW;var jA="MenuItemIndicator",[aW,m1e]=pf(jA,{checked:!1}),sW=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=m1e(jA,n);return I.jsx($m,{present:r||kb(o.checked)||o.checked===!0,children:I.jsx(gt.span,{...i,ref:t,"data-state":BA(o.checked)})})});sW.displayName=jA;var v1e="MenuSeparator",uW=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return I.jsx(gt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});uW.displayName=v1e;var y1e="MenuArrow",lW=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Rw(n);return I.jsx(Mw,{...i,...r,ref:t})});lW.displayName=y1e;var b1e="MenuSub",[mJe,cW]=pf(b1e),c0="MenuSubTrigger",fW=v.forwardRef((e,t)=>{const n=gf(c0,e.__scopeMenu),r=Nm(c0,e.__scopeMenu),i=cW(c0,e.__scopeMenu),o=NA(c0,e.__scopeMenu),a=v.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:u}=o,l={__scopeMenu:e.__scopeMenu},c=v.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return v.useEffect(()=>c,[c]),v.useEffect(()=>{const f=s.current;return()=>{window.clearTimeout(f),u(null)}},[s,u]),I.jsx($A,{asChild:!0,...l,children:I.jsx(eW,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":pW(n.open),...e,ref:sw(t,i.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ye(e.onPointerMove,Sg(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:Ye(e.onPointerLeave,Sg(f=>{c();const h=n.content?.getBoundingClientRect();if(h){const p=n.content?.dataset.side,m=p==="right",y=m?-5:5,b=h[m?"left":"right"],w=h[m?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x:b,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:b,y:h.bottom}],side:p}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ye(e.onKeyDown,f=>{const h=o.searchRef.current!=="";e.disabled||h&&f.key===" "||e1e[r.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});fW.displayName=c0;var dW="MenuSubContent",hW=v.forwardRef((e,t)=>{const n=Zz(ha,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=gf(ha,e.__scopeMenu),a=Nm(ha,e.__scopeMenu),s=cW(dW,e.__scopeMenu),u=v.useRef(null),l=Nt(t,u);return I.jsx(_g.Provider,{scope:e.__scopeMenu,children:I.jsx($m,{present:r||o.open,children:I.jsx(_g.Slot,{scope:e.__scopeMenu,children:I.jsx(LA,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{a.isUsingKeyboardRef.current&&u.current?.focus(),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:Ye(e.onFocusOutside,c=>{c.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ye(e.onEscapeKeyDown,c=>{a.onClose(),c.preventDefault()}),onKeyDown:Ye(e.onKeyDown,c=>{const f=c.currentTarget.contains(c.target),h=t1e[a.dir].includes(c.key);f&&h&&(o.onOpenChange(!1),s.trigger?.focus(),c.preventDefault())})})})})})});hW.displayName=dW;function pW(e){return e?"open":"closed"}function kb(e){return e==="indeterminate"}function BA(e){return kb(e)?"indeterminate":e?"checked":"unchecked"}function x1e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function w1e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function _1e(e,t,n){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=w1e(e,Math.max(o,0));i.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function S1e(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=c>r&&n<(l-s)*(r-u)/(c-u)+s&&(i=!i)}return i}function C1e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return S1e(n,t)}function Sg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var E1e=Yz,O1e=$A,A1e=Xz,P1e=Qz,k1e=FA,T1e=Jz,M1e=Dw,R1e=tW,D1e=rW,$1e=oW,I1e=sW,N1e=uW,L1e=lW,F1e=fW,j1e=hW,UA="DropdownMenu",[B1e,vJe]=Di(UA,[Kz]),Yi=Kz(),[U1e,gW]=B1e(UA),mW=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,u=Yi(t),l=v.useRef(null),[c=!1,f]=Ts({prop:i,defaultProp:o,onChange:a});return I.jsx(U1e,{scope:t,triggerId:Lo(),triggerRef:l,contentId:Lo(),open:c,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),modal:s,children:I.jsx(E1e,{...u,open:c,onOpenChange:f,dir:r,modal:s,children:n})})};mW.displayName=UA;var vW="DropdownMenuTrigger",yW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=gW(vW,n),a=Yi(n);return I.jsx(O1e,{asChild:!0,...a,children:I.jsx(gt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:sw(t,o.triggerRef),onPointerDown:Ye(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Ye(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});yW.displayName=vW;var z1e="DropdownMenuPortal",bW=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Yi(t);return I.jsx(A1e,{...r,...n})};bW.displayName=z1e;var xW="DropdownMenuContent",wW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=gW(xW,n),o=Yi(n),a=v.useRef(!1);return I.jsx(P1e,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ye(e.onCloseAutoFocus,s=>{a.current||i.triggerRef.current?.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Ye(e.onInteractOutside,s=>{const u=s.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,c=u.button===2||l;(!i.modal||c)&&(a.current=!0)}),style:{...e.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)"}})});wW.displayName=xW;var W1e="DropdownMenuGroup",_W=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(k1e,{...i,...r,ref:t})});_W.displayName=W1e;var V1e="DropdownMenuLabel",SW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(T1e,{...i,...r,ref:t})});SW.displayName=V1e;var H1e="DropdownMenuItem",CW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(M1e,{...i,...r,ref:t})});CW.displayName=H1e;var q1e="DropdownMenuCheckboxItem",EW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(R1e,{...i,...r,ref:t})});EW.displayName=q1e;var K1e="DropdownMenuRadioGroup",G1e=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(D1e,{...i,...r,ref:t})});G1e.displayName=K1e;var Y1e="DropdownMenuRadioItem",OW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx($1e,{...i,...r,ref:t})});OW.displayName=Y1e;var Z1e="DropdownMenuItemIndicator",AW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(I1e,{...i,...r,ref:t})});AW.displayName=Z1e;var X1e="DropdownMenuSeparator",PW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(N1e,{...i,...r,ref:t})});PW.displayName=X1e;var Q1e="DropdownMenuArrow",J1e=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(L1e,{...i,...r,ref:t})});J1e.displayName=Q1e;var ebe="DropdownMenuSubTrigger",kW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(F1e,{...i,...r,ref:t})});kW.displayName=ebe;var tbe="DropdownMenuSubContent",TW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(j1e,{...i,...r,ref:t,style:{...e.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)"}})});TW.displayName=tbe;var yJe=mW,bJe=yW,xJe=bW,wJe=wW,_Je=_W,SJe=SW,CJe=CW,EJe=EW,OJe=OW,AJe=AW,PJe=PW,kJe=kW,TJe=TW;function nbe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var MW=e=>{const{present:t,children:n}=e,r=rbe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,ibe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};MW.displayName="Presence";function rbe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=nbe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=_y(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=_y(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=_y(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=_y(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function _y(e){return e?.animationName||"none"}function ibe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zA="Collapsible",[obe,MJe]=Di(zA),[abe,WA]=obe(zA),RW=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[u=!1,l]=Ts({prop:r,defaultProp:i,onChange:a});return I.jsx(abe,{scope:n,disabled:o,contentId:Lo(),open:u,onOpenToggle:v.useCallback(()=>l(c=>!c),[l]),children:I.jsx(gt.div,{"data-state":HA(u),"data-disabled":o?"":void 0,...s,ref:t})})});RW.displayName=zA;var DW="CollapsibleTrigger",sbe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=WA(DW,n);return I.jsx(gt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":HA(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Ye(e.onClick,i.onOpenToggle)})});sbe.displayName=DW;var VA="CollapsibleContent",ube=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=WA(VA,e.__scopeCollapsible);return I.jsx(MW,{present:n||i.open,children:({present:o})=>I.jsx(lbe,{...r,ref:t,present:o})})});ube.displayName=VA;var lbe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,a=WA(VA,n),[s,u]=v.useState(r),l=v.useRef(null),c=Nt(t,l),f=v.useRef(0),h=f.current,p=v.useRef(0),m=p.current,y=a.open||s,b=v.useRef(y),w=v.useRef(void 0);return v.useEffect(()=>{const x=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(x)},[]),On(()=>{const x=l.current;if(x){w.current=w.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const S=x.getBoundingClientRect();f.current=S.height,p.current=S.width,b.current||(x.style.transitionDuration=w.current.transitionDuration,x.style.animationName=w.current.animationName),u(r)}},[a.open,r]),I.jsx(gt.div,{"data-state":HA(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!y,...o,ref:c,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:y&&i})});function HA(e){return e?"open":"closed"}var RJe=RW;function cbe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var qA=e=>{const{present:t,children:n}=e,r=fbe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,dbe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};qA.displayName="Presence";function fbe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=cbe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Sy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Sy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=Sy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=Sy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Sy(e){return e?.animationName||"none"}function dbe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hbe="VisuallyHidden",KA=v.forwardRef((e,t)=>I.jsx(gt.span,{...e,ref:t,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",...e.style}}));KA.displayName=hbe;var pbe=KA,[$w,DJe]=Di("Tooltip",[zl]),Iw=zl(),$W="TooltipProvider",gbe=700,UE="tooltip.open",[mbe,GA]=$w($W),IW=e=>{const{__scopeTooltip:t,delayDuration:n=gbe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[a,s]=v.useState(!0),u=v.useRef(!1),l=v.useRef(0);return v.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),I.jsx(mbe,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(l.current),s(!1)},[]),onClose:v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:v.useCallback(c=>{u.current=c},[]),disableHoverableContent:i,children:o})};IW.displayName=$W;var Nw="Tooltip",[vbe,Lm]=$w(Nw),NW=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,u=GA(Nw,e.__scopeTooltip),l=Iw(t),[c,f]=v.useState(null),h=Lo(),p=v.useRef(0),m=a??u.disableHoverableContent,y=s??u.delayDuration,b=v.useRef(!1),[w=!1,x]=Ts({prop:r,defaultProp:i,onChange:P=>{P?(u.onOpen(),document.dispatchEvent(new CustomEvent(UE))):u.onClose(),o?.(P)}}),S=v.useMemo(()=>w?b.current?"delayed-open":"instant-open":"closed",[w]),O=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,x(!0)},[x]),E=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),C=v.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,x(!0),p.current=0},y)},[y,x]);return v.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),I.jsx(kw,{...l,children:I.jsx(vbe,{scope:t,contentId:h,open:w,stateAttribute:S,trigger:c,onTriggerChange:f,onTriggerEnter:v.useCallback(()=>{u.isOpenDelayed?C():O()},[u.isOpenDelayed,C,O]),onTriggerLeave:v.useCallback(()=>{m?E():(window.clearTimeout(p.current),p.current=0)},[E,m]),onOpen:O,onClose:E,disableHoverableContent:m,children:n})})};NW.displayName=Nw;var zE="TooltipTrigger",LW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Lm(zE,n),o=GA(zE,n),a=Iw(n),s=v.useRef(null),u=Nt(t,s,i.onTriggerChange),l=v.useRef(!1),c=v.useRef(!1),f=v.useCallback(()=>l.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),I.jsx(Dm,{asChild:!0,...a,children:I.jsx(gt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:u,onPointerMove:Ye(e.onPointerMove,h=>{h.pointerType!=="touch"&&!c.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:Ye(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:Ye(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ye(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:Ye(e.onBlur,i.onClose),onClick:Ye(e.onClick,i.onClose)})})});LW.displayName=zE;var YA="TooltipPortal",[ybe,bbe]=$w(YA,{forceMount:void 0}),FW=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Lm(YA,t);return I.jsx(ybe,{scope:t,forceMount:n,children:I.jsx(qA,{present:n||o.open,children:I.jsx(jh,{asChild:!0,container:i,children:r})})})};FW.displayName=YA;var Jd="TooltipContent",jW=v.forwardRef((e,t)=>{const n=bbe(Jd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Lm(Jd,e.__scopeTooltip);return I.jsx(qA,{present:r||a.open,children:a.disableHoverableContent?I.jsx(BW,{side:i,...o,ref:t}):I.jsx(xbe,{side:i,...o,ref:t})})}),xbe=v.forwardRef((e,t)=>{const n=Lm(Jd,e.__scopeTooltip),r=GA(Jd,e.__scopeTooltip),i=v.useRef(null),o=Nt(t,i),[a,s]=v.useState(null),{trigger:u,onClose:l}=n,c=i.current,{onPointerInTransitChange:f}=r,h=v.useCallback(()=>{s(null),f(!1)},[f]),p=v.useCallback((m,y)=>{const b=m.currentTarget,w={x:m.clientX,y:m.clientY},x=Cbe(w,b.getBoundingClientRect()),S=Ebe(w,x),O=Obe(y.getBoundingClientRect()),E=Pbe([...S,...O]);s(E),f(!0)},[f]);return v.useEffect(()=>()=>h(),[h]),v.useEffect(()=>{if(u&&c){const m=b=>p(b,c),y=b=>p(b,u);return u.addEventListener("pointerleave",m),c.addEventListener("pointerleave",y),()=>{u.removeEventListener("pointerleave",m),c.removeEventListener("pointerleave",y)}}},[u,c,p,h]),v.useEffect(()=>{if(a){const m=y=>{const b=y.target,w={x:y.clientX,y:y.clientY},x=u?.contains(b)||c?.contains(b),S=!Abe(w,a);x?h():S&&(h(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[u,c,a,l,h]),I.jsx(BW,{...e,ref:o})}),[wbe,_be]=$w(Nw,{isInside:!1}),BW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,u=Lm(Jd,n),l=Iw(n),{onClose:c}=u;return v.useEffect(()=>(document.addEventListener(UE,c),()=>document.removeEventListener(UE,c)),[c]),v.useEffect(()=>{if(u.trigger){const f=h=>{h.target?.contains(u.trigger)&&c()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[u.trigger,c]),I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:c,children:I.jsxs(Tw,{"data-state":u.stateAttribute,...l,...s,ref:t,style:{...s.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:[I.jsx(ZO,{children:r}),I.jsx(wbe,{scope:n,isInside:!0,children:I.jsx(pbe,{id:u.contentId,role:"tooltip",children:i||r})})]})})});jW.displayName=Jd;var UW="TooltipArrow",Sbe=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Iw(n);return _be(UW,n).isInside?null:I.jsx(Mw,{...i,...r,ref:t})});Sbe.displayName=UW;function Cbe(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ebe(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Obe(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Abe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=c>r&&n<(l-s)*(r-u)/(c-u)+s&&(i=!i)}return i}function Pbe(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),kbe(t)}function kbe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var $Je=IW,IJe=NW,NJe=LW,LJe=FW,FJe=jW;/** +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},yve="DialogDescriptionWarning",bve=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Cz(yve).contentName}}.`;return v.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},xve=cz,wve=dz,_ve=pz,Sve=gz,Cve=mz,Eve=yz,Ove=xz,Ez=_z;function Yr(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var Ave=["color"],GQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Ave);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Pve=["color"],YQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Pve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),kve=["color"],ZQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,kve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Tve=["color"],XQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Tve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Mve=["color"],QQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Mve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Rve=["color"],JQe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Rve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Dve=["color"],eJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Dve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M0.877075 7.49991C0.877075 3.84222 3.84222 0.877075 7.49991 0.877075C11.1576 0.877075 14.1227 3.84222 14.1227 7.49991C14.1227 11.1576 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1576 0.877075 7.49991ZM7.49991 1.82708C4.36689 1.82708 1.82708 4.36689 1.82708 7.49991C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49991C13.1727 4.36689 10.6329 1.82708 7.49991 1.82708Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),$ve=["color"],tJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,$ve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Ive=["color"],nJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Ive);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704ZM9.85358 5.14644C10.0488 5.3417 10.0488 5.65829 9.85358 5.85355L8.20713 7.49999L9.85358 9.14644C10.0488 9.3417 10.0488 9.65829 9.85358 9.85355C9.65832 10.0488 9.34173 10.0488 9.14647 9.85355L7.50002 8.2071L5.85358 9.85355C5.65832 10.0488 5.34173 10.0488 5.14647 9.85355C4.95121 9.65829 4.95121 9.3417 5.14647 9.14644L6.79292 7.49999L5.14647 5.85355C4.95121 5.65829 4.95121 5.3417 5.14647 5.14644C5.34173 4.95118 5.65832 4.95118 5.85358 5.14644L7.50002 6.79289L9.14647 5.14644C9.34173 4.95118 9.65832 4.95118 9.85358 5.14644Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Nve=["color"],rJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Nve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),Lve=["color"],iJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Lve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Fve=["color"],oJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Fve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),jve=["color"],aJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,jve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M5.5 4.625C6.12132 4.625 6.625 4.12132 6.625 3.5C6.625 2.87868 6.12132 2.375 5.5 2.375C4.87868 2.375 4.375 2.87868 4.375 3.5C4.375 4.12132 4.87868 4.625 5.5 4.625ZM9.5 4.625C10.1213 4.625 10.625 4.12132 10.625 3.5C10.625 2.87868 10.1213 2.375 9.5 2.375C8.87868 2.375 8.375 2.87868 8.375 3.5C8.375 4.12132 8.87868 4.625 9.5 4.625ZM10.625 7.5C10.625 8.12132 10.1213 8.625 9.5 8.625C8.87868 8.625 8.375 8.12132 8.375 7.5C8.375 6.87868 8.87868 6.375 9.5 6.375C10.1213 6.375 10.625 6.87868 10.625 7.5ZM5.5 8.625C6.12132 8.625 6.625 8.12132 6.625 7.5C6.625 6.87868 6.12132 6.375 5.5 6.375C4.87868 6.375 4.375 6.87868 4.375 7.5C4.375 8.12132 4.87868 8.625 5.5 8.625ZM10.625 11.5C10.625 12.1213 10.1213 12.625 9.5 12.625C8.87868 12.625 8.375 12.1213 8.375 11.5C8.375 10.8787 8.87868 10.375 9.5 10.375C10.1213 10.375 10.625 10.8787 10.625 11.5ZM5.5 12.625C6.12132 12.625 6.625 12.1213 6.625 11.5C6.625 10.8787 6.12132 10.375 5.5 10.375C4.87868 10.375 4.375 10.8787 4.375 11.5C4.375 12.1213 4.87868 12.625 5.5 12.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Bve=["color"],sJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Bve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Uve=["color"],uJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Uve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M5.5 3C4.67157 3 4 3.67157 4 4.5C4 5.32843 4.67157 6 5.5 6C6.32843 6 7 5.32843 7 4.5C7 3.67157 6.32843 3 5.5 3ZM3 5C3.01671 5 3.03323 4.99918 3.04952 4.99758C3.28022 6.1399 4.28967 7 5.5 7C6.71033 7 7.71978 6.1399 7.95048 4.99758C7.96677 4.99918 7.98329 5 8 5H13.5C13.7761 5 14 4.77614 14 4.5C14 4.22386 13.7761 4 13.5 4H8C7.98329 4 7.96677 4.00082 7.95048 4.00242C7.71978 2.86009 6.71033 2 5.5 2C4.28967 2 3.28022 2.86009 3.04952 4.00242C3.03323 4.00082 3.01671 4 3 4H1.5C1.22386 4 1 4.22386 1 4.5C1 4.77614 1.22386 5 1.5 5H3ZM11.9505 10.9976C11.7198 12.1399 10.7103 13 9.5 13C8.28967 13 7.28022 12.1399 7.04952 10.9976C7.03323 10.9992 7.01671 11 7 11H1.5C1.22386 11 1 10.7761 1 10.5C1 10.2239 1.22386 10 1.5 10H7C7.01671 10 7.03323 10.0008 7.04952 10.0024C7.28022 8.8601 8.28967 8 9.5 8C10.7103 8 11.7198 8.8601 11.9505 10.0024C11.9668 10.0008 11.9833 10 12 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H12C11.9833 11 11.9668 10.9992 11.9505 10.9976ZM8 10.5C8 9.67157 8.67157 9 9.5 9C10.3284 9 11 9.67157 11 10.5C11 11.3284 10.3284 12 9.5 12C8.67157 12 8 11.3284 8 10.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),zve=["color"],lJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,zve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M12.1464 1.14645C12.3417 0.951184 12.6583 0.951184 12.8535 1.14645L14.8535 3.14645C15.0488 3.34171 15.0488 3.65829 14.8535 3.85355L10.9109 7.79618C10.8349 7.87218 10.7471 7.93543 10.651 7.9835L6.72359 9.94721C6.53109 10.0435 6.29861 10.0057 6.14643 9.85355C5.99425 9.70137 5.95652 9.46889 6.05277 9.27639L8.01648 5.34897C8.06455 5.25283 8.1278 5.16507 8.2038 5.08907L12.1464 1.14645ZM12.5 2.20711L8.91091 5.79618L7.87266 7.87267L8.12731 8.12732L10.2038 7.08907L13.7929 3.5L12.5 2.20711ZM9.99998 2L8.99998 3H4.9C4.47171 3 4.18056 3.00039 3.95552 3.01877C3.73631 3.03668 3.62421 3.06915 3.54601 3.10899C3.35785 3.20487 3.20487 3.35785 3.10899 3.54601C3.06915 3.62421 3.03669 3.73631 3.01878 3.95552C3.00039 4.18056 3 4.47171 3 4.9V11.1C3 11.5283 3.00039 11.8194 3.01878 12.0445C3.03669 12.2637 3.06915 12.3758 3.10899 12.454C3.20487 12.6422 3.35785 12.7951 3.54601 12.891C3.62421 12.9309 3.73631 12.9633 3.95552 12.9812C4.18056 12.9996 4.47171 13 4.9 13H11.1C11.5283 13 11.8194 12.9996 12.0445 12.9812C12.2637 12.9633 12.3758 12.9309 12.454 12.891C12.6422 12.7951 12.7951 12.6422 12.891 12.454C12.9309 12.3758 12.9633 12.2637 12.9812 12.0445C12.9996 11.8194 13 11.5283 13 11.1V6.99998L14 5.99998V11.1V11.1207C14 11.5231 14 11.8553 13.9779 12.1259C13.9549 12.407 13.9057 12.6653 13.782 12.908C13.5903 13.2843 13.2843 13.5903 12.908 13.782C12.6653 13.9057 12.407 13.9549 12.1259 13.9779C11.8553 14 11.5231 14 11.1207 14H11.1H4.9H4.87934C4.47686 14 4.14468 14 3.87409 13.9779C3.59304 13.9549 3.33469 13.9057 3.09202 13.782C2.7157 13.5903 2.40973 13.2843 2.21799 12.908C2.09434 12.6653 2.04506 12.407 2.0221 12.1259C1.99999 11.8553 1.99999 11.5231 2 11.1207V11.1206V11.1V4.9V4.87935V4.87932V4.87931C1.99999 4.47685 1.99999 4.14468 2.0221 3.87409C2.04506 3.59304 2.09434 3.33469 2.21799 3.09202C2.40973 2.71569 2.7157 2.40973 3.09202 2.21799C3.33469 2.09434 3.59304 2.04506 3.87409 2.0221C4.14468 1.99999 4.47685 1.99999 4.87932 2H4.87935H4.9H9.99998Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Wve=["color"],cJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Wve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM7.50003 4C7.77617 4 8.00003 4.22386 8.00003 4.5V7H10.5C10.7762 7 11 7.22386 11 7.5C11 7.77614 10.7762 8 10.5 8H8.00003V10.5C8.00003 10.7761 7.77617 11 7.50003 11C7.22389 11 7.00003 10.7761 7.00003 10.5V8H4.50003C4.22389 8 4.00003 7.77614 4.00003 7.5C4.00003 7.22386 4.22389 7 4.50003 7H7.00003V4.5C7.00003 4.22386 7.22389 4 7.50003 4Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Vve=["color"],fJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Vve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Hve=["color"],dJe=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Yr(e,Hve);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M5.49998 0.5C5.49998 0.223858 5.72383 0 5.99998 0H7.49998H8.99998C9.27612 0 9.49998 0.223858 9.49998 0.5C9.49998 0.776142 9.27612 1 8.99998 1H7.99998V2.11922C9.09832 2.20409 10.119 2.56622 10.992 3.13572C11.0116 3.10851 11.0336 3.08252 11.058 3.05806L11.858 2.25806C12.1021 2.01398 12.4978 2.01398 12.7419 2.25806C12.986 2.50214 12.986 2.89786 12.7419 3.14194L11.967 3.91682C13.1595 5.07925 13.9 6.70314 13.9 8.49998C13.9 12.0346 11.0346 14.9 7.49998 14.9C3.96535 14.9 1.09998 12.0346 1.09998 8.49998C1.09998 5.13362 3.69904 2.3743 6.99998 2.11922V1H5.99998C5.72383 1 5.49998 0.776142 5.49998 0.5ZM2.09998 8.49998C2.09998 5.51764 4.51764 3.09998 7.49998 3.09998C10.4823 3.09998 12.9 5.51764 12.9 8.49998C12.9 11.4823 10.4823 13.9 7.49998 13.9C4.51764 13.9 2.09998 11.4823 2.09998 8.49998ZM7.99998 4.5C7.99998 4.22386 7.77612 4 7.49998 4C7.22383 4 6.99998 4.22386 6.99998 4.5V9.5C6.99998 9.77614 7.22383 10 7.49998 10C7.77612 10 7.99998 9.77614 7.99998 9.5V4.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),qve=["title"],Kve=["title"],Gve=["title"];function bg(){return bg=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yve(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var hJe=function(t){var n=t.title,r=EA(t,qve);return F.createElement("svg",bg({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},r),n&&F.createElement("title",null,n),F.createElement("path",{fill:"#D80027",d:"M0 0h513v342H0z"}),F.createElement("path",{d:"m226.8 239.2-9.7-15.6-17.9 4.4 11.9-14.1-9.7-15.6 17.1 6.9 11.8-14.1-1.3 18.4 17.1 6.9-17.9 4.4zM290.6 82l-10.1 15.4 11.6 14.3-17.7-4.8-10.1 15.5-1-18.4-17.7-4.8 17.2-6.6-1-18.4 11.6 14.3zm-54.4-56.6-2 18.3 16.8 7.6-18 3.8-2 18.3-9.2-16-17.9 3.8 12.3-13.7-9.2-15.9 16.8 7.5zm56.6 136.4-14.9 10.9 5.8 17.5-14.9-10.8-14.9 11 5.6-17.6-14.9-10.7 18.4-.1 5.6-17.6 5.8 17.5zM115 46.3l17.3 53.5h56.2l-45.4 32.9 17.3 53.5-45.4-33-45.5 33 17.4-53.5-45.5-32.9h56.3z",fill:"#FFDA44"}))},pJe=function(t){var n=t.title,r=EA(t,Kve);return F.createElement("svg",bg({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 513 342"},r),n&&F.createElement("title",null,n),F.createElement("g",{fill:"#FFF"},F.createElement("path",{d:"M0 0h513v341.3H0V0z"}),F.createElement("path",{d:"M311.7 230 513 341.3v-31.5L369.3 230h-57.6zM200.3 111.3 0 0v31.5l143.7 79.8h56.6z"})),F.createElement("path",{d:"M393.8 230 513 295.7V230H393.8zm-82.1 0L513 341.3v-31.5L369.3 230h-57.6zm146.9 111.3-147-81.7v81.7h147zM90.3 230 0 280.2V230h90.3zm110 14.2v97.2H25.5l174.8-97.2zm-82.1-132.9L0 45.6v65.7h118.2zm82.1 0L0 0v31.5l143.7 79.8h56.6zM53.4 0l147 81.7V0h-147zm368.3 111.3L513 61.1v50.2h-91.3zm-110-14.2V0h174.9L311.7 97.1z",fill:"#0052B4"}),F.createElement("g",{fill:"#D80027"},F.createElement("path",{d:"M288 0h-64v138.7H0v64h224v138.7h64V202.7h224v-64H288V0z"}),F.createElement("path",{d:"M311.7 230 513 341.3v-31.5L369.3 230h-57.6zm-168 0L0 309.9v31.5L200.3 230h-56.6zm56.6-118.7L0 0v31.5l143.7 79.8h56.6zm168 0L513 31.5V0L311.7 111.3h56.6z"})))},gJe=function(t){var n=t.title,r=EA(t,Gve);return F.createElement("svg",bg({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 900 600"},r),n&&F.createElement("title",null,n),F.createElement("path",{fill:"#FFF",d:"M0 0h900v600H0z"}),F.createElement("g",{transform:"rotate(-56.31)"},F.createElement("path",{d:"M-75 228.3H75m-150 37.5H75m-150 37.5H75m-150 475H75m-150 37.5H75m-150 37.5H75",stroke:"#000",strokeWidth:25}),F.createElement("path",{stroke:"#FFF",strokeWidth:12.5,d:"M0 753.3v125"}),F.createElement("circle",{fill:"#ca163a",cy:540.8,r:150}),F.createElement("path",{fill:"#0e4896",d:"M0 390.8c-41.4 0-75 33.6-75 75s33.6 75 75 75 75 33.6 75 75-33.6 75-75 75c-82.8 0-150-67.2-150-150s67.2-150 150-150z"})),F.createElement("path",{d:"m231.56 535.73-83.205-124.808M262.76 514.928l-83.205-124.807m114.407 104.006-83.205-124.808m478.43-138.675-83.205-124.807M720.39 209.843 637.184 85.036m114.407 104.006L668.386 64.234",stroke:"#000",strokeWidth:25}),F.createElement("path",{stroke:"#FFF",strokeWidth:12.5,d:"m205.6 462.897 31.202-20.8m389.981-259.989 36.444-24.296m31.202-20.801 31.202-20.801"}))};const Zve=["top","right","bottom","left"],Dl=Math.min,Ro=Math.max,Cb=Math.round,xy=Math.floor,$l=e=>({x:e,y:e}),Xve={left:"right",right:"left",bottom:"top",top:"bottom"},Qve={start:"end",end:"start"};function FE(e,t,n){return Ro(e,Dl(t,n))}function xu(e,t){return typeof e=="function"?e(t):e}function wu(e){return e.split("-")[0]}function Bh(e){return e.split("-")[1]}function OA(e){return e==="x"?"y":"x"}function AA(e){return e==="y"?"height":"width"}function Uh(e){return["top","bottom"].includes(wu(e))?"y":"x"}function PA(e){return OA(Uh(e))}function Jve(e,t,n){n===void 0&&(n=!1);const r=Bh(e),i=PA(e),o=AA(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Eb(a)),[a,Eb(a)]}function eye(e){const t=Eb(e);return[jE(e),t,jE(t)]}function jE(e){return e.replace(/start|end/g,t=>Qve[t])}function tye(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function nye(e,t,n,r){const i=Bh(e);let o=tye(wu(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(jE)))),o}function Eb(e){return e.replace(/left|right|bottom|top/g,t=>Xve[t])}function rye(e){return{top:0,right:0,bottom:0,left:0,...e}}function Oz(e){return typeof e!="number"?rye(e):{top:e,right:e,bottom:e,left:e}}function Ob(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function T9(e,t,n){let{reference:r,floating:i}=e;const o=Uh(t),a=PA(t),s=AA(a),u=wu(t),l=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let p;switch(u){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Bh(t)){case"start":p[a]-=h*(n&&l?-1:1);break;case"end":p[a]+=h*(n&&l?-1:1);break}return p}const iye=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=T9(l,r,u),h=r,p={},m=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:u}=t,{element:l,padding:c=0}=xu(e,t)||{};if(l==null)return{};const f=Oz(c),h={x:n,y:r},p=PA(i),m=AA(p),y=await a.getDimensions(l),b=p==="y",w=b?"top":"left",x=b?"bottom":"right",S=b?"clientHeight":"clientWidth",O=o.reference[m]+o.reference[p]-h[p]-o.floating[m],E=h[p]-o.reference[p],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let P=C?C[S]:0;(!P||!await(a.isElement==null?void 0:a.isElement(C)))&&(P=s.floating[S]||o.floating[m]);const M=O/2-E/2,N=P/2-y[m]/2-1,B=Dl(f[w],N),V=Dl(f[x],N),W=B,ne=P-y[m]-V,Z=P/2-y[m]/2+M,q=FE(W,Z,ne),G=!u.arrow&&Bh(i)!=null&&Z!==q&&o.reference[m]/2-(ZW<=0)){var N,B;const W=(((N=o.flip)==null?void 0:N.index)||0)+1,ne=E[W];if(ne)return{data:{index:W,overflows:M},reset:{placement:ne}};let Z=(B=M.filter(q=>q.overflows[0]<=0).sort((q,G)=>q.overflows[1]-G.overflows[1])[0])==null?void 0:B.placement;if(!Z)switch(p){case"bestFit":{var V;const q=(V=M.map(G=>[G.placement,G.overflows.filter(H=>H>0).reduce((H,j)=>H+j,0)]).sort((G,H)=>G[1]-H[1])[0])==null?void 0:V[0];q&&(Z=q);break}case"initialPlacement":Z=s;break}if(i!==Z)return{reset:{placement:Z}}}return{}}}};function M9(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function R9(e){return Zve.some(t=>e[t]>=0)}const sye=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=xu(e,t);switch(r){case"referenceHidden":{const o=await xg(t,{...i,elementContext:"reference"}),a=M9(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:R9(a)}}}case"escaped":{const o=await xg(t,{...i,altBoundary:!0}),a=M9(o,n.floating);return{data:{escapedOffsets:a,escaped:R9(a)}}}default:return{}}}}};async function uye(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=wu(n),s=Bh(n),u=Uh(n)==="y",l=["left","top"].includes(a)?-1:1,c=o&&u?-1:1,f=xu(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),u?{x:p*c,y:h*l}:{x:h*l,y:p*c}}const lye=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,u=await uye(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},cye=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:b=>{let{x:w,y:x}=b;return{x:w,y:x}}},...u}=xu(e,t),l={x:n,y:r},c=await xg(t,u),f=Uh(wu(i)),h=OA(f);let p=l[h],m=l[f];if(o){const b=h==="y"?"top":"left",w=h==="y"?"bottom":"right",x=p+c[b],S=p-c[w];p=FE(x,p,S)}if(a){const b=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=m+c[b],S=m-c[w];m=FE(x,m,S)}const y=s.fn({...t,[h]:p,[f]:m});return{...y,data:{x:y.x-n,y:y.y-r}}}}},fye=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=xu(e,t),c={x:n,y:r},f=Uh(i),h=OA(f);let p=c[h],m=c[f];const y=xu(s,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){const S=h==="y"?"height":"width",O=o.reference[h]-o.floating[S]+b.mainAxis,E=o.reference[h]+o.reference[S]-b.mainAxis;pE&&(p=E)}if(l){var w,x;const S=h==="y"?"width":"height",O=["top","left"].includes(wu(i)),E=o.reference[f]-o.floating[S]+(O&&((w=a.offset)==null?void 0:w[f])||0)+(O?0:b.crossAxis),C=o.reference[f]+o.reference[S]+(O?0:((x=a.offset)==null?void 0:x[f])||0)-(O?b.crossAxis:0);mC&&(m=C)}return{[h]:p,[f]:m}}}},dye=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:a=()=>{},...s}=xu(e,t),u=await xg(t,s),l=wu(n),c=Bh(n),f=Uh(n)==="y",{width:h,height:p}=r.floating;let m,y;l==="top"||l==="bottom"?(m=l,y=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(y=l,m=c==="end"?"top":"bottom");const b=p-u[m],w=h-u[y],x=!t.middlewareData.shift;let S=b,O=w;if(f){const C=h-u.left-u.right;O=c||x?Dl(w,C):C}else{const C=p-u.top-u.bottom;S=c||x?Dl(b,C):C}if(x&&!c){const C=Ro(u.left,0),P=Ro(u.right,0),M=Ro(u.top,0),N=Ro(u.bottom,0);f?O=h-2*(C!==0||P!==0?C+P:Ro(u.left,u.right)):S=p-2*(M!==0||N!==0?M+N:Ro(u.top,u.bottom))}await a({...t,availableWidth:O,availableHeight:S});const E=await i.getDimensions(o.floating);return h!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function Il(e){return Az(e)?(e.nodeName||"").toLowerCase():"#document"}function jo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ku(e){var t;return(t=(Az(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Az(e){return e instanceof Node||e instanceof jo(e).Node}function _u(e){return e instanceof Element||e instanceof jo(e).Element}function Ms(e){return e instanceof HTMLElement||e instanceof jo(e).HTMLElement}function D9(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jo(e).ShadowRoot}function Rm(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=va(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function hye(e){return["table","td","th"].includes(Il(e))}function kA(e){const t=TA(),n=va(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(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 pye(e){let t=Qd(e);for(;Ms(t)&&!Aw(t);){if(kA(t))return t;t=Qd(t)}return null}function TA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Aw(e){return["html","body","#document"].includes(Il(e))}function va(e){return jo(e).getComputedStyle(e)}function Pw(e){return _u(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Qd(e){if(Il(e)==="html")return e;const t=e.assignedSlot||e.parentNode||D9(e)&&e.host||ku(e);return D9(t)?t.host:t}function Pz(e){const t=Qd(e);return Aw(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ms(t)&&Rm(t)?t:Pz(t)}function wg(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Pz(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=jo(i);return o?t.concat(a,a.visualViewport||[],Rm(i)?i:[],a.frameElement&&n?wg(a.frameElement):[]):t.concat(i,wg(i,[],n))}function kz(e){const t=va(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ms(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Cb(n)!==o||Cb(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function MA(e){return _u(e)?e:e.contextElement}function Md(e){const t=MA(e);if(!Ms(t))return $l(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=kz(t);let a=(o?Cb(n.width):n.width)/r,s=(o?Cb(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const gye=$l(0);function Tz(e){const t=jo(e);return!TA()||!t.visualViewport?gye:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mye(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jo(e)?!1:t}function Jc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=MA(e);let a=$l(1);t&&(r?_u(r)&&(a=Md(r)):a=Md(e));const s=mye(o,n,r)?Tz(o):$l(0);let u=(i.left+s.x)/a.x,l=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const h=jo(o),p=r&&_u(r)?jo(r):r;let m=h,y=m.frameElement;for(;y&&r&&p!==m;){const b=Md(y),w=y.getBoundingClientRect(),x=va(y),S=w.left+(y.clientLeft+parseFloat(x.paddingLeft))*b.x,O=w.top+(y.clientTop+parseFloat(x.paddingTop))*b.y;u*=b.x,l*=b.y,c*=b.x,f*=b.y,u+=S,l+=O,m=jo(y),y=m.frameElement}}return Ob({width:c,height:f,x:u,y:l})}const vye=[":popover-open",":modal"];function Mz(e){return vye.some(t=>{try{return e.matches(t)}catch{return!1}})}function yye(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=ku(r),s=t?Mz(t.floating):!1;if(r===a||s&&o)return n;let u={scrollLeft:0,scrollTop:0},l=$l(1);const c=$l(0),f=Ms(r);if((f||!f&&!o)&&((Il(r)!=="body"||Rm(a))&&(u=Pw(r)),Ms(r))){const h=Jc(r);l=Md(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+c.x,y:n.y*l.y-u.scrollTop*l.y+c.y}}function bye(e){return Array.from(e.getClientRects())}function Rz(e){return Jc(ku(e)).left+Pw(e).scrollLeft}function xye(e){const t=ku(e),n=Pw(e),r=e.ownerDocument.body,i=Ro(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ro(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Rz(e);const s=-n.scrollTop;return va(r).direction==="rtl"&&(a+=Ro(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function wye(e,t){const n=jo(e),r=ku(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const l=TA();(!l||l&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}function _ye(e,t){const n=Jc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Ms(e)?Md(e):$l(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,l=r*o.y;return{width:a,height:s,x:u,y:l}}function $9(e,t,n){let r;if(t==="viewport")r=wye(e,n);else if(t==="document")r=xye(ku(e));else if(_u(t))r=_ye(t,n);else{const i=Tz(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Ob(r)}function Dz(e,t){const n=Qd(e);return n===t||!_u(n)||Aw(n)?!1:va(n).position==="fixed"||Dz(n,t)}function Sye(e,t){const n=t.get(e);if(n)return n;let r=wg(e,[],!1).filter(s=>_u(s)&&Il(s)!=="body"),i=null;const o=va(e).position==="fixed";let a=o?Qd(e):e;for(;_u(a)&&!Aw(a);){const s=va(a),u=kA(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Rm(a)&&!u&&Dz(e,a))?r=r.filter(c=>c!==a):i=s,a=Qd(a)}return t.set(e,r),r}function Cye(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Sye(t,this._c):[].concat(n),r],s=a[0],u=a.reduce((l,c)=>{const f=$9(t,c,i);return l.top=Ro(f.top,l.top),l.right=Dl(f.right,l.right),l.bottom=Dl(f.bottom,l.bottom),l.left=Ro(f.left,l.left),l},$9(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Eye(e){const{width:t,height:n}=kz(e);return{width:t,height:n}}function Oye(e,t,n){const r=Ms(t),i=ku(t),o=n==="fixed",a=Jc(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const u=$l(0);if(r||!r&&!o)if((Il(t)!=="body"||Rm(i))&&(s=Pw(t)),r){const f=Jc(t,!0,o,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else i&&(u.x=Rz(i));const l=a.left+s.scrollLeft-u.x,c=a.top+s.scrollTop-u.y;return{x:l,y:c,width:a.width,height:a.height}}function I9(e,t){return!Ms(e)||va(e).position==="fixed"?null:t?t(e):e.offsetParent}function $z(e,t){const n=jo(e);if(!Ms(e)||Mz(e))return n;let r=I9(e,t);for(;r&&hye(r)&&va(r).position==="static";)r=I9(r,t);return r&&(Il(r)==="html"||Il(r)==="body"&&va(r).position==="static"&&!kA(r))?n:r||pye(e)||n}const Aye=async function(e){const t=this.getOffsetParent||$z,n=this.getDimensions;return{reference:Oye(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function Pye(e){return va(e).direction==="rtl"}const kye={convertOffsetParentRelativeRectToViewportRelativeRect:yye,getDocumentElement:ku,getClippingRect:Cye,getOffsetParent:$z,getElementRects:Aye,getClientRects:bye,getDimensions:Eye,getScale:Md,isElement:_u,isRTL:Pye};function Tye(e,t){let n=null,r;const i=ku(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const{left:l,top:c,width:f,height:h}=e.getBoundingClientRect();if(s||t(),!f||!h)return;const p=xy(c),m=xy(i.clientWidth-(l+f)),y=xy(i.clientHeight-(c+h)),b=xy(l),x={rootMargin:-p+"px "+-m+"px "+-y+"px "+-b+"px",threshold:Ro(0,Dl(1,u))||1};let S=!0;function O(E){const C=E[0].intersectionRatio;if(C!==u){if(!S)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(O,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,x)}n.observe(e)}return a(!0),o}function Mye(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=MA(e),c=i||o?[...l?wg(l):[],...wg(t)]:[];c.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const f=l&&s?Tye(l,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(w=>{let[x]=w;x&&x.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),l&&!u&&p.observe(l),p.observe(t));let m,y=u?Jc(e):null;u&&b();function b(){const w=Jc(e);y&&(w.x!==y.x||w.y!==y.y||w.width!==y.width||w.height!==y.height)&&n(),y=w,m=requestAnimationFrame(b)}return n(),()=>{var w;c.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),f?.(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(m)}}const Rye=cye,Dye=aye,$ye=dye,Iye=sye,N9=oye,Nye=fye,Lye=(e,t,n)=>{const r=new Map,i={platform:kye,...n},o={...i.platform,_c:r};return iye(e,t,{...i,platform:o})},Fye=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?N9({element:r.current,padding:i}).fn(n):{}:r?N9({element:r,padding:i}).fn(n):{}}}};var v1=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Ab(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ab(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Ab(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Iz(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function L9(e,t){const n=Iz(e);return Math.round(t*n)/n}function F9(e){const t=v.useRef(e);return v1(()=>{t.current=e}),t}function jye(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:u,open:l}=e,[c,f]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=v.useState(r);Ab(h,r)||p(r);const[m,y]=v.useState(null),[b,w]=v.useState(null),x=v.useCallback(H=>{H!==C.current&&(C.current=H,y(H))},[]),S=v.useCallback(H=>{H!==P.current&&(P.current=H,w(H))},[]),O=o||m,E=a||b,C=v.useRef(null),P=v.useRef(null),M=v.useRef(c),N=u!=null,B=F9(u),V=F9(i),W=v.useCallback(()=>{if(!C.current||!P.current)return;const H={placement:t,strategy:n,middleware:h};V.current&&(H.platform=V.current),Lye(C.current,P.current,H).then(j=>{const K={...j,isPositioned:!0};ne.current&&!Ab(M.current,K)&&(M.current=K,Au.flushSync(()=>{f(K)}))})},[h,t,n,V]);v1(()=>{l===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,f(H=>({...H,isPositioned:!1})))},[l]);const ne=v.useRef(!1);v1(()=>(ne.current=!0,()=>{ne.current=!1}),[]),v1(()=>{if(O&&(C.current=O),E&&(P.current=E),O&&E){if(B.current)return B.current(O,E,W);W()}},[O,E,W,B,N]);const Z=v.useMemo(()=>({reference:C,floating:P,setReference:x,setFloating:S}),[x,S]),q=v.useMemo(()=>({reference:O,floating:E}),[O,E]),G=v.useMemo(()=>{const H={position:n,left:0,top:0};if(!q.floating)return H;const j=L9(q.floating,c.x),K=L9(q.floating,c.y);return s?{...H,transform:"translate("+j+"px, "+K+"px)",...Iz(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:K}},[n,s,q.floating,c.x,c.y]);return v.useMemo(()=>({...c,update:W,refs:Z,elements:q,floatingStyles:G}),[c,W,Z,q,G])}var Bye="Arrow",Nz=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return I.jsx(mt.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:I.jsx("polygon",{points:"0,0 30,0 15,10"})})});Nz.displayName=Bye;var Uye=Nz;function zye(e){const[t,n]=v.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var RA="Popper",[Lz,zl]=Di(RA),[Wye,Fz]=Lz(RA),jz=e=>{const{__scopePopper:t,children:n}=e,[r,i]=v.useState(null);return I.jsx(Wye,{scope:t,anchor:r,onAnchorChange:i,children:n})};jz.displayName=RA;var Bz="PopperAnchor",Uz=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Fz(Bz,n),a=v.useRef(null),s=Nt(t,a);return v.useEffect(()=>{o.onAnchorChange(r?.current||a.current)}),r?null:I.jsx(mt.div,{...i,ref:s})});Uz.displayName=Bz;var DA="PopperContent",[Vye,Hye]=Lz(DA),zz=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:c=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...y}=e,b=Fz(DA,n),[w,x]=v.useState(null),S=Nt(t,me=>x(me)),[O,E]=v.useState(null),C=zye(O),P=C?.width??0,M=C?.height??0,N=r+(o!=="center"?"-"+o:""),B=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},V=Array.isArray(l)?l:[l],W=V.length>0,ne={padding:B,boundary:V.filter(Kye),altBoundary:W},{refs:Z,floatingStyles:q,placement:G,isPositioned:H,middlewareData:j}=jye({strategy:"fixed",placement:N,whileElementsMounted:(...me)=>Mye(...me,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[lye({mainAxis:i+M,alignmentAxis:a}),u&&Rye({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Nye():void 0,...ne}),u&&Dye({...ne}),$ye({...ne,apply:({elements:me,rects:Ze,availableWidth:Ae,availableHeight:Le})=>{const{width:$e,height:be}=Ze.reference,bt=me.floating.style;bt.setProperty("--radix-popper-available-width",`${Ae}px`),bt.setProperty("--radix-popper-available-height",`${Le}px`),bt.setProperty("--radix-popper-anchor-width",`${$e}px`),bt.setProperty("--radix-popper-anchor-height",`${be}px`)}}),O&&Fye({element:O,padding:s}),Gye({arrowWidth:P,arrowHeight:M}),h&&Iye({strategy:"referenceHidden",...ne})]}),[K,Y]=Hz(G),oe=Vr(m);On(()=>{H&&oe?.()},[H,oe]);const X=j.arrow?.x,Q=j.arrow?.y,ue=j.arrow?.centerOffset!==0,[de,Se]=v.useState();return On(()=>{w&&Se(window.getComputedStyle(w).zIndex)},[w]),I.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:H?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:I.jsx(Vye,{scope:n,placedSide:K,onArrowChange:E,arrowX:X,arrowY:Q,shouldHideArrow:ue,children:I.jsx(mt.div,{"data-side":K,"data-align":Y,...y,ref:S,style:{...y.style,animation:H?void 0:"none"}})})})});zz.displayName=DA;var Wz="PopperArrow",qye={top:"bottom",right:"left",bottom:"top",left:"right"},Vz=v.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Hye(Wz,r),a=qye[o.placedSide];return I.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:I.jsx(Uye,{...i,ref:n,style:{...i.style,display:"block"}})})});Vz.displayName=Wz;function Kye(e){return e!==null}var Gye=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,c]=Hz(n),f={start:"0%",center:"50%",end:"100%"}[c],h=(i.arrow?.x??0)+s/2,p=(i.arrow?.y??0)+u/2;let m="",y="";return l==="bottom"?(m=a?f:`${h}px`,y=`${-u}px`):l==="top"?(m=a?f:`${h}px`,y=`${r.floating.height+u}px`):l==="right"?(m=`${-u}px`,y=a?f:`${p}px`):l==="left"&&(m=`${r.floating.width+u}px`,y=a?f:`${p}px`),{data:{x:m,y}}}});function Hz(e){const[t,n="center"]=e.split("-");return[t,n]}var kw=jz,Dm=Uz,Tw=zz,Mw=Vz;function Yye(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var $m=e=>{const{present:t,children:n}=e,r=Zye(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,Xye(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};$m.displayName="Presence";function Zye(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=Yye(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=wy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=wy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=wy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=wy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function wy(e){return e?.animationName||"none"}function Xye(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var BE=["Enter"," "],Qye=["ArrowDown","PageUp","Home"],qz=["ArrowUp","PageDown","End"],Jye=[...Qye,...qz],e1e={ltr:[...BE,"ArrowRight"],rtl:[...BE,"ArrowLeft"]},t1e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Im="Menu",[_g,n1e,r1e]=oA(Im),[pf,Kz]=Di(Im,[r1e,zl,fw]),Rw=zl(),Gz=fw(),[i1e,gf]=pf(Im),[o1e,Nm]=pf(Im),Yz=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=Rw(t),[u,l]=v.useState(null),c=v.useRef(!1),f=Vr(o),h=Em(i);return v.useEffect(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),I.jsx(kw,{...s,children:I.jsx(i1e,{scope:t,open:n,onOpenChange:f,content:u,onContentChange:l,children:I.jsx(o1e,{scope:t,onClose:v.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:h,modal:a,children:r})})})};Yz.displayName=Im;var a1e="MenuAnchor",$A=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Rw(n);return I.jsx(Dm,{...i,...r,ref:t})});$A.displayName=a1e;var IA="MenuPortal",[s1e,Zz]=pf(IA,{forceMount:void 0}),Xz=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=gf(IA,t);return I.jsx(s1e,{scope:t,forceMount:n,children:I.jsx($m,{present:n||o.open,children:I.jsx(jh,{asChild:!0,container:i,children:r})})})};Xz.displayName=IA;var ha="MenuContent",[u1e,NA]=pf(ha),Qz=v.forwardRef((e,t)=>{const n=Zz(ha,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=gf(ha,e.__scopeMenu),a=Nm(ha,e.__scopeMenu);return I.jsx(_g.Provider,{scope:e.__scopeMenu,children:I.jsx($m,{present:r||o.open,children:I.jsx(_g.Slot,{scope:e.__scopeMenu,children:a.modal?I.jsx(l1e,{...i,ref:t}):I.jsx(c1e,{...i,ref:t})})})})}),l1e=v.forwardRef((e,t)=>{const n=gf(ha,e.__scopeMenu),r=v.useRef(null),i=Nt(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Mm(o)},[]),I.jsx(LA,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ye(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),c1e=v.forwardRef((e,t)=>{const n=gf(ha,e.__scopeMenu);return I.jsx(LA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),LA=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:m,...y}=e,b=gf(ha,n),w=Nm(ha,n),x=Rw(n),S=Gz(n),O=n1e(n),[E,C]=v.useState(null),P=v.useRef(null),M=Nt(t,P,b.onContentChange),N=v.useRef(0),B=v.useRef(""),V=v.useRef(0),W=v.useRef(null),ne=v.useRef("right"),Z=v.useRef(0),q=m?Tm:v.Fragment,G=m?{as:Pl,allowPinchZoom:!0}:void 0,H=K=>{const Y=B.current+K,oe=O().filter(me=>!me.disabled),X=document.activeElement,Q=oe.find(me=>me.ref.current===X)?.textValue,ue=oe.map(me=>me.textValue),de=_1e(ue,Y,Q),Se=oe.find(me=>me.textValue===de)?.ref.current;(function me(Ze){B.current=Ze,window.clearTimeout(N.current),Ze!==""&&(N.current=window.setTimeout(()=>me(""),1e3))})(Y),Se&&setTimeout(()=>Se.focus())};v.useEffect(()=>()=>window.clearTimeout(N.current),[]),Ew();const j=v.useCallback(K=>ne.current===W.current?.side&&C1e(K,W.current?.area),[]);return I.jsx(u1e,{scope:n,searchRef:B,onItemEnter:v.useCallback(K=>{j(K)&&K.preventDefault()},[j]),onItemLeave:v.useCallback(K=>{j(K)||(P.current?.focus(),C(null))},[j]),onTriggerLeave:v.useCallback(K=>{j(K)&&K.preventDefault()},[j]),pointerGraceTimerRef:V,onPointerGraceIntentChange:v.useCallback(K=>{W.current=K},[]),children:I.jsx(q,{...G,children:I.jsx(km,{asChild:!0,trapped:i,onMountAutoFocus:Ye(o,K=>{K.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:I.jsx(OB,{asChild:!0,...S,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:Ye(u,K=>{w.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:I.jsx(Tw,{role:"menu","aria-orientation":"vertical","data-state":pW(b.open),"data-radix-menu-content":"",dir:w.dir,...x,...y,ref:M,style:{outline:"none",...y.style},onKeyDown:Ye(y.onKeyDown,K=>{const oe=K.target.closest("[data-radix-menu-content]")===K.currentTarget,X=K.ctrlKey||K.altKey||K.metaKey,Q=K.key.length===1;oe&&(K.key==="Tab"&&K.preventDefault(),!X&&Q&&H(K.key));const ue=P.current;if(K.target!==ue||!Jye.includes(K.key))return;K.preventDefault();const Se=O().filter(me=>!me.disabled).map(me=>me.ref.current);qz.includes(K.key)&&Se.reverse(),x1e(Se)}),onBlur:Ye(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(N.current),B.current="")}),onPointerMove:Ye(e.onPointerMove,Sg(K=>{const Y=K.target,oe=Z.current!==K.clientX;if(K.currentTarget.contains(Y)&&oe){const X=K.clientX>Z.current?"right":"left";ne.current=X,Z.current=K.clientX}}))})})})})})})});Qz.displayName=ha;var f1e="MenuGroup",FA=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return I.jsx(mt.div,{role:"group",...r,ref:t})});FA.displayName=f1e;var d1e="MenuLabel",Jz=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return I.jsx(mt.div,{...r,ref:t})});Jz.displayName=d1e;var Pb="MenuItem",j9="menu.itemSelect",Dw=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=v.useRef(null),a=Nm(Pb,e.__scopeMenu),s=NA(Pb,e.__scopeMenu),u=Nt(t,o),l=v.useRef(!1),c=()=>{const f=o.current;if(!n&&f){const h=new CustomEvent(j9,{bubbles:!0,cancelable:!0});f.addEventListener(j9,p=>r?.(p),{once:!0}),zj(f,h),h.defaultPrevented?l.current=!1:a.onClose()}};return I.jsx(eW,{...i,ref:u,disabled:n,onClick:Ye(e.onClick,c),onPointerDown:f=>{e.onPointerDown?.(f),l.current=!0},onPointerUp:Ye(e.onPointerUp,f=>{l.current||f.currentTarget?.click()}),onKeyDown:Ye(e.onKeyDown,f=>{const h=s.searchRef.current!=="";n||h&&f.key===" "||BE.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Dw.displayName=Pb;var eW=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=NA(Pb,n),s=Gz(n),u=v.useRef(null),l=Nt(t,u),[c,f]=v.useState(!1),[h,p]=v.useState("");return v.useEffect(()=>{const m=u.current;m&&p((m.textContent??"").trim())},[o.children]),I.jsx(_g.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:I.jsx(AB,{asChild:!0,...s,focusable:!r,children:I.jsx(mt.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:l,onPointerMove:Ye(e.onPointerMove,Sg(m=>{r?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ye(e.onPointerLeave,Sg(m=>a.onItemLeave(m))),onFocus:Ye(e.onFocus,()=>f(!0)),onBlur:Ye(e.onBlur,()=>f(!1))})})})}),h1e="MenuCheckboxItem",tW=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return I.jsx(aW,{scope:e.__scopeMenu,checked:n,children:I.jsx(Dw,{role:"menuitemcheckbox","aria-checked":kb(n)?"mixed":n,...i,ref:t,"data-state":BA(n),onSelect:Ye(i.onSelect,()=>r?.(kb(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tW.displayName=h1e;var nW="MenuRadioGroup",[p1e,g1e]=pf(nW,{value:void 0,onValueChange:()=>{}}),rW=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Vr(r);return I.jsx(p1e,{scope:e.__scopeMenu,value:n,onValueChange:o,children:I.jsx(FA,{...i,ref:t})})});rW.displayName=nW;var iW="MenuRadioItem",oW=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=g1e(iW,e.__scopeMenu),o=n===i.value;return I.jsx(aW,{scope:e.__scopeMenu,checked:o,children:I.jsx(Dw,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":BA(o),onSelect:Ye(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});oW.displayName=iW;var jA="MenuItemIndicator",[aW,m1e]=pf(jA,{checked:!1}),sW=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=m1e(jA,n);return I.jsx($m,{present:r||kb(o.checked)||o.checked===!0,children:I.jsx(mt.span,{...i,ref:t,"data-state":BA(o.checked)})})});sW.displayName=jA;var v1e="MenuSeparator",uW=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return I.jsx(mt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});uW.displayName=v1e;var y1e="MenuArrow",lW=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Rw(n);return I.jsx(Mw,{...i,...r,ref:t})});lW.displayName=y1e;var b1e="MenuSub",[mJe,cW]=pf(b1e),c0="MenuSubTrigger",fW=v.forwardRef((e,t)=>{const n=gf(c0,e.__scopeMenu),r=Nm(c0,e.__scopeMenu),i=cW(c0,e.__scopeMenu),o=NA(c0,e.__scopeMenu),a=v.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:u}=o,l={__scopeMenu:e.__scopeMenu},c=v.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return v.useEffect(()=>c,[c]),v.useEffect(()=>{const f=s.current;return()=>{window.clearTimeout(f),u(null)}},[s,u]),I.jsx($A,{asChild:!0,...l,children:I.jsx(eW,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":pW(n.open),...e,ref:sw(t,i.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ye(e.onPointerMove,Sg(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:Ye(e.onPointerLeave,Sg(f=>{c();const h=n.content?.getBoundingClientRect();if(h){const p=n.content?.dataset.side,m=p==="right",y=m?-5:5,b=h[m?"left":"right"],w=h[m?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x:b,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:b,y:h.bottom}],side:p}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ye(e.onKeyDown,f=>{const h=o.searchRef.current!=="";e.disabled||h&&f.key===" "||e1e[r.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});fW.displayName=c0;var dW="MenuSubContent",hW=v.forwardRef((e,t)=>{const n=Zz(ha,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=gf(ha,e.__scopeMenu),a=Nm(ha,e.__scopeMenu),s=cW(dW,e.__scopeMenu),u=v.useRef(null),l=Nt(t,u);return I.jsx(_g.Provider,{scope:e.__scopeMenu,children:I.jsx($m,{present:r||o.open,children:I.jsx(_g.Slot,{scope:e.__scopeMenu,children:I.jsx(LA,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{a.isUsingKeyboardRef.current&&u.current?.focus(),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:Ye(e.onFocusOutside,c=>{c.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ye(e.onEscapeKeyDown,c=>{a.onClose(),c.preventDefault()}),onKeyDown:Ye(e.onKeyDown,c=>{const f=c.currentTarget.contains(c.target),h=t1e[a.dir].includes(c.key);f&&h&&(o.onOpenChange(!1),s.trigger?.focus(),c.preventDefault())})})})})})});hW.displayName=dW;function pW(e){return e?"open":"closed"}function kb(e){return e==="indeterminate"}function BA(e){return kb(e)?"indeterminate":e?"checked":"unchecked"}function x1e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function w1e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function _1e(e,t,n){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=w1e(e,Math.max(o,0));i.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function S1e(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=c>r&&n<(l-s)*(r-u)/(c-u)+s&&(i=!i)}return i}function C1e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return S1e(n,t)}function Sg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var E1e=Yz,O1e=$A,A1e=Xz,P1e=Qz,k1e=FA,T1e=Jz,M1e=Dw,R1e=tW,D1e=rW,$1e=oW,I1e=sW,N1e=uW,L1e=lW,F1e=fW,j1e=hW,UA="DropdownMenu",[B1e,vJe]=Di(UA,[Kz]),Yi=Kz(),[U1e,gW]=B1e(UA),mW=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,u=Yi(t),l=v.useRef(null),[c=!1,f]=Ts({prop:i,defaultProp:o,onChange:a});return I.jsx(U1e,{scope:t,triggerId:Lo(),triggerRef:l,contentId:Lo(),open:c,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),modal:s,children:I.jsx(E1e,{...u,open:c,onOpenChange:f,dir:r,modal:s,children:n})})};mW.displayName=UA;var vW="DropdownMenuTrigger",yW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=gW(vW,n),a=Yi(n);return I.jsx(O1e,{asChild:!0,...a,children:I.jsx(mt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:sw(t,o.triggerRef),onPointerDown:Ye(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Ye(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});yW.displayName=vW;var z1e="DropdownMenuPortal",bW=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Yi(t);return I.jsx(A1e,{...r,...n})};bW.displayName=z1e;var xW="DropdownMenuContent",wW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=gW(xW,n),o=Yi(n),a=v.useRef(!1);return I.jsx(P1e,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ye(e.onCloseAutoFocus,s=>{a.current||i.triggerRef.current?.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Ye(e.onInteractOutside,s=>{const u=s.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,c=u.button===2||l;(!i.modal||c)&&(a.current=!0)}),style:{...e.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)"}})});wW.displayName=xW;var W1e="DropdownMenuGroup",_W=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(k1e,{...i,...r,ref:t})});_W.displayName=W1e;var V1e="DropdownMenuLabel",SW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(T1e,{...i,...r,ref:t})});SW.displayName=V1e;var H1e="DropdownMenuItem",CW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(M1e,{...i,...r,ref:t})});CW.displayName=H1e;var q1e="DropdownMenuCheckboxItem",EW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(R1e,{...i,...r,ref:t})});EW.displayName=q1e;var K1e="DropdownMenuRadioGroup",G1e=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(D1e,{...i,...r,ref:t})});G1e.displayName=K1e;var Y1e="DropdownMenuRadioItem",OW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx($1e,{...i,...r,ref:t})});OW.displayName=Y1e;var Z1e="DropdownMenuItemIndicator",AW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(I1e,{...i,...r,ref:t})});AW.displayName=Z1e;var X1e="DropdownMenuSeparator",PW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(N1e,{...i,...r,ref:t})});PW.displayName=X1e;var Q1e="DropdownMenuArrow",J1e=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(L1e,{...i,...r,ref:t})});J1e.displayName=Q1e;var ebe="DropdownMenuSubTrigger",kW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(F1e,{...i,...r,ref:t})});kW.displayName=ebe;var tbe="DropdownMenuSubContent",TW=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Yi(n);return I.jsx(j1e,{...i,...r,ref:t,style:{...e.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)"}})});TW.displayName=tbe;var yJe=mW,bJe=yW,xJe=bW,wJe=wW,_Je=_W,SJe=SW,CJe=CW,EJe=EW,OJe=OW,AJe=AW,PJe=PW,kJe=kW,TJe=TW;function nbe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var MW=e=>{const{present:t,children:n}=e,r=rbe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,ibe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};MW.displayName="Presence";function rbe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=nbe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=_y(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=_y(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=_y(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=_y(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function _y(e){return e?.animationName||"none"}function ibe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zA="Collapsible",[obe,MJe]=Di(zA),[abe,WA]=obe(zA),RW=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[u=!1,l]=Ts({prop:r,defaultProp:i,onChange:a});return I.jsx(abe,{scope:n,disabled:o,contentId:Lo(),open:u,onOpenToggle:v.useCallback(()=>l(c=>!c),[l]),children:I.jsx(mt.div,{"data-state":HA(u),"data-disabled":o?"":void 0,...s,ref:t})})});RW.displayName=zA;var DW="CollapsibleTrigger",sbe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=WA(DW,n);return I.jsx(mt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":HA(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Ye(e.onClick,i.onOpenToggle)})});sbe.displayName=DW;var VA="CollapsibleContent",ube=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=WA(VA,e.__scopeCollapsible);return I.jsx(MW,{present:n||i.open,children:({present:o})=>I.jsx(lbe,{...r,ref:t,present:o})})});ube.displayName=VA;var lbe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,a=WA(VA,n),[s,u]=v.useState(r),l=v.useRef(null),c=Nt(t,l),f=v.useRef(0),h=f.current,p=v.useRef(0),m=p.current,y=a.open||s,b=v.useRef(y),w=v.useRef(void 0);return v.useEffect(()=>{const x=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(x)},[]),On(()=>{const x=l.current;if(x){w.current=w.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const S=x.getBoundingClientRect();f.current=S.height,p.current=S.width,b.current||(x.style.transitionDuration=w.current.transitionDuration,x.style.animationName=w.current.animationName),u(r)}},[a.open,r]),I.jsx(mt.div,{"data-state":HA(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!y,...o,ref:c,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:y&&i})});function HA(e){return e?"open":"closed"}var RJe=RW;function cbe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var qA=e=>{const{present:t,children:n}=e,r=fbe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,dbe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};qA.displayName="Presence";function fbe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=cbe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Sy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Sy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=Sy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=Sy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Sy(e){return e?.animationName||"none"}function dbe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hbe="VisuallyHidden",KA=v.forwardRef((e,t)=>I.jsx(mt.span,{...e,ref:t,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",...e.style}}));KA.displayName=hbe;var pbe=KA,[$w,DJe]=Di("Tooltip",[zl]),Iw=zl(),$W="TooltipProvider",gbe=700,UE="tooltip.open",[mbe,GA]=$w($W),IW=e=>{const{__scopeTooltip:t,delayDuration:n=gbe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[a,s]=v.useState(!0),u=v.useRef(!1),l=v.useRef(0);return v.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),I.jsx(mbe,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(l.current),s(!1)},[]),onClose:v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:v.useCallback(c=>{u.current=c},[]),disableHoverableContent:i,children:o})};IW.displayName=$W;var Nw="Tooltip",[vbe,Lm]=$w(Nw),NW=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,u=GA(Nw,e.__scopeTooltip),l=Iw(t),[c,f]=v.useState(null),h=Lo(),p=v.useRef(0),m=a??u.disableHoverableContent,y=s??u.delayDuration,b=v.useRef(!1),[w=!1,x]=Ts({prop:r,defaultProp:i,onChange:P=>{P?(u.onOpen(),document.dispatchEvent(new CustomEvent(UE))):u.onClose(),o?.(P)}}),S=v.useMemo(()=>w?b.current?"delayed-open":"instant-open":"closed",[w]),O=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,x(!0)},[x]),E=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),C=v.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,x(!0),p.current=0},y)},[y,x]);return v.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),I.jsx(kw,{...l,children:I.jsx(vbe,{scope:t,contentId:h,open:w,stateAttribute:S,trigger:c,onTriggerChange:f,onTriggerEnter:v.useCallback(()=>{u.isOpenDelayed?C():O()},[u.isOpenDelayed,C,O]),onTriggerLeave:v.useCallback(()=>{m?E():(window.clearTimeout(p.current),p.current=0)},[E,m]),onOpen:O,onClose:E,disableHoverableContent:m,children:n})})};NW.displayName=Nw;var zE="TooltipTrigger",LW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Lm(zE,n),o=GA(zE,n),a=Iw(n),s=v.useRef(null),u=Nt(t,s,i.onTriggerChange),l=v.useRef(!1),c=v.useRef(!1),f=v.useCallback(()=>l.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),I.jsx(Dm,{asChild:!0,...a,children:I.jsx(mt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:u,onPointerMove:Ye(e.onPointerMove,h=>{h.pointerType!=="touch"&&!c.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:Ye(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:Ye(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ye(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:Ye(e.onBlur,i.onClose),onClick:Ye(e.onClick,i.onClose)})})});LW.displayName=zE;var YA="TooltipPortal",[ybe,bbe]=$w(YA,{forceMount:void 0}),FW=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Lm(YA,t);return I.jsx(ybe,{scope:t,forceMount:n,children:I.jsx(qA,{present:n||o.open,children:I.jsx(jh,{asChild:!0,container:i,children:r})})})};FW.displayName=YA;var Jd="TooltipContent",jW=v.forwardRef((e,t)=>{const n=bbe(Jd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Lm(Jd,e.__scopeTooltip);return I.jsx(qA,{present:r||a.open,children:a.disableHoverableContent?I.jsx(BW,{side:i,...o,ref:t}):I.jsx(xbe,{side:i,...o,ref:t})})}),xbe=v.forwardRef((e,t)=>{const n=Lm(Jd,e.__scopeTooltip),r=GA(Jd,e.__scopeTooltip),i=v.useRef(null),o=Nt(t,i),[a,s]=v.useState(null),{trigger:u,onClose:l}=n,c=i.current,{onPointerInTransitChange:f}=r,h=v.useCallback(()=>{s(null),f(!1)},[f]),p=v.useCallback((m,y)=>{const b=m.currentTarget,w={x:m.clientX,y:m.clientY},x=Cbe(w,b.getBoundingClientRect()),S=Ebe(w,x),O=Obe(y.getBoundingClientRect()),E=Pbe([...S,...O]);s(E),f(!0)},[f]);return v.useEffect(()=>()=>h(),[h]),v.useEffect(()=>{if(u&&c){const m=b=>p(b,c),y=b=>p(b,u);return u.addEventListener("pointerleave",m),c.addEventListener("pointerleave",y),()=>{u.removeEventListener("pointerleave",m),c.removeEventListener("pointerleave",y)}}},[u,c,p,h]),v.useEffect(()=>{if(a){const m=y=>{const b=y.target,w={x:y.clientX,y:y.clientY},x=u?.contains(b)||c?.contains(b),S=!Abe(w,a);x?h():S&&(h(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[u,c,a,l,h]),I.jsx(BW,{...e,ref:o})}),[wbe,_be]=$w(Nw,{isInside:!1}),BW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,u=Lm(Jd,n),l=Iw(n),{onClose:c}=u;return v.useEffect(()=>(document.addEventListener(UE,c),()=>document.removeEventListener(UE,c)),[c]),v.useEffect(()=>{if(u.trigger){const f=h=>{h.target?.contains(u.trigger)&&c()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[u.trigger,c]),I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:c,children:I.jsxs(Tw,{"data-state":u.stateAttribute,...l,...s,ref:t,style:{...s.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:[I.jsx(ZO,{children:r}),I.jsx(wbe,{scope:n,isInside:!0,children:I.jsx(pbe,{id:u.contentId,role:"tooltip",children:i||r})})]})})});jW.displayName=Jd;var UW="TooltipArrow",Sbe=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Iw(n);return _be(UW,n).isInside?null:I.jsx(Mw,{...i,...r,ref:t})});Sbe.displayName=UW;function Cbe(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ebe(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Obe(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Abe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=c>r&&n<(l-s)*(r-u)/(c-u)+s&&(i=!i)}return i}function Pbe(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),kbe(t)}function kbe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var $Je=IW,IJe=NW,NJe=LW,LJe=FW,FJe=jW;/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. @@ -184,287 +184,297 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yt=(e,t)=>{const n=v.forwardRef(({className:r,...i},o)=>v.createElement(Rbe,{ref:o,iconNode:t,className:zW(`lucide-${Tbe(e)}`,r),...i}));return n.displayName=`${e}`,n};/** + */const gt=(e,t)=>{const n=v.forwardRef(({className:r,...i},o)=>v.createElement(Rbe,{ref:o,iconNode:t,className:zW(`lucide-${Tbe(e)}`,r),...i}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jJe=yt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + */const jJe=gt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BJe=yt("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/** + */const BJe=gt("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UJe=yt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + */const UJe=gt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zJe=yt("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** + */const zJe=gt("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const WJe=yt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const WJe=gt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const VJe=yt("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + */const VJe=gt("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const HJe=yt("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** + */const HJe=gt("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qJe=yt("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 qJe=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const KJe=yt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const KJe=gt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const GJe=yt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const GJe=gt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YJe=yt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const YJe=gt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZJe=yt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const ZJe=gt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const XJe=yt("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"}]]);/** + */const XJe=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const QJe=yt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const QJe=gt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JJe=yt("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 JJe=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eet=yt("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/** + */const eet=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tet=yt("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"}]]);/** + */const tet=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const net=yt("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);/** + */const net=gt("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ret=yt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + */const ret=gt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iet=yt("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"}]]);/** + */const iet=gt("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oet=yt("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + */const oet=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aet=yt("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"}]]);/** + */const aet=gt("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const set=yt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + */const set=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uet=yt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + */const uet=gt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cet=yt("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const cet=gt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fet=yt("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"}]]);/** + */const fet=gt("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const det=yt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + */const det=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const het=yt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const het=gt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pet=yt("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"}]]);/** + */const pet=gt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const get=yt("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** + */const get=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const met=yt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + */const met=gt("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vet=yt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const vet=gt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yet=yt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const yet=gt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bet=yt("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2z",key:"jj09z8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** + */const bet=gt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xet=yt("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** + */const xet=gt("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2z",key:"jj09z8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wet=yt("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 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 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** + */const wet=gt("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _et=yt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + */const _et=gt("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 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 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cet=yt("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/** + */const Cet=gt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Eet=yt("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** + */const Eet=gt("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Oet=yt("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 Oet=gt("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Aet=yt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + */const Aet=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pet=yt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/** + */const Pet=gt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ket=yt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const ket=gt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tet=yt("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** + */const Tet=gt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Met=yt("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 Met=gt("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ret=yt("ShieldBan",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m4.243 5.21 14.39 12.472",key:"1c9a7c"}]]);/** + */const Ret=gt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Det=yt("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** + */const Det=gt("ShieldBan",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m4.243 5.21 14.39 12.472",key:"1c9a7c"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $et=yt("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** + */const $et=gt("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Iet=yt("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"}]]);/** + */const Iet=gt("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Net=yt("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + */const Net=gt("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"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Let=yt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const Let=gt("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fet=yt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + */const Fet=gt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jet=yt("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** + */const jet=gt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bet=yt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + */const Bet=gt("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Uet=yt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + */const Uet=gt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zet=yt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var BD=1,Dbe=.9,$be=.8,Ibe=.17,XS=.1,QS=.999,Nbe=.9999,Lbe=.99,Fbe=/[\\\/_+.#"@\[\(\{&]/,jbe=/[\\\/_+.#"@\[\(\{&]/g,Bbe=/[\s-]/,WW=/[\s-]/g;function WE(e,t,n,r,i,o,a){if(o===t.length)return i===e.length?BD:Lbe;var s=`${i},${o}`;if(a[s]!==void 0)return a[s];for(var u=r.charAt(o),l=n.indexOf(u,i),c=0,f,h,p,m;l>=0;)f=WE(e,t,n,r,l+1,o+1,a),f>c&&(l===i?f*=BD:Fbe.test(e.charAt(l-1))?(f*=$be,p=e.slice(i,l-1).match(jbe),p&&i>0&&(f*=Math.pow(QS,p.length))):Bbe.test(e.charAt(l-1))?(f*=Dbe,m=e.slice(i,l-1).match(WW),m&&i>0&&(f*=Math.pow(QS,m.length))):(f*=Ibe,i>0&&(f*=Math.pow(QS,l-i))),e.charAt(l)!==t.charAt(o)&&(f*=Nbe)),(ff&&(f=h*XS)),f>c&&(c=f),l=n.indexOf(u,l+1);return a[s]=c,c}function UD(e){return e.toLowerCase().replace(WW," ")}function Ube(e,t){return WE(e,t,UD(e),UD(t),0,0,{})}function Hi(){return Hi=Object.assign?Object.assign.bind():function(e){for(var t=1;te.forEach(n=>zbe(n,t))}function Fm(...e){return v.useCallback(VW(...e),e)}function Wbe(e,t=[]){let n=[];function r(o,a){const s=v.createContext(a),u=n.length;n=[...n,a];function l(f){const{scope:h,children:p,...m}=f,y=h?.[e][u]||s,b=v.useMemo(()=>m,Object.values(m));return v.createElement(y.Provider,{value:b},p)}function c(f,h){const p=h?.[e][u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return l.displayName=o+"Provider",[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,Vbe(i,...t)]}function Vbe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}const Hbe=globalThis?.document?v.useLayoutEffect:()=>{},qbe=zx.useId||(()=>{});let Kbe=0;function JS(e){const[t,n]=v.useState(qbe());return Hbe(()=>{e||n(r=>r??String(Kbe++))},[e]),e||(t?`radix-${t}`:"")}function HW(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Gbe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Ybe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=HW(n),u=v.useCallback(l=>{if(o){const f=typeof l=="function"?l(e):l;f!==e&&s(f)}else i(l)},[o,e,i,s]);return[a,u]}function Ybe({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),o=HW(t);return v.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const ZA=v.forwardRef((e,t)=>{const{children:n,...r}=e,i=v.Children.toArray(n),o=i.find(Xbe);if(o){const a=o.props.children,s=i.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return v.createElement(VE,Hi({},r,{ref:t}),v.isValidElement(a)?v.cloneElement(a,void 0,s):null)}return v.createElement(VE,Hi({},r,{ref:t}),n)});ZA.displayName="Slot";const VE=v.forwardRef((e,t)=>{const{children:n,...r}=e;return v.isValidElement(n)?v.cloneElement(n,{...Qbe(r,n.props),ref:VW(t,n.ref)}):v.Children.count(n)>1?v.Children.only(null):null});VE.displayName="SlotClone";const Zbe=({children:e})=>v.createElement(v.Fragment,null,e);function Xbe(e){return v.isValidElement(e)&&e.type===Zbe}function Qbe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?n[r]=(...s)=>{o?.(...s),i?.(...s)}:r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const Jbe=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],Lw=Jbe.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?ZA:t;return v.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),v.createElement(s,Hi({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function exe(e,t){e&&Au.flushSync(()=>e.dispatchEvent(t))}function XA(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function txe(e){const t=XA(e);v.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const HE="dismissableLayer.update",nxe="dismissableLayer.pointerDownOutside",rxe="dismissableLayer.focusOutside";let zD;const ixe=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oxe=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...u}=e,l=v.useContext(ixe),[c,f]=v.useState(null),[,h]=v.useState({}),p=Fm(t,C=>f(C)),m=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(y),w=c?m.indexOf(c):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,O=axe(C=>{const P=C.target,M=[...l.branches].some(N=>N.contains(P));!S||M||(i?.(C),a?.(C),C.defaultPrevented||s?.())}),E=sxe(C=>{const P=C.target;[...l.branches].some(N=>N.contains(P))||(o?.(C),a?.(C),C.defaultPrevented||s?.())});return txe(C=>{w===l.layers.size-1&&(r?.(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))}),v.useEffect(()=>{if(c)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(zD=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),WD(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=zD)}},[c,n,l]),v.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),WD())},[c,l]),v.useEffect(()=>{const C=()=>h({});return document.addEventListener(HE,C),()=>document.removeEventListener(HE,C)},[]),v.createElement(Lw.div,Hi({},u,{ref:p,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:Rd(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Rd(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Rd(e.onPointerDownCapture,O.onPointerDownCapture)}))});function axe(e){const t=XA(e),n=v.useRef(!1),r=v.useRef(()=>{});return v.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let u=function(){qW(nxe,t,s,{discrete:!0})};const s={originalEvent:a};a.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=u,document.addEventListener("click",r.current,{once:!0})):u()}n.current=!1},o=window.setTimeout(()=>{document.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),document.removeEventListener("pointerdown",i),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function sxe(e){const t=XA(e),n=v.useRef(!1);return v.useEffect(()=>{const r=i=>{i.target&&!n.current&&qW(rxe,t,{originalEvent:i},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function WD(){const e=new CustomEvent(HE);document.dispatchEvent(e)}function qW(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?exe(i,o):i.dispatchEvent(o)}function VD(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const e3="focusScope.autoFocusOnMount",t3="focusScope.autoFocusOnUnmount",HD={bubbles:!1,cancelable:!0},uxe=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,u]=v.useState(null),l=VD(i),c=VD(o),f=v.useRef(null),h=Fm(t,y=>u(y)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let y=function(w){if(p.paused||!s)return;const x=w.target;s.contains(x)?f.current=x:fc(f.current,{select:!0})},b=function(w){p.paused||!s||s.contains(w.relatedTarget)||fc(f.current,{select:!0})};return document.addEventListener("focusin",y),document.addEventListener("focusout",b),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b)}}},[r,s,p.paused]),v.useEffect(()=>{if(s){KD.add(p);const y=document.activeElement;if(!s.contains(y)){const w=new CustomEvent(e3,HD);s.addEventListener(e3,l),s.dispatchEvent(w),w.defaultPrevented||(lxe(pxe(KW(s)),{select:!0}),document.activeElement===y&&fc(s))}return()=>{s.removeEventListener(e3,l),setTimeout(()=>{const w=new CustomEvent(t3,HD);s.addEventListener(t3,c),s.dispatchEvent(w),w.defaultPrevented||fc(y??document.body,{select:!0}),s.removeEventListener(t3,c),KD.remove(p)},0)}}},[s,l,c,p]);const m=v.useCallback(y=>{if(!n&&!r||p.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(b&&w){const x=y.currentTarget,[S,O]=cxe(x);S&&O?!y.shiftKey&&w===O?(y.preventDefault(),n&&fc(S,{select:!0})):y.shiftKey&&w===S&&(y.preventDefault(),n&&fc(O,{select:!0})):w===x&&y.preventDefault()}},[n,r,p.paused]);return v.createElement(Lw.div,Hi({tabIndex:-1},a,{ref:h,onKeyDown:m}))});function lxe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fc(r,{select:t}),document.activeElement!==n)return}function cxe(e){const t=KW(e),n=qD(t,e),r=qD(t.reverse(),e);return[n,r]}function KW(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qD(e,t){for(const n of e)if(!fxe(n,{upTo:t}))return n}function fxe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function dxe(e){return e instanceof HTMLInputElement&&"select"in e}function fc(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dxe(e)&&t&&e.select()}}const KD=hxe();function hxe(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=GD(e,t),e.unshift(t)},remove(t){var n;e=GD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function GD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pxe(e){return e.filter(t=>t.tagName!=="A")}const gxe=v.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?iw.createPortal(v.createElement(Lw.div,Hi({},i,{ref:t})),r):null}),YD=globalThis?.document?v.useLayoutEffect:()=>{};function mxe(e,t){return v.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Fw=e=>{const{present:t,children:n}=e,r=vxe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Fm(r.ref,i.ref);return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};Fw.displayName="Presence";function vxe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=mxe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Cy(r.current);o.current=s==="mounted"?l:"none"},[s]),YD(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Cy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),YD(()=>{if(t){const l=f=>{const p=Cy(r.current).includes(f.animationName);f.target===t&&p&&Au.flushSync(()=>u("ANIMATION_END"))},c=f=>{f.target===t&&(o.current=Cy(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Cy(e){return e?.animationName||"none"}let n3=0;function yxe(){v.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:ZD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:ZD()),n3++,()=>{n3===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),n3--}},[])}function ZD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var y1="right-scroll-bar-position",b1="width-before-scroll-bar",bxe="with-scroll-bars-hidden",xxe="--removed-body-scroll-bar-size";function r3(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wxe(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var _xe=typeof window<"u"?v.useLayoutEffect:v.useEffect,XD=new WeakMap;function Sxe(e,t){var n=wxe(null,function(r){return e.forEach(function(i){return r3(i,r)})});return _xe(function(){var r=XD.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||r3(s,null)}),o.forEach(function(s){i.has(s)||r3(s,a)})}XD.set(n,e)},[e]),n}var GW=JU(),i3=function(){},jw=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:i3,onWheelCapture:i3,onTouchMoveCapture:i3}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,f=e.shards,h=e.sideCar,p=e.noIsolation,m=e.inert,y=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,x=bA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=h,O=Sxe([n,t]),E=Ti(Ti({},x),i);return v.createElement(v.Fragment,null,c&&v.createElement(S,{sideCar:GW,removeScrollBar:l,shards:f,noIsolation:p,inert:m,setCallbacks:o,allowPinchZoom:!!y,lockRef:n}),a?v.cloneElement(v.Children.only(s),Ti(Ti({},E),{ref:O})):v.createElement(w,Ti({},E,{className:u,ref:O}),s))});jw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};jw.classNames={fullWidth:b1,zeroRight:y1};var Cxe={left:0,top:0,right:0,gap:0},o3=function(e){return parseInt(e||"",10)||0},Exe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[o3(n),o3(r),o3(i)]},Oxe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Cxe;var t=Exe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Axe=xA(),Dd="data-scroll-locked",Pxe=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` + */const zet=gt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + * @license lucide-react v0.399.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wet=gt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.399.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vet=gt("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var B9=1,Dbe=.9,$be=.8,Ibe=.17,XS=.1,QS=.999,Nbe=.9999,Lbe=.99,Fbe=/[\\\/_+.#"@\[\(\{&]/,jbe=/[\\\/_+.#"@\[\(\{&]/g,Bbe=/[\s-]/,WW=/[\s-]/g;function WE(e,t,n,r,i,o,a){if(o===t.length)return i===e.length?B9:Lbe;var s=`${i},${o}`;if(a[s]!==void 0)return a[s];for(var u=r.charAt(o),l=n.indexOf(u,i),c=0,f,h,p,m;l>=0;)f=WE(e,t,n,r,l+1,o+1,a),f>c&&(l===i?f*=B9:Fbe.test(e.charAt(l-1))?(f*=$be,p=e.slice(i,l-1).match(jbe),p&&i>0&&(f*=Math.pow(QS,p.length))):Bbe.test(e.charAt(l-1))?(f*=Dbe,m=e.slice(i,l-1).match(WW),m&&i>0&&(f*=Math.pow(QS,m.length))):(f*=Ibe,i>0&&(f*=Math.pow(QS,l-i))),e.charAt(l)!==t.charAt(o)&&(f*=Nbe)),(ff&&(f=h*XS)),f>c&&(c=f),l=n.indexOf(u,l+1);return a[s]=c,c}function U9(e){return e.toLowerCase().replace(WW," ")}function Ube(e,t){return WE(e,t,U9(e),U9(t),0,0,{})}function Hi(){return Hi=Object.assign?Object.assign.bind():function(e){for(var t=1;te.forEach(n=>zbe(n,t))}function Fm(...e){return v.useCallback(VW(...e),e)}function Wbe(e,t=[]){let n=[];function r(o,a){const s=v.createContext(a),u=n.length;n=[...n,a];function l(f){const{scope:h,children:p,...m}=f,y=h?.[e][u]||s,b=v.useMemo(()=>m,Object.values(m));return v.createElement(y.Provider,{value:b},p)}function c(f,h){const p=h?.[e][u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return l.displayName=o+"Provider",[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,Vbe(i,...t)]}function Vbe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}const Hbe=globalThis?.document?v.useLayoutEffect:()=>{},qbe=zx.useId||(()=>{});let Kbe=0;function JS(e){const[t,n]=v.useState(qbe());return Hbe(()=>{e||n(r=>r??String(Kbe++))},[e]),e||(t?`radix-${t}`:"")}function HW(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Gbe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Ybe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=HW(n),u=v.useCallback(l=>{if(o){const f=typeof l=="function"?l(e):l;f!==e&&s(f)}else i(l)},[o,e,i,s]);return[a,u]}function Ybe({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),o=HW(t);return v.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const ZA=v.forwardRef((e,t)=>{const{children:n,...r}=e,i=v.Children.toArray(n),o=i.find(Xbe);if(o){const a=o.props.children,s=i.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return v.createElement(VE,Hi({},r,{ref:t}),v.isValidElement(a)?v.cloneElement(a,void 0,s):null)}return v.createElement(VE,Hi({},r,{ref:t}),n)});ZA.displayName="Slot";const VE=v.forwardRef((e,t)=>{const{children:n,...r}=e;return v.isValidElement(n)?v.cloneElement(n,{...Qbe(r,n.props),ref:VW(t,n.ref)}):v.Children.count(n)>1?v.Children.only(null):null});VE.displayName="SlotClone";const Zbe=({children:e})=>v.createElement(v.Fragment,null,e);function Xbe(e){return v.isValidElement(e)&&e.type===Zbe}function Qbe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?n[r]=(...s)=>{o?.(...s),i?.(...s)}:r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const Jbe=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],Lw=Jbe.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?ZA:t;return v.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),v.createElement(s,Hi({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function exe(e,t){e&&Au.flushSync(()=>e.dispatchEvent(t))}function XA(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function txe(e){const t=XA(e);v.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const HE="dismissableLayer.update",nxe="dismissableLayer.pointerDownOutside",rxe="dismissableLayer.focusOutside";let z9;const ixe=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oxe=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...u}=e,l=v.useContext(ixe),[c,f]=v.useState(null),[,h]=v.useState({}),p=Fm(t,C=>f(C)),m=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(y),w=c?m.indexOf(c):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,O=axe(C=>{const P=C.target,M=[...l.branches].some(N=>N.contains(P));!S||M||(i?.(C),a?.(C),C.defaultPrevented||s?.())}),E=sxe(C=>{const P=C.target;[...l.branches].some(N=>N.contains(P))||(o?.(C),a?.(C),C.defaultPrevented||s?.())});return txe(C=>{w===l.layers.size-1&&(r?.(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))}),v.useEffect(()=>{if(c)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(z9=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),W9(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=z9)}},[c,n,l]),v.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),W9())},[c,l]),v.useEffect(()=>{const C=()=>h({});return document.addEventListener(HE,C),()=>document.removeEventListener(HE,C)},[]),v.createElement(Lw.div,Hi({},u,{ref:p,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:Rd(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Rd(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Rd(e.onPointerDownCapture,O.onPointerDownCapture)}))});function axe(e){const t=XA(e),n=v.useRef(!1),r=v.useRef(()=>{});return v.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let u=function(){qW(nxe,t,s,{discrete:!0})};const s={originalEvent:a};a.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=u,document.addEventListener("click",r.current,{once:!0})):u()}n.current=!1},o=window.setTimeout(()=>{document.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),document.removeEventListener("pointerdown",i),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function sxe(e){const t=XA(e),n=v.useRef(!1);return v.useEffect(()=>{const r=i=>{i.target&&!n.current&&qW(rxe,t,{originalEvent:i},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function W9(){const e=new CustomEvent(HE);document.dispatchEvent(e)}function qW(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?exe(i,o):i.dispatchEvent(o)}function V9(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const e3="focusScope.autoFocusOnMount",t3="focusScope.autoFocusOnUnmount",H9={bubbles:!1,cancelable:!0},uxe=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,u]=v.useState(null),l=V9(i),c=V9(o),f=v.useRef(null),h=Fm(t,y=>u(y)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let y=function(w){if(p.paused||!s)return;const x=w.target;s.contains(x)?f.current=x:fc(f.current,{select:!0})},b=function(w){p.paused||!s||s.contains(w.relatedTarget)||fc(f.current,{select:!0})};return document.addEventListener("focusin",y),document.addEventListener("focusout",b),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b)}}},[r,s,p.paused]),v.useEffect(()=>{if(s){K9.add(p);const y=document.activeElement;if(!s.contains(y)){const w=new CustomEvent(e3,H9);s.addEventListener(e3,l),s.dispatchEvent(w),w.defaultPrevented||(lxe(pxe(KW(s)),{select:!0}),document.activeElement===y&&fc(s))}return()=>{s.removeEventListener(e3,l),setTimeout(()=>{const w=new CustomEvent(t3,H9);s.addEventListener(t3,c),s.dispatchEvent(w),w.defaultPrevented||fc(y??document.body,{select:!0}),s.removeEventListener(t3,c),K9.remove(p)},0)}}},[s,l,c,p]);const m=v.useCallback(y=>{if(!n&&!r||p.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(b&&w){const x=y.currentTarget,[S,O]=cxe(x);S&&O?!y.shiftKey&&w===O?(y.preventDefault(),n&&fc(S,{select:!0})):y.shiftKey&&w===S&&(y.preventDefault(),n&&fc(O,{select:!0})):w===x&&y.preventDefault()}},[n,r,p.paused]);return v.createElement(Lw.div,Hi({tabIndex:-1},a,{ref:h,onKeyDown:m}))});function lxe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fc(r,{select:t}),document.activeElement!==n)return}function cxe(e){const t=KW(e),n=q9(t,e),r=q9(t.reverse(),e);return[n,r]}function KW(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function q9(e,t){for(const n of e)if(!fxe(n,{upTo:t}))return n}function fxe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function dxe(e){return e instanceof HTMLInputElement&&"select"in e}function fc(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dxe(e)&&t&&e.select()}}const K9=hxe();function hxe(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=G9(e,t),e.unshift(t)},remove(t){var n;e=G9(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function G9(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pxe(e){return e.filter(t=>t.tagName!=="A")}const gxe=v.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?iw.createPortal(v.createElement(Lw.div,Hi({},i,{ref:t})),r):null}),Y9=globalThis?.document?v.useLayoutEffect:()=>{};function mxe(e,t){return v.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Fw=e=>{const{present:t,children:n}=e,r=vxe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Fm(r.ref,i.ref);return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};Fw.displayName="Presence";function vxe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=mxe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Cy(r.current);o.current=s==="mounted"?l:"none"},[s]),Y9(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Cy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Y9(()=>{if(t){const l=f=>{const p=Cy(r.current).includes(f.animationName);f.target===t&&p&&Au.flushSync(()=>u("ANIMATION_END"))},c=f=>{f.target===t&&(o.current=Cy(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Cy(e){return e?.animationName||"none"}let n3=0;function yxe(){v.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:Z9()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:Z9()),n3++,()=>{n3===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),n3--}},[])}function Z9(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var y1="right-scroll-bar-position",b1="width-before-scroll-bar",bxe="with-scroll-bars-hidden",xxe="--removed-body-scroll-bar-size";function r3(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wxe(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var _xe=typeof window<"u"?v.useLayoutEffect:v.useEffect,X9=new WeakMap;function Sxe(e,t){var n=wxe(null,function(r){return e.forEach(function(i){return r3(i,r)})});return _xe(function(){var r=X9.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||r3(s,null)}),o.forEach(function(s){i.has(s)||r3(s,a)})}X9.set(n,e)},[e]),n}var GW=JU(),i3=function(){},jw=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:i3,onWheelCapture:i3,onTouchMoveCapture:i3}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,f=e.shards,h=e.sideCar,p=e.noIsolation,m=e.inert,y=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,x=bA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=h,O=Sxe([n,t]),E=Ti(Ti({},x),i);return v.createElement(v.Fragment,null,c&&v.createElement(S,{sideCar:GW,removeScrollBar:l,shards:f,noIsolation:p,inert:m,setCallbacks:o,allowPinchZoom:!!y,lockRef:n}),a?v.cloneElement(v.Children.only(s),Ti(Ti({},E),{ref:O})):v.createElement(w,Ti({},E,{className:u,ref:O}),s))});jw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};jw.classNames={fullWidth:b1,zeroRight:y1};var Cxe={left:0,top:0,right:0,gap:0},o3=function(e){return parseInt(e||"",10)||0},Exe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[o3(n),o3(r),o3(i)]},Oxe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Cxe;var t=Exe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Axe=xA(),Dd="data-scroll-locked",Pxe=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(bxe,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; @@ -501,10 +511,10 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do body[`).concat(Dd,`] { `).concat(xxe,": ").concat(s,`px; } -`)},QD=function(){var e=parseInt(document.body.getAttribute(Dd)||"0",10);return isFinite(e)?e:0},kxe=function(){v.useEffect(function(){return document.body.setAttribute(Dd,(QD()+1).toString()),function(){var e=QD()-1;e<=0?document.body.removeAttribute(Dd):document.body.setAttribute(Dd,e.toString())}},[])},Txe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;kxe();var o=v.useMemo(function(){return Oxe(i)},[i]);return v.createElement(Axe,{styles:Pxe(o,!t,i,n?"":"!important")})},qE=!1;if(typeof window<"u")try{var Ey=Object.defineProperty({},"passive",{get:function(){return qE=!0,!0}});window.addEventListener("test",Ey,Ey),window.removeEventListener("test",Ey,Ey)}catch{qE=!1}var Kf=qE?{passive:!1}:!1,Mxe=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},Rxe=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},JD=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=YW(e,n);if(r){var i=ZW(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Dxe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$xe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},YW=function(e,t){return e==="v"?Mxe(t):Rxe(t)},ZW=function(e,t){return e==="v"?Dxe(t):$xe(t)},Ixe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nxe=function(e,t,n,r,i){var o=Ixe(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,u=t.contains(s),l=!1,c=a>0,f=0,h=0;do{var p=ZW(e,s),m=p[0],y=p[1],b=p[2],w=y-b-o*m;(m||w)&&YW(e,s)&&(f+=w,h+=m),s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(c&&(f===0||!i)||!c&&(h===0||!i))&&(l=!0),l},Oy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},e9=function(e){return[e.deltaX,e.deltaY]},t9=function(e){return e&&"current"in e?e.current:e},Lxe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Fxe=function(e){return` +`)},Q9=function(){var e=parseInt(document.body.getAttribute(Dd)||"0",10);return isFinite(e)?e:0},kxe=function(){v.useEffect(function(){return document.body.setAttribute(Dd,(Q9()+1).toString()),function(){var e=Q9()-1;e<=0?document.body.removeAttribute(Dd):document.body.setAttribute(Dd,e.toString())}},[])},Txe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;kxe();var o=v.useMemo(function(){return Oxe(i)},[i]);return v.createElement(Axe,{styles:Pxe(o,!t,i,n?"":"!important")})},qE=!1;if(typeof window<"u")try{var Ey=Object.defineProperty({},"passive",{get:function(){return qE=!0,!0}});window.addEventListener("test",Ey,Ey),window.removeEventListener("test",Ey,Ey)}catch{qE=!1}var Kf=qE?{passive:!1}:!1,Mxe=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},Rxe=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},J9=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=YW(e,n);if(r){var i=ZW(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Dxe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$xe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},YW=function(e,t){return e==="v"?Mxe(t):Rxe(t)},ZW=function(e,t){return e==="v"?Dxe(t):$xe(t)},Ixe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nxe=function(e,t,n,r,i){var o=Ixe(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,u=t.contains(s),l=!1,c=a>0,f=0,h=0;do{var p=ZW(e,s),m=p[0],y=p[1],b=p[2],w=y-b-o*m;(m||w)&&YW(e,s)&&(f+=w,h+=m),s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(c&&(f===0||!i)||!c&&(h===0||!i))&&(l=!0),l},Oy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eD=function(e){return[e.deltaX,e.deltaY]},tD=function(e){return e&&"current"in e?e.current:e},Lxe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Fxe=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},jxe=0,Gf=[];function Bxe(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(jxe++)[0],o=v.useState(function(){return xA()})[0],a=v.useRef(e);v.useEffect(function(){a.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=QU([e.lockRef.current],(e.shards||[]).map(t9),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(y,b){if("touches"in y&&y.touches.length===2)return!a.current.allowPinchZoom;var w=Oy(y),x=n.current,S="deltaX"in y?y.deltaX:x[0]-w[0],O="deltaY"in y?y.deltaY:x[1]-w[1],E,C=y.target,P=Math.abs(S)>Math.abs(O)?"h":"v";if("touches"in y&&P==="h"&&C.type==="range")return!1;var M=JD(P,C);if(!M)return!0;if(M?E=P:(E=P==="v"?"h":"v",M=JD(P,C)),!M)return!1;if(!r.current&&"changedTouches"in y&&(S||O)&&(r.current=E),!E)return!0;var N=r.current||E;return Nxe(N,b,y,N==="h"?S:O,!0)},[]),u=v.useCallback(function(y){var b=y;if(!(!Gf.length||Gf[Gf.length-1]!==o)){var w="deltaY"in b?e9(b):Oy(b),x=t.current.filter(function(E){return E.name===b.type&&E.target===b.target&&Lxe(E.delta,w)})[0];if(x&&x.should){b.preventDefault();return}if(!x){var S=(a.current.shards||[]).map(t9).filter(Boolean).filter(function(E){return E.contains(b.target)}),O=S.length>0?s(b,S[0]):!a.current.noIsolation;O&&b.preventDefault()}}},[]),l=v.useCallback(function(y,b,w,x){var S={name:y,delta:b,target:w,should:x};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(O){return O!==S})},1)},[]),c=v.useCallback(function(y){n.current=Oy(y),r.current=void 0},[]),f=v.useCallback(function(y){l(y.type,e9(y),y.target,s(y,e.lockRef.current))},[]),h=v.useCallback(function(y){l(y.type,Oy(y),y.target,s(y,e.lockRef.current))},[]);v.useEffect(function(){return Gf.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Kf),document.addEventListener("touchmove",u,Kf),document.addEventListener("touchstart",c,Kf),function(){Gf=Gf.filter(function(y){return y!==o}),document.removeEventListener("wheel",u,Kf),document.removeEventListener("touchmove",u,Kf),document.removeEventListener("touchstart",c,Kf)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(o,{styles:Fxe(i)}):null,p?v.createElement(Txe,{gapMode:"margin"}):null)}const Uxe=tz(GW,Bxe);var XW=v.forwardRef(function(e,t){return v.createElement(jw,Ti({},e,{ref:t,sideCar:Uxe}))});XW.classNames=jw.classNames;const QW="Dialog",[JW,Wet]=Wbe(QW),[zxe,mf]=JW(QW),Wxe=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=v.useRef(null),u=v.useRef(null),[l=!1,c]=Gbe({prop:r,defaultProp:i,onChange:o});return v.createElement(zxe,{scope:t,triggerRef:s,contentRef:u,contentId:JS(),titleId:JS(),descriptionId:JS(),open:l,onOpenChange:c,onOpenToggle:v.useCallback(()=>c(f=>!f),[c]),modal:a},n)},eV="DialogPortal",[Vxe,tV]=JW(eV,{forceMount:void 0}),Hxe=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=mf(eV,t);return v.createElement(Vxe,{scope:t,forceMount:n},v.Children.map(r,a=>v.createElement(Fw,{present:n||o.open},v.createElement(gxe,{asChild:!0,container:i},a))))},KE="DialogOverlay",qxe=v.forwardRef((e,t)=>{const n=tV(KE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=mf(KE,e.__scopeDialog);return o.modal?v.createElement(Fw,{present:r||o.open},v.createElement(Kxe,Hi({},i,{ref:t}))):null}),Kxe=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=mf(KE,n);return v.createElement(XW,{as:ZA,allowPinchZoom:!0,shards:[i.contentRef]},v.createElement(Lw.div,Hi({"data-state":rV(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Cg="DialogContent",Gxe=v.forwardRef((e,t)=>{const n=tV(Cg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=mf(Cg,e.__scopeDialog);return v.createElement(Fw,{present:r||o.open},o.modal?v.createElement(Yxe,Hi({},i,{ref:t})):v.createElement(Zxe,Hi({},i,{ref:t})))}),Yxe=v.forwardRef((e,t)=>{const n=mf(Cg,e.__scopeDialog),r=v.useRef(null),i=Fm(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Mm(o)},[]),v.createElement(nV,Hi({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Rd(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Rd(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Rd(e.onFocusOutside,o=>o.preventDefault())}))}),Zxe=v.forwardRef((e,t)=>{const n=mf(Cg,e.__scopeDialog),r=v.useRef(!1);return v.createElement(nV,Hi({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1},onInteractOutside:i=>{var o,a;(o=e.onInteractOutside)===null||o===void 0||o.call(e,i),i.defaultPrevented||(r.current=!0);const s=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&i.preventDefault()}}))}),nV=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=mf(Cg,n),u=v.useRef(null),l=Fm(t,u);return yxe(),v.createElement(v.Fragment,null,v.createElement(uxe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},v.createElement(oxe,Hi({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":rV(s.open)},a,{ref:l,onDismiss:()=>s.onOpenChange(!1)}))),!1)});function rV(e){return e?"open":"closed"}const Xxe=Wxe,Qxe=Hxe,Jxe=qxe,ewe=Gxe;var twe='[cmdk-list-sizer=""]',Up='[cmdk-group=""]',a3='[cmdk-group-items=""]',nwe='[cmdk-group-heading=""]',QA='[cmdk-item=""]',n9=`${QA}:not([aria-disabled="true"])`,GE="cmdk-item-select",Qs="data-value",rwe=(e,t)=>Ube(e,t),iV=v.createContext(void 0),jm=()=>v.useContext(iV),oV=v.createContext(void 0),JA=()=>v.useContext(oV),aV=v.createContext(void 0),sV=v.forwardRef((e,t)=>{let n=v.useRef(null),r=nd(()=>{var Y,oe,X;return{search:"",value:(X=(oe=e.value)!=null?oe:(Y=e.defaultValue)==null?void 0:Y.toLowerCase())!=null?X:"",filtered:{count:0,items:new Map,groups:new Set}}}),i=nd(()=>new Set),o=nd(()=>new Map),a=nd(()=>new Map),s=nd(()=>new Set),u=uV(e),{label:l,children:c,value:f,onValueChange:h,filter:p,shouldFilter:m,vimBindings:y=!0,...b}=e,w=v.useId(),x=v.useId(),S=v.useId(),O=pwe();zh(()=>{if(f!==void 0){let Y=f.trim().toLowerCase();r.current.value=Y,O(6,V),E.emit()}},[f]);let E=v.useMemo(()=>({subscribe:Y=>(s.current.add(Y),()=>s.current.delete(Y)),snapshot:()=>r.current,setState:(Y,oe,X)=>{var Q,ue,de;if(!Object.is(r.current[Y],oe)){if(r.current[Y]=oe,Y==="search")B(),M(),O(1,N);else if(Y==="value")if(((Q=u.current)==null?void 0:Q.value)!==void 0){let Se=oe??"";(de=(ue=u.current).onValueChange)==null||de.call(ue,Se);return}else X||O(5,V);E.emit()}},emit:()=>{s.current.forEach(Y=>Y())}}),[]),C=v.useMemo(()=>({value:(Y,oe)=>{oe!==a.current.get(Y)&&(a.current.set(Y,oe),r.current.filtered.items.set(Y,P(oe)),O(2,()=>{M(),E.emit()}))},item:(Y,oe)=>(i.current.add(Y),oe&&(o.current.has(oe)?o.current.get(oe).add(Y):o.current.set(oe,new Set([Y]))),O(3,()=>{B(),M(),r.current.value||N(),E.emit()}),()=>{a.current.delete(Y),i.current.delete(Y),r.current.filtered.items.delete(Y);let X=W();O(4,()=>{B(),X?.getAttribute("id")===Y&&N(),E.emit()})}),group:Y=>(o.current.has(Y)||o.current.set(Y,new Set),()=>{a.current.delete(Y),o.current.delete(Y)}),filter:()=>u.current.shouldFilter,label:l||e["aria-label"],commandRef:n,listId:w,inputId:S,labelId:x}),[]);function P(Y){var oe,X;let Q=(X=(oe=u.current)==null?void 0:oe.filter)!=null?X:rwe;return Y?Q(Y,r.current.search):0}function M(){if(!n.current||!r.current.search||u.current.shouldFilter===!1)return;let Y=r.current.filtered.items,oe=[];r.current.filtered.groups.forEach(Q=>{let ue=o.current.get(Q),de=0;ue.forEach(Se=>{let me=Y.get(Se);de=Math.max(me,de)}),oe.push([Q,de])});let X=n.current.querySelector(twe);ne().sort((Q,ue)=>{var de,Se;let me=Q.getAttribute(Qs),Ze=ue.getAttribute(Qs);return((de=Y.get(Ze))!=null?de:0)-((Se=Y.get(me))!=null?Se:0)}).forEach(Q=>{let ue=Q.closest(a3);ue?ue.appendChild(Q.parentElement===ue?Q:Q.closest(`${a3} > *`)):X.appendChild(Q.parentElement===X?Q:Q.closest(`${a3} > *`))}),oe.sort((Q,ue)=>ue[1]-Q[1]).forEach(Q=>{let ue=n.current.querySelector(`${Up}[${Qs}="${Q[0]}"]`);ue?.parentElement.appendChild(ue)})}function N(){let Y=ne().find(X=>!X.ariaDisabled),oe=Y?.getAttribute(Qs);E.setState("value",oe||void 0)}function B(){if(!r.current.search||u.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let Y=0;for(let oe of i.current){let X=a.current.get(oe),Q=P(X);r.current.filtered.items.set(oe,Q),Q>0&&Y++}for(let[oe,X]of o.current)for(let Q of X)if(r.current.filtered.items.get(Q)>0){r.current.filtered.groups.add(oe);break}r.current.filtered.count=Y}function V(){var Y,oe,X;let Q=W();Q&&(((Y=Q.parentElement)==null?void 0:Y.firstChild)===Q&&((X=(oe=Q.closest(Up))==null?void 0:oe.querySelector(nwe))==null||X.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function W(){var Y;return(Y=n.current)==null?void 0:Y.querySelector(`${QA}[aria-selected="true"]`)}function ne(){return Array.from(n.current.querySelectorAll(n9))}function Z(Y){let oe=ne()[Y];oe&&E.setState("value",oe.getAttribute(Qs))}function q(Y){var oe;let X=W(),Q=ne(),ue=Q.findIndex(Se=>Se===X),de=Q[ue+Y];(oe=u.current)!=null&&oe.loop&&(de=ue+Y<0?Q[Q.length-1]:ue+Y===Q.length?Q[0]:Q[ue+Y]),de&&E.setState("value",de.getAttribute(Qs))}function G(Y){let oe=W(),X=oe?.closest(Up),Q;for(;X&&!Q;)X=Y>0?dwe(X,Up):hwe(X,Up),Q=X?.querySelector(n9);Q?E.setState("value",Q.getAttribute(Qs)):q(Y)}let H=()=>Z(ne().length-1),j=Y=>{Y.preventDefault(),Y.metaKey?H():Y.altKey?G(1):q(1)},K=Y=>{Y.preventDefault(),Y.metaKey?Z(0):Y.altKey?G(-1):q(-1)};return v.createElement("div",{ref:Bm([n,t]),...b,"cmdk-root":"",onKeyDown:Y=>{var oe;if((oe=b.onKeyDown)==null||oe.call(b,Y),!Y.defaultPrevented)switch(Y.key){case"n":case"j":{y&&Y.ctrlKey&&j(Y);break}case"ArrowDown":{j(Y);break}case"p":case"k":{y&&Y.ctrlKey&&K(Y);break}case"ArrowUp":{K(Y);break}case"Home":{Y.preventDefault(),Z(0);break}case"End":{Y.preventDefault(),H();break}case"Enter":if(!Y.nativeEvent.isComposing){Y.preventDefault();let X=W();if(X){let Q=new Event(GE);X.dispatchEvent(Q)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:gwe},l),v.createElement(oV.Provider,{value:E},v.createElement(iV.Provider,{value:C},c)))}),iwe=v.forwardRef((e,t)=>{var n,r;let i=v.useId(),o=v.useRef(null),a=v.useContext(aV),s=jm(),u=uV(e),l=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;zh(()=>s.item(i,a?.id),[]);let c=lV(i,o,[e.value,e.children,o]),f=JA(),h=ef(E=>E.value&&E.value===c.current),p=ef(E=>l||s.filter()===!1?!0:E.search?E.filtered.items.get(i)>0:!0);v.useEffect(()=>{let E=o.current;if(!(!E||e.disabled))return E.addEventListener(GE,m),()=>E.removeEventListener(GE,m)},[p,e.onSelect,e.disabled]);function m(){var E,C;y(),(C=(E=u.current).onSelect)==null||C.call(E,c.current)}function y(){f.setState("value",c.current,!0)}if(!p)return null;let{disabled:b,value:w,onSelect:x,forceMount:S,...O}=e;return v.createElement("div",{ref:Bm([o,t]),...O,id:i,"cmdk-item":"",role:"option","aria-disabled":b||void 0,"aria-selected":h||void 0,"data-disabled":b||void 0,"data-selected":h||void 0,onPointerMove:b?void 0:y,onClick:b?void 0:m},e.children)}),owe=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,a=v.useId(),s=v.useRef(null),u=v.useRef(null),l=v.useId(),c=jm(),f=ef(m=>i||c.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);zh(()=>c.group(a),[]),lV(a,s,[e.value,e.heading,u]);let h=v.useMemo(()=>({id:a,forceMount:i}),[i]),p=v.createElement(aV.Provider,{value:h},r);return v.createElement("div",{ref:Bm([s,t]),...o,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&v.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},p))}),awe=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=v.useRef(null),o=ef(a=>!a.search);return!n&&!o?null:v.createElement("div",{ref:Bm([i,t]),...r,"cmdk-separator":"",role:"separator"})}),swe=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=JA(),a=ef(c=>c.search),s=ef(c=>c.value),u=jm(),l=v.useMemo(()=>{var c;let f=(c=u.commandRef.current)==null?void 0:c.querySelector(`${QA}[${Qs}="${s}"]`);return f?.getAttribute("id")},[s,u.commandRef]);return v.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),v.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:i?e.value:a,onChange:c=>{i||o.setState("search",c.target.value),n?.(c.target.value)}})}),uwe=v.forwardRef((e,t)=>{let{children:n,...r}=e,i=v.useRef(null),o=v.useRef(null),a=jm();return v.useEffect(()=>{if(o.current&&i.current){let s=o.current,u=i.current,l,c=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let f=s.offsetHeight;u.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return c.observe(s),()=>{cancelAnimationFrame(l),c.unobserve(s)}}},[]),v.createElement("div",{ref:Bm([i,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:a.listId,"aria-labelledby":a.inputId},v.createElement("div",{ref:o,"cmdk-list-sizer":""},n))}),lwe=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=e;return v.createElement(Xxe,{open:n,onOpenChange:r},v.createElement(Qxe,{container:a},v.createElement(Jxe,{"cmdk-overlay":"",className:i}),v.createElement(ewe,{"aria-label":e.label,"cmdk-dialog":"",className:o},v.createElement(sV,{ref:t,...s}))))}),cwe=v.forwardRef((e,t)=>{let n=v.useRef(!0),r=ef(i=>i.filtered.count===0);return v.useEffect(()=>{n.current=!1},[]),n.current||!r?null:v.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),fwe=v.forwardRef((e,t)=>{let{progress:n,children:r,...i}=e;return v.createElement("div",{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},v.createElement("div",{"aria-hidden":!0},r))}),Vet=Object.assign(sV,{List:uwe,Item:iwe,Input:swe,Group:owe,Separator:awe,Dialog:lwe,Empty:cwe,Loading:fwe});function dwe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function hwe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function uV(e){let t=v.useRef(e);return zh(()=>{t.current=e}),t}var zh=typeof window>"u"?v.useEffect:v.useLayoutEffect;function nd(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Bm(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function ef(e){let t=JA(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function lV(e,t,n){let r=v.useRef(),i=jm();return zh(()=>{var o;let a=(()=>{var s;for(let u of n){if(typeof u=="string")return u.trim().toLowerCase();if(typeof u=="object"&&"current"in u)return u.current?(s=u.current.textContent)==null?void 0:s.trim().toLowerCase():r.current}})();i.value(e,a),(o=t.current)==null||o.setAttribute(Qs,a),r.current=a}),r}var pwe=()=>{let[e,t]=v.useState(),n=nd(()=>new Map);return zh(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}},gwe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},eP="Avatar",[mwe,Het]=Di(eP),[vwe,cV]=mwe(eP),fV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=v.useState("idle");return I.jsx(vwe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:I.jsx(gt.span,{...r,ref:t})})});fV.displayName=eP;var dV="AvatarImage",hV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=cV(dV,n),s=ywe(r,o.referrerPolicy),u=Vr(l=>{i(l),a.onImageLoadingStatusChange(l)});return On(()=>{s!=="idle"&&u(s)},[s,u]),s==="loaded"?I.jsx(gt.img,{...o,ref:t,src:r}):null});hV.displayName=dV;var pV="AvatarFallback",gV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=cV(pV,n),[a,s]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(u)}},[r]),a&&o.imageLoadingStatus!=="loaded"?I.jsx(gt.span,{...i,ref:t}):null});gV.displayName=pV;function ywe(e,t){const[n,r]=v.useState("idle");return On(()=>{if(!e){r("error");return}let i=!0;const o=new window.Image,a=s=>()=>{i&&r(s)};return r("loading"),o.onload=a("loaded"),o.onerror=a("error"),o.src=e,t&&(o.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var qet=fV,Ket=hV,Get=gV,bwe=Array.isArray,mo=bwe,xwe=typeof la=="object"&&la&&la.Object===Object&&la,mV=xwe,wwe=mV,_we=typeof self=="object"&&self&&self.Object===Object&&self,Swe=wwe||_we||Function("return this")(),Ds=Swe,Cwe=Ds,Ewe=Cwe.Symbol,Um=Ewe,r9=Um,vV=Object.prototype,Owe=vV.hasOwnProperty,Awe=vV.toString,zp=r9?r9.toStringTag:void 0;function Pwe(e){var t=Owe.call(e,zp),n=e[zp];try{e[zp]=void 0;var r=!0}catch{}var i=Awe.call(e);return r&&(t?e[zp]=n:delete e[zp]),i}var kwe=Pwe,Twe=Object.prototype,Mwe=Twe.toString;function Rwe(e){return Mwe.call(e)}var Dwe=Rwe,i9=Um,$we=kwe,Iwe=Dwe,Nwe="[object Null]",Lwe="[object Undefined]",o9=i9?i9.toStringTag:void 0;function Fwe(e){return e==null?e===void 0?Lwe:Nwe:o9&&o9 in Object(e)?$we(e):Iwe(e)}var Tu=Fwe;function jwe(e){return e!=null&&typeof e=="object"}var Mu=jwe,Bwe=Tu,Uwe=Mu,zwe="[object Symbol]";function Wwe(e){return typeof e=="symbol"||Uwe(e)&&Bwe(e)==zwe}var Wh=Wwe,Vwe=mo,Hwe=Wh,qwe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kwe=/^\w*$/;function Gwe(e,t){if(Vwe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Hwe(e)?!0:Kwe.test(e)||!qwe.test(e)||t!=null&&e in Object(t)}var tP=Gwe;function Ywe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Wl=Ywe;const Vh=kn(Wl);var Zwe=Tu,Xwe=Wl,Qwe="[object AsyncFunction]",Jwe="[object Function]",e2e="[object GeneratorFunction]",t2e="[object Proxy]";function n2e(e){if(!Xwe(e))return!1;var t=Zwe(e);return t==Jwe||t==e2e||t==Qwe||t==t2e}var nP=n2e;const qt=kn(nP);var r2e=Ds,i2e=r2e["__core-js_shared__"],o2e=i2e,s3=o2e,a9=function(){var e=/[^.]+$/.exec(s3&&s3.keys&&s3.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function a2e(e){return!!a9&&a9 in e}var s2e=a2e,u2e=Function.prototype,l2e=u2e.toString;function c2e(e){if(e!=null){try{return l2e.call(e)}catch{}try{return e+""}catch{}}return""}var yV=c2e,f2e=nP,d2e=s2e,h2e=Wl,p2e=yV,g2e=/[\\^$.*+?()[\]{}|]/g,m2e=/^\[object .+?Constructor\]$/,v2e=Function.prototype,y2e=Object.prototype,b2e=v2e.toString,x2e=y2e.hasOwnProperty,w2e=RegExp("^"+b2e.call(x2e).replace(g2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _2e(e){if(!h2e(e)||d2e(e))return!1;var t=f2e(e)?w2e:m2e;return t.test(p2e(e))}var S2e=_2e;function C2e(e,t){return e?.[t]}var E2e=C2e,O2e=S2e,A2e=E2e;function P2e(e,t){var n=A2e(e,t);return O2e(n)?n:void 0}var vf=P2e,k2e=vf,T2e=k2e(Object,"create"),Bw=T2e,s9=Bw;function M2e(){this.__data__=s9?s9(null):{},this.size=0}var R2e=M2e;function D2e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var $2e=D2e,I2e=Bw,N2e="__lodash_hash_undefined__",L2e=Object.prototype,F2e=L2e.hasOwnProperty;function j2e(e){var t=this.__data__;if(I2e){var n=t[e];return n===N2e?void 0:n}return F2e.call(t,e)?t[e]:void 0}var B2e=j2e,U2e=Bw,z2e=Object.prototype,W2e=z2e.hasOwnProperty;function V2e(e){var t=this.__data__;return U2e?t[e]!==void 0:W2e.call(t,e)}var H2e=V2e,q2e=Bw,K2e="__lodash_hash_undefined__";function G2e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=q2e&&t===void 0?K2e:t,this}var Y2e=G2e,Z2e=R2e,X2e=$2e,Q2e=B2e,J2e=H2e,e_e=Y2e;function Hh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1}var v_e=m_e,y_e=Uw;function b_e(e,t){var n=this.__data__,r=y_e(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var x_e=b_e,w_e=r_e,__e=f_e,S_e=p_e,C_e=v_e,E_e=x_e;function qh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tMath.abs(O)?"h":"v";if("touches"in y&&P==="h"&&C.type==="range")return!1;var M=J9(P,C);if(!M)return!0;if(M?E=P:(E=P==="v"?"h":"v",M=J9(P,C)),!M)return!1;if(!r.current&&"changedTouches"in y&&(S||O)&&(r.current=E),!E)return!0;var N=r.current||E;return Nxe(N,b,y,N==="h"?S:O,!0)},[]),u=v.useCallback(function(y){var b=y;if(!(!Gf.length||Gf[Gf.length-1]!==o)){var w="deltaY"in b?eD(b):Oy(b),x=t.current.filter(function(E){return E.name===b.type&&E.target===b.target&&Lxe(E.delta,w)})[0];if(x&&x.should){b.preventDefault();return}if(!x){var S=(a.current.shards||[]).map(tD).filter(Boolean).filter(function(E){return E.contains(b.target)}),O=S.length>0?s(b,S[0]):!a.current.noIsolation;O&&b.preventDefault()}}},[]),l=v.useCallback(function(y,b,w,x){var S={name:y,delta:b,target:w,should:x};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(O){return O!==S})},1)},[]),c=v.useCallback(function(y){n.current=Oy(y),r.current=void 0},[]),f=v.useCallback(function(y){l(y.type,eD(y),y.target,s(y,e.lockRef.current))},[]),h=v.useCallback(function(y){l(y.type,Oy(y),y.target,s(y,e.lockRef.current))},[]);v.useEffect(function(){return Gf.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Kf),document.addEventListener("touchmove",u,Kf),document.addEventListener("touchstart",c,Kf),function(){Gf=Gf.filter(function(y){return y!==o}),document.removeEventListener("wheel",u,Kf),document.removeEventListener("touchmove",u,Kf),document.removeEventListener("touchstart",c,Kf)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(o,{styles:Fxe(i)}):null,p?v.createElement(Txe,{gapMode:"margin"}):null)}const Uxe=tz(GW,Bxe);var XW=v.forwardRef(function(e,t){return v.createElement(jw,Ti({},e,{ref:t,sideCar:Uxe}))});XW.classNames=jw.classNames;const QW="Dialog",[JW,Het]=Wbe(QW),[zxe,mf]=JW(QW),Wxe=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=v.useRef(null),u=v.useRef(null),[l=!1,c]=Gbe({prop:r,defaultProp:i,onChange:o});return v.createElement(zxe,{scope:t,triggerRef:s,contentRef:u,contentId:JS(),titleId:JS(),descriptionId:JS(),open:l,onOpenChange:c,onOpenToggle:v.useCallback(()=>c(f=>!f),[c]),modal:a},n)},eV="DialogPortal",[Vxe,tV]=JW(eV,{forceMount:void 0}),Hxe=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=mf(eV,t);return v.createElement(Vxe,{scope:t,forceMount:n},v.Children.map(r,a=>v.createElement(Fw,{present:n||o.open},v.createElement(gxe,{asChild:!0,container:i},a))))},KE="DialogOverlay",qxe=v.forwardRef((e,t)=>{const n=tV(KE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=mf(KE,e.__scopeDialog);return o.modal?v.createElement(Fw,{present:r||o.open},v.createElement(Kxe,Hi({},i,{ref:t}))):null}),Kxe=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=mf(KE,n);return v.createElement(XW,{as:ZA,allowPinchZoom:!0,shards:[i.contentRef]},v.createElement(Lw.div,Hi({"data-state":rV(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Cg="DialogContent",Gxe=v.forwardRef((e,t)=>{const n=tV(Cg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=mf(Cg,e.__scopeDialog);return v.createElement(Fw,{present:r||o.open},o.modal?v.createElement(Yxe,Hi({},i,{ref:t})):v.createElement(Zxe,Hi({},i,{ref:t})))}),Yxe=v.forwardRef((e,t)=>{const n=mf(Cg,e.__scopeDialog),r=v.useRef(null),i=Fm(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Mm(o)},[]),v.createElement(nV,Hi({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Rd(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Rd(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Rd(e.onFocusOutside,o=>o.preventDefault())}))}),Zxe=v.forwardRef((e,t)=>{const n=mf(Cg,e.__scopeDialog),r=v.useRef(!1);return v.createElement(nV,Hi({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1},onInteractOutside:i=>{var o,a;(o=e.onInteractOutside)===null||o===void 0||o.call(e,i),i.defaultPrevented||(r.current=!0);const s=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&i.preventDefault()}}))}),nV=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=mf(Cg,n),u=v.useRef(null),l=Fm(t,u);return yxe(),v.createElement(v.Fragment,null,v.createElement(uxe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},v.createElement(oxe,Hi({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":rV(s.open)},a,{ref:l,onDismiss:()=>s.onOpenChange(!1)}))),!1)});function rV(e){return e?"open":"closed"}const Xxe=Wxe,Qxe=Hxe,Jxe=qxe,ewe=Gxe;var twe='[cmdk-list-sizer=""]',Up='[cmdk-group=""]',a3='[cmdk-group-items=""]',nwe='[cmdk-group-heading=""]',QA='[cmdk-item=""]',nD=`${QA}:not([aria-disabled="true"])`,GE="cmdk-item-select",Qs="data-value",rwe=(e,t)=>Ube(e,t),iV=v.createContext(void 0),jm=()=>v.useContext(iV),oV=v.createContext(void 0),JA=()=>v.useContext(oV),aV=v.createContext(void 0),sV=v.forwardRef((e,t)=>{let n=v.useRef(null),r=nd(()=>{var Y,oe,X;return{search:"",value:(X=(oe=e.value)!=null?oe:(Y=e.defaultValue)==null?void 0:Y.toLowerCase())!=null?X:"",filtered:{count:0,items:new Map,groups:new Set}}}),i=nd(()=>new Set),o=nd(()=>new Map),a=nd(()=>new Map),s=nd(()=>new Set),u=uV(e),{label:l,children:c,value:f,onValueChange:h,filter:p,shouldFilter:m,vimBindings:y=!0,...b}=e,w=v.useId(),x=v.useId(),S=v.useId(),O=pwe();zh(()=>{if(f!==void 0){let Y=f.trim().toLowerCase();r.current.value=Y,O(6,V),E.emit()}},[f]);let E=v.useMemo(()=>({subscribe:Y=>(s.current.add(Y),()=>s.current.delete(Y)),snapshot:()=>r.current,setState:(Y,oe,X)=>{var Q,ue,de;if(!Object.is(r.current[Y],oe)){if(r.current[Y]=oe,Y==="search")B(),M(),O(1,N);else if(Y==="value")if(((Q=u.current)==null?void 0:Q.value)!==void 0){let Se=oe??"";(de=(ue=u.current).onValueChange)==null||de.call(ue,Se);return}else X||O(5,V);E.emit()}},emit:()=>{s.current.forEach(Y=>Y())}}),[]),C=v.useMemo(()=>({value:(Y,oe)=>{oe!==a.current.get(Y)&&(a.current.set(Y,oe),r.current.filtered.items.set(Y,P(oe)),O(2,()=>{M(),E.emit()}))},item:(Y,oe)=>(i.current.add(Y),oe&&(o.current.has(oe)?o.current.get(oe).add(Y):o.current.set(oe,new Set([Y]))),O(3,()=>{B(),M(),r.current.value||N(),E.emit()}),()=>{a.current.delete(Y),i.current.delete(Y),r.current.filtered.items.delete(Y);let X=W();O(4,()=>{B(),X?.getAttribute("id")===Y&&N(),E.emit()})}),group:Y=>(o.current.has(Y)||o.current.set(Y,new Set),()=>{a.current.delete(Y),o.current.delete(Y)}),filter:()=>u.current.shouldFilter,label:l||e["aria-label"],commandRef:n,listId:w,inputId:S,labelId:x}),[]);function P(Y){var oe,X;let Q=(X=(oe=u.current)==null?void 0:oe.filter)!=null?X:rwe;return Y?Q(Y,r.current.search):0}function M(){if(!n.current||!r.current.search||u.current.shouldFilter===!1)return;let Y=r.current.filtered.items,oe=[];r.current.filtered.groups.forEach(Q=>{let ue=o.current.get(Q),de=0;ue.forEach(Se=>{let me=Y.get(Se);de=Math.max(me,de)}),oe.push([Q,de])});let X=n.current.querySelector(twe);ne().sort((Q,ue)=>{var de,Se;let me=Q.getAttribute(Qs),Ze=ue.getAttribute(Qs);return((de=Y.get(Ze))!=null?de:0)-((Se=Y.get(me))!=null?Se:0)}).forEach(Q=>{let ue=Q.closest(a3);ue?ue.appendChild(Q.parentElement===ue?Q:Q.closest(`${a3} > *`)):X.appendChild(Q.parentElement===X?Q:Q.closest(`${a3} > *`))}),oe.sort((Q,ue)=>ue[1]-Q[1]).forEach(Q=>{let ue=n.current.querySelector(`${Up}[${Qs}="${Q[0]}"]`);ue?.parentElement.appendChild(ue)})}function N(){let Y=ne().find(X=>!X.ariaDisabled),oe=Y?.getAttribute(Qs);E.setState("value",oe||void 0)}function B(){if(!r.current.search||u.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let Y=0;for(let oe of i.current){let X=a.current.get(oe),Q=P(X);r.current.filtered.items.set(oe,Q),Q>0&&Y++}for(let[oe,X]of o.current)for(let Q of X)if(r.current.filtered.items.get(Q)>0){r.current.filtered.groups.add(oe);break}r.current.filtered.count=Y}function V(){var Y,oe,X;let Q=W();Q&&(((Y=Q.parentElement)==null?void 0:Y.firstChild)===Q&&((X=(oe=Q.closest(Up))==null?void 0:oe.querySelector(nwe))==null||X.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function W(){var Y;return(Y=n.current)==null?void 0:Y.querySelector(`${QA}[aria-selected="true"]`)}function ne(){return Array.from(n.current.querySelectorAll(nD))}function Z(Y){let oe=ne()[Y];oe&&E.setState("value",oe.getAttribute(Qs))}function q(Y){var oe;let X=W(),Q=ne(),ue=Q.findIndex(Se=>Se===X),de=Q[ue+Y];(oe=u.current)!=null&&oe.loop&&(de=ue+Y<0?Q[Q.length-1]:ue+Y===Q.length?Q[0]:Q[ue+Y]),de&&E.setState("value",de.getAttribute(Qs))}function G(Y){let oe=W(),X=oe?.closest(Up),Q;for(;X&&!Q;)X=Y>0?dwe(X,Up):hwe(X,Up),Q=X?.querySelector(nD);Q?E.setState("value",Q.getAttribute(Qs)):q(Y)}let H=()=>Z(ne().length-1),j=Y=>{Y.preventDefault(),Y.metaKey?H():Y.altKey?G(1):q(1)},K=Y=>{Y.preventDefault(),Y.metaKey?Z(0):Y.altKey?G(-1):q(-1)};return v.createElement("div",{ref:Bm([n,t]),...b,"cmdk-root":"",onKeyDown:Y=>{var oe;if((oe=b.onKeyDown)==null||oe.call(b,Y),!Y.defaultPrevented)switch(Y.key){case"n":case"j":{y&&Y.ctrlKey&&j(Y);break}case"ArrowDown":{j(Y);break}case"p":case"k":{y&&Y.ctrlKey&&K(Y);break}case"ArrowUp":{K(Y);break}case"Home":{Y.preventDefault(),Z(0);break}case"End":{Y.preventDefault(),H();break}case"Enter":if(!Y.nativeEvent.isComposing){Y.preventDefault();let X=W();if(X){let Q=new Event(GE);X.dispatchEvent(Q)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:gwe},l),v.createElement(oV.Provider,{value:E},v.createElement(iV.Provider,{value:C},c)))}),iwe=v.forwardRef((e,t)=>{var n,r;let i=v.useId(),o=v.useRef(null),a=v.useContext(aV),s=jm(),u=uV(e),l=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;zh(()=>s.item(i,a?.id),[]);let c=lV(i,o,[e.value,e.children,o]),f=JA(),h=ef(E=>E.value&&E.value===c.current),p=ef(E=>l||s.filter()===!1?!0:E.search?E.filtered.items.get(i)>0:!0);v.useEffect(()=>{let E=o.current;if(!(!E||e.disabled))return E.addEventListener(GE,m),()=>E.removeEventListener(GE,m)},[p,e.onSelect,e.disabled]);function m(){var E,C;y(),(C=(E=u.current).onSelect)==null||C.call(E,c.current)}function y(){f.setState("value",c.current,!0)}if(!p)return null;let{disabled:b,value:w,onSelect:x,forceMount:S,...O}=e;return v.createElement("div",{ref:Bm([o,t]),...O,id:i,"cmdk-item":"",role:"option","aria-disabled":b||void 0,"aria-selected":h||void 0,"data-disabled":b||void 0,"data-selected":h||void 0,onPointerMove:b?void 0:y,onClick:b?void 0:m},e.children)}),owe=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,a=v.useId(),s=v.useRef(null),u=v.useRef(null),l=v.useId(),c=jm(),f=ef(m=>i||c.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);zh(()=>c.group(a),[]),lV(a,s,[e.value,e.heading,u]);let h=v.useMemo(()=>({id:a,forceMount:i}),[i]),p=v.createElement(aV.Provider,{value:h},r);return v.createElement("div",{ref:Bm([s,t]),...o,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&v.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},p))}),awe=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=v.useRef(null),o=ef(a=>!a.search);return!n&&!o?null:v.createElement("div",{ref:Bm([i,t]),...r,"cmdk-separator":"",role:"separator"})}),swe=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=JA(),a=ef(c=>c.search),s=ef(c=>c.value),u=jm(),l=v.useMemo(()=>{var c;let f=(c=u.commandRef.current)==null?void 0:c.querySelector(`${QA}[${Qs}="${s}"]`);return f?.getAttribute("id")},[s,u.commandRef]);return v.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),v.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:i?e.value:a,onChange:c=>{i||o.setState("search",c.target.value),n?.(c.target.value)}})}),uwe=v.forwardRef((e,t)=>{let{children:n,...r}=e,i=v.useRef(null),o=v.useRef(null),a=jm();return v.useEffect(()=>{if(o.current&&i.current){let s=o.current,u=i.current,l,c=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let f=s.offsetHeight;u.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return c.observe(s),()=>{cancelAnimationFrame(l),c.unobserve(s)}}},[]),v.createElement("div",{ref:Bm([i,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:a.listId,"aria-labelledby":a.inputId},v.createElement("div",{ref:o,"cmdk-list-sizer":""},n))}),lwe=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=e;return v.createElement(Xxe,{open:n,onOpenChange:r},v.createElement(Qxe,{container:a},v.createElement(Jxe,{"cmdk-overlay":"",className:i}),v.createElement(ewe,{"aria-label":e.label,"cmdk-dialog":"",className:o},v.createElement(sV,{ref:t,...s}))))}),cwe=v.forwardRef((e,t)=>{let n=v.useRef(!0),r=ef(i=>i.filtered.count===0);return v.useEffect(()=>{n.current=!1},[]),n.current||!r?null:v.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),fwe=v.forwardRef((e,t)=>{let{progress:n,children:r,...i}=e;return v.createElement("div",{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},v.createElement("div",{"aria-hidden":!0},r))}),qet=Object.assign(sV,{List:uwe,Item:iwe,Input:swe,Group:owe,Separator:awe,Dialog:lwe,Empty:cwe,Loading:fwe});function dwe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function hwe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function uV(e){let t=v.useRef(e);return zh(()=>{t.current=e}),t}var zh=typeof window>"u"?v.useEffect:v.useLayoutEffect;function nd(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Bm(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function ef(e){let t=JA(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function lV(e,t,n){let r=v.useRef(),i=jm();return zh(()=>{var o;let a=(()=>{var s;for(let u of n){if(typeof u=="string")return u.trim().toLowerCase();if(typeof u=="object"&&"current"in u)return u.current?(s=u.current.textContent)==null?void 0:s.trim().toLowerCase():r.current}})();i.value(e,a),(o=t.current)==null||o.setAttribute(Qs,a),r.current=a}),r}var pwe=()=>{let[e,t]=v.useState(),n=nd(()=>new Map);return zh(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}},gwe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},eP="Avatar",[mwe,Ket]=Di(eP),[vwe,cV]=mwe(eP),fV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=v.useState("idle");return I.jsx(vwe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:I.jsx(mt.span,{...r,ref:t})})});fV.displayName=eP;var dV="AvatarImage",hV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=cV(dV,n),s=ywe(r,o.referrerPolicy),u=Vr(l=>{i(l),a.onImageLoadingStatusChange(l)});return On(()=>{s!=="idle"&&u(s)},[s,u]),s==="loaded"?I.jsx(mt.img,{...o,ref:t,src:r}):null});hV.displayName=dV;var pV="AvatarFallback",gV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=cV(pV,n),[a,s]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(u)}},[r]),a&&o.imageLoadingStatus!=="loaded"?I.jsx(mt.span,{...i,ref:t}):null});gV.displayName=pV;function ywe(e,t){const[n,r]=v.useState("idle");return On(()=>{if(!e){r("error");return}let i=!0;const o=new window.Image,a=s=>()=>{i&&r(s)};return r("loading"),o.onload=a("loaded"),o.onerror=a("error"),o.src=e,t&&(o.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var Get=fV,Yet=hV,Zet=gV,bwe=Array.isArray,mo=bwe,xwe=typeof la=="object"&&la&&la.Object===Object&&la,mV=xwe,wwe=mV,_we=typeof self=="object"&&self&&self.Object===Object&&self,Swe=wwe||_we||Function("return this")(),Ds=Swe,Cwe=Ds,Ewe=Cwe.Symbol,Um=Ewe,rD=Um,vV=Object.prototype,Owe=vV.hasOwnProperty,Awe=vV.toString,zp=rD?rD.toStringTag:void 0;function Pwe(e){var t=Owe.call(e,zp),n=e[zp];try{e[zp]=void 0;var r=!0}catch{}var i=Awe.call(e);return r&&(t?e[zp]=n:delete e[zp]),i}var kwe=Pwe,Twe=Object.prototype,Mwe=Twe.toString;function Rwe(e){return Mwe.call(e)}var Dwe=Rwe,iD=Um,$we=kwe,Iwe=Dwe,Nwe="[object Null]",Lwe="[object Undefined]",oD=iD?iD.toStringTag:void 0;function Fwe(e){return e==null?e===void 0?Lwe:Nwe:oD&&oD in Object(e)?$we(e):Iwe(e)}var Tu=Fwe;function jwe(e){return e!=null&&typeof e=="object"}var Mu=jwe,Bwe=Tu,Uwe=Mu,zwe="[object Symbol]";function Wwe(e){return typeof e=="symbol"||Uwe(e)&&Bwe(e)==zwe}var Wh=Wwe,Vwe=mo,Hwe=Wh,qwe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kwe=/^\w*$/;function Gwe(e,t){if(Vwe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Hwe(e)?!0:Kwe.test(e)||!qwe.test(e)||t!=null&&e in Object(t)}var tP=Gwe;function Ywe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Wl=Ywe;const Vh=kn(Wl);var Zwe=Tu,Xwe=Wl,Qwe="[object AsyncFunction]",Jwe="[object Function]",e2e="[object GeneratorFunction]",t2e="[object Proxy]";function n2e(e){if(!Xwe(e))return!1;var t=Zwe(e);return t==Jwe||t==e2e||t==Qwe||t==t2e}var nP=n2e;const qt=kn(nP);var r2e=Ds,i2e=r2e["__core-js_shared__"],o2e=i2e,s3=o2e,aD=function(){var e=/[^.]+$/.exec(s3&&s3.keys&&s3.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function a2e(e){return!!aD&&aD in e}var s2e=a2e,u2e=Function.prototype,l2e=u2e.toString;function c2e(e){if(e!=null){try{return l2e.call(e)}catch{}try{return e+""}catch{}}return""}var yV=c2e,f2e=nP,d2e=s2e,h2e=Wl,p2e=yV,g2e=/[\\^$.*+?()[\]{}|]/g,m2e=/^\[object .+?Constructor\]$/,v2e=Function.prototype,y2e=Object.prototype,b2e=v2e.toString,x2e=y2e.hasOwnProperty,w2e=RegExp("^"+b2e.call(x2e).replace(g2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _2e(e){if(!h2e(e)||d2e(e))return!1;var t=f2e(e)?w2e:m2e;return t.test(p2e(e))}var S2e=_2e;function C2e(e,t){return e?.[t]}var E2e=C2e,O2e=S2e,A2e=E2e;function P2e(e,t){var n=A2e(e,t);return O2e(n)?n:void 0}var vf=P2e,k2e=vf,T2e=k2e(Object,"create"),Bw=T2e,sD=Bw;function M2e(){this.__data__=sD?sD(null):{},this.size=0}var R2e=M2e;function D2e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var $2e=D2e,I2e=Bw,N2e="__lodash_hash_undefined__",L2e=Object.prototype,F2e=L2e.hasOwnProperty;function j2e(e){var t=this.__data__;if(I2e){var n=t[e];return n===N2e?void 0:n}return F2e.call(t,e)?t[e]:void 0}var B2e=j2e,U2e=Bw,z2e=Object.prototype,W2e=z2e.hasOwnProperty;function V2e(e){var t=this.__data__;return U2e?t[e]!==void 0:W2e.call(t,e)}var H2e=V2e,q2e=Bw,K2e="__lodash_hash_undefined__";function G2e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=q2e&&t===void 0?K2e:t,this}var Y2e=G2e,Z2e=R2e,X2e=$2e,Q2e=B2e,J2e=H2e,e_e=Y2e;function Hh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1}var v_e=m_e,y_e=Uw;function b_e(e,t){var n=this.__data__,r=y_e(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var x_e=b_e,w_e=r_e,__e=f_e,S_e=p_e,C_e=v_e,E_e=x_e;function qh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t0?1:-1},Cc=function(t){return zm(t)&&t.indexOf("%")===t.length-1},Ke=function(t){return KSe(t)&&!Gh(t)},qr=function(t){return Ke(t)||zm(t)},XSe=0,yf=function(t){var n=++XSe;return"".concat(t||"").concat(n)},tf=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ke(t)&&!zm(t))return r;var o;if(Cc(t)){var a=t.indexOf("%");o=n*parseFloat(t.slice(0,a))/100}else o=+t;return Gh(o)&&(o=r),i&&o>n&&(o=n),o},rl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},QSe=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function o3e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ZE(e){"@babel/helpers - typeof";return ZE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ZE(e)}var p9={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},fu=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},g9=null,l3=null,dP=function e(t){if(t===g9&&Array.isArray(l3))return l3;var n=[];return v.Children.forEach(t,function(r){Vt(r)||(zSe.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),l3=n,g9=t,n};function ho(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return fu(i)}):r=[fu(t)],dP(e).forEach(function(i){var o=pa(i,"type.displayName")||pa(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function ko(e,t){var n=ho(e,t);return n[0]}var m9=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!Ke(r)||r<=0||!Ke(i)||i<=0)},a3e=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],s3e=function(t){return t&&t.type&&zm(t.type)&&a3e.indexOf(t.type)>=0},PV=function(t){return t&&ZE(t)==="object"&&"clipDot"in t},u3e=function(t,n,r,i){var o,a=(o=u3?.[i])!==null&&o!==void 0?o:[];return!qt(t)&&(i&&a.includes(n)||t3e.includes(n))||r&&fP.includes(n)},Wt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(v.isValidElement(t)&&(i=t.props),!Vh(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;u3e((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},XE=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return v9(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function h3e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function JE(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,a=e.style,s=e.title,u=e.desc,l=d3e(e,f3e),c=i||{width:n,height:r,x:0,y:0},f=dn("recharts-surface",o);return F.createElement("svg",QE({},Wt(l,!0,"svg"),{className:f,width:n,height:r,style:a,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),F.createElement("title",null,s),F.createElement("desc",null,u),t)}var p3e=["children","className"];function e6(){return e6=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function m3e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var En=F.forwardRef(function(e,t){var n=e.children,r=e.className,i=g3e(e,p3e),o=dn("recharts-layer",r);return F.createElement("g",e6({className:o},Wt(i,!0),{ref:t}),n)}),du=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r=r?e:b3e(e,t,n)}var w3e=x3e,_3e="\\ud800-\\udfff",S3e="\\u0300-\\u036f",C3e="\\ufe20-\\ufe2f",E3e="\\u20d0-\\u20ff",O3e=S3e+C3e+E3e,A3e="\\ufe0e\\ufe0f",P3e="\\u200d",k3e=RegExp("["+P3e+_3e+O3e+A3e+"]");function T3e(e){return k3e.test(e)}var kV=T3e;function M3e(e){return e.split("")}var R3e=M3e,TV="\\ud800-\\udfff",D3e="\\u0300-\\u036f",$3e="\\ufe20-\\ufe2f",I3e="\\u20d0-\\u20ff",N3e=D3e+$3e+I3e,L3e="\\ufe0e\\ufe0f",F3e="["+TV+"]",t6="["+N3e+"]",n6="\\ud83c[\\udffb-\\udfff]",j3e="(?:"+t6+"|"+n6+")",MV="[^"+TV+"]",RV="(?:\\ud83c[\\udde6-\\uddff]){2}",DV="[\\ud800-\\udbff][\\udc00-\\udfff]",B3e="\\u200d",$V=j3e+"?",IV="["+L3e+"]?",U3e="(?:"+B3e+"(?:"+[MV,RV,DV].join("|")+")"+IV+$V+")*",z3e=IV+$V+U3e,W3e="(?:"+[MV+t6+"?",t6,RV,DV,F3e].join("|")+")",V3e=RegExp(n6+"(?="+n6+")|"+W3e+z3e,"g");function H3e(e){return e.match(V3e)||[]}var q3e=H3e,K3e=R3e,G3e=kV,Y3e=q3e;function Z3e(e){return G3e(e)?Y3e(e):K3e(e)}var X3e=Z3e,Q3e=w3e,J3e=kV,eCe=X3e,tCe=_V;function nCe(e){return function(t){t=tCe(t);var n=J3e(t)?eCe(t):void 0,r=n?n[0]:t.charAt(0),i=n?Q3e(n,1).join(""):t.slice(1);return r[e]()+i}}var rCe=nCe,iCe=rCe,oCe=iCe("toUpperCase"),aCe=oCe;const t2=kn(aCe);function Vn(e){return function(){return e}}const NV=Math.cos,Rb=Math.sin,ns=Math.sqrt,Db=Math.PI,n2=2*Db,r6=Math.PI,i6=2*r6,dc=1e-6,sCe=i6-dc;function LV(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return LV;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;idc)if(!(Math.abs(f*u-l*c)>dc)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,m=i-s,y=u*u+l*l,b=p*p+m*m,w=Math.sqrt(y),x=Math.sqrt(h),S=o*Math.tan((r6-Math.acos((y+h-b)/(2*w*x)))/2),O=S/x,E=S/w;Math.abs(O-1)>dc&&this._append`L${t+O*c},${n+O*f}`,this._append`A${o},${o},0,0,${+(f*p>c*m)},${this._x1=t+E*u},${this._y1=n+E*l}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),l=t+s,c=n+u,f=1^a,h=a?i-o:o-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>dc||Math.abs(this._y1-c)>dc)&&this._append`L${l},${c}`,r&&(h<0&&(h=h%i6+i6),h>sCe?this._append`A${r},${r},0,1,${f},${t-s},${n-u}A${r},${r},0,1,${f},${this._x1=l},${this._y1=c}`:h>dc&&this._append`A${r},${r},0,${+(h>=r6)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function hP(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new lCe(t)}function pP(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function FV(e){this._context=e}FV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function r2(e){return new FV(e)}function jV(e){return e[0]}function BV(e){return e[1]}function UV(e,t){var n=Vn(!0),r=null,i=r2,o=null,a=hP(s);e=typeof e=="function"?e:e===void 0?jV:Vn(e),t=typeof t=="function"?t:t===void 0?BV:Vn(t);function s(u){var l,c=(u=pP(u)).length,f,h=!1,p;for(r==null&&(o=i(p=a())),l=0;l<=c;++l)!(l=p;--m)s.point(S[m],O[m]);s.lineEnd(),s.areaEnd()}w&&(S[h]=+e(b,h,f),O[h]=+t(b,h,f),s.point(r?+r(b,h,f):S[h],n?+n(b,h,f):O[h]))}if(x)return s=null,x+""||null}function c(){return UV().defined(i).curve(a).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Vn(+f),r=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Vn(+f),l):e},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Vn(+f),l):r},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Vn(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Vn(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Vn(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(r).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Vn(!!f),l):i},l.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),l):a},l.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),l):o},l}class zV{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function cCe(e){return new zV(e,!0)}function fCe(e){return new zV(e,!1)}const gP={draw(e,t){const n=ns(t/Db);e.moveTo(n,0),e.arc(0,0,n,0,n2)}},dCe={draw(e,t){const n=ns(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},WV=ns(1/3),hCe=WV*2,pCe={draw(e,t){const n=ns(t/hCe),r=n*WV;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},gCe={draw(e,t){const n=ns(t),r=-n/2;e.rect(r,r,n,n)}},mCe=.8908130915292852,VV=Rb(Db/10)/Rb(7*Db/10),vCe=Rb(n2/10)*VV,yCe=-NV(n2/10)*VV,bCe={draw(e,t){const n=ns(t*mCe),r=vCe*n,i=yCe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const a=n2*o/5,s=NV(a),u=Rb(a);e.lineTo(u*n,-s*n),e.lineTo(s*r-u*i,u*r+s*i)}e.closePath()}},c3=ns(3),xCe={draw(e,t){const n=-ns(t/(c3*3));e.moveTo(0,n*2),e.lineTo(-c3*n,-n),e.lineTo(c3*n,-n),e.closePath()}},ta=-.5,na=ns(3)/2,o6=1/ns(12),wCe=(o6/2+1)*3,_Ce={draw(e,t){const n=ns(t/wCe),r=n/2,i=n*o6,o=r,a=n*o6+n,s=-o,u=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,u),e.lineTo(ta*r-na*i,na*r+ta*i),e.lineTo(ta*o-na*a,na*o+ta*a),e.lineTo(ta*s-na*u,na*s+ta*u),e.lineTo(ta*r+na*i,ta*i-na*r),e.lineTo(ta*o+na*a,ta*a-na*o),e.lineTo(ta*s+na*u,ta*u-na*s),e.closePath()}};function SCe(e,t){let n=null,r=hP(i);e=typeof e=="function"?e:Vn(e||gP),t=typeof t=="function"?t:Vn(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:Vn(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:Vn(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function $b(){}function Ib(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function HV(e){this._context=e}HV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ib(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ib(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function CCe(e){return new HV(e)}function qV(e){this._context=e}qV.prototype={areaStart:$b,areaEnd:$b,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ib(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ECe(e){return new qV(e)}function KV(e){this._context=e}KV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ib(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OCe(e){return new KV(e)}function GV(e){this._context=e}GV.prototype={areaStart:$b,areaEnd:$b,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ACe(e){return new GV(e)}function b9(e){return e<0?-1:1}function x9(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(b9(o)+b9(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function w9(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function f3(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function Nb(e){this._context=e}Nb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:f3(this,this._t0,w9(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,f3(this,w9(this,n=x9(this,e,t)),n);break;default:f3(this,this._t0,n=x9(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function YV(e){this._context=new ZV(e)}(YV.prototype=Object.create(Nb.prototype)).point=function(e,t){Nb.prototype.point.call(this,t,e)};function ZV(e){this._context=e}ZV.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function PCe(e){return new Nb(e)}function kCe(e){return new YV(e)}function XV(e){this._context=e}XV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=_9(e),i=_9(t),o=0,a=1;a=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function MCe(e){return new i2(e,.5)}function RCe(e){return new i2(e,0)}function DCe(e){return new i2(e,1)}function eh(e,t){if((a=e.length)>1)for(var n=1,r,i,o=e[t[0]],a,s=o.length;n=0;)n[t]=t;return n}function $Ce(e,t){return e[t]}function ICe(e){const t=[];return t.key=e,t}function NCe(){var e=Vn([]),t=a6,n=eh,r=$Ce;function i(o){var a=Array.from(e.apply(this,arguments),ICe),s,u=a.length,l=-1,c;for(const f of o)for(s=0,++l;s0){for(var n,r,i=0,o=e[0].length,a;i0){for(var n=0,r=e[t[0]],i,o=r.length;n0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,a;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HCe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var QV={symbolCircle:gP,symbolCross:dCe,symbolDiamond:pCe,symbolSquare:gCe,symbolStar:bCe,symbolTriangle:xCe,symbolWye:_Ce},qCe=Math.PI/180,KCe=function(t){var n="symbol".concat(t2(t));return QV[n]||gP},GCe=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*qCe;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},YCe=function(t,n){QV["symbol".concat(t2(t))]=n},o2=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,a=t.sizeType,s=a===void 0?"area":a,u=VCe(t,BCe),l=C9(C9({},u),{},{type:r,size:o,sizeType:s}),c=function(){var b=KCe(r),w=SCe().type(b).size(GCe(o,s,r));return w()},f=l.className,h=l.cx,p=l.cy,m=Wt(l,!0);return h===+h&&p===+p&&o===+o?F.createElement("path",s6({},m,{className:dn("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:c()})):null};o2.registerSymbol=YCe;function th(e){"@babel/helpers - typeof";return th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},th(e)}function u6(){return u6=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?1:-1},Cc=function(t){return zm(t)&&t.indexOf("%")===t.length-1},Ke=function(t){return KSe(t)&&!Gh(t)},qr=function(t){return Ke(t)||zm(t)},XSe=0,yf=function(t){var n=++XSe;return"".concat(t||"").concat(n)},tf=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ke(t)&&!zm(t))return r;var o;if(Cc(t)){var a=t.indexOf("%");o=n*parseFloat(t.slice(0,a))/100}else o=+t;return Gh(o)&&(o=r),i&&o>n&&(o=n),o},rl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},QSe=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function o3e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ZE(e){"@babel/helpers - typeof";return ZE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ZE(e)}var pD={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},fu=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},gD=null,l3=null,dP=function e(t){if(t===gD&&Array.isArray(l3))return l3;var n=[];return v.Children.forEach(t,function(r){Vt(r)||(zSe.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),l3=n,gD=t,n};function ho(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return fu(i)}):r=[fu(t)],dP(e).forEach(function(i){var o=pa(i,"type.displayName")||pa(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function ko(e,t){var n=ho(e,t);return n[0]}var mD=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!Ke(r)||r<=0||!Ke(i)||i<=0)},a3e=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],s3e=function(t){return t&&t.type&&zm(t.type)&&a3e.indexOf(t.type)>=0},PV=function(t){return t&&ZE(t)==="object"&&"clipDot"in t},u3e=function(t,n,r,i){var o,a=(o=u3?.[i])!==null&&o!==void 0?o:[];return!qt(t)&&(i&&a.includes(n)||t3e.includes(n))||r&&fP.includes(n)},Wt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(v.isValidElement(t)&&(i=t.props),!Vh(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;u3e((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},XE=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return vD(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function h3e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function JE(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,a=e.style,s=e.title,u=e.desc,l=d3e(e,f3e),c=i||{width:n,height:r,x:0,y:0},f=dn("recharts-surface",o);return F.createElement("svg",QE({},Wt(l,!0,"svg"),{className:f,width:n,height:r,style:a,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),F.createElement("title",null,s),F.createElement("desc",null,u),t)}var p3e=["children","className"];function e6(){return e6=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function m3e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var En=F.forwardRef(function(e,t){var n=e.children,r=e.className,i=g3e(e,p3e),o=dn("recharts-layer",r);return F.createElement("g",e6({className:o},Wt(i,!0),{ref:t}),n)}),du=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r=r?e:b3e(e,t,n)}var w3e=x3e,_3e="\\ud800-\\udfff",S3e="\\u0300-\\u036f",C3e="\\ufe20-\\ufe2f",E3e="\\u20d0-\\u20ff",O3e=S3e+C3e+E3e,A3e="\\ufe0e\\ufe0f",P3e="\\u200d",k3e=RegExp("["+P3e+_3e+O3e+A3e+"]");function T3e(e){return k3e.test(e)}var kV=T3e;function M3e(e){return e.split("")}var R3e=M3e,TV="\\ud800-\\udfff",D3e="\\u0300-\\u036f",$3e="\\ufe20-\\ufe2f",I3e="\\u20d0-\\u20ff",N3e=D3e+$3e+I3e,L3e="\\ufe0e\\ufe0f",F3e="["+TV+"]",t6="["+N3e+"]",n6="\\ud83c[\\udffb-\\udfff]",j3e="(?:"+t6+"|"+n6+")",MV="[^"+TV+"]",RV="(?:\\ud83c[\\udde6-\\uddff]){2}",DV="[\\ud800-\\udbff][\\udc00-\\udfff]",B3e="\\u200d",$V=j3e+"?",IV="["+L3e+"]?",U3e="(?:"+B3e+"(?:"+[MV,RV,DV].join("|")+")"+IV+$V+")*",z3e=IV+$V+U3e,W3e="(?:"+[MV+t6+"?",t6,RV,DV,F3e].join("|")+")",V3e=RegExp(n6+"(?="+n6+")|"+W3e+z3e,"g");function H3e(e){return e.match(V3e)||[]}var q3e=H3e,K3e=R3e,G3e=kV,Y3e=q3e;function Z3e(e){return G3e(e)?Y3e(e):K3e(e)}var X3e=Z3e,Q3e=w3e,J3e=kV,eCe=X3e,tCe=_V;function nCe(e){return function(t){t=tCe(t);var n=J3e(t)?eCe(t):void 0,r=n?n[0]:t.charAt(0),i=n?Q3e(n,1).join(""):t.slice(1);return r[e]()+i}}var rCe=nCe,iCe=rCe,oCe=iCe("toUpperCase"),aCe=oCe;const t2=kn(aCe);function Vn(e){return function(){return e}}const NV=Math.cos,Rb=Math.sin,ns=Math.sqrt,Db=Math.PI,n2=2*Db,r6=Math.PI,i6=2*r6,dc=1e-6,sCe=i6-dc;function LV(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return LV;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;idc)if(!(Math.abs(f*u-l*c)>dc)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,m=i-s,y=u*u+l*l,b=p*p+m*m,w=Math.sqrt(y),x=Math.sqrt(h),S=o*Math.tan((r6-Math.acos((y+h-b)/(2*w*x)))/2),O=S/x,E=S/w;Math.abs(O-1)>dc&&this._append`L${t+O*c},${n+O*f}`,this._append`A${o},${o},0,0,${+(f*p>c*m)},${this._x1=t+E*u},${this._y1=n+E*l}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),l=t+s,c=n+u,f=1^a,h=a?i-o:o-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>dc||Math.abs(this._y1-c)>dc)&&this._append`L${l},${c}`,r&&(h<0&&(h=h%i6+i6),h>sCe?this._append`A${r},${r},0,1,${f},${t-s},${n-u}A${r},${r},0,1,${f},${this._x1=l},${this._y1=c}`:h>dc&&this._append`A${r},${r},0,${+(h>=r6)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function hP(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new lCe(t)}function pP(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function FV(e){this._context=e}FV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function r2(e){return new FV(e)}function jV(e){return e[0]}function BV(e){return e[1]}function UV(e,t){var n=Vn(!0),r=null,i=r2,o=null,a=hP(s);e=typeof e=="function"?e:e===void 0?jV:Vn(e),t=typeof t=="function"?t:t===void 0?BV:Vn(t);function s(u){var l,c=(u=pP(u)).length,f,h=!1,p;for(r==null&&(o=i(p=a())),l=0;l<=c;++l)!(l=p;--m)s.point(S[m],O[m]);s.lineEnd(),s.areaEnd()}w&&(S[h]=+e(b,h,f),O[h]=+t(b,h,f),s.point(r?+r(b,h,f):S[h],n?+n(b,h,f):O[h]))}if(x)return s=null,x+""||null}function c(){return UV().defined(i).curve(a).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Vn(+f),r=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Vn(+f),l):e},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Vn(+f),l):r},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Vn(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Vn(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Vn(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(r).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Vn(!!f),l):i},l.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),l):a},l.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),l):o},l}class zV{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function cCe(e){return new zV(e,!0)}function fCe(e){return new zV(e,!1)}const gP={draw(e,t){const n=ns(t/Db);e.moveTo(n,0),e.arc(0,0,n,0,n2)}},dCe={draw(e,t){const n=ns(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},WV=ns(1/3),hCe=WV*2,pCe={draw(e,t){const n=ns(t/hCe),r=n*WV;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},gCe={draw(e,t){const n=ns(t),r=-n/2;e.rect(r,r,n,n)}},mCe=.8908130915292852,VV=Rb(Db/10)/Rb(7*Db/10),vCe=Rb(n2/10)*VV,yCe=-NV(n2/10)*VV,bCe={draw(e,t){const n=ns(t*mCe),r=vCe*n,i=yCe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const a=n2*o/5,s=NV(a),u=Rb(a);e.lineTo(u*n,-s*n),e.lineTo(s*r-u*i,u*r+s*i)}e.closePath()}},c3=ns(3),xCe={draw(e,t){const n=-ns(t/(c3*3));e.moveTo(0,n*2),e.lineTo(-c3*n,-n),e.lineTo(c3*n,-n),e.closePath()}},ta=-.5,na=ns(3)/2,o6=1/ns(12),wCe=(o6/2+1)*3,_Ce={draw(e,t){const n=ns(t/wCe),r=n/2,i=n*o6,o=r,a=n*o6+n,s=-o,u=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,u),e.lineTo(ta*r-na*i,na*r+ta*i),e.lineTo(ta*o-na*a,na*o+ta*a),e.lineTo(ta*s-na*u,na*s+ta*u),e.lineTo(ta*r+na*i,ta*i-na*r),e.lineTo(ta*o+na*a,ta*a-na*o),e.lineTo(ta*s+na*u,ta*u-na*s),e.closePath()}};function SCe(e,t){let n=null,r=hP(i);e=typeof e=="function"?e:Vn(e||gP),t=typeof t=="function"?t:Vn(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:Vn(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:Vn(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function $b(){}function Ib(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function HV(e){this._context=e}HV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ib(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ib(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function CCe(e){return new HV(e)}function qV(e){this._context=e}qV.prototype={areaStart:$b,areaEnd:$b,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ib(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ECe(e){return new qV(e)}function KV(e){this._context=e}KV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ib(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OCe(e){return new KV(e)}function GV(e){this._context=e}GV.prototype={areaStart:$b,areaEnd:$b,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ACe(e){return new GV(e)}function bD(e){return e<0?-1:1}function xD(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(bD(o)+bD(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function wD(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function f3(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function Nb(e){this._context=e}Nb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:f3(this,this._t0,wD(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,f3(this,wD(this,n=xD(this,e,t)),n);break;default:f3(this,this._t0,n=xD(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function YV(e){this._context=new ZV(e)}(YV.prototype=Object.create(Nb.prototype)).point=function(e,t){Nb.prototype.point.call(this,t,e)};function ZV(e){this._context=e}ZV.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function PCe(e){return new Nb(e)}function kCe(e){return new YV(e)}function XV(e){this._context=e}XV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=_D(e),i=_D(t),o=0,a=1;a=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function MCe(e){return new i2(e,.5)}function RCe(e){return new i2(e,0)}function DCe(e){return new i2(e,1)}function eh(e,t){if((a=e.length)>1)for(var n=1,r,i,o=e[t[0]],a,s=o.length;n=0;)n[t]=t;return n}function $Ce(e,t){return e[t]}function ICe(e){const t=[];return t.key=e,t}function NCe(){var e=Vn([]),t=a6,n=eh,r=$Ce;function i(o){var a=Array.from(e.apply(this,arguments),ICe),s,u=a.length,l=-1,c;for(const f of o)for(s=0,++l;s0){for(var n,r,i=0,o=e[0].length,a;i0){for(var n=0,r=e[t[0]],i,o=r.length;n0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,a;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HCe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var QV={symbolCircle:gP,symbolCross:dCe,symbolDiamond:pCe,symbolSquare:gCe,symbolStar:bCe,symbolTriangle:xCe,symbolWye:_Ce},qCe=Math.PI/180,KCe=function(t){var n="symbol".concat(t2(t));return QV[n]||gP},GCe=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*qCe;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},YCe=function(t,n){QV["symbol".concat(t2(t))]=n},o2=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,a=t.sizeType,s=a===void 0?"area":a,u=VCe(t,BCe),l=CD(CD({},u),{},{type:r,size:o,sizeType:s}),c=function(){var b=KCe(r),w=SCe().type(b).size(GCe(o,s,r));return w()},f=l.className,h=l.cx,p=l.cy,m=Wt(l,!0);return h===+h&&p===+p&&o===+o?F.createElement("path",s6({},m,{className:dn("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:c()})):null};o2.registerSymbol=YCe;function th(e){"@babel/helpers - typeof";return th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},th(e)}function u6(){return u6=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=p.inactive?l:p.color;return F.createElement("li",u6({className:b,style:f,key:"legend-item-".concat(m)},Eg(r.props,p,m)),F.createElement(JE,{width:a,height:a,viewBox:c,style:h},r.renderIcon(p)),F.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},y?y(w,p,m):w))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return F.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(v.PureComponent);Ag(mP,"displayName","Legend");Ag(mP,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var oEe=zw;function aEe(){this.__data__=new oEe,this.size=0}var sEe=aEe;function uEe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var lEe=uEe;function cEe(e){return this.__data__.get(e)}var fEe=cEe;function dEe(e){return this.__data__.has(e)}var hEe=dEe,pEe=zw,gEe=iP,mEe=oP,vEe=200;function yEe(e,t){var n=this.__data__;if(n instanceof pEe){var r=n.__data__;if(!gEe||r.lengths))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var f=-1,h=!0,p=n&BEe?new NEe:void 0;for(o.set(e,t),o.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=V6e}var xP=H6e,q6e=Tu,K6e=xP,G6e=Mu,Y6e="[object Arguments]",Z6e="[object Array]",X6e="[object Boolean]",Q6e="[object Date]",J6e="[object Error]",e4e="[object Function]",t4e="[object Map]",n4e="[object Number]",r4e="[object Object]",i4e="[object RegExp]",o4e="[object Set]",a4e="[object String]",s4e="[object WeakMap]",u4e="[object ArrayBuffer]",l4e="[object DataView]",c4e="[object Float32Array]",f4e="[object Float64Array]",d4e="[object Int8Array]",h4e="[object Int16Array]",p4e="[object Int32Array]",g4e="[object Uint8Array]",m4e="[object Uint8ClampedArray]",v4e="[object Uint16Array]",y4e="[object Uint32Array]",tr={};tr[c4e]=tr[f4e]=tr[d4e]=tr[h4e]=tr[p4e]=tr[g4e]=tr[m4e]=tr[v4e]=tr[y4e]=!0;tr[Y6e]=tr[Z6e]=tr[u4e]=tr[X6e]=tr[l4e]=tr[Q6e]=tr[J6e]=tr[e4e]=tr[t4e]=tr[n4e]=tr[r4e]=tr[i4e]=tr[o4e]=tr[a4e]=tr[s4e]=!1;function b4e(e){return G6e(e)&&K6e(e.length)&&!!tr[q6e(e)]}var x4e=b4e;function w4e(e){return function(t){return e(t)}}var lH=w4e,Bb={exports:{}};Bb.exports;(function(e,t){var n=mV,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var u=i&&i.require&&i.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s})(Bb,Bb.exports);var _4e=Bb.exports,S4e=x4e,C4e=lH,M9=_4e,R9=M9&&M9.isTypedArray,E4e=R9?C4e(R9):S4e,cH=E4e,O4e=k6e,A4e=yP,P4e=mo,k4e=uH,T4e=bP,M4e=cH,R4e=Object.prototype,D4e=R4e.hasOwnProperty;function $4e(e,t){var n=P4e(e),r=!n&&A4e(e),i=!n&&!r&&k4e(e),o=!n&&!r&&!i&&M4e(e),a=n||r||i||o,s=a?O4e(e.length,String):[],u=s.length;for(var l in e)(t||D4e.call(e,l))&&!(a&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||T4e(l,u)))&&s.push(l);return s}var I4e=$4e,N4e=Object.prototype;function L4e(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||N4e;return e===n}var F4e=L4e;function j4e(e,t){return function(n){return e(t(n))}}var fH=j4e,B4e=fH,U4e=B4e(Object.keys,Object),z4e=U4e,W4e=F4e,V4e=z4e,H4e=Object.prototype,q4e=H4e.hasOwnProperty;function K4e(e){if(!W4e(e))return V4e(e);var t=[];for(var n in Object(e))q4e.call(e,n)&&n!="constructor"&&t.push(n);return t}var G4e=K4e,Y4e=nP,Z4e=xP;function X4e(e){return e!=null&&Z4e(e.length)&&!Y4e(e)}var Wm=X4e,Q4e=I4e,J4e=G4e,eOe=Wm;function tOe(e){return eOe(e)?Q4e(e):J4e(e)}var a2=tOe,nOe=v6e,rOe=A6e,iOe=a2;function oOe(e){return nOe(e,iOe,rOe)}var aOe=oOe,D9=aOe,sOe=1,uOe=Object.prototype,lOe=uOe.hasOwnProperty;function cOe(e,t,n,r,i,o){var a=n&sOe,s=D9(e),u=s.length,l=D9(t),c=l.length;if(u!=c&&!a)return!1;for(var f=u;f--;){var h=s[f];if(!(a?h in t:lOe.call(t,h)))return!1}var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var y=!0;o.set(e,t),o.set(t,e);for(var b=a;++f-1}var uPe=sPe;function lPe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r=CPe){var l=t?null:_Pe(e);if(l)return SPe(l);a=!1,i=wPe,u=new yPe}else u=t?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BPe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function UPe(e){return e.value}function zPe(e,t){if(F.isValidElement(e))return F.cloneElement(e,t);if(typeof e=="function")return F.createElement(e,t);t.ref;var n=jPe(t,MPe);return F.createElement(mP,n)}var Y9=1,Id=function(e){function t(){var n;RPe(this,t);for(var r=arguments.length,i=new Array(r),o=0;oY9||Math.abs(i.height-this.lastBoundingBox.height)>Y9)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Gs({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,u=i.margin,l=i.chartWidth,c=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var p=this.getBBoxSnapshot();f={left:((l||0)-p.width)/2}}else f=a==="right"?{right:u&&u.right||0}:{left:u&&u.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var m=this.getBBoxSnapshot();h={top:((c||0)-m.height)/2}}else h=s==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return Gs(Gs({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,u=i.wrapperStyle,l=i.payloadUniqBy,c=i.payload,f=Gs(Gs({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(u)),u);return F.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},zPe(o,Gs(Gs({},this.props),{},{payload:yH(c,l,UPe)})))}}],[{key:"getWithHeight",value:function(r,i){var o=Gs(Gs({},this.defaultProps),r.props),a=o.layout;return a==="vertical"&&Ke(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(v.PureComponent);s2(Id,"displayName","Legend");s2(Id,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Z9=Um,WPe=yP,VPe=mo,X9=Z9?Z9.isConcatSpreadable:void 0;function HPe(e){return VPe(e)||WPe(e)||!!(X9&&e&&e[X9])}var qPe=HPe,KPe=aH,GPe=qPe;function wH(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=GPe),i||(i=[]);++o0&&n(s)?t>1?wH(s,t-1,n,r,i):KPe(i,s):r||(i[i.length]=s)}return i}var _H=wH;function YPe(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(n(o[u],u,o)===!1)break}return t}}var ZPe=YPe,XPe=ZPe,QPe=XPe(),JPe=QPe,e5e=JPe,t5e=a2;function n5e(e,t){return e&&e5e(e,t,t5e)}var SH=n5e,r5e=Wm;function i5e(e,t){return function(n,r){if(n==null)return n;if(!r5e(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++ot||o&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!l&&e=s)return u;var l=n[r];return u*(l=="desc"?-1:1)}}return e.index-t.index}var y5e=v5e,g3=sP,b5e=uP,x5e=Vl,w5e=CH,_5e=h5e,S5e=lH,C5e=y5e,E5e=Xh,O5e=mo;function A5e(e,t,n){t.length?t=g3(t,function(o){return O5e(o)?function(a){return b5e(a,o.length===1?o[0]:o)}:o}):t=[E5e];var r=-1;t=g3(t,S5e(x5e));var i=w5e(e,function(o,a,s){var u=g3(t,function(l){return l(o)});return{criteria:u,index:++r,value:o}});return _5e(i,function(o,a){return C5e(o,a,n)})}var P5e=A5e;function k5e(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var T5e=k5e,M5e=T5e,J9=Math.max;function R5e(e,t,n){return t=J9(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=J9(r.length-t,0),a=Array(o);++i0){if(++t>=z5e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var q5e=H5e,K5e=U5e,G5e=q5e,Y5e=G5e(K5e),Z5e=Y5e,X5e=Xh,Q5e=D5e,J5e=Z5e;function e8e(e,t){return J5e(Q5e(e,t,X5e),e+"")}var t8e=e8e,n8e=rP,r8e=Wm,i8e=bP,o8e=Wl;function a8e(e,t,n){if(!o8e(n))return!1;var r=typeof t;return(r=="number"?r8e(n)&&i8e(t,n.length):r=="string"&&t in n)?n8e(n[t],e):!1}var u2=a8e,s8e=_H,u8e=P5e,l8e=t8e,t7=u2,c8e=l8e(function(e,t){if(e==null)return[];var n=t.length;return n>1&&t7(e,t[0],t[1])?t=[]:n>2&&t7(t[0],t[1],t[2])&&(t=[t[0]]),u8e(e,s8e(t,1),[])}),f8e=c8e;const SP=kn(f8e);function Pg(e){"@babel/helpers - typeof";return Pg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pg(e)}function m6(){return m6=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=p.inactive?l:p.color;return F.createElement("li",u6({className:b,style:f,key:"legend-item-".concat(m)},Eg(r.props,p,m)),F.createElement(JE,{width:a,height:a,viewBox:c,style:h},r.renderIcon(p)),F.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},y?y(w,p,m):w))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return F.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(v.PureComponent);Ag(mP,"displayName","Legend");Ag(mP,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var oEe=zw;function aEe(){this.__data__=new oEe,this.size=0}var sEe=aEe;function uEe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var lEe=uEe;function cEe(e){return this.__data__.get(e)}var fEe=cEe;function dEe(e){return this.__data__.has(e)}var hEe=dEe,pEe=zw,gEe=iP,mEe=oP,vEe=200;function yEe(e,t){var n=this.__data__;if(n instanceof pEe){var r=n.__data__;if(!gEe||r.lengths))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var f=-1,h=!0,p=n&BEe?new NEe:void 0;for(o.set(e,t),o.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=V6e}var xP=H6e,q6e=Tu,K6e=xP,G6e=Mu,Y6e="[object Arguments]",Z6e="[object Array]",X6e="[object Boolean]",Q6e="[object Date]",J6e="[object Error]",e4e="[object Function]",t4e="[object Map]",n4e="[object Number]",r4e="[object Object]",i4e="[object RegExp]",o4e="[object Set]",a4e="[object String]",s4e="[object WeakMap]",u4e="[object ArrayBuffer]",l4e="[object DataView]",c4e="[object Float32Array]",f4e="[object Float64Array]",d4e="[object Int8Array]",h4e="[object Int16Array]",p4e="[object Int32Array]",g4e="[object Uint8Array]",m4e="[object Uint8ClampedArray]",v4e="[object Uint16Array]",y4e="[object Uint32Array]",tr={};tr[c4e]=tr[f4e]=tr[d4e]=tr[h4e]=tr[p4e]=tr[g4e]=tr[m4e]=tr[v4e]=tr[y4e]=!0;tr[Y6e]=tr[Z6e]=tr[u4e]=tr[X6e]=tr[l4e]=tr[Q6e]=tr[J6e]=tr[e4e]=tr[t4e]=tr[n4e]=tr[r4e]=tr[i4e]=tr[o4e]=tr[a4e]=tr[s4e]=!1;function b4e(e){return G6e(e)&&K6e(e.length)&&!!tr[q6e(e)]}var x4e=b4e;function w4e(e){return function(t){return e(t)}}var lH=w4e,Bb={exports:{}};Bb.exports;(function(e,t){var n=mV,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var u=i&&i.require&&i.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s})(Bb,Bb.exports);var _4e=Bb.exports,S4e=x4e,C4e=lH,MD=_4e,RD=MD&&MD.isTypedArray,E4e=RD?C4e(RD):S4e,cH=E4e,O4e=k6e,A4e=yP,P4e=mo,k4e=uH,T4e=bP,M4e=cH,R4e=Object.prototype,D4e=R4e.hasOwnProperty;function $4e(e,t){var n=P4e(e),r=!n&&A4e(e),i=!n&&!r&&k4e(e),o=!n&&!r&&!i&&M4e(e),a=n||r||i||o,s=a?O4e(e.length,String):[],u=s.length;for(var l in e)(t||D4e.call(e,l))&&!(a&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||T4e(l,u)))&&s.push(l);return s}var I4e=$4e,N4e=Object.prototype;function L4e(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||N4e;return e===n}var F4e=L4e;function j4e(e,t){return function(n){return e(t(n))}}var fH=j4e,B4e=fH,U4e=B4e(Object.keys,Object),z4e=U4e,W4e=F4e,V4e=z4e,H4e=Object.prototype,q4e=H4e.hasOwnProperty;function K4e(e){if(!W4e(e))return V4e(e);var t=[];for(var n in Object(e))q4e.call(e,n)&&n!="constructor"&&t.push(n);return t}var G4e=K4e,Y4e=nP,Z4e=xP;function X4e(e){return e!=null&&Z4e(e.length)&&!Y4e(e)}var Wm=X4e,Q4e=I4e,J4e=G4e,eOe=Wm;function tOe(e){return eOe(e)?Q4e(e):J4e(e)}var a2=tOe,nOe=v6e,rOe=A6e,iOe=a2;function oOe(e){return nOe(e,iOe,rOe)}var aOe=oOe,DD=aOe,sOe=1,uOe=Object.prototype,lOe=uOe.hasOwnProperty;function cOe(e,t,n,r,i,o){var a=n&sOe,s=DD(e),u=s.length,l=DD(t),c=l.length;if(u!=c&&!a)return!1;for(var f=u;f--;){var h=s[f];if(!(a?h in t:lOe.call(t,h)))return!1}var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var y=!0;o.set(e,t),o.set(t,e);for(var b=a;++f-1}var uPe=sPe;function lPe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r=CPe){var l=t?null:_Pe(e);if(l)return SPe(l);a=!1,i=wPe,u=new yPe}else u=t?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BPe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function UPe(e){return e.value}function zPe(e,t){if(F.isValidElement(e))return F.cloneElement(e,t);if(typeof e=="function")return F.createElement(e,t);t.ref;var n=jPe(t,MPe);return F.createElement(mP,n)}var YD=1,Id=function(e){function t(){var n;RPe(this,t);for(var r=arguments.length,i=new Array(r),o=0;oYD||Math.abs(i.height-this.lastBoundingBox.height)>YD)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Gs({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,u=i.margin,l=i.chartWidth,c=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var p=this.getBBoxSnapshot();f={left:((l||0)-p.width)/2}}else f=a==="right"?{right:u&&u.right||0}:{left:u&&u.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var m=this.getBBoxSnapshot();h={top:((c||0)-m.height)/2}}else h=s==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return Gs(Gs({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,u=i.wrapperStyle,l=i.payloadUniqBy,c=i.payload,f=Gs(Gs({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(u)),u);return F.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},zPe(o,Gs(Gs({},this.props),{},{payload:yH(c,l,UPe)})))}}],[{key:"getWithHeight",value:function(r,i){var o=Gs(Gs({},this.defaultProps),r.props),a=o.layout;return a==="vertical"&&Ke(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(v.PureComponent);s2(Id,"displayName","Legend");s2(Id,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var ZD=Um,WPe=yP,VPe=mo,XD=ZD?ZD.isConcatSpreadable:void 0;function HPe(e){return VPe(e)||WPe(e)||!!(XD&&e&&e[XD])}var qPe=HPe,KPe=aH,GPe=qPe;function wH(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=GPe),i||(i=[]);++o0&&n(s)?t>1?wH(s,t-1,n,r,i):KPe(i,s):r||(i[i.length]=s)}return i}var _H=wH;function YPe(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(n(o[u],u,o)===!1)break}return t}}var ZPe=YPe,XPe=ZPe,QPe=XPe(),JPe=QPe,e5e=JPe,t5e=a2;function n5e(e,t){return e&&e5e(e,t,t5e)}var SH=n5e,r5e=Wm;function i5e(e,t){return function(n,r){if(n==null)return n;if(!r5e(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++ot||o&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!l&&e=s)return u;var l=n[r];return u*(l=="desc"?-1:1)}}return e.index-t.index}var y5e=v5e,g3=sP,b5e=uP,x5e=Vl,w5e=CH,_5e=h5e,S5e=lH,C5e=y5e,E5e=Xh,O5e=mo;function A5e(e,t,n){t.length?t=g3(t,function(o){return O5e(o)?function(a){return b5e(a,o.length===1?o[0]:o)}:o}):t=[E5e];var r=-1;t=g3(t,S5e(x5e));var i=w5e(e,function(o,a,s){var u=g3(t,function(l){return l(o)});return{criteria:u,index:++r,value:o}});return _5e(i,function(o,a){return C5e(o,a,n)})}var P5e=A5e;function k5e(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var T5e=k5e,M5e=T5e,JD=Math.max;function R5e(e,t,n){return t=JD(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=JD(r.length-t,0),a=Array(o);++i0){if(++t>=z5e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var q5e=H5e,K5e=U5e,G5e=q5e,Y5e=G5e(K5e),Z5e=Y5e,X5e=Xh,Q5e=D5e,J5e=Z5e;function e8e(e,t){return J5e(Q5e(e,t,X5e),e+"")}var t8e=e8e,n8e=rP,r8e=Wm,i8e=bP,o8e=Wl;function a8e(e,t,n){if(!o8e(n))return!1;var r=typeof t;return(r=="number"?r8e(n)&&i8e(t,n.length):r=="string"&&t in n)?n8e(n[t],e):!1}var u2=a8e,s8e=_H,u8e=P5e,l8e=t8e,t7=u2,c8e=l8e(function(e,t){if(e==null)return[];var n=t.length;return n>1&&t7(e,t[0],t[1])?t=[]:n>2&&t7(t[0],t[1],t[2])&&(t=[t[0]]),u8e(e,s8e(t,1),[])}),f8e=c8e;const SP=kn(f8e);function Pg(e){"@babel/helpers - typeof";return Pg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pg(e)}function m6(){return m6=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(Wp,"-left"),Ke(n)&&t&&Ke(t.x)&&n=t.y),"".concat(Wp,"-top"),Ke(r)&&t&&Ke(t.y)&&ry?Math.max(c,u[r]):Math.max(f,u[r])}function O8e(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function A8e(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,o=e.reverseDirection,a=e.tooltipBox,s=e.useTranslate3d,u=e.viewBox,l,c,f;return a.height>0&&a.width>0&&n?(c=i7({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:u,viewBoxDimension:u.width}),f=i7({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:u,viewBoxDimension:u.height}),l=O8e({translateX:c,translateY:f,useTranslate3d:s})):l=C8e,{cssProperties:l,cssClasses:E8e({translateX:c,translateY:f,coordinate:n})}}function rh(e){"@babel/helpers - typeof";return rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rh(e)}function o7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function a7(e){for(var t=1;ts7||Math.abs(r.height-this.state.lastBoundingBox.height)>s7)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,u=i.animationEasing,l=i.children,c=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,p=i.offset,m=i.position,y=i.reverseDirection,b=i.useTranslate3d,w=i.viewBox,x=i.wrapperStyle,S=A8e({allowEscapeViewBox:a,coordinate:c,offsetTopLeft:p,position:m,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:w}),O=S.cssClasses,E=S.cssProperties,C=a7(a7({transition:h&&o?"transform ".concat(s,"ms ").concat(u):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return F.createElement("div",{tabIndex:-1,className:O,style:C,ref:function(M){r.wrapperNode=M}},l)}}])}(v.PureComponent),L8e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},qa={isSsr:L8e(),get:function(t){return qa[t]},set:function(t,n){if(typeof t=="string")qa[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(i){qa[i]=t[i]})}}};function ih(e){"@babel/helpers - typeof";return ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ih(e)}function u7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function l7(e){for(var t=1;t0;return F.createElement(N8e,{allowEscapeViewBox:a,animationDuration:s,animationEasing:u,isAnimationActive:h,active:o,coordinate:c,hasPayload:C,offset:p,position:b,reverseDirection:w,useTranslate3d:x,viewBox:S,wrapperStyle:O},K8e(l,l7(l7({},this.props),{},{payload:E})))}}])}(v.PureComponent);CP(Js,"displayName","Tooltip");CP(Js,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!qa.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var G8e=Ds,Y8e=function(){return G8e.Date.now()},Z8e=Y8e,X8e=/\s/;function Q8e(e){for(var t=e.length;t--&&X8e.test(e.charAt(t)););return t}var J8e=Q8e,eke=J8e,tke=/^\s+/;function nke(e){return e&&e.slice(0,eke(e)+1).replace(tke,"")}var rke=nke,ike=rke,c7=Wl,oke=Wh,f7=NaN,ake=/^[-+]0x[0-9a-f]+$/i,ske=/^0b[01]+$/i,uke=/^0o[0-7]+$/i,lke=parseInt;function cke(e){if(typeof e=="number")return e;if(oke(e))return f7;if(c7(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=c7(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=ike(e);var n=ske.test(e);return n||uke.test(e)?lke(e.slice(2),n?2:8):ake.test(e)?f7:+e}var TH=cke,fke=Wl,v3=Z8e,d7=TH,dke="Expected a function",hke=Math.max,pke=Math.min;function gke(e,t,n){var r,i,o,a,s,u,l=0,c=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(dke);t=d7(t)||0,fke(n)&&(c=!!n.leading,f="maxWait"in n,o=f?hke(d7(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function p(C){var P=r,M=i;return r=i=void 0,l=C,a=e.apply(M,P),a}function m(C){return l=C,s=setTimeout(w,t),c?p(C):a}function y(C){var P=C-u,M=C-l,N=t-P;return f?pke(N,o-M):N}function b(C){var P=C-u,M=C-l;return u===void 0||P>=t||P<0||f&&M>=o}function w(){var C=v3();if(b(C))return x(C);s=setTimeout(w,y(C))}function x(C){return s=void 0,h&&r?p(C):(r=i=void 0,a)}function S(){s!==void 0&&clearTimeout(s),l=0,r=u=i=s=void 0}function O(){return s===void 0?a:x(v3())}function E(){var C=v3(),P=b(C);if(r=arguments,i=this,u=C,P){if(s===void 0)return m(u);if(f)return clearTimeout(s),s=setTimeout(w,t),p(u)}return s===void 0&&(s=setTimeout(w,t)),a}return E.cancel=S,E.flush=O,E}var mke=gke,vke=mke,yke=Wl,bke="Expected a function";function xke(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(bke);return yke(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),vke(e,t,{leading:r,maxWait:t,trailing:i})}var wke=xke;const MH=kn(wke);function Tg(e){"@babel/helpers - typeof";return Tg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tg(e)}function h7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ty(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(ne=MH(ne,y,{trailing:!0,leading:!1}));var Z=new ResizeObserver(ne),q=E.current.getBoundingClientRect(),G=q.width,H=q.height;return V(G,H),Z.observe(E.current),function(){Z.disconnect()}},[V,y]);var W=v.useMemo(function(){var ne=N.containerWidth,Z=N.containerHeight;if(ne<0||Z<0)return null;du(Cc(a)||Cc(u),`The width(%s) and height(%s) are both fixed numbers, +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ake(e,t){if(e){if(typeof e=="string")return p7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p7(e,t)}}function p7(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(ne=MH(ne,y,{trailing:!0,leading:!1}));var Z=new ResizeObserver(ne),q=E.current.getBoundingClientRect(),G=q.width,H=q.height;return V(G,H),Z.observe(E.current),function(){Z.disconnect()}},[V,y]);var W=v.useMemo(function(){var ne=N.containerWidth,Z=N.containerHeight;if(ne<0||Z<0)return null;du(Cc(a)||Cc(u),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,a,u),du(!n||n>0,"The aspect(%s) must be greater than zero.",n);var q=Cc(a)?ne:a,G=Cc(u)?Z:u;n&&n>0&&(q?G=q/n:G&&(q=G*n),h&&G>h&&(G=h)),du(q>0||G>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.`,q,G,a,u,c,f,n);var H=!Array.isArray(p)&&fu(p.type).endsWith("Chart");return F.Children.map(p,function(j){return F.isValidElement(j)?v.cloneElement(j,Ty({width:q,height:G},H?{style:Ty({height:"100%",width:"100%",maxHeight:G,maxWidth:q},j.props.style)}:{})):j})},[n,p,u,h,f,c,N,a]);return F.createElement("div",{id:b?"".concat(b):void 0,className:dn("recharts-responsive-container",w),style:Ty(Ty({},O),{},{width:a,height:u,minWidth:c,minHeight:f,maxHeight:h}),ref:E},W)}),EP=function(t){return null};EP.displayName="Cell";function Mg(e){"@babel/helpers - typeof";return Mg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mg(e)}function g7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function x6(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||qa.isSsr)return{width:0,height:0};var r=Ike(n),i=JSON.stringify({text:t,copyStyle:r});if(Yf.widthCache[i])return Yf.widthCache[i];try{var o=document.getElementById(m7);o||(o=document.createElement("span"),o.setAttribute("id",m7),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=x6(x6({},$ke),r);Object.assign(o.style,a),o.textContent="".concat(t);var s=o.getBoundingClientRect(),u={width:s.width,height:s.height};return Yf.widthCache[i]=u,++Yf.cacheCount>Dke&&(Yf.cacheCount=0,Yf.widthCache={}),u}catch{return{width:0,height:0}}},Nke=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Rg(e){"@babel/helpers - typeof";return Rg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rg(e)}function Vb(e,t){return Bke(e)||jke(e,t)||Fke(e,t)||Lke()}function Lke(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fke(e,t){if(e){if(typeof e=="string")return v7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v7(e,t)}}function v7(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eTe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function S7(e,t){return iTe(e)||rTe(e,t)||nTe(e,t)||tTe()}function tTe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nTe(e,t){if(e){if(typeof e=="string")return C7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C7(e,t)}}function C7(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return q.reduce(function(G,H){var j=H.word,K=H.width,Y=G[G.length-1];if(Y&&(i==null||o||Y.width+K+rH.width?G:H})};if(!c)return p;for(var y="…",b=function(q){var G=f.slice(0,q),H=IH({breakAll:l,style:u,children:G+y}).wordsWithComputedWidth,j=h(H),K=j.length>a||m(j).width>Number(i);return[K,j]},w=0,x=f.length-1,S=0,O;w<=x&&S<=f.length-1;){var E=Math.floor((w+x)/2),C=E-1,P=b(C),M=S7(P,2),N=M[0],B=M[1],V=b(E),W=S7(V,1),ne=W[0];if(!N&&!ne&&(w=E+1),N&&ne&&(x=E-1),!N&&ne){O=B;break}S++}return O||p},E7=function(t){var n=Vt(t)?[]:t.toString().split($H);return[{words:n}]},aTe=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,a=t.breakAll,s=t.maxLines;if((n||r)&&!qa.isSsr){var u,l,c=IH({breakAll:a,children:i,style:o});if(c){var f=c.wordsWithComputedWidth,h=c.spaceWidth;u=f,l=h}else return E7(i);return oTe({breakAll:a,children:i,maxLines:s,style:o},u,l,n,r)}return E7(i)},O7="#808080",Hb=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,a=t.lineHeight,s=a===void 0?"1em":a,u=t.capHeight,l=u===void 0?"0.71em":u,c=t.scaleToFit,f=c===void 0?!1:c,h=t.textAnchor,p=h===void 0?"start":h,m=t.verticalAnchor,y=m===void 0?"end":m,b=t.fill,w=b===void 0?O7:b,x=_7(t,Qke),S=v.useMemo(function(){return aTe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),O=x.dx,E=x.dy,C=x.angle,P=x.className,M=x.breakAll,N=_7(x,Jke);if(!qr(r)||!qr(o))return null;var B=r+(Ke(O)?O:0),V=o+(Ke(E)?E:0),W;switch(y){case"start":W=y3("calc(".concat(l,")"));break;case"middle":W=y3("calc(".concat((S.length-1)/2," * -").concat(s," + (").concat(l," / 2))"));break;default:W=y3("calc(".concat(S.length-1," * -").concat(s,")"));break}var ne=[];if(f){var Z=S[0].width,q=x.width;ne.push("scale(".concat((Ke(q)?q/Z:1)/Z,")"))}return C&&ne.push("rotate(".concat(C,", ").concat(B,", ").concat(V,")")),ne.length&&(N.transform=ne.join(" ")),F.createElement("text",w6({},Wt(N,!0),{x:B,y:V,className:dn("recharts-text",P),textAnchor:p,fill:w.includes("url")?O7:w}),S.map(function(G,H){var j=G.words.join(M?"":" ");return F.createElement("tspan",{x:B,dy:H===0?W:s,key:"".concat(j,"-").concat(H)},j)}))};function Sl(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function sTe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function OP(e){let t,n,r;e.length!==2?(t=Sl,n=(s,u)=>Sl(e(s),u),r=(s,u)=>e(s)-u):(t=e===Sl||e===sTe?e:uTe,n=e,r=e);function i(s,u,l=0,c=s.length){if(l>>1;n(s[f],u)<0?l=f+1:c=f}while(l>>1;n(s[f],u)<=0?l=f+1:c=f}while(ll&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function uTe(){return 0}function NH(e){return e===null?NaN:+e}function*lTe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const cTe=OP(Sl),Vm=cTe.right;OP(NH).center;class A7 extends Map{constructor(t,n=hTe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(P7(this,t))}has(t){return super.has(P7(this,t))}set(t,n){return super.set(fTe(this,t),n)}delete(t){return super.delete(dTe(this,t))}}function P7({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function fTe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function dTe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function hTe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function pTe(e=Sl){if(e===Sl)return LH;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function LH(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const gTe=Math.sqrt(50),mTe=Math.sqrt(10),vTe=Math.sqrt(2);function qb(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=gTe?10:o>=mTe?5:o>=vTe?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(e*l),u=Math.round(t*l),s/lt&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(e/l),u=Math.round(t/l),s*lt&&--u),u0))return[];if(e===t)return[e];const r=t=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l=r)&&(n=r);return n}function T7(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function FH(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?LH:pTe(i);r>n;){if(r-n>600){const u=r-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),p=Math.max(n,Math.floor(t-l*f/u+h)),m=Math.min(r,Math.floor(t+(u-l)*f/u+h));FH(e,t,p,m,i)}const o=e[t];let a=n,s=r;for(Vp(e,n,t),i(e[r],o)>0&&Vp(e,n,r);a0;)--s}i(e[n],o)===0?Vp(e,n,s):(++s,Vp(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Vp(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function yTe(e,t,n){if(e=Float64Array.from(lTe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return T7(e);if(t>=1)return k7(e);var r,i=(r-1)*t,o=Math.floor(i),a=k7(FH(e,o).subarray(0,o+1)),s=T7(e.subarray(o+1));return a+(s-a)*(i-o)}}function bTe(e,t,n=NH){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e),s=+n(e[o+1],o+1,e);return a+(s-a)*(i-o)}}function xTe(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ry(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ry(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_Te.exec(e))?new ao(t[1],t[2],t[3],1):(t=STe.exec(e))?new ao(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=CTe.exec(e))?Ry(t[1],t[2],t[3],t[4]):(t=ETe.exec(e))?Ry(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=OTe.exec(e))?L7(t[1],t[2]/100,t[3]/100,1):(t=ATe.exec(e))?L7(t[1],t[2]/100,t[3]/100,t[4]):M7.hasOwnProperty(e)?$7(M7[e]):e==="transparent"?new ao(NaN,NaN,NaN,0):null}function $7(e){return new ao(e>>16&255,e>>8&255,e&255,1)}function Ry(e,t,n,r){return r<=0&&(e=t=n=NaN),new ao(e,t,n,r)}function TTe(e){return e instanceof Hm||(e=Ng(e)),e?(e=e.rgb(),new ao(e.r,e.g,e.b,e.opacity)):new ao}function O6(e,t,n,r){return arguments.length===1?TTe(e):new ao(e,t,n,r??1)}function ao(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}PP(ao,O6,BH(Hm,{brighter(e){return e=e==null?Kb:Math.pow(Kb,e),new ao(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$g:Math.pow($g,e),new ao(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ao($c(this.r),$c(this.g),$c(this.b),Gb(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:I7,formatHex:I7,formatHex8:MTe,formatRgb:N7,toString:N7}));function I7(){return`#${Ec(this.r)}${Ec(this.g)}${Ec(this.b)}`}function MTe(){return`#${Ec(this.r)}${Ec(this.g)}${Ec(this.b)}${Ec((isNaN(this.opacity)?1:this.opacity)*255)}`}function N7(){const e=Gb(this.opacity);return`${e===1?"rgb(":"rgba("}${$c(this.r)}, ${$c(this.g)}, ${$c(this.b)}${e===1?")":`, ${e})`}`}function Gb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $c(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ec(e){return e=$c(e),(e<16?"0":"")+e.toString(16)}function L7(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ba(e,t,n,r)}function UH(e){if(e instanceof Ba)return new Ba(e.h,e.s,e.l,e.opacity);if(e instanceof Hm||(e=Ng(e)),!e)return new Ba;if(e instanceof Ba)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(t===o?a=(n-r)/s+(n0&&u<1?0:a,new Ba(a,s,u,e.opacity)}function RTe(e,t,n,r){return arguments.length===1?UH(e):new Ba(e,t,n,r??1)}function Ba(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}PP(Ba,RTe,BH(Hm,{brighter(e){return e=e==null?Kb:Math.pow(Kb,e),new Ba(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$g:Math.pow($g,e),new Ba(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ao(b3(e>=240?e-240:e+120,i,r),b3(e,i,r),b3(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ba(F7(this.h),Dy(this.s),Dy(this.l),Gb(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Gb(this.opacity);return`${e===1?"hsl(":"hsla("}${F7(this.h)}, ${Dy(this.s)*100}%, ${Dy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function F7(e){return e=(e||0)%360,e<0?e+360:e}function Dy(e){return Math.max(0,Math.min(1,e||0))}function b3(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const kP=e=>()=>e;function DTe(e,t){return function(n){return e+n*t}}function $Te(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function ITe(e){return(e=+e)==1?zH:function(t,n){return n-t?$Te(t,n,e):kP(isNaN(t)?n:t)}}function zH(e,t){var n=t-e;return n?DTe(e,n):kP(isNaN(e)?t:e)}const j7=function e(t){var n=ITe(t);function r(i,o){var a=n((i=O6(i)).r,(o=O6(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=zH(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=e,r}(1);function NTe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;in&&(o=t.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:Yb(r,i)})),n=x3.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function KTe(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i2?GTe:KTe,u=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(u||(u=s(e.map(r),t,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=s(t,e.map(r),Yb)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Zb),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=TP,c()},f.clamp=function(h){return arguments.length?(a=h?!0:zi,c()):a!==zi},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function MP(){return l2()(zi,zi)}function YTe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Xb(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function oh(e){return e=Xb(Math.abs(e)),e?e[1]:NaN}function ZTe(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function XTe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var QTe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lg(e){if(!(t=QTe.exec(e)))throw new Error("invalid format: "+e);var t;return new RP({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Lg.prototype=RP.prototype;function RP(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}RP.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function JTe(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var WH;function eMe(e,t){var n=Xb(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(WH=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Xb(e,Math.max(0,t+o-1))[0]}function U7(e,t){var n=Xb(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const z7={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:YTe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>U7(e*100,t),r:U7,s:eMe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function W7(e){return e}var V7=Array.prototype.map,H7=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tMe(e){var t=e.grouping===void 0||e.thousands===void 0?W7:ZTe(V7.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?W7:XTe(V7.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=Lg(f);var h=f.fill,p=f.align,m=f.sign,y=f.symbol,b=f.zero,w=f.width,x=f.comma,S=f.precision,O=f.trim,E=f.type;E==="n"?(x=!0,E="g"):z7[E]||(S===void 0&&(S=12),O=!0,E="g"),(b||h==="0"&&p==="=")&&(b=!0,h="0",p="=");var C=y==="$"?n:y==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",P=y==="$"?r:/[%p]/.test(E)?a:"",M=z7[E],N=/[defgprs%]/.test(E);S=S===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function B(V){var W=C,ne=P,Z,q,G;if(E==="c")ne=M(V)+ne,V="";else{V=+V;var H=V<0||1/V<0;if(V=isNaN(V)?u:M(Math.abs(V),S),O&&(V=JTe(V)),H&&+V==0&&m!=="+"&&(H=!1),W=(H?m==="("?m:s:m==="-"||m==="("?"":m)+W,ne=(E==="s"?H7[8+WH/3]:"")+ne+(H&&m==="("?")":""),N){for(Z=-1,q=V.length;++ZG||G>57){ne=(G===46?i+V.slice(Z+1):V.slice(Z))+ne,V=V.slice(0,Z);break}}}x&&!b&&(V=t(V,1/0));var j=W.length+V.length+ne.length,K=j>1)+W+V+ne+K.slice(j);break;default:V=K+W+V+ne;break}return o(V)}return B.toString=function(){return f+""},B}function c(f,h){var p=l((f=Lg(f),f.type="f",f)),m=Math.max(-8,Math.min(8,Math.floor(oh(h)/3)))*3,y=Math.pow(10,-m),b=H7[8+m/3];return function(w){return p(y*w)+b}}return{format:l,formatPrefix:c}}var $y,DP,VH;nMe({thousands:",",grouping:[3],currency:["$",""]});function nMe(e){return $y=tMe(e),DP=$y.format,VH=$y.formatPrefix,$y}function rMe(e){return Math.max(0,-oh(Math.abs(e)))}function iMe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(oh(t)/3)))*3-oh(Math.abs(e)))}function oMe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,oh(t)-oh(e))+1}function HH(e,t,n,r){var i=C6(e,t,n),o;switch(r=Lg(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=iMe(i,a))&&(r.precision=o),VH(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=oMe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=rMe(i))&&(r.precision=o-(r.type==="%")*2);break}}return DP(r)}function Hl(e){var t=e.domain;return e.ticks=function(n){var r=t();return _6(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return HH(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,a=r[i],s=r[o],u,l,c=10;for(s0;){if(l=S6(a,s,n),l===u)return r[i]=a,r[o]=s,t(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return e},e}function Qb(){var e=MP();return e.copy=function(){return qm(e,Qb())},wa.apply(e,arguments),Hl(e)}function qH(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Zb),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return qH(e).unknown(t)},e=arguments.length?Array.from(e,Zb):[0,1],Hl(n)}function KH(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],a;return oMath.pow(e,t)}function cMe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function G7(e){return(t,n)=>-e(-t,n)}function $P(e){const t=e(q7,K7),n=t.domain;let r=10,i,o;function a(){return i=cMe(r),o=lMe(r),n()[0]<0?(i=G7(i),o=G7(o),e(aMe,sMe)):e(q7,K7),t}return t.base=function(s){return arguments.length?(r=+s,a()):r},t.domain=function(s){return arguments.length?(n(s),a()):n()},t.ticks=s=>{const u=n();let l=u[0],c=u[u.length-1];const f=c0){for(;h<=p;++h)for(m=1;mc)break;w.push(y)}}else for(;h<=p;++h)for(m=r-1;m>=1;--m)if(y=h>0?m/o(-h):m*o(h),!(yc)break;w.push(y)}w.length*2{if(s==null&&(s=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=Lg(u)).precision==null&&(u.trim=!0),u=DP(u)),s===1/0)return u;const l=Math.max(1,r*s/t.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*rn(KH(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function GH(){const e=$P(l2()).domain([1,10]);return e.copy=()=>qm(e,GH()).base(e.base()),wa.apply(e,arguments),e}function Y7(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Z7(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function IP(e){var t=1,n=e(Y7(t),Z7(t));return n.constant=function(r){return arguments.length?e(Y7(t=+r),Z7(t)):t},Hl(n)}function YH(){var e=IP(l2());return e.copy=function(){return qm(e,YH()).constant(e.constant())},wa.apply(e,arguments)}function X7(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function fMe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function dMe(e){return e<0?-e*e:e*e}function NP(e){var t=e(zi,zi),n=1;function r(){return n===1?e(zi,zi):n===.5?e(fMe,dMe):e(X7(n),X7(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Hl(t)}function LP(){var e=NP(l2());return e.copy=function(){return qm(e,LP()).exponent(e.exponent())},wa.apply(e,arguments),e}function hMe(){return LP.apply(null,arguments).exponent(.5)}function Q7(e){return Math.sign(e)*e*e}function pMe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function ZH(){var e=MP(),t=[0,1],n=!1,r;function i(o){var a=pMe(e(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return e.invert(Q7(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Zb)).map(Q7)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return ZH(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},wa.apply(i,arguments),Hl(i)}function XH(){var e=[],t=[],n=[],r;function i(){var a=0,s=Math.max(1,t.length);for(n=new Array(s-1);++a0?n[s-1]:e[0],s=n?[r[n-1],t]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return QH().domain([e,t]).range(i).unknown(o)},wa.apply(Hl(a),arguments)}function JH(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Vm(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return JH().domain(e).range(t).unknown(n)},wa.apply(i,arguments)}const w3=new Date,_3=new Date;function Zr(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a(t(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const u=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return u;let l;do u.push(l=new Date(+o)),t(o,s),e(o);while(lZr(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!o(a););else for(;--s>=0;)for(;t(a,1),!o(a););}),n&&(i.count=(o,a)=>(w3.setTime(+o),_3.setTime(+a),e(w3),e(_3),Math.floor(n(w3,_3))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const Jb=Zr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Jb.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Zr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Jb);Jb.range;const ou=1e3,fa=ou*60,au=fa*60,Su=au*24,FP=Su*7,J7=Su*30,S3=Su*365,Oc=Zr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ou)},(e,t)=>(t-e)/ou,e=>e.getUTCSeconds());Oc.range;const jP=Zr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ou)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getMinutes());jP.range;const BP=Zr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getUTCMinutes());BP.range;const UP=Zr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ou-e.getMinutes()*fa)},(e,t)=>{e.setTime(+e+t*au)},(e,t)=>(t-e)/au,e=>e.getHours());UP.range;const zP=Zr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*au)},(e,t)=>(t-e)/au,e=>e.getUTCHours());zP.range;const Km=Zr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*fa)/Su,e=>e.getDate()-1);Km.range;const c2=Zr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Su,e=>e.getUTCDate()-1);c2.range;const eq=Zr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Su,e=>Math.floor(e/Su));eq.range;function bf(e){return Zr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*fa)/FP)}const f2=bf(0),ex=bf(1),gMe=bf(2),mMe=bf(3),ah=bf(4),vMe=bf(5),yMe=bf(6);f2.range;ex.range;gMe.range;mMe.range;ah.range;vMe.range;yMe.range;function xf(e){return Zr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/FP)}const d2=xf(0),tx=xf(1),bMe=xf(2),xMe=xf(3),sh=xf(4),wMe=xf(5),_Me=xf(6);d2.range;tx.range;bMe.range;xMe.range;sh.range;wMe.range;_Me.range;const WP=Zr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());WP.range;const VP=Zr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());VP.range;const Cu=Zr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Cu.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Cu.range;const Eu=Zr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Eu.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Eu.range;function tq(e,t,n,r,i,o){const a=[[Oc,1,ou],[Oc,5,5*ou],[Oc,15,15*ou],[Oc,30,30*ou],[o,1,fa],[o,5,5*fa],[o,15,15*fa],[o,30,30*fa],[i,1,au],[i,3,3*au],[i,6,6*au],[i,12,12*au],[r,1,Su],[r,2,2*Su],[n,1,FP],[t,1,J7],[t,3,3*J7],[e,1,S3]];function s(l,c,f){const h=cb).right(a,h);if(p===a.length)return e.every(C6(l/S3,c/S3,f));if(p===0)return Jb.every(Math.max(C6(l,c,f),1));const[m,y]=a[h/a[p-1][2]53)return null;"w"in be||(be.w=1),"Z"in be?(lt=E3(Hp(be.y,0,1)),Ft=lt.getUTCDay(),lt=Ft>4||Ft===0?tx.ceil(lt):tx(lt),lt=c2.offset(lt,(be.V-1)*7),be.y=lt.getUTCFullYear(),be.m=lt.getUTCMonth(),be.d=lt.getUTCDate()+(be.w+6)%7):(lt=C3(Hp(be.y,0,1)),Ft=lt.getDay(),lt=Ft>4||Ft===0?ex.ceil(lt):ex(lt),lt=Km.offset(lt,(be.V-1)*7),be.y=lt.getFullYear(),be.m=lt.getMonth(),be.d=lt.getDate()+(be.w+6)%7)}else("W"in be||"U"in be)&&("w"in be||(be.w="u"in be?be.u%7:"W"in be?1:0),Ft="Z"in be?E3(Hp(be.y,0,1)).getUTCDay():C3(Hp(be.y,0,1)).getDay(),be.m=0,be.d="W"in be?(be.w+6)%7+be.W*7-(Ft+5)%7:be.w+be.U*7-(Ft+6)%7);return"Z"in be?(be.H+=be.Z/100|0,be.M+=be.Z%100,E3(be)):C3(be)}}function M(Ae,Le,$e,be){for(var bt=0,lt=Le.length,Ft=$e.length,yn,nn;bt=Ft)return-1;if(yn=Le.charCodeAt(bt++),yn===37){if(yn=Le.charAt(bt++),nn=E[yn in e$?Le.charAt(bt++):yn],!nn||(be=nn(Ae,$e,be))<0)return-1}else if(yn!=$e.charCodeAt(be++))return-1}return be}function N(Ae,Le,$e){var be=l.exec(Le.slice($e));return be?(Ae.p=c.get(be[0].toLowerCase()),$e+be[0].length):-1}function B(Ae,Le,$e){var be=p.exec(Le.slice($e));return be?(Ae.w=m.get(be[0].toLowerCase()),$e+be[0].length):-1}function V(Ae,Le,$e){var be=f.exec(Le.slice($e));return be?(Ae.w=h.get(be[0].toLowerCase()),$e+be[0].length):-1}function W(Ae,Le,$e){var be=w.exec(Le.slice($e));return be?(Ae.m=x.get(be[0].toLowerCase()),$e+be[0].length):-1}function ne(Ae,Le,$e){var be=y.exec(Le.slice($e));return be?(Ae.m=b.get(be[0].toLowerCase()),$e+be[0].length):-1}function Z(Ae,Le,$e){return M(Ae,t,Le,$e)}function q(Ae,Le,$e){return M(Ae,n,Le,$e)}function G(Ae,Le,$e){return M(Ae,r,Le,$e)}function H(Ae){return a[Ae.getDay()]}function j(Ae){return o[Ae.getDay()]}function K(Ae){return u[Ae.getMonth()]}function Y(Ae){return s[Ae.getMonth()]}function oe(Ae){return i[+(Ae.getHours()>=12)]}function X(Ae){return 1+~~(Ae.getMonth()/3)}function Q(Ae){return a[Ae.getUTCDay()]}function ue(Ae){return o[Ae.getUTCDay()]}function de(Ae){return u[Ae.getUTCMonth()]}function Se(Ae){return s[Ae.getUTCMonth()]}function me(Ae){return i[+(Ae.getUTCHours()>=12)]}function Ze(Ae){return 1+~~(Ae.getUTCMonth()/3)}return{format:function(Ae){var Le=C(Ae+="",S);return Le.toString=function(){return Ae},Le},parse:function(Ae){var Le=P(Ae+="",!1);return Le.toString=function(){return Ae},Le},utcFormat:function(Ae){var Le=C(Ae+="",O);return Le.toString=function(){return Ae},Le},utcParse:function(Ae){var Le=P(Ae+="",!0);return Le.toString=function(){return Ae},Le}}}var e$={"-":"",_:" ",0:"0"},oi=/^\s*\d+/,PMe=/^%/,kMe=/[\\^$*+?|[\]().{}]/g;function bn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[t.toLowerCase(),n]))}function MMe(e,t,n){var r=oi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function RMe(e,t,n){var r=oi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function DMe(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function $Me(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function IMe(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function t$(e,t,n){var r=oi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function n$(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function NMe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function LMe(e,t,n){var r=oi.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function FMe(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function r$(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function jMe(e,t,n){var r=oi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function i$(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function BMe(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function UMe(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function zMe(e,t,n){var r=oi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function WMe(e,t,n){var r=oi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function VMe(e,t,n){var r=PMe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function HMe(e,t,n){var r=oi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qMe(e,t,n){var r=oi.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function o$(e,t){return bn(e.getDate(),t,2)}function KMe(e,t){return bn(e.getHours(),t,2)}function GMe(e,t){return bn(e.getHours()%12||12,t,2)}function YMe(e,t){return bn(1+Km.count(Cu(e),e),t,3)}function nq(e,t){return bn(e.getMilliseconds(),t,3)}function ZMe(e,t){return nq(e,t)+"000"}function XMe(e,t){return bn(e.getMonth()+1,t,2)}function QMe(e,t){return bn(e.getMinutes(),t,2)}function JMe(e,t){return bn(e.getSeconds(),t,2)}function eRe(e){var t=e.getDay();return t===0?7:t}function tRe(e,t){return bn(f2.count(Cu(e)-1,e),t,2)}function rq(e){var t=e.getDay();return t>=4||t===0?ah(e):ah.ceil(e)}function nRe(e,t){return e=rq(e),bn(ah.count(Cu(e),e)+(Cu(e).getDay()===4),t,2)}function rRe(e){return e.getDay()}function iRe(e,t){return bn(ex.count(Cu(e)-1,e),t,2)}function oRe(e,t){return bn(e.getFullYear()%100,t,2)}function aRe(e,t){return e=rq(e),bn(e.getFullYear()%100,t,2)}function sRe(e,t){return bn(e.getFullYear()%1e4,t,4)}function uRe(e,t){var n=e.getDay();return e=n>=4||n===0?ah(e):ah.ceil(e),bn(e.getFullYear()%1e4,t,4)}function lRe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+bn(t/60|0,"0",2)+bn(t%60,"0",2)}function a$(e,t){return bn(e.getUTCDate(),t,2)}function cRe(e,t){return bn(e.getUTCHours(),t,2)}function fRe(e,t){return bn(e.getUTCHours()%12||12,t,2)}function dRe(e,t){return bn(1+c2.count(Eu(e),e),t,3)}function iq(e,t){return bn(e.getUTCMilliseconds(),t,3)}function hRe(e,t){return iq(e,t)+"000"}function pRe(e,t){return bn(e.getUTCMonth()+1,t,2)}function gRe(e,t){return bn(e.getUTCMinutes(),t,2)}function mRe(e,t){return bn(e.getUTCSeconds(),t,2)}function vRe(e){var t=e.getUTCDay();return t===0?7:t}function yRe(e,t){return bn(d2.count(Eu(e)-1,e),t,2)}function oq(e){var t=e.getUTCDay();return t>=4||t===0?sh(e):sh.ceil(e)}function bRe(e,t){return e=oq(e),bn(sh.count(Eu(e),e)+(Eu(e).getUTCDay()===4),t,2)}function xRe(e){return e.getUTCDay()}function wRe(e,t){return bn(tx.count(Eu(e)-1,e),t,2)}function _Re(e,t){return bn(e.getUTCFullYear()%100,t,2)}function SRe(e,t){return e=oq(e),bn(e.getUTCFullYear()%100,t,2)}function CRe(e,t){return bn(e.getUTCFullYear()%1e4,t,4)}function ERe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?sh(e):sh.ceil(e),bn(e.getUTCFullYear()%1e4,t,4)}function ORe(){return"+0000"}function s$(){return"%"}function u$(e){return+e}function l$(e){return Math.floor(+e/1e3)}var Zf,aq,sq;ARe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function ARe(e){return Zf=AMe(e),aq=Zf.format,Zf.parse,sq=Zf.utcFormat,Zf.utcParse,Zf}function PRe(e){return new Date(e)}function kRe(e){return e instanceof Date?+e:+new Date(+e)}function HP(e,t,n,r,i,o,a,s,u,l){var c=MP(),f=c.invert,h=c.domain,p=l(".%L"),m=l(":%S"),y=l("%I:%M"),b=l("%I %p"),w=l("%a %d"),x=l("%b %d"),S=l("%B"),O=l("%Y");function E(C){return(u(C)t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>yTe(e,o/r))},n.copy=function(){return fq(t).domain(e)},Ru.apply(n,arguments)}function p2(){var e=0,t=.5,n=1,r=1,i,o,a,s,u,l=zi,c,f=!1,h;function p(y){return isNaN(y=+y)?h:(y=.5+((y=+c(y))-o)*(r*yt}var LRe=NRe,FRe=gq,jRe=LRe,BRe=Xh;function URe(e){return e&&e.length?FRe(e,BRe,jRe):void 0}var zRe=URe;const ul=kn(zRe);function WRe(e,t){return ee.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=re.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};st.decimalPlaces=st.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*nr;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};st.dividedBy=st.div=function(e){return hu(this,new this.constructor(e))};st.dividedToIntegerBy=st.idiv=function(e){var t=this,n=t.constructor;return zn(hu(t,new n(e),0,1),n.precision)};st.equals=st.eq=function(e){return!this.cmp(e)};st.exponent=function(){return Rr(this)};st.greaterThan=st.gt=function(e){return this.cmp(e)>0};st.greaterThanOrEqualTo=st.gte=function(e){return this.cmp(e)>=0};st.isInteger=st.isint=function(){return this.e>this.d.length-2};st.isNegative=st.isneg=function(){return this.s<0};st.isPositive=st.ispos=function(){return this.s>0};st.isZero=function(){return this.s===0};st.lessThan=st.lt=function(e){return this.cmp(e)<0};st.lessThanOrEqualTo=st.lte=function(e){return this.cmp(e)<1};st.logarithm=st.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Do))throw Error(ya+"NaN");if(n.s<1)throw Error(ya+(n.s?"NaN":"-Infinity"));return n.eq(Do)?new r(0):(sr=!1,t=hu(Fg(n,o),Fg(e,o),o),sr=!0,zn(t,i))};st.minus=st.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?bq(t,e):vq(t,(e.s=-e.s,e))};st.modulo=st.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(ya+"NaN");return n.s?(sr=!1,t=hu(n,e,0,1).times(e),sr=!0,n.minus(t)):zn(new r(n),i)};st.naturalExponential=st.exp=function(){return yq(this)};st.naturalLogarithm=st.ln=function(){return Fg(this)};st.negated=st.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};st.plus=st.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?vq(t,e):bq(t,(e.s=-e.s,e))};st.precision=st.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ic+e);if(t=Rr(i)+1,r=i.d.length-1,n=r*nr+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};st.squareRoot=st.sqrt=function(){var e,t,n,r,i,o,a,s=this,u=s.constructor;if(s.s<1){if(!s.s)return new u(0);throw Error(ya+"NaN")}for(e=Rr(s),sr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=vs(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=ep((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new u(t)):r=new u(i.toString()),n=u.precision,i=a=n+3;;)if(o=r,r=o.plus(hu(s,o,a+2)).times(.5),vs(o.d).slice(0,a)===(t=vs(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(zn(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(t!="9999")break;a+=4}return sr=!0,zn(r,n)};st.times=st.mul=function(e){var t,n,r,i,o,a,s,u,l,c=this,f=c.constructor,h=c.d,p=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,n=c.e+e.e,u=h.length,l=p.length,u=0;){for(t=0,i=u+r;i>r;)s=o[i]+p[r]*h[i-r-1]+t,o[i--]=s%ei|0,t=s/ei|0;o[i]=(o[i]+t)%ei|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,sr?zn(e,f.precision):e};st.toDecimalPlaces=st.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Rs(e,0,Jh),t===void 0?t=r.rounding:Rs(t,0,8),zn(n,e+Rr(n)+1,t))};st.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=rf(r,!0):(Rs(e,0,Jh),t===void 0?t=i.rounding:Rs(t,0,8),r=zn(new i(r),e+1,t),n=rf(r,!0,e+1)),n};st.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?rf(i):(Rs(e,0,Jh),t===void 0?t=o.rounding:Rs(t,0,8),r=zn(new o(i),e+Rr(i)+1,t),n=rf(r.abs(),!1,e+Rr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};st.toInteger=st.toint=function(){var e=this,t=e.constructor;return zn(new t(e),Rr(e)+1,t.rounding)};st.toNumber=function(){return+this};st.toPower=st.pow=function(e){var t,n,r,i,o,a,s=this,u=s.constructor,l=12,c=+(e=new u(e));if(!e.s)return new u(Do);if(s=new u(s),!s.s){if(e.s<1)throw Error(ya+"Infinity");return s}if(s.eq(Do))return s;if(r=u.precision,e.eq(Do))return zn(s,r);if(t=e.e,n=e.d.length-1,a=t>=n,o=s.s,a){if((n=c<0?-c:c)<=mq){for(i=new u(Do),t=Math.ceil(r/nr+4),sr=!1;n%2&&(i=i.times(s),d$(i.d,t)),n=ep(n/2),n!==0;)s=s.times(s),d$(s.d,t);return sr=!0,e.s<0?new u(Do).div(i):zn(i,r)}}else if(o<0)throw Error(ya+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,sr=!1,i=e.times(Fg(s,r+l)),sr=!0,i=yq(i),i.s=o,i};st.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=Rr(i),r=rf(i,n<=o.toExpNeg||n>=o.toExpPos)):(Rs(e,1,Jh),t===void 0?t=o.rounding:Rs(t,0,8),i=zn(new o(i),e,t),n=Rr(i),r=rf(i,e<=n||n<=o.toExpNeg,e)),r};st.toSignificantDigits=st.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Rs(e,1,Jh),t===void 0?t=r.rounding:Rs(t,0,8)),zn(new r(n),e,t)};st.toString=st.valueOf=st.val=st.toJSON=st[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Rr(e),n=e.constructor;return rf(e,t<=n.toExpNeg||t>=n.toExpPos)};function vq(e,t){var n,r,i,o,a,s,u,l,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),sr?zn(t,f):t;if(u=e.d,l=t.d,a=e.e,i=t.e,u=u.slice(),o=a-i,o){for(o<0?(r=u,o=-o,s=l.length):(r=l,i=a,s=u.length),a=Math.ceil(f/nr),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=u.length,o=l.length,s-o<0&&(o=s,r=l,l=u,u=r),n=0;o;)n=(u[--o]=u[o]+l[o]+n)/ei|0,u[o]%=ei;for(n&&(u.unshift(n),++i),s=u.length;u[--s]==0;)u.pop();return t.d=u,t.e=i,sr?zn(t,f):t}function Rs(e,t,n){if(e!==~~e||en)throw Error(Ic+e)}function vs(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;ta?1:-1;else for(s=u=0;si[s]?1:-1;break}return u}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,a){var s,u,l,c,f,h,p,m,y,b,w,x,S,O,E,C,P,M,N=r.constructor,B=r.s==i.s?1:-1,V=r.d,W=i.d;if(!r.s)return new N(r);if(!i.s)throw Error(ya+"Division by zero");for(u=r.e-i.e,P=W.length,E=V.length,p=new N(B),m=p.d=[],l=0;W[l]==(V[l]||0);)++l;if(W[l]>(V[l]||0)&&--u,o==null?x=o=N.precision:a?x=o+(Rr(r)-Rr(i))+1:x=o,x<0)return new N(0);if(x=x/nr+2|0,l=0,P==1)for(c=0,W=W[0],x++;(l1&&(W=e(W,c),V=e(V,c),P=W.length,E=V.length),O=P,y=V.slice(0,P),b=y.length;b=ei/2&&++C;do c=0,s=t(W,y,P,b),s<0?(w=y[0],P!=b&&(w=w*ei+(y[1]||0)),c=w/C|0,c>1?(c>=ei&&(c=ei-1),f=e(W,c),h=f.length,b=y.length,s=t(f,y,h,b),s==1&&(c--,n(f,P16)throw Error(GP+Rr(e));if(!e.s)return new c(Do);for(t==null?(sr=!1,s=f):s=t,a=new c(.03125);e.abs().gte(.1);)e=e.times(a),l+=5;for(r=Math.log(pc(2,l))/Math.LN10*2+5|0,s+=r,n=i=o=new c(Do),c.precision=s;;){if(i=zn(i.times(e),s),n=n.times(++u),a=o.plus(hu(i,n,s)),vs(a.d).slice(0,s)===vs(o.d).slice(0,s)){for(;l--;)o=zn(o.times(o),s);return c.precision=f,t==null?(sr=!0,zn(o,f)):o}o=a}}function Rr(e){for(var t=e.e*nr,n=e.d[0];n>=10;n/=10)t++;return t}function O3(e,t,n){if(t>e.LN10.sd())throw sr=!0,n&&(e.precision=n),Error(ya+"LN10 precision limit exceeded");return zn(new e(e.LN10),t)}function Qu(e){for(var t="";e--;)t+="0";return t}function Fg(e,t){var n,r,i,o,a,s,u,l,c,f=1,h=10,p=e,m=p.d,y=p.constructor,b=y.precision;if(p.s<1)throw Error(ya+(p.s?"NaN":"-Infinity"));if(p.eq(Do))return new y(0);if(t==null?(sr=!1,l=b):l=t,p.eq(10))return t==null&&(sr=!0),O3(y,l);if(l+=h,y.precision=l,n=vs(m),r=n.charAt(0),o=Rr(p),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=vs(p.d),r=n.charAt(0),f++;o=Rr(p),r>1?(p=new y("0."+n),o++):p=new y(r+"."+n.slice(1))}else return u=O3(y,l+2,b).times(o+""),p=Fg(new y(r+"."+n.slice(1)),l-h).plus(u),y.precision=b,t==null?(sr=!0,zn(p,b)):p;for(s=a=p=hu(p.minus(Do),p.plus(Do),l),c=zn(p.times(p),l),i=3;;){if(a=zn(a.times(c),l),u=s.plus(hu(a,new y(i),l)),vs(u.d).slice(0,l)===vs(s.d).slice(0,l))return s=s.times(2),o!==0&&(s=s.plus(O3(y,l+2,b).times(o+""))),s=hu(s,new y(f),l),y.precision=b,t==null?(sr=!0,zn(s,b)):s;s=u,i+=2}}function f$(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=ep(n/nr),e.d=[],r=(n+1)%nr,n<0&&(r+=nr),rnx||e.e<-nx))throw Error(GP+n)}else e.s=0,e.e=0,e.d=[0];return e}function zn(e,t,n){var r,i,o,a,s,u,l,c,f=e.d;for(a=1,o=f[0];o>=10;o/=10)a++;if(r=t-a,r<0)r+=nr,i=t,l=f[c=0];else{if(c=Math.ceil((r+1)/nr),o=f.length,c>=o)return e;for(l=o=f[c],a=1;o>=10;o/=10)a++;r%=nr,i=r-nr+a}if(n!==void 0&&(o=pc(10,a-i-1),s=l/o%10|0,u=t<0||f[c+1]!==void 0||l%o,u=n<4?(s||u)&&(n==0||n==(e.s<0?3:2)):s>5||s==5&&(n==4||u||n==6&&(r>0?i>0?l/pc(10,a-i):0:f[c-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return u?(o=Rr(e),f.length=1,t=t-o-1,f[0]=pc(10,(nr-t%nr)%nr),e.e=ep(-t/nr)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=c,o=1,c--):(f.length=c+1,o=pc(10,nr-r),f[c]=i>0?(l/pc(10,a-i)%pc(10,i)|0)*o:0),u)for(;;)if(c==0){(f[0]+=o)==ei&&(f[0]=1,++e.e);break}else{if(f[c]+=o,f[c]!=ei)break;f[c--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(sr&&(e.e>nx||e.e<-nx))throw Error(GP+Rr(e));return e}function bq(e,t){var n,r,i,o,a,s,u,l,c,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),sr?zn(t,p):t;if(u=e.d,f=t.d,r=t.e,l=e.e,u=u.slice(),a=l-r,a){for(c=a<0,c?(n=u,a=-a,s=f.length):(n=f,r=l,s=u.length),i=Math.max(Math.ceil(p/nr),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=u.length,s=f.length,c=i0;--i)u[s++]=0;for(i=f.length;i>a;){if(u[--i]0?o=o.charAt(0)+"."+o.slice(1)+Qu(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Qu(-i-1)+o,n&&(r=n-a)>0&&(o+=Qu(r))):i>=a?(o+=Qu(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Qu(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=Qu(r))),e.s<0?"-"+o:o}function d$(e,t){if(e.length>t)return e.length=t,!0}function xq(e){var t,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Ic+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return f$(a,o.toString())}else if(typeof o!="string")throw Error(Ic+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,fDe.test(o))f$(a,o);else throw Error(Ic+o)}if(i.prototype=st,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=xq,i.config=i.set=dDe,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Ic+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ic+n+": "+r);return this}var YP=xq(cDe);Do=new YP(1);const Ln=YP;function hDe(e){return vDe(e)||mDe(e)||gDe(e)||pDe()}function pDe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gDe(e,t){if(e){if(typeof e=="string")return k6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k6(e,t)}}function mDe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function vDe(e){if(Array.isArray(e))return k6(e)}function k6(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,i):e(t-a,h$(function(){for(var s=arguments.length,u=new Array(s),l=0;le.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(u){i=!0,o=u}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function RDe(e){if(Array.isArray(e))return e}function Eq(e){var t=jg(e,2),n=t[0],r=t[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function Oq(e,t,n){if(e.lte(0))return new Ln(0);var r=v2.getDigitCount(e.toNumber()),i=new Ln(10).pow(r),o=e.div(i),a=r!==1?.05:.1,s=new Ln(Math.ceil(o.div(a).toNumber())).add(n).mul(a),u=s.mul(i);return t?u:new Ln(Math.ceil(u))}function DDe(e,t,n){var r=1,i=new Ln(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new Ln(10).pow(v2.getDigitCount(e)-1),i=new Ln(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Ln(Math.floor(e)))}else e===0?i=new Ln(Math.floor((t-1)/2)):n||(i=new Ln(Math.floor(e)));var a=Math.floor((t-1)/2),s=wDe(xDe(function(u){return i.add(new Ln(u-a).mul(r)).toNumber()}),T6);return s(0,t)}function Aq(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Ln(0),tickMin:new Ln(0),tickMax:new Ln(0)};var o=Oq(new Ln(t).sub(e).div(n-1),r,i),a;e<=0&&t>=0?a=new Ln(0):(a=new Ln(e).add(t).div(2),a=a.sub(new Ln(a).mod(o)));var s=Math.ceil(a.sub(e).div(o).toNumber()),u=Math.ceil(new Ln(t).sub(a).div(o).toNumber()),l=s+u+1;return l>n?Aq(e,t,n,r,i+1):(l0?u+(n-l):u,s=t>0?s:s+(n-l)),{step:o,tickMin:a.sub(new Ln(s).mul(o)),tickMax:a.add(new Ln(u).mul(o))})}function $De(e){var t=jg(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=Eq([n,r]),u=jg(s,2),l=u[0],c=u[1];if(l===-1/0||c===1/0){var f=c===1/0?[l].concat(R6(T6(0,i-1).map(function(){return 1/0}))):[].concat(R6(T6(0,i-1).map(function(){return-1/0})),[c]);return n>r?M6(f):f}if(l===c)return DDe(l,i,o);var h=Aq(l,c,a,o),p=h.step,m=h.tickMin,y=h.tickMax,b=v2.rangeStep(m,y.add(new Ln(.1).mul(p)),p);return n>r?M6(b):b}function IDe(e,t){var n=jg(e,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Eq([r,i]),s=jg(a,2),u=s[0],l=s[1];if(u===-1/0||l===1/0)return[r,i];if(u===l)return[u];var c=Math.max(t,2),f=Oq(new Ln(l).sub(u).div(c-1),o,0),h=[].concat(R6(v2.rangeStep(new Ln(u),new Ln(l).sub(new Ln(.99).mul(f)),f)),[l]);return r>i?M6(h):h}var NDe=Sq($De),LDe=Sq(IDe),FDe="Invariant failed";function of(e,t){throw new Error(FDe)}var jDe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function uh(e){"@babel/helpers - typeof";return uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uh(e)}function rx(){return rx=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qDe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function KDe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GDe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r?.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var u=o.range,l=0;l0?i[l-1].coordinate:i[s-1].coordinate,f=i[l].coordinate,h=l>=s-1?i[0].coordinate:i[l+1].coordinate,p=void 0;if(za(f-c)!==za(h-f)){var m=[];if(za(h-f)===za(u[1]-u[0])){p=h;var y=f+u[1]-u[0];m[0]=Math.min(y,(y+c)/2),m[1]=Math.max(y,(y+c)/2)}else{p=c;var b=h+u[1]-u[0];m[0]=Math.min(f,(b+f)/2),m[1]=Math.max(f,(b+f)/2)}var w=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>w[0]&&t<=w[1]||t>=m[0]&&t<=m[1]){a=i[l].index;break}}else{var x=Math.min(c,h),S=Math.max(c,h);if(t>(x+f)/2&&t<=(S+f)/2){a=i[l].index;break}}}else for(var O=0;O0&&O(r[O].coordinate+r[O-1].coordinate)/2&&t<=(r[O].coordinate+r[O+1].coordinate)/2||O===s-1&&t>(r[O].coordinate+r[O-1].coordinate)/2){a=r[O].index;break}return a},ZP=function(t){var n,r=t,i=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?vr(vr({},t.type.defaultProps),t.props):t.props,a=o.stroke,s=o.fill,u;switch(i){case"Line":u=a;break;case"Area":case"Radar":u=a&&a!=="none"?a:s;break;default:u=s;break}return u},f9e=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),u=0,l=s.length;u=0});if(w&&w.length){var x=w[0].type.defaultProps,S=x!==void 0?vr(vr({},x),w[0].props):w[0].props,O=S.barSize,E=S[b];a[E]||(a[E]=[]);var C=Vt(O)?n:O;a[E].push({item:w[0],stackList:w.slice(1),barSize:Vt(C)?void 0:tf(C,r,0)})}}return a},d9e=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,o=t.sizeList,a=o===void 0?[]:o,s=t.maxBarSize,u=a.length;if(u<1)return null;var l=tf(n,i,0,!0),c,f=[];if(a[0].barSize===+a[0].barSize){var h=!1,p=i/u,m=a.reduce(function(O,E){return O+E.barSize||0},0);m+=(u-1)*l,m>=i&&(m-=(u-1)*l,l=0),m>=i&&p>0&&(h=!0,p*=.9,m=u*p);var y=(i-m)/2>>0,b={offset:y-l,size:0};c=a.reduce(function(O,E){var C={item:E.item,position:{offset:b.offset+b.size+l,size:h?p:E.barSize}},P=[].concat(m$(O),[C]);return b=P[P.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(M){P.push({item:M,position:b})}),P},f)}else{var w=tf(r,i,0,!0);i-2*w-(u-1)*l<=0&&(l=0);var x=(i-2*w-(u-1)*l)/u;x>1&&(x>>=0);var S=s===+s?Math.min(x,s):x;c=a.reduce(function(O,E,C){var P=[].concat(m$(O),[{item:E.item,position:{offset:w+(x+l)*C+(x-S)/2,size:S}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(M){P.push({item:M,position:P[P.length-1].position})}),P},f)}return c},h9e=function(t,n,r,i){var o=r.children,a=r.width,s=r.margin,u=a-(s.left||0)-(s.right||0),l=Mq({children:o,legendWidth:u});if(l){var c=i||{},f=c.width,h=c.height,p=l.align,m=l.verticalAlign,y=l.layout;if((y==="vertical"||y==="horizontal"&&m==="middle")&&p!=="center"&&Ke(t[p]))return vr(vr({},t),{},Ld({},p,t[p]+(f||0)));if((y==="horizontal"||y==="vertical"&&p==="center")&&m!=="middle"&&Ke(t[m]))return vr(vr({},t),{},Ld({},m,t[m]+(h||0)))}return t},p9e=function(t,n,r){return Vt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Rq=function(t,n,r,i,o){var a=n.props.children,s=ho(a,tp).filter(function(l){return p9e(i,o,l.props.direction)});if(s&&s.length){var u=s.map(function(l){return l.props.dataKey});return t.reduce(function(l,c){var f=Kr(c,r);if(Vt(f))return l;var h=Array.isArray(f)?[g2(f),ul(f)]:[f,f],p=u.reduce(function(m,y){var b=Kr(c,y,0),w=h[0]-Math.abs(Array.isArray(b)?b[0]:b),x=h[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(w,m[0]),Math.max(x,m[1])]},[1/0,-1/0]);return[Math.min(p[0],l[0]),Math.max(p[1],l[1])]},[1/0,-1/0])}return null},g9e=function(t,n,r,i,o){var a=n.map(function(s){return Rq(t,s,r,o,i)}).filter(function(s){return!Vt(s)});return a&&a.length?a.reduce(function(s,u){return[Math.min(s[0],u[0]),Math.max(s[1],u[1])]},[1/0,-1/0]):null},Dq=function(t,n,r,i,o){var a=n.map(function(u){var l=u.props.dataKey;return r==="number"&&l&&Rq(t,u,l,i)||k0(t,l,r,o)});if(r==="number")return a.reduce(function(u,l){return[Math.min(u[0],l[0]),Math.max(u[1],l[1])]},[1/0,-1/0]);var s={};return a.reduce(function(u,l){for(var c=0,f=l.length;c=2?za(s[0]-s[1])*2*l:l,n&&(t.ticks||t.niceTicks)){var c=(t.ticks||t.niceTicks).map(function(f){var h=o?o.indexOf(f):f;return{coordinate:i(h)+l,value:f,offset:l}});return c.filter(function(f){return!Gh(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+l,value:f,index:h,offset:l}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+l,value:f,offset:l}}):i.domain().map(function(f,h){return{coordinate:i(f)+l,value:o?o[f]:f,index:h,offset:l}})},A3=new WeakMap,Iy=function(t,n){if(typeof n!="function")return t;A3.has(t)||A3.set(t,new WeakMap);var r=A3.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},m9e=function(t,n,r){var i=t.scale,o=t.type,a=t.layout,s=t.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:Dg(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:Qb(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:P0(),realScaleType:"point"}:o==="category"?{scale:Dg(),realScaleType:"band"}:{scale:Qb(),realScaleType:"linear"};if(zm(i)){var u="scale".concat(t2(i));return{scale:(c$[u]||P0)(),realScaleType:c$[u]?u:"point"}}return qt(i)?{scale:i}:{scale:P0(),realScaleType:"point"}},y$=1e-4,v9e=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),o=Math.min(i[0],i[1])-y$,a=Math.max(i[0],i[1])+y$,s=t(n[0]),u=t(n[r-1]);(sa||ua)&&t.domain([n[0],n[r-1]])}},y9e=function(t,n){if(!t)return null;for(var r=0,i=t.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(t[s][r][0]=o,t[s][r][1]=o+u,o=t[s][r][1]):(t[s][r][0]=a,t[s][r][1]=a+u,a=t[s][r][1])}},w9e=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r=0?(t[a][r][0]=o,t[a][r][1]=o+s,o=t[a][r][1]):(t[a][r][0]=0,t[a][r][1]=0)}},_9e={sign:x9e,expand:LCe,none:eh,silhouette:FCe,wiggle:jCe,positive:w9e},S9e=function(t,n,r){var i=n.map(function(s){return s.props.dataKey}),o=_9e[r],a=NCe().keys(i).value(function(s,u){return+Kr(s,u,0)}).order(a6).offset(o);return a(t)},C9e=function(t,n,r,i,o,a){if(!t)return null;var s=a?n.reverse():n,u={},l=s.reduce(function(f,h){var p,m=(p=h.type)!==null&&p!==void 0&&p.defaultProps?vr(vr({},h.type.defaultProps),h.props):h.props,y=m.stackId,b=m.hide;if(b)return f;var w=m[r],x=f[w]||{hasStack:!1,stackGroups:{}};if(qr(y)){var S=x.stackGroups[y]||{numericAxisId:r,cateAxisId:i,items:[]};S.items.push(h),x.hasStack=!0,x.stackGroups[y]=S}else x.stackGroups[yf("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return vr(vr({},f),{},Ld({},w,x))},u),c={};return Object.keys(l).reduce(function(f,h){var p=l[h];if(p.hasStack){var m={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(y,b){var w=p.stackGroups[b];return vr(vr({},y),{},Ld({},b,{numericAxisId:r,cateAxisId:i,items:w.items,stackedData:S9e(t,w.items,o)}))},m)}return vr(vr({},f),{},Ld({},h,p))},c)},E9e=function(t,n){var r=n.realScaleType,i=n.type,o=n.tickCount,a=n.originalDomain,s=n.allowDecimals,u=r||n.scale;if(u!=="auto"&&u!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var l=t.domain();if(!l.length)return null;var c=NDe(l,o,s);return t.domain([g2(c),ul(c)]),{niceTicks:c}}if(o&&i==="number"){var f=t.domain(),h=LDe(f,o,s);return{niceTicks:h}}return null};function lh(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,o=e.index,a=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Vt(i[t.dataKey])){var s=Tb(n,"value",i[t.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var u=Kr(i,Vt(a)?t.dataKey:a);return Vt(u)?null:t.scale(u)}var b$=function(t){var n=t.axis,r=t.ticks,i=t.offset,o=t.bandSize,a=t.entry,s=t.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var u=Kr(a,n.dataKey,n.domain[s]);return Vt(u)?null:n.scale(u)-o/2+i},O9e=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},A9e=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?vr(vr({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(qr(o)){var a=n[o];if(a){var s=a.items.indexOf(t);return s>=0?a.stackedData[s]:null}}return null},P9e=function(t){return t.reduce(function(n,r){return[g2(r.concat([n[0]]).filter(Ke)),ul(r.concat([n[1]]).filter(Ke))]},[1/0,-1/0])},Nq=function(t,n,r){return Object.keys(t).reduce(function(i,o){var a=t[o],s=a.stackedData,u=s.reduce(function(l,c){var f=P9e(c.slice(n,r+1));return[Math.min(l[0],f[0]),Math.max(l[1],f[1])]},[1/0,-1/0]);return[Math.min(u[0],i[0]),Math.max(u[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},x$=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,w$=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,N6=function(t,n,r){if(qt(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(Ke(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(x$.test(t[0])){var o=+x$.exec(t[0])[1];i[0]=n[0]-o}else qt(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(Ke(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(w$.test(t[1])){var a=+w$.exec(t[1])[1];i[1]=n[1]+a}else qt(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},ox=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var o=SP(n,function(f){return f.coordinate}),a=1/0,s=1,u=o.length;sa&&(l=2*Math.PI-l),{radius:s,angle:R9e(l),angleInRadian:l}},I9e=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return{startAngle:n-a*360,endAngle:r-a*360}},N9e=function(t,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),a=Math.floor(i/360),s=Math.min(o,a);return t+s*360},E$=function(t,n){var r=t.x,i=t.y,o=$9e({x:r,y:i},n),a=o.radius,s=o.angle,u=n.innerRadius,l=n.outerRadius;if(al)return!1;if(a===0)return!0;var c=I9e(n),f=c.startAngle,h=c.endAngle,p=s,m;if(f<=h){for(;p>h;)p-=360;for(;p=f&&p<=h}else{for(;p>f;)p-=360;for(;p=h&&p<=f}return m?C$(C$({},n),{},{radius:a,angle:N9e(p,n)}):null};function Wg(e){"@babel/helpers - typeof";return Wg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wg(e)}var L9e=["offset"];function F9e(e){return z9e(e)||U9e(e)||B9e(e)||j9e()}function j9e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B9e(e,t){if(e){if(typeof e=="string")return L6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L6(e,t)}}function U9e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function z9e(e){if(Array.isArray(e))return L6(e)}function L6(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function V9e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function O$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Br(e){for(var t=1;t=0?1:-1,S,O;i==="insideStart"?(S=p+x*a,O=y):i==="insideEnd"?(S=m-x*a,O=!y):i==="end"&&(S=m+x*a,O=y),O=w<=0?O:!O;var E=hi(l,c,b,S),C=hi(l,c,b,S+(O?1:-1)*359),P="M".concat(E.x,",").concat(E.y,` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nTe(e,t){if(e){if(typeof e=="string")return C7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C7(e,t)}}function C7(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return q.reduce(function(G,H){var j=H.word,K=H.width,Y=G[G.length-1];if(Y&&(i==null||o||Y.width+K+rH.width?G:H})};if(!c)return p;for(var y="…",b=function(q){var G=f.slice(0,q),H=IH({breakAll:l,style:u,children:G+y}).wordsWithComputedWidth,j=h(H),K=j.length>a||m(j).width>Number(i);return[K,j]},w=0,x=f.length-1,S=0,O;w<=x&&S<=f.length-1;){var E=Math.floor((w+x)/2),C=E-1,P=b(C),M=S7(P,2),N=M[0],B=M[1],V=b(E),W=S7(V,1),ne=W[0];if(!N&&!ne&&(w=E+1),N&&ne&&(x=E-1),!N&&ne){O=B;break}S++}return O||p},E7=function(t){var n=Vt(t)?[]:t.toString().split($H);return[{words:n}]},aTe=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,a=t.breakAll,s=t.maxLines;if((n||r)&&!qa.isSsr){var u,l,c=IH({breakAll:a,children:i,style:o});if(c){var f=c.wordsWithComputedWidth,h=c.spaceWidth;u=f,l=h}else return E7(i);return oTe({breakAll:a,children:i,maxLines:s,style:o},u,l,n,r)}return E7(i)},O7="#808080",Hb=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,a=t.lineHeight,s=a===void 0?"1em":a,u=t.capHeight,l=u===void 0?"0.71em":u,c=t.scaleToFit,f=c===void 0?!1:c,h=t.textAnchor,p=h===void 0?"start":h,m=t.verticalAnchor,y=m===void 0?"end":m,b=t.fill,w=b===void 0?O7:b,x=_7(t,Qke),S=v.useMemo(function(){return aTe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),O=x.dx,E=x.dy,C=x.angle,P=x.className,M=x.breakAll,N=_7(x,Jke);if(!qr(r)||!qr(o))return null;var B=r+(Ke(O)?O:0),V=o+(Ke(E)?E:0),W;switch(y){case"start":W=y3("calc(".concat(l,")"));break;case"middle":W=y3("calc(".concat((S.length-1)/2," * -").concat(s," + (").concat(l," / 2))"));break;default:W=y3("calc(".concat(S.length-1," * -").concat(s,")"));break}var ne=[];if(f){var Z=S[0].width,q=x.width;ne.push("scale(".concat((Ke(q)?q/Z:1)/Z,")"))}return C&&ne.push("rotate(".concat(C,", ").concat(B,", ").concat(V,")")),ne.length&&(N.transform=ne.join(" ")),F.createElement("text",w6({},Wt(N,!0),{x:B,y:V,className:dn("recharts-text",P),textAnchor:p,fill:w.includes("url")?O7:w}),S.map(function(G,H){var j=G.words.join(M?"":" ");return F.createElement("tspan",{x:B,dy:H===0?W:s,key:"".concat(j,"-").concat(H)},j)}))};function Sl(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function sTe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function OP(e){let t,n,r;e.length!==2?(t=Sl,n=(s,u)=>Sl(e(s),u),r=(s,u)=>e(s)-u):(t=e===Sl||e===sTe?e:uTe,n=e,r=e);function i(s,u,l=0,c=s.length){if(l>>1;n(s[f],u)<0?l=f+1:c=f}while(l>>1;n(s[f],u)<=0?l=f+1:c=f}while(ll&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function uTe(){return 0}function NH(e){return e===null?NaN:+e}function*lTe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const cTe=OP(Sl),Vm=cTe.right;OP(NH).center;class A7 extends Map{constructor(t,n=hTe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(P7(this,t))}has(t){return super.has(P7(this,t))}set(t,n){return super.set(fTe(this,t),n)}delete(t){return super.delete(dTe(this,t))}}function P7({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function fTe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function dTe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function hTe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function pTe(e=Sl){if(e===Sl)return LH;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function LH(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const gTe=Math.sqrt(50),mTe=Math.sqrt(10),vTe=Math.sqrt(2);function qb(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=gTe?10:o>=mTe?5:o>=vTe?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(e*l),u=Math.round(t*l),s/lt&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(e/l),u=Math.round(t/l),s*lt&&--u),u0))return[];if(e===t)return[e];const r=t=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l=r)&&(n=r);return n}function T7(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function FH(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?LH:pTe(i);r>n;){if(r-n>600){const u=r-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),p=Math.max(n,Math.floor(t-l*f/u+h)),m=Math.min(r,Math.floor(t+(u-l)*f/u+h));FH(e,t,p,m,i)}const o=e[t];let a=n,s=r;for(Vp(e,n,t),i(e[r],o)>0&&Vp(e,n,r);a0;)--s}i(e[n],o)===0?Vp(e,n,s):(++s,Vp(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Vp(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function yTe(e,t,n){if(e=Float64Array.from(lTe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return T7(e);if(t>=1)return k7(e);var r,i=(r-1)*t,o=Math.floor(i),a=k7(FH(e,o).subarray(0,o+1)),s=T7(e.subarray(o+1));return a+(s-a)*(i-o)}}function bTe(e,t,n=NH){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e),s=+n(e[o+1],o+1,e);return a+(s-a)*(i-o)}}function xTe(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ry(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ry(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_Te.exec(e))?new ao(t[1],t[2],t[3],1):(t=STe.exec(e))?new ao(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=CTe.exec(e))?Ry(t[1],t[2],t[3],t[4]):(t=ETe.exec(e))?Ry(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=OTe.exec(e))?L7(t[1],t[2]/100,t[3]/100,1):(t=ATe.exec(e))?L7(t[1],t[2]/100,t[3]/100,t[4]):M7.hasOwnProperty(e)?$7(M7[e]):e==="transparent"?new ao(NaN,NaN,NaN,0):null}function $7(e){return new ao(e>>16&255,e>>8&255,e&255,1)}function Ry(e,t,n,r){return r<=0&&(e=t=n=NaN),new ao(e,t,n,r)}function TTe(e){return e instanceof Hm||(e=Ng(e)),e?(e=e.rgb(),new ao(e.r,e.g,e.b,e.opacity)):new ao}function O6(e,t,n,r){return arguments.length===1?TTe(e):new ao(e,t,n,r??1)}function ao(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}PP(ao,O6,BH(Hm,{brighter(e){return e=e==null?Kb:Math.pow(Kb,e),new ao(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$g:Math.pow($g,e),new ao(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ao($c(this.r),$c(this.g),$c(this.b),Gb(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:I7,formatHex:I7,formatHex8:MTe,formatRgb:N7,toString:N7}));function I7(){return`#${Ec(this.r)}${Ec(this.g)}${Ec(this.b)}`}function MTe(){return`#${Ec(this.r)}${Ec(this.g)}${Ec(this.b)}${Ec((isNaN(this.opacity)?1:this.opacity)*255)}`}function N7(){const e=Gb(this.opacity);return`${e===1?"rgb(":"rgba("}${$c(this.r)}, ${$c(this.g)}, ${$c(this.b)}${e===1?")":`, ${e})`}`}function Gb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $c(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ec(e){return e=$c(e),(e<16?"0":"")+e.toString(16)}function L7(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ba(e,t,n,r)}function UH(e){if(e instanceof Ba)return new Ba(e.h,e.s,e.l,e.opacity);if(e instanceof Hm||(e=Ng(e)),!e)return new Ba;if(e instanceof Ba)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(t===o?a=(n-r)/s+(n0&&u<1?0:a,new Ba(a,s,u,e.opacity)}function RTe(e,t,n,r){return arguments.length===1?UH(e):new Ba(e,t,n,r??1)}function Ba(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}PP(Ba,RTe,BH(Hm,{brighter(e){return e=e==null?Kb:Math.pow(Kb,e),new Ba(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$g:Math.pow($g,e),new Ba(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ao(b3(e>=240?e-240:e+120,i,r),b3(e,i,r),b3(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ba(F7(this.h),Dy(this.s),Dy(this.l),Gb(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Gb(this.opacity);return`${e===1?"hsl(":"hsla("}${F7(this.h)}, ${Dy(this.s)*100}%, ${Dy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function F7(e){return e=(e||0)%360,e<0?e+360:e}function Dy(e){return Math.max(0,Math.min(1,e||0))}function b3(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const kP=e=>()=>e;function DTe(e,t){return function(n){return e+n*t}}function $Te(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function ITe(e){return(e=+e)==1?zH:function(t,n){return n-t?$Te(t,n,e):kP(isNaN(t)?n:t)}}function zH(e,t){var n=t-e;return n?DTe(e,n):kP(isNaN(e)?t:e)}const j7=function e(t){var n=ITe(t);function r(i,o){var a=n((i=O6(i)).r,(o=O6(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=zH(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=e,r}(1);function NTe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;in&&(o=t.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:Yb(r,i)})),n=x3.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function KTe(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i2?GTe:KTe,u=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(u||(u=s(e.map(r),t,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=s(t,e.map(r),Yb)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Zb),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=TP,c()},f.clamp=function(h){return arguments.length?(a=h?!0:zi,c()):a!==zi},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function MP(){return l2()(zi,zi)}function YTe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Xb(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function oh(e){return e=Xb(Math.abs(e)),e?e[1]:NaN}function ZTe(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function XTe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var QTe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lg(e){if(!(t=QTe.exec(e)))throw new Error("invalid format: "+e);var t;return new RP({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Lg.prototype=RP.prototype;function RP(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}RP.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function JTe(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var WH;function eMe(e,t){var n=Xb(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(WH=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Xb(e,Math.max(0,t+o-1))[0]}function U7(e,t){var n=Xb(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const z7={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:YTe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>U7(e*100,t),r:U7,s:eMe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function W7(e){return e}var V7=Array.prototype.map,H7=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tMe(e){var t=e.grouping===void 0||e.thousands===void 0?W7:ZTe(V7.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?W7:XTe(V7.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=Lg(f);var h=f.fill,p=f.align,m=f.sign,y=f.symbol,b=f.zero,w=f.width,x=f.comma,S=f.precision,O=f.trim,E=f.type;E==="n"?(x=!0,E="g"):z7[E]||(S===void 0&&(S=12),O=!0,E="g"),(b||h==="0"&&p==="=")&&(b=!0,h="0",p="=");var C=y==="$"?n:y==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",P=y==="$"?r:/[%p]/.test(E)?a:"",M=z7[E],N=/[defgprs%]/.test(E);S=S===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function B(V){var W=C,ne=P,Z,q,G;if(E==="c")ne=M(V)+ne,V="";else{V=+V;var H=V<0||1/V<0;if(V=isNaN(V)?u:M(Math.abs(V),S),O&&(V=JTe(V)),H&&+V==0&&m!=="+"&&(H=!1),W=(H?m==="("?m:s:m==="-"||m==="("?"":m)+W,ne=(E==="s"?H7[8+WH/3]:"")+ne+(H&&m==="("?")":""),N){for(Z=-1,q=V.length;++ZG||G>57){ne=(G===46?i+V.slice(Z+1):V.slice(Z))+ne,V=V.slice(0,Z);break}}}x&&!b&&(V=t(V,1/0));var j=W.length+V.length+ne.length,K=j>1)+W+V+ne+K.slice(j);break;default:V=K+W+V+ne;break}return o(V)}return B.toString=function(){return f+""},B}function c(f,h){var p=l((f=Lg(f),f.type="f",f)),m=Math.max(-8,Math.min(8,Math.floor(oh(h)/3)))*3,y=Math.pow(10,-m),b=H7[8+m/3];return function(w){return p(y*w)+b}}return{format:l,formatPrefix:c}}var $y,DP,VH;nMe({thousands:",",grouping:[3],currency:["$",""]});function nMe(e){return $y=tMe(e),DP=$y.format,VH=$y.formatPrefix,$y}function rMe(e){return Math.max(0,-oh(Math.abs(e)))}function iMe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(oh(t)/3)))*3-oh(Math.abs(e)))}function oMe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,oh(t)-oh(e))+1}function HH(e,t,n,r){var i=C6(e,t,n),o;switch(r=Lg(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=iMe(i,a))&&(r.precision=o),VH(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=oMe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=rMe(i))&&(r.precision=o-(r.type==="%")*2);break}}return DP(r)}function Hl(e){var t=e.domain;return e.ticks=function(n){var r=t();return _6(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return HH(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,a=r[i],s=r[o],u,l,c=10;for(s0;){if(l=S6(a,s,n),l===u)return r[i]=a,r[o]=s,t(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return e},e}function Qb(){var e=MP();return e.copy=function(){return qm(e,Qb())},wa.apply(e,arguments),Hl(e)}function qH(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Zb),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return qH(e).unknown(t)},e=arguments.length?Array.from(e,Zb):[0,1],Hl(n)}function KH(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],a;return oMath.pow(e,t)}function cMe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function G7(e){return(t,n)=>-e(-t,n)}function $P(e){const t=e(q7,K7),n=t.domain;let r=10,i,o;function a(){return i=cMe(r),o=lMe(r),n()[0]<0?(i=G7(i),o=G7(o),e(aMe,sMe)):e(q7,K7),t}return t.base=function(s){return arguments.length?(r=+s,a()):r},t.domain=function(s){return arguments.length?(n(s),a()):n()},t.ticks=s=>{const u=n();let l=u[0],c=u[u.length-1];const f=c0){for(;h<=p;++h)for(m=1;mc)break;w.push(y)}}else for(;h<=p;++h)for(m=r-1;m>=1;--m)if(y=h>0?m/o(-h):m*o(h),!(yc)break;w.push(y)}w.length*2{if(s==null&&(s=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=Lg(u)).precision==null&&(u.trim=!0),u=DP(u)),s===1/0)return u;const l=Math.max(1,r*s/t.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*rn(KH(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function GH(){const e=$P(l2()).domain([1,10]);return e.copy=()=>qm(e,GH()).base(e.base()),wa.apply(e,arguments),e}function Y7(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Z7(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function IP(e){var t=1,n=e(Y7(t),Z7(t));return n.constant=function(r){return arguments.length?e(Y7(t=+r),Z7(t)):t},Hl(n)}function YH(){var e=IP(l2());return e.copy=function(){return qm(e,YH()).constant(e.constant())},wa.apply(e,arguments)}function X7(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function fMe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function dMe(e){return e<0?-e*e:e*e}function NP(e){var t=e(zi,zi),n=1;function r(){return n===1?e(zi,zi):n===.5?e(fMe,dMe):e(X7(n),X7(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Hl(t)}function LP(){var e=NP(l2());return e.copy=function(){return qm(e,LP()).exponent(e.exponent())},wa.apply(e,arguments),e}function hMe(){return LP.apply(null,arguments).exponent(.5)}function Q7(e){return Math.sign(e)*e*e}function pMe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function ZH(){var e=MP(),t=[0,1],n=!1,r;function i(o){var a=pMe(e(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return e.invert(Q7(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Zb)).map(Q7)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return ZH(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},wa.apply(i,arguments),Hl(i)}function XH(){var e=[],t=[],n=[],r;function i(){var a=0,s=Math.max(1,t.length);for(n=new Array(s-1);++a0?n[s-1]:e[0],s=n?[r[n-1],t]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return QH().domain([e,t]).range(i).unknown(o)},wa.apply(Hl(a),arguments)}function JH(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Vm(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return JH().domain(e).range(t).unknown(n)},wa.apply(i,arguments)}const w3=new Date,_3=new Date;function Zr(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a(t(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const u=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return u;let l;do u.push(l=new Date(+o)),t(o,s),e(o);while(lZr(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!o(a););else for(;--s>=0;)for(;t(a,1),!o(a););}),n&&(i.count=(o,a)=>(w3.setTime(+o),_3.setTime(+a),e(w3),e(_3),Math.floor(n(w3,_3))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const Jb=Zr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Jb.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Zr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Jb);Jb.range;const ou=1e3,fa=ou*60,au=fa*60,Su=au*24,FP=Su*7,J7=Su*30,S3=Su*365,Oc=Zr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ou)},(e,t)=>(t-e)/ou,e=>e.getUTCSeconds());Oc.range;const jP=Zr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ou)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getMinutes());jP.range;const BP=Zr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getUTCMinutes());BP.range;const UP=Zr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ou-e.getMinutes()*fa)},(e,t)=>{e.setTime(+e+t*au)},(e,t)=>(t-e)/au,e=>e.getHours());UP.range;const zP=Zr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*au)},(e,t)=>(t-e)/au,e=>e.getUTCHours());zP.range;const Km=Zr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*fa)/Su,e=>e.getDate()-1);Km.range;const c2=Zr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Su,e=>e.getUTCDate()-1);c2.range;const eq=Zr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Su,e=>Math.floor(e/Su));eq.range;function bf(e){return Zr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*fa)/FP)}const f2=bf(0),ex=bf(1),gMe=bf(2),mMe=bf(3),ah=bf(4),vMe=bf(5),yMe=bf(6);f2.range;ex.range;gMe.range;mMe.range;ah.range;vMe.range;yMe.range;function xf(e){return Zr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/FP)}const d2=xf(0),tx=xf(1),bMe=xf(2),xMe=xf(3),sh=xf(4),wMe=xf(5),_Me=xf(6);d2.range;tx.range;bMe.range;xMe.range;sh.range;wMe.range;_Me.range;const WP=Zr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());WP.range;const VP=Zr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());VP.range;const Cu=Zr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Cu.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Cu.range;const Eu=Zr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Eu.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Eu.range;function tq(e,t,n,r,i,o){const a=[[Oc,1,ou],[Oc,5,5*ou],[Oc,15,15*ou],[Oc,30,30*ou],[o,1,fa],[o,5,5*fa],[o,15,15*fa],[o,30,30*fa],[i,1,au],[i,3,3*au],[i,6,6*au],[i,12,12*au],[r,1,Su],[r,2,2*Su],[n,1,FP],[t,1,J7],[t,3,3*J7],[e,1,S3]];function s(l,c,f){const h=cb).right(a,h);if(p===a.length)return e.every(C6(l/S3,c/S3,f));if(p===0)return Jb.every(Math.max(C6(l,c,f),1));const[m,y]=a[h/a[p-1][2]53)return null;"w"in be||(be.w=1),"Z"in be?(lt=E3(Hp(be.y,0,1)),Ft=lt.getUTCDay(),lt=Ft>4||Ft===0?tx.ceil(lt):tx(lt),lt=c2.offset(lt,(be.V-1)*7),be.y=lt.getUTCFullYear(),be.m=lt.getUTCMonth(),be.d=lt.getUTCDate()+(be.w+6)%7):(lt=C3(Hp(be.y,0,1)),Ft=lt.getDay(),lt=Ft>4||Ft===0?ex.ceil(lt):ex(lt),lt=Km.offset(lt,(be.V-1)*7),be.y=lt.getFullYear(),be.m=lt.getMonth(),be.d=lt.getDate()+(be.w+6)%7)}else("W"in be||"U"in be)&&("w"in be||(be.w="u"in be?be.u%7:"W"in be?1:0),Ft="Z"in be?E3(Hp(be.y,0,1)).getUTCDay():C3(Hp(be.y,0,1)).getDay(),be.m=0,be.d="W"in be?(be.w+6)%7+be.W*7-(Ft+5)%7:be.w+be.U*7-(Ft+6)%7);return"Z"in be?(be.H+=be.Z/100|0,be.M+=be.Z%100,E3(be)):C3(be)}}function M(Ae,Le,$e,be){for(var bt=0,lt=Le.length,Ft=$e.length,yn,nn;bt=Ft)return-1;if(yn=Le.charCodeAt(bt++),yn===37){if(yn=Le.charAt(bt++),nn=E[yn in e$?Le.charAt(bt++):yn],!nn||(be=nn(Ae,$e,be))<0)return-1}else if(yn!=$e.charCodeAt(be++))return-1}return be}function N(Ae,Le,$e){var be=l.exec(Le.slice($e));return be?(Ae.p=c.get(be[0].toLowerCase()),$e+be[0].length):-1}function B(Ae,Le,$e){var be=p.exec(Le.slice($e));return be?(Ae.w=m.get(be[0].toLowerCase()),$e+be[0].length):-1}function V(Ae,Le,$e){var be=f.exec(Le.slice($e));return be?(Ae.w=h.get(be[0].toLowerCase()),$e+be[0].length):-1}function W(Ae,Le,$e){var be=w.exec(Le.slice($e));return be?(Ae.m=x.get(be[0].toLowerCase()),$e+be[0].length):-1}function ne(Ae,Le,$e){var be=y.exec(Le.slice($e));return be?(Ae.m=b.get(be[0].toLowerCase()),$e+be[0].length):-1}function Z(Ae,Le,$e){return M(Ae,t,Le,$e)}function q(Ae,Le,$e){return M(Ae,n,Le,$e)}function G(Ae,Le,$e){return M(Ae,r,Le,$e)}function H(Ae){return a[Ae.getDay()]}function j(Ae){return o[Ae.getDay()]}function K(Ae){return u[Ae.getMonth()]}function Y(Ae){return s[Ae.getMonth()]}function oe(Ae){return i[+(Ae.getHours()>=12)]}function X(Ae){return 1+~~(Ae.getMonth()/3)}function Q(Ae){return a[Ae.getUTCDay()]}function ue(Ae){return o[Ae.getUTCDay()]}function de(Ae){return u[Ae.getUTCMonth()]}function Se(Ae){return s[Ae.getUTCMonth()]}function me(Ae){return i[+(Ae.getUTCHours()>=12)]}function Ze(Ae){return 1+~~(Ae.getUTCMonth()/3)}return{format:function(Ae){var Le=C(Ae+="",S);return Le.toString=function(){return Ae},Le},parse:function(Ae){var Le=P(Ae+="",!1);return Le.toString=function(){return Ae},Le},utcFormat:function(Ae){var Le=C(Ae+="",O);return Le.toString=function(){return Ae},Le},utcParse:function(Ae){var Le=P(Ae+="",!0);return Le.toString=function(){return Ae},Le}}}var e$={"-":"",_:" ",0:"0"},oi=/^\s*\d+/,PMe=/^%/,kMe=/[\\^$*+?|[\]().{}]/g;function bn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[t.toLowerCase(),n]))}function MMe(e,t,n){var r=oi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function RMe(e,t,n){var r=oi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function DMe(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function $Me(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function IMe(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function t$(e,t,n){var r=oi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function n$(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function NMe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function LMe(e,t,n){var r=oi.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function FMe(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function r$(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function jMe(e,t,n){var r=oi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function i$(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function BMe(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function UMe(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function zMe(e,t,n){var r=oi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function WMe(e,t,n){var r=oi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function VMe(e,t,n){var r=PMe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function HMe(e,t,n){var r=oi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qMe(e,t,n){var r=oi.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function o$(e,t){return bn(e.getDate(),t,2)}function KMe(e,t){return bn(e.getHours(),t,2)}function GMe(e,t){return bn(e.getHours()%12||12,t,2)}function YMe(e,t){return bn(1+Km.count(Cu(e),e),t,3)}function nq(e,t){return bn(e.getMilliseconds(),t,3)}function ZMe(e,t){return nq(e,t)+"000"}function XMe(e,t){return bn(e.getMonth()+1,t,2)}function QMe(e,t){return bn(e.getMinutes(),t,2)}function JMe(e,t){return bn(e.getSeconds(),t,2)}function eRe(e){var t=e.getDay();return t===0?7:t}function tRe(e,t){return bn(f2.count(Cu(e)-1,e),t,2)}function rq(e){var t=e.getDay();return t>=4||t===0?ah(e):ah.ceil(e)}function nRe(e,t){return e=rq(e),bn(ah.count(Cu(e),e)+(Cu(e).getDay()===4),t,2)}function rRe(e){return e.getDay()}function iRe(e,t){return bn(ex.count(Cu(e)-1,e),t,2)}function oRe(e,t){return bn(e.getFullYear()%100,t,2)}function aRe(e,t){return e=rq(e),bn(e.getFullYear()%100,t,2)}function sRe(e,t){return bn(e.getFullYear()%1e4,t,4)}function uRe(e,t){var n=e.getDay();return e=n>=4||n===0?ah(e):ah.ceil(e),bn(e.getFullYear()%1e4,t,4)}function lRe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+bn(t/60|0,"0",2)+bn(t%60,"0",2)}function a$(e,t){return bn(e.getUTCDate(),t,2)}function cRe(e,t){return bn(e.getUTCHours(),t,2)}function fRe(e,t){return bn(e.getUTCHours()%12||12,t,2)}function dRe(e,t){return bn(1+c2.count(Eu(e),e),t,3)}function iq(e,t){return bn(e.getUTCMilliseconds(),t,3)}function hRe(e,t){return iq(e,t)+"000"}function pRe(e,t){return bn(e.getUTCMonth()+1,t,2)}function gRe(e,t){return bn(e.getUTCMinutes(),t,2)}function mRe(e,t){return bn(e.getUTCSeconds(),t,2)}function vRe(e){var t=e.getUTCDay();return t===0?7:t}function yRe(e,t){return bn(d2.count(Eu(e)-1,e),t,2)}function oq(e){var t=e.getUTCDay();return t>=4||t===0?sh(e):sh.ceil(e)}function bRe(e,t){return e=oq(e),bn(sh.count(Eu(e),e)+(Eu(e).getUTCDay()===4),t,2)}function xRe(e){return e.getUTCDay()}function wRe(e,t){return bn(tx.count(Eu(e)-1,e),t,2)}function _Re(e,t){return bn(e.getUTCFullYear()%100,t,2)}function SRe(e,t){return e=oq(e),bn(e.getUTCFullYear()%100,t,2)}function CRe(e,t){return bn(e.getUTCFullYear()%1e4,t,4)}function ERe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?sh(e):sh.ceil(e),bn(e.getUTCFullYear()%1e4,t,4)}function ORe(){return"+0000"}function s$(){return"%"}function u$(e){return+e}function l$(e){return Math.floor(+e/1e3)}var Zf,aq,sq;ARe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function ARe(e){return Zf=AMe(e),aq=Zf.format,Zf.parse,sq=Zf.utcFormat,Zf.utcParse,Zf}function PRe(e){return new Date(e)}function kRe(e){return e instanceof Date?+e:+new Date(+e)}function HP(e,t,n,r,i,o,a,s,u,l){var c=MP(),f=c.invert,h=c.domain,p=l(".%L"),m=l(":%S"),y=l("%I:%M"),b=l("%I %p"),w=l("%a %d"),x=l("%b %d"),S=l("%B"),O=l("%Y");function E(C){return(u(C)t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>yTe(e,o/r))},n.copy=function(){return fq(t).domain(e)},Ru.apply(n,arguments)}function p2(){var e=0,t=.5,n=1,r=1,i,o,a,s,u,l=zi,c,f=!1,h;function p(y){return isNaN(y=+y)?h:(y=.5+((y=+c(y))-o)*(r*yt}var LRe=NRe,FRe=gq,jRe=LRe,BRe=Xh;function URe(e){return e&&e.length?FRe(e,BRe,jRe):void 0}var zRe=URe;const ul=kn(zRe);function WRe(e,t){return ee.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=re.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};st.decimalPlaces=st.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*nr;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};st.dividedBy=st.div=function(e){return hu(this,new this.constructor(e))};st.dividedToIntegerBy=st.idiv=function(e){var t=this,n=t.constructor;return zn(hu(t,new n(e),0,1),n.precision)};st.equals=st.eq=function(e){return!this.cmp(e)};st.exponent=function(){return Rr(this)};st.greaterThan=st.gt=function(e){return this.cmp(e)>0};st.greaterThanOrEqualTo=st.gte=function(e){return this.cmp(e)>=0};st.isInteger=st.isint=function(){return this.e>this.d.length-2};st.isNegative=st.isneg=function(){return this.s<0};st.isPositive=st.ispos=function(){return this.s>0};st.isZero=function(){return this.s===0};st.lessThan=st.lt=function(e){return this.cmp(e)<0};st.lessThanOrEqualTo=st.lte=function(e){return this.cmp(e)<1};st.logarithm=st.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Do))throw Error(ya+"NaN");if(n.s<1)throw Error(ya+(n.s?"NaN":"-Infinity"));return n.eq(Do)?new r(0):(sr=!1,t=hu(Fg(n,o),Fg(e,o),o),sr=!0,zn(t,i))};st.minus=st.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?bq(t,e):vq(t,(e.s=-e.s,e))};st.modulo=st.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(ya+"NaN");return n.s?(sr=!1,t=hu(n,e,0,1).times(e),sr=!0,n.minus(t)):zn(new r(n),i)};st.naturalExponential=st.exp=function(){return yq(this)};st.naturalLogarithm=st.ln=function(){return Fg(this)};st.negated=st.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};st.plus=st.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?vq(t,e):bq(t,(e.s=-e.s,e))};st.precision=st.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ic+e);if(t=Rr(i)+1,r=i.d.length-1,n=r*nr+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};st.squareRoot=st.sqrt=function(){var e,t,n,r,i,o,a,s=this,u=s.constructor;if(s.s<1){if(!s.s)return new u(0);throw Error(ya+"NaN")}for(e=Rr(s),sr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=vs(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=ep((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new u(t)):r=new u(i.toString()),n=u.precision,i=a=n+3;;)if(o=r,r=o.plus(hu(s,o,a+2)).times(.5),vs(o.d).slice(0,a)===(t=vs(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(zn(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(t!="9999")break;a+=4}return sr=!0,zn(r,n)};st.times=st.mul=function(e){var t,n,r,i,o,a,s,u,l,c=this,f=c.constructor,h=c.d,p=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,n=c.e+e.e,u=h.length,l=p.length,u=0;){for(t=0,i=u+r;i>r;)s=o[i]+p[r]*h[i-r-1]+t,o[i--]=s%ei|0,t=s/ei|0;o[i]=(o[i]+t)%ei|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,sr?zn(e,f.precision):e};st.toDecimalPlaces=st.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Rs(e,0,Jh),t===void 0?t=r.rounding:Rs(t,0,8),zn(n,e+Rr(n)+1,t))};st.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=rf(r,!0):(Rs(e,0,Jh),t===void 0?t=i.rounding:Rs(t,0,8),r=zn(new i(r),e+1,t),n=rf(r,!0,e+1)),n};st.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?rf(i):(Rs(e,0,Jh),t===void 0?t=o.rounding:Rs(t,0,8),r=zn(new o(i),e+Rr(i)+1,t),n=rf(r.abs(),!1,e+Rr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};st.toInteger=st.toint=function(){var e=this,t=e.constructor;return zn(new t(e),Rr(e)+1,t.rounding)};st.toNumber=function(){return+this};st.toPower=st.pow=function(e){var t,n,r,i,o,a,s=this,u=s.constructor,l=12,c=+(e=new u(e));if(!e.s)return new u(Do);if(s=new u(s),!s.s){if(e.s<1)throw Error(ya+"Infinity");return s}if(s.eq(Do))return s;if(r=u.precision,e.eq(Do))return zn(s,r);if(t=e.e,n=e.d.length-1,a=t>=n,o=s.s,a){if((n=c<0?-c:c)<=mq){for(i=new u(Do),t=Math.ceil(r/nr+4),sr=!1;n%2&&(i=i.times(s),d$(i.d,t)),n=ep(n/2),n!==0;)s=s.times(s),d$(s.d,t);return sr=!0,e.s<0?new u(Do).div(i):zn(i,r)}}else if(o<0)throw Error(ya+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,sr=!1,i=e.times(Fg(s,r+l)),sr=!0,i=yq(i),i.s=o,i};st.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=Rr(i),r=rf(i,n<=o.toExpNeg||n>=o.toExpPos)):(Rs(e,1,Jh),t===void 0?t=o.rounding:Rs(t,0,8),i=zn(new o(i),e,t),n=Rr(i),r=rf(i,e<=n||n<=o.toExpNeg,e)),r};st.toSignificantDigits=st.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Rs(e,1,Jh),t===void 0?t=r.rounding:Rs(t,0,8)),zn(new r(n),e,t)};st.toString=st.valueOf=st.val=st.toJSON=st[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Rr(e),n=e.constructor;return rf(e,t<=n.toExpNeg||t>=n.toExpPos)};function vq(e,t){var n,r,i,o,a,s,u,l,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),sr?zn(t,f):t;if(u=e.d,l=t.d,a=e.e,i=t.e,u=u.slice(),o=a-i,o){for(o<0?(r=u,o=-o,s=l.length):(r=l,i=a,s=u.length),a=Math.ceil(f/nr),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=u.length,o=l.length,s-o<0&&(o=s,r=l,l=u,u=r),n=0;o;)n=(u[--o]=u[o]+l[o]+n)/ei|0,u[o]%=ei;for(n&&(u.unshift(n),++i),s=u.length;u[--s]==0;)u.pop();return t.d=u,t.e=i,sr?zn(t,f):t}function Rs(e,t,n){if(e!==~~e||en)throw Error(Ic+e)}function vs(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;ta?1:-1;else for(s=u=0;si[s]?1:-1;break}return u}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,a){var s,u,l,c,f,h,p,m,y,b,w,x,S,O,E,C,P,M,N=r.constructor,B=r.s==i.s?1:-1,V=r.d,W=i.d;if(!r.s)return new N(r);if(!i.s)throw Error(ya+"Division by zero");for(u=r.e-i.e,P=W.length,E=V.length,p=new N(B),m=p.d=[],l=0;W[l]==(V[l]||0);)++l;if(W[l]>(V[l]||0)&&--u,o==null?x=o=N.precision:a?x=o+(Rr(r)-Rr(i))+1:x=o,x<0)return new N(0);if(x=x/nr+2|0,l=0,P==1)for(c=0,W=W[0],x++;(l1&&(W=e(W,c),V=e(V,c),P=W.length,E=V.length),O=P,y=V.slice(0,P),b=y.length;b=ei/2&&++C;do c=0,s=t(W,y,P,b),s<0?(w=y[0],P!=b&&(w=w*ei+(y[1]||0)),c=w/C|0,c>1?(c>=ei&&(c=ei-1),f=e(W,c),h=f.length,b=y.length,s=t(f,y,h,b),s==1&&(c--,n(f,P16)throw Error(GP+Rr(e));if(!e.s)return new c(Do);for(t==null?(sr=!1,s=f):s=t,a=new c(.03125);e.abs().gte(.1);)e=e.times(a),l+=5;for(r=Math.log(pc(2,l))/Math.LN10*2+5|0,s+=r,n=i=o=new c(Do),c.precision=s;;){if(i=zn(i.times(e),s),n=n.times(++u),a=o.plus(hu(i,n,s)),vs(a.d).slice(0,s)===vs(o.d).slice(0,s)){for(;l--;)o=zn(o.times(o),s);return c.precision=f,t==null?(sr=!0,zn(o,f)):o}o=a}}function Rr(e){for(var t=e.e*nr,n=e.d[0];n>=10;n/=10)t++;return t}function O3(e,t,n){if(t>e.LN10.sd())throw sr=!0,n&&(e.precision=n),Error(ya+"LN10 precision limit exceeded");return zn(new e(e.LN10),t)}function Qu(e){for(var t="";e--;)t+="0";return t}function Fg(e,t){var n,r,i,o,a,s,u,l,c,f=1,h=10,p=e,m=p.d,y=p.constructor,b=y.precision;if(p.s<1)throw Error(ya+(p.s?"NaN":"-Infinity"));if(p.eq(Do))return new y(0);if(t==null?(sr=!1,l=b):l=t,p.eq(10))return t==null&&(sr=!0),O3(y,l);if(l+=h,y.precision=l,n=vs(m),r=n.charAt(0),o=Rr(p),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=vs(p.d),r=n.charAt(0),f++;o=Rr(p),r>1?(p=new y("0."+n),o++):p=new y(r+"."+n.slice(1))}else return u=O3(y,l+2,b).times(o+""),p=Fg(new y(r+"."+n.slice(1)),l-h).plus(u),y.precision=b,t==null?(sr=!0,zn(p,b)):p;for(s=a=p=hu(p.minus(Do),p.plus(Do),l),c=zn(p.times(p),l),i=3;;){if(a=zn(a.times(c),l),u=s.plus(hu(a,new y(i),l)),vs(u.d).slice(0,l)===vs(s.d).slice(0,l))return s=s.times(2),o!==0&&(s=s.plus(O3(y,l+2,b).times(o+""))),s=hu(s,new y(f),l),y.precision=b,t==null?(sr=!0,zn(s,b)):s;s=u,i+=2}}function f$(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=ep(n/nr),e.d=[],r=(n+1)%nr,n<0&&(r+=nr),rnx||e.e<-nx))throw Error(GP+n)}else e.s=0,e.e=0,e.d=[0];return e}function zn(e,t,n){var r,i,o,a,s,u,l,c,f=e.d;for(a=1,o=f[0];o>=10;o/=10)a++;if(r=t-a,r<0)r+=nr,i=t,l=f[c=0];else{if(c=Math.ceil((r+1)/nr),o=f.length,c>=o)return e;for(l=o=f[c],a=1;o>=10;o/=10)a++;r%=nr,i=r-nr+a}if(n!==void 0&&(o=pc(10,a-i-1),s=l/o%10|0,u=t<0||f[c+1]!==void 0||l%o,u=n<4?(s||u)&&(n==0||n==(e.s<0?3:2)):s>5||s==5&&(n==4||u||n==6&&(r>0?i>0?l/pc(10,a-i):0:f[c-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return u?(o=Rr(e),f.length=1,t=t-o-1,f[0]=pc(10,(nr-t%nr)%nr),e.e=ep(-t/nr)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=c,o=1,c--):(f.length=c+1,o=pc(10,nr-r),f[c]=i>0?(l/pc(10,a-i)%pc(10,i)|0)*o:0),u)for(;;)if(c==0){(f[0]+=o)==ei&&(f[0]=1,++e.e);break}else{if(f[c]+=o,f[c]!=ei)break;f[c--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(sr&&(e.e>nx||e.e<-nx))throw Error(GP+Rr(e));return e}function bq(e,t){var n,r,i,o,a,s,u,l,c,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),sr?zn(t,p):t;if(u=e.d,f=t.d,r=t.e,l=e.e,u=u.slice(),a=l-r,a){for(c=a<0,c?(n=u,a=-a,s=f.length):(n=f,r=l,s=u.length),i=Math.max(Math.ceil(p/nr),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=u.length,s=f.length,c=i0;--i)u[s++]=0;for(i=f.length;i>a;){if(u[--i]0?o=o.charAt(0)+"."+o.slice(1)+Qu(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Qu(-i-1)+o,n&&(r=n-a)>0&&(o+=Qu(r))):i>=a?(o+=Qu(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Qu(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=Qu(r))),e.s<0?"-"+o:o}function d$(e,t){if(e.length>t)return e.length=t,!0}function xq(e){var t,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Ic+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return f$(a,o.toString())}else if(typeof o!="string")throw Error(Ic+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,f9e.test(o))f$(a,o);else throw Error(Ic+o)}if(i.prototype=st,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=xq,i.config=i.set=d9e,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Ic+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ic+n+": "+r);return this}var YP=xq(c9e);Do=new YP(1);const Ln=YP;function h9e(e){return v9e(e)||m9e(e)||g9e(e)||p9e()}function p9e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g9e(e,t){if(e){if(typeof e=="string")return k6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k6(e,t)}}function m9e(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function v9e(e){if(Array.isArray(e))return k6(e)}function k6(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,i):e(t-a,h$(function(){for(var s=arguments.length,u=new Array(s),l=0;le.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(u){i=!0,o=u}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function R9e(e){if(Array.isArray(e))return e}function Eq(e){var t=jg(e,2),n=t[0],r=t[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function Oq(e,t,n){if(e.lte(0))return new Ln(0);var r=v2.getDigitCount(e.toNumber()),i=new Ln(10).pow(r),o=e.div(i),a=r!==1?.05:.1,s=new Ln(Math.ceil(o.div(a).toNumber())).add(n).mul(a),u=s.mul(i);return t?u:new Ln(Math.ceil(u))}function D9e(e,t,n){var r=1,i=new Ln(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new Ln(10).pow(v2.getDigitCount(e)-1),i=new Ln(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Ln(Math.floor(e)))}else e===0?i=new Ln(Math.floor((t-1)/2)):n||(i=new Ln(Math.floor(e)));var a=Math.floor((t-1)/2),s=w9e(x9e(function(u){return i.add(new Ln(u-a).mul(r)).toNumber()}),T6);return s(0,t)}function Aq(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Ln(0),tickMin:new Ln(0),tickMax:new Ln(0)};var o=Oq(new Ln(t).sub(e).div(n-1),r,i),a;e<=0&&t>=0?a=new Ln(0):(a=new Ln(e).add(t).div(2),a=a.sub(new Ln(a).mod(o)));var s=Math.ceil(a.sub(e).div(o).toNumber()),u=Math.ceil(new Ln(t).sub(a).div(o).toNumber()),l=s+u+1;return l>n?Aq(e,t,n,r,i+1):(l0?u+(n-l):u,s=t>0?s:s+(n-l)),{step:o,tickMin:a.sub(new Ln(s).mul(o)),tickMax:a.add(new Ln(u).mul(o))})}function $9e(e){var t=jg(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=Eq([n,r]),u=jg(s,2),l=u[0],c=u[1];if(l===-1/0||c===1/0){var f=c===1/0?[l].concat(R6(T6(0,i-1).map(function(){return 1/0}))):[].concat(R6(T6(0,i-1).map(function(){return-1/0})),[c]);return n>r?M6(f):f}if(l===c)return D9e(l,i,o);var h=Aq(l,c,a,o),p=h.step,m=h.tickMin,y=h.tickMax,b=v2.rangeStep(m,y.add(new Ln(.1).mul(p)),p);return n>r?M6(b):b}function I9e(e,t){var n=jg(e,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Eq([r,i]),s=jg(a,2),u=s[0],l=s[1];if(u===-1/0||l===1/0)return[r,i];if(u===l)return[u];var c=Math.max(t,2),f=Oq(new Ln(l).sub(u).div(c-1),o,0),h=[].concat(R6(v2.rangeStep(new Ln(u),new Ln(l).sub(new Ln(.99).mul(f)),f)),[l]);return r>i?M6(h):h}var N9e=Sq($9e),L9e=Sq(I9e),F9e="Invariant failed";function of(e,t){throw new Error(F9e)}var j9e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function uh(e){"@babel/helpers - typeof";return uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uh(e)}function rx(){return rx=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function q9e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function K9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G9e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r?.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var u=o.range,l=0;l0?i[l-1].coordinate:i[s-1].coordinate,f=i[l].coordinate,h=l>=s-1?i[0].coordinate:i[l+1].coordinate,p=void 0;if(za(f-c)!==za(h-f)){var m=[];if(za(h-f)===za(u[1]-u[0])){p=h;var y=f+u[1]-u[0];m[0]=Math.min(y,(y+c)/2),m[1]=Math.max(y,(y+c)/2)}else{p=c;var b=h+u[1]-u[0];m[0]=Math.min(f,(b+f)/2),m[1]=Math.max(f,(b+f)/2)}var w=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>w[0]&&t<=w[1]||t>=m[0]&&t<=m[1]){a=i[l].index;break}}else{var x=Math.min(c,h),S=Math.max(c,h);if(t>(x+f)/2&&t<=(S+f)/2){a=i[l].index;break}}}else for(var O=0;O0&&O(r[O].coordinate+r[O-1].coordinate)/2&&t<=(r[O].coordinate+r[O+1].coordinate)/2||O===s-1&&t>(r[O].coordinate+r[O-1].coordinate)/2){a=r[O].index;break}return a},ZP=function(t){var n,r=t,i=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?vr(vr({},t.type.defaultProps),t.props):t.props,a=o.stroke,s=o.fill,u;switch(i){case"Line":u=a;break;case"Area":case"Radar":u=a&&a!=="none"?a:s;break;default:u=s;break}return u},fDe=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),u=0,l=s.length;u=0});if(w&&w.length){var x=w[0].type.defaultProps,S=x!==void 0?vr(vr({},x),w[0].props):w[0].props,O=S.barSize,E=S[b];a[E]||(a[E]=[]);var C=Vt(O)?n:O;a[E].push({item:w[0],stackList:w.slice(1),barSize:Vt(C)?void 0:tf(C,r,0)})}}return a},dDe=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,o=t.sizeList,a=o===void 0?[]:o,s=t.maxBarSize,u=a.length;if(u<1)return null;var l=tf(n,i,0,!0),c,f=[];if(a[0].barSize===+a[0].barSize){var h=!1,p=i/u,m=a.reduce(function(O,E){return O+E.barSize||0},0);m+=(u-1)*l,m>=i&&(m-=(u-1)*l,l=0),m>=i&&p>0&&(h=!0,p*=.9,m=u*p);var y=(i-m)/2>>0,b={offset:y-l,size:0};c=a.reduce(function(O,E){var C={item:E.item,position:{offset:b.offset+b.size+l,size:h?p:E.barSize}},P=[].concat(m$(O),[C]);return b=P[P.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(M){P.push({item:M,position:b})}),P},f)}else{var w=tf(r,i,0,!0);i-2*w-(u-1)*l<=0&&(l=0);var x=(i-2*w-(u-1)*l)/u;x>1&&(x>>=0);var S=s===+s?Math.min(x,s):x;c=a.reduce(function(O,E,C){var P=[].concat(m$(O),[{item:E.item,position:{offset:w+(x+l)*C+(x-S)/2,size:S}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(M){P.push({item:M,position:P[P.length-1].position})}),P},f)}return c},hDe=function(t,n,r,i){var o=r.children,a=r.width,s=r.margin,u=a-(s.left||0)-(s.right||0),l=Mq({children:o,legendWidth:u});if(l){var c=i||{},f=c.width,h=c.height,p=l.align,m=l.verticalAlign,y=l.layout;if((y==="vertical"||y==="horizontal"&&m==="middle")&&p!=="center"&&Ke(t[p]))return vr(vr({},t),{},Ld({},p,t[p]+(f||0)));if((y==="horizontal"||y==="vertical"&&p==="center")&&m!=="middle"&&Ke(t[m]))return vr(vr({},t),{},Ld({},m,t[m]+(h||0)))}return t},pDe=function(t,n,r){return Vt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Rq=function(t,n,r,i,o){var a=n.props.children,s=ho(a,tp).filter(function(l){return pDe(i,o,l.props.direction)});if(s&&s.length){var u=s.map(function(l){return l.props.dataKey});return t.reduce(function(l,c){var f=Kr(c,r);if(Vt(f))return l;var h=Array.isArray(f)?[g2(f),ul(f)]:[f,f],p=u.reduce(function(m,y){var b=Kr(c,y,0),w=h[0]-Math.abs(Array.isArray(b)?b[0]:b),x=h[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(w,m[0]),Math.max(x,m[1])]},[1/0,-1/0]);return[Math.min(p[0],l[0]),Math.max(p[1],l[1])]},[1/0,-1/0])}return null},gDe=function(t,n,r,i,o){var a=n.map(function(s){return Rq(t,s,r,o,i)}).filter(function(s){return!Vt(s)});return a&&a.length?a.reduce(function(s,u){return[Math.min(s[0],u[0]),Math.max(s[1],u[1])]},[1/0,-1/0]):null},Dq=function(t,n,r,i,o){var a=n.map(function(u){var l=u.props.dataKey;return r==="number"&&l&&Rq(t,u,l,i)||k0(t,l,r,o)});if(r==="number")return a.reduce(function(u,l){return[Math.min(u[0],l[0]),Math.max(u[1],l[1])]},[1/0,-1/0]);var s={};return a.reduce(function(u,l){for(var c=0,f=l.length;c=2?za(s[0]-s[1])*2*l:l,n&&(t.ticks||t.niceTicks)){var c=(t.ticks||t.niceTicks).map(function(f){var h=o?o.indexOf(f):f;return{coordinate:i(h)+l,value:f,offset:l}});return c.filter(function(f){return!Gh(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+l,value:f,index:h,offset:l}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+l,value:f,offset:l}}):i.domain().map(function(f,h){return{coordinate:i(f)+l,value:o?o[f]:f,index:h,offset:l}})},A3=new WeakMap,Iy=function(t,n){if(typeof n!="function")return t;A3.has(t)||A3.set(t,new WeakMap);var r=A3.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},mDe=function(t,n,r){var i=t.scale,o=t.type,a=t.layout,s=t.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:Dg(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:Qb(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:P0(),realScaleType:"point"}:o==="category"?{scale:Dg(),realScaleType:"band"}:{scale:Qb(),realScaleType:"linear"};if(zm(i)){var u="scale".concat(t2(i));return{scale:(c$[u]||P0)(),realScaleType:c$[u]?u:"point"}}return qt(i)?{scale:i}:{scale:P0(),realScaleType:"point"}},y$=1e-4,vDe=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),o=Math.min(i[0],i[1])-y$,a=Math.max(i[0],i[1])+y$,s=t(n[0]),u=t(n[r-1]);(sa||ua)&&t.domain([n[0],n[r-1]])}},yDe=function(t,n){if(!t)return null;for(var r=0,i=t.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(t[s][r][0]=o,t[s][r][1]=o+u,o=t[s][r][1]):(t[s][r][0]=a,t[s][r][1]=a+u,a=t[s][r][1])}},wDe=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r=0?(t[a][r][0]=o,t[a][r][1]=o+s,o=t[a][r][1]):(t[a][r][0]=0,t[a][r][1]=0)}},_De={sign:xDe,expand:LCe,none:eh,silhouette:FCe,wiggle:jCe,positive:wDe},SDe=function(t,n,r){var i=n.map(function(s){return s.props.dataKey}),o=_De[r],a=NCe().keys(i).value(function(s,u){return+Kr(s,u,0)}).order(a6).offset(o);return a(t)},CDe=function(t,n,r,i,o,a){if(!t)return null;var s=a?n.reverse():n,u={},l=s.reduce(function(f,h){var p,m=(p=h.type)!==null&&p!==void 0&&p.defaultProps?vr(vr({},h.type.defaultProps),h.props):h.props,y=m.stackId,b=m.hide;if(b)return f;var w=m[r],x=f[w]||{hasStack:!1,stackGroups:{}};if(qr(y)){var S=x.stackGroups[y]||{numericAxisId:r,cateAxisId:i,items:[]};S.items.push(h),x.hasStack=!0,x.stackGroups[y]=S}else x.stackGroups[yf("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return vr(vr({},f),{},Ld({},w,x))},u),c={};return Object.keys(l).reduce(function(f,h){var p=l[h];if(p.hasStack){var m={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(y,b){var w=p.stackGroups[b];return vr(vr({},y),{},Ld({},b,{numericAxisId:r,cateAxisId:i,items:w.items,stackedData:SDe(t,w.items,o)}))},m)}return vr(vr({},f),{},Ld({},h,p))},c)},EDe=function(t,n){var r=n.realScaleType,i=n.type,o=n.tickCount,a=n.originalDomain,s=n.allowDecimals,u=r||n.scale;if(u!=="auto"&&u!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var l=t.domain();if(!l.length)return null;var c=N9e(l,o,s);return t.domain([g2(c),ul(c)]),{niceTicks:c}}if(o&&i==="number"){var f=t.domain(),h=L9e(f,o,s);return{niceTicks:h}}return null};function lh(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,o=e.index,a=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Vt(i[t.dataKey])){var s=Tb(n,"value",i[t.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var u=Kr(i,Vt(a)?t.dataKey:a);return Vt(u)?null:t.scale(u)}var b$=function(t){var n=t.axis,r=t.ticks,i=t.offset,o=t.bandSize,a=t.entry,s=t.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var u=Kr(a,n.dataKey,n.domain[s]);return Vt(u)?null:n.scale(u)-o/2+i},ODe=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},ADe=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?vr(vr({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(qr(o)){var a=n[o];if(a){var s=a.items.indexOf(t);return s>=0?a.stackedData[s]:null}}return null},PDe=function(t){return t.reduce(function(n,r){return[g2(r.concat([n[0]]).filter(Ke)),ul(r.concat([n[1]]).filter(Ke))]},[1/0,-1/0])},Nq=function(t,n,r){return Object.keys(t).reduce(function(i,o){var a=t[o],s=a.stackedData,u=s.reduce(function(l,c){var f=PDe(c.slice(n,r+1));return[Math.min(l[0],f[0]),Math.max(l[1],f[1])]},[1/0,-1/0]);return[Math.min(u[0],i[0]),Math.max(u[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},x$=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,w$=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,N6=function(t,n,r){if(qt(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(Ke(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(x$.test(t[0])){var o=+x$.exec(t[0])[1];i[0]=n[0]-o}else qt(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(Ke(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(w$.test(t[1])){var a=+w$.exec(t[1])[1];i[1]=n[1]+a}else qt(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},ox=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var o=SP(n,function(f){return f.coordinate}),a=1/0,s=1,u=o.length;sa&&(l=2*Math.PI-l),{radius:s,angle:RDe(l),angleInRadian:l}},IDe=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return{startAngle:n-a*360,endAngle:r-a*360}},NDe=function(t,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),a=Math.floor(i/360),s=Math.min(o,a);return t+s*360},E$=function(t,n){var r=t.x,i=t.y,o=$De({x:r,y:i},n),a=o.radius,s=o.angle,u=n.innerRadius,l=n.outerRadius;if(al)return!1;if(a===0)return!0;var c=IDe(n),f=c.startAngle,h=c.endAngle,p=s,m;if(f<=h){for(;p>h;)p-=360;for(;p=f&&p<=h}else{for(;p>f;)p-=360;for(;p=h&&p<=f}return m?C$(C$({},n),{},{radius:a,angle:NDe(p,n)}):null};function Wg(e){"@babel/helpers - typeof";return Wg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wg(e)}var LDe=["offset"];function FDe(e){return zDe(e)||UDe(e)||BDe(e)||jDe()}function jDe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BDe(e,t){if(e){if(typeof e=="string")return L6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L6(e,t)}}function UDe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zDe(e){if(Array.isArray(e))return L6(e)}function L6(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VDe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function O$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Br(e){for(var t=1;t=0?1:-1,S,O;i==="insideStart"?(S=p+x*a,O=y):i==="insideEnd"?(S=m-x*a,O=!y):i==="end"&&(S=m+x*a,O=y),O=w<=0?O:!O;var E=hi(l,c,b,S),C=hi(l,c,b,S+(O?1:-1)*359),P="M".concat(E.x,",").concat(E.y,` A`).concat(b,",").concat(b,",0,1,").concat(O?0:1,`, - `).concat(C.x,",").concat(C.y),M=Vt(t.id)?yf("recharts-radial-line-"):t.id;return F.createElement("text",Vg({},r,{dominantBaseline:"central",className:dn("recharts-radial-bar-label",s)}),F.createElement("defs",null,F.createElement("path",{id:M,d:P})),F.createElement("textPath",{xlinkHref:"#".concat(M)},n))},X9e=function(t){var n=t.viewBox,r=t.offset,i=t.position,o=n,a=o.cx,s=o.cy,u=o.innerRadius,l=o.outerRadius,c=o.startAngle,f=o.endAngle,h=(c+f)/2;if(i==="outside"){var p=hi(a,s,l+r,h),m=p.x,y=p.y;return{x:m,y,textAnchor:m>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var b=(u+l)/2,w=hi(a,s,b,h),x=w.x,S=w.y;return{x,y:S,textAnchor:"middle",verticalAnchor:"middle"}},Q9e=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,o=t.position,a=n,s=a.x,u=a.y,l=a.width,c=a.height,f=c>=0?1:-1,h=f*i,p=f>0?"end":"start",m=f>0?"start":"end",y=l>=0?1:-1,b=y*i,w=y>0?"end":"start",x=y>0?"start":"end";if(o==="top"){var S={x:s+l/2,y:u-f*i,textAnchor:"middle",verticalAnchor:p};return Br(Br({},S),r?{height:Math.max(u-r.y,0),width:l}:{})}if(o==="bottom"){var O={x:s+l/2,y:u+c+h,textAnchor:"middle",verticalAnchor:m};return Br(Br({},O),r?{height:Math.max(r.y+r.height-(u+c),0),width:l}:{})}if(o==="left"){var E={x:s-b,y:u+c/2,textAnchor:w,verticalAnchor:"middle"};return Br(Br({},E),r?{width:Math.max(E.x-r.x,0),height:c}:{})}if(o==="right"){var C={x:s+l+b,y:u+c/2,textAnchor:x,verticalAnchor:"middle"};return Br(Br({},C),r?{width:Math.max(r.x+r.width-C.x,0),height:c}:{})}var P=r?{width:l,height:c}:{};return o==="insideLeft"?Br({x:s+b,y:u+c/2,textAnchor:x,verticalAnchor:"middle"},P):o==="insideRight"?Br({x:s+l-b,y:u+c/2,textAnchor:w,verticalAnchor:"middle"},P):o==="insideTop"?Br({x:s+l/2,y:u+h,textAnchor:"middle",verticalAnchor:m},P):o==="insideBottom"?Br({x:s+l/2,y:u+c-h,textAnchor:"middle",verticalAnchor:p},P):o==="insideTopLeft"?Br({x:s+b,y:u+h,textAnchor:x,verticalAnchor:m},P):o==="insideTopRight"?Br({x:s+l-b,y:u+h,textAnchor:w,verticalAnchor:m},P):o==="insideBottomLeft"?Br({x:s+b,y:u+c-h,textAnchor:x,verticalAnchor:p},P):o==="insideBottomRight"?Br({x:s+l-b,y:u+c-h,textAnchor:w,verticalAnchor:p},P):Vh(o)&&(Ke(o.x)||Cc(o.x))&&(Ke(o.y)||Cc(o.y))?Br({x:s+tf(o.x,l),y:u+tf(o.y,c),textAnchor:"end",verticalAnchor:"end"},P):Br({x:s+l/2,y:u+c/2,textAnchor:"middle",verticalAnchor:"middle"},P)},J9e=function(t){return"cx"in t&&Ke(t.cx)};function Ai(e){var t=e.offset,n=t===void 0?5:t,r=W9e(e,L9e),i=Br({offset:n},r),o=i.viewBox,a=i.position,s=i.value,u=i.children,l=i.content,c=i.className,f=c===void 0?"":c,h=i.textBreakAll;if(!o||Vt(s)&&Vt(u)&&!v.isValidElement(l)&&!qt(l))return null;if(v.isValidElement(l))return v.cloneElement(l,i);var p;if(qt(l)){if(p=v.createElement(l,i),v.isValidElement(p))return p}else p=G9e(i);var m=J9e(o),y=Wt(i,!0);if(m&&(a==="insideStart"||a==="insideEnd"||a==="end"))return Z9e(i,p,y);var b=m?X9e(i):Q9e(i);return F.createElement(Hb,Vg({className:dn("recharts-label",f)},y,b,{breakAll:h}),p)}Ai.displayName="Label";var Fq=function(t){var n=t.cx,r=t.cy,i=t.angle,o=t.startAngle,a=t.endAngle,s=t.r,u=t.radius,l=t.innerRadius,c=t.outerRadius,f=t.x,h=t.y,p=t.top,m=t.left,y=t.width,b=t.height,w=t.clockWise,x=t.labelViewBox;if(x)return x;if(Ke(y)&&Ke(b)){if(Ke(f)&&Ke(h))return{x:f,y:h,width:y,height:b};if(Ke(p)&&Ke(m))return{x:p,y:m,width:y,height:b}}return Ke(f)&&Ke(h)?{x:f,y:h,width:0,height:0}:Ke(n)&&Ke(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:a||i||0,innerRadius:l||0,outerRadius:c||u||s||0,clockWise:w}:t.viewBox?t.viewBox:{}},e7e=function(t,n){return t?t===!0?F.createElement(Ai,{key:"label-implicit",viewBox:n}):qr(t)?F.createElement(Ai,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===Ai?v.cloneElement(t,{key:"label-implicit",viewBox:n}):F.createElement(Ai,{key:"label-implicit",content:t,viewBox:n}):qt(t)?F.createElement(Ai,{key:"label-implicit",content:t,viewBox:n}):Vh(t)?F.createElement(Ai,Vg({viewBox:n},t,{key:"label-implicit"})):null:null},t7e=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,o=Fq(t),a=ho(i,Ai).map(function(u,l){return v.cloneElement(u,{viewBox:n||o,key:"label-".concat(l)})});if(!r)return a;var s=e7e(t.label,n||o);return[s].concat(F9e(a))};Ai.parseViewBox=Fq;Ai.renderCallByParent=t7e;function n7e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var r7e=n7e;const i7e=kn(r7e);function Hg(e){"@babel/helpers - typeof";return Hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hg(e)}var o7e=["valueAccessor"],a7e=["data","dataKey","clockWise","id","textBreakAll"];function s7e(e){return f7e(e)||c7e(e)||l7e(e)||u7e()}function u7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. + `).concat(C.x,",").concat(C.y),M=Vt(t.id)?yf("recharts-radial-line-"):t.id;return F.createElement("text",Vg({},r,{dominantBaseline:"central",className:dn("recharts-radial-bar-label",s)}),F.createElement("defs",null,F.createElement("path",{id:M,d:P})),F.createElement("textPath",{xlinkHref:"#".concat(M)},n))},XDe=function(t){var n=t.viewBox,r=t.offset,i=t.position,o=n,a=o.cx,s=o.cy,u=o.innerRadius,l=o.outerRadius,c=o.startAngle,f=o.endAngle,h=(c+f)/2;if(i==="outside"){var p=hi(a,s,l+r,h),m=p.x,y=p.y;return{x:m,y,textAnchor:m>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var b=(u+l)/2,w=hi(a,s,b,h),x=w.x,S=w.y;return{x,y:S,textAnchor:"middle",verticalAnchor:"middle"}},QDe=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,o=t.position,a=n,s=a.x,u=a.y,l=a.width,c=a.height,f=c>=0?1:-1,h=f*i,p=f>0?"end":"start",m=f>0?"start":"end",y=l>=0?1:-1,b=y*i,w=y>0?"end":"start",x=y>0?"start":"end";if(o==="top"){var S={x:s+l/2,y:u-f*i,textAnchor:"middle",verticalAnchor:p};return Br(Br({},S),r?{height:Math.max(u-r.y,0),width:l}:{})}if(o==="bottom"){var O={x:s+l/2,y:u+c+h,textAnchor:"middle",verticalAnchor:m};return Br(Br({},O),r?{height:Math.max(r.y+r.height-(u+c),0),width:l}:{})}if(o==="left"){var E={x:s-b,y:u+c/2,textAnchor:w,verticalAnchor:"middle"};return Br(Br({},E),r?{width:Math.max(E.x-r.x,0),height:c}:{})}if(o==="right"){var C={x:s+l+b,y:u+c/2,textAnchor:x,verticalAnchor:"middle"};return Br(Br({},C),r?{width:Math.max(r.x+r.width-C.x,0),height:c}:{})}var P=r?{width:l,height:c}:{};return o==="insideLeft"?Br({x:s+b,y:u+c/2,textAnchor:x,verticalAnchor:"middle"},P):o==="insideRight"?Br({x:s+l-b,y:u+c/2,textAnchor:w,verticalAnchor:"middle"},P):o==="insideTop"?Br({x:s+l/2,y:u+h,textAnchor:"middle",verticalAnchor:m},P):o==="insideBottom"?Br({x:s+l/2,y:u+c-h,textAnchor:"middle",verticalAnchor:p},P):o==="insideTopLeft"?Br({x:s+b,y:u+h,textAnchor:x,verticalAnchor:m},P):o==="insideTopRight"?Br({x:s+l-b,y:u+h,textAnchor:w,verticalAnchor:m},P):o==="insideBottomLeft"?Br({x:s+b,y:u+c-h,textAnchor:x,verticalAnchor:p},P):o==="insideBottomRight"?Br({x:s+l-b,y:u+c-h,textAnchor:w,verticalAnchor:p},P):Vh(o)&&(Ke(o.x)||Cc(o.x))&&(Ke(o.y)||Cc(o.y))?Br({x:s+tf(o.x,l),y:u+tf(o.y,c),textAnchor:"end",verticalAnchor:"end"},P):Br({x:s+l/2,y:u+c/2,textAnchor:"middle",verticalAnchor:"middle"},P)},JDe=function(t){return"cx"in t&&Ke(t.cx)};function Ai(e){var t=e.offset,n=t===void 0?5:t,r=WDe(e,LDe),i=Br({offset:n},r),o=i.viewBox,a=i.position,s=i.value,u=i.children,l=i.content,c=i.className,f=c===void 0?"":c,h=i.textBreakAll;if(!o||Vt(s)&&Vt(u)&&!v.isValidElement(l)&&!qt(l))return null;if(v.isValidElement(l))return v.cloneElement(l,i);var p;if(qt(l)){if(p=v.createElement(l,i),v.isValidElement(p))return p}else p=GDe(i);var m=JDe(o),y=Wt(i,!0);if(m&&(a==="insideStart"||a==="insideEnd"||a==="end"))return ZDe(i,p,y);var b=m?XDe(i):QDe(i);return F.createElement(Hb,Vg({className:dn("recharts-label",f)},y,b,{breakAll:h}),p)}Ai.displayName="Label";var Fq=function(t){var n=t.cx,r=t.cy,i=t.angle,o=t.startAngle,a=t.endAngle,s=t.r,u=t.radius,l=t.innerRadius,c=t.outerRadius,f=t.x,h=t.y,p=t.top,m=t.left,y=t.width,b=t.height,w=t.clockWise,x=t.labelViewBox;if(x)return x;if(Ke(y)&&Ke(b)){if(Ke(f)&&Ke(h))return{x:f,y:h,width:y,height:b};if(Ke(p)&&Ke(m))return{x:p,y:m,width:y,height:b}}return Ke(f)&&Ke(h)?{x:f,y:h,width:0,height:0}:Ke(n)&&Ke(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:a||i||0,innerRadius:l||0,outerRadius:c||u||s||0,clockWise:w}:t.viewBox?t.viewBox:{}},e7e=function(t,n){return t?t===!0?F.createElement(Ai,{key:"label-implicit",viewBox:n}):qr(t)?F.createElement(Ai,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===Ai?v.cloneElement(t,{key:"label-implicit",viewBox:n}):F.createElement(Ai,{key:"label-implicit",content:t,viewBox:n}):qt(t)?F.createElement(Ai,{key:"label-implicit",content:t,viewBox:n}):Vh(t)?F.createElement(Ai,Vg({viewBox:n},t,{key:"label-implicit"})):null:null},t7e=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,o=Fq(t),a=ho(i,Ai).map(function(u,l){return v.cloneElement(u,{viewBox:n||o,key:"label-".concat(l)})});if(!r)return a;var s=e7e(t.label,n||o);return[s].concat(FDe(a))};Ai.parseViewBox=Fq;Ai.renderCallByParent=t7e;function n7e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var r7e=n7e;const i7e=kn(r7e);function Hg(e){"@babel/helpers - typeof";return Hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hg(e)}var o7e=["valueAccessor"],a7e=["data","dataKey","clockWise","id","textBreakAll"];function s7e(e){return f7e(e)||c7e(e)||l7e(e)||u7e()}function u7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l7e(e,t){if(e){if(typeof e=="string")return F6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F6(e,t)}}function c7e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function f7e(e){if(Array.isArray(e))return F6(e)}function F6(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function g7e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var m7e=function(t){return Array.isArray(t.value)?i7e(t.value):t.value};function Os(e){var t=e.valueAccessor,n=t===void 0?m7e:t,r=k$(e,o7e),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,u=r.textBreakAll,l=k$(r,a7e);return!i||!i.length?null:F.createElement(En,{className:"recharts-label-list"},i.map(function(c,f){var h=Vt(o)?n(c,f):Kr(c&&c.payload,o),p=Vt(s)?{}:{id:"".concat(s,"-").concat(f)};return F.createElement(Ai,sx({},Wt(c,!0),l,p,{parentViewBox:c.parentViewBox,value:h,textBreakAll:u,viewBox:Ai.parseViewBox(Vt(a)?c:P$(P$({},c),{},{clockWise:a})),key:"label-".concat(f),index:f}))}))}Os.displayName="LabelList";function v7e(e,t){return e?e===!0?F.createElement(Os,{key:"labelList-implicit",data:t}):F.isValidElement(e)||qt(e)?F.createElement(Os,{key:"labelList-implicit",data:t,content:e}):Vh(e)?F.createElement(Os,sx({data:t},e,{key:"labelList-implicit"})):null:null}function y7e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=ho(r,Os).map(function(a,s){return v.cloneElement(a,{data:t,key:"labelList-".concat(s)})});if(!n)return i;var o=v7e(e.label,t);return[o].concat(s7e(i))}Os.renderCallByParent=y7e;function qg(e){"@babel/helpers - typeof";return qg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qg(e)}function j6(){return j6=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(a>l),`, @@ -567,17 +577,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho A `).concat(m,",").concat(m,",0,0,").concat(l,",").concat(t+r-u*m,",").concat(n+i,` L `).concat(t+u*m,",").concat(n+i,` A `).concat(m,",").concat(m,",0,0,").concat(l,",").concat(t,",").concat(n+i-s*m," Z")}else c="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return c},rIe=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,o=n.x,a=n.y,s=n.width,u=n.height;if(Math.abs(s)>0&&Math.abs(u)>0){var l=Math.min(o,o+s),c=Math.max(o,o+s),f=Math.min(a,a+u),h=Math.max(a,a+u);return r>=l&&r<=c&&i>=f&&i<=h}return!1},iIe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},XP=function(t){var n=tI(tI({},iIe),t),r=v.useRef(),i=v.useState(-1),o=Y$e(i,2),a=o[0],s=o[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var O=r.current.getTotalLength();O&&s(O)}catch{}},[]);var u=n.x,l=n.y,c=n.width,f=n.height,h=n.radius,p=n.className,m=n.animationEasing,y=n.animationDuration,b=n.animationBegin,w=n.isAnimationActive,x=n.isUpdateAnimationActive;if(u!==+u||l!==+l||c!==+c||f!==+f||c===0||f===0)return null;var S=dn("recharts-rectangle",p);return x?F.createElement(Za,{canBegin:a>0,from:{width:c,height:f,x:u,y:l},to:{width:c,height:f,x:u,y:l},duration:y,animationEasing:m,isActive:x},function(O){var E=O.width,C=O.height,P=O.x,M=O.y;return F.createElement(Za,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:y,isActive:w,easing:m},F.createElement("path",fx({},Wt(n,!0),{className:S,d:nI(P,M,E,C,h),ref:r})))}):F.createElement("path",fx({},Wt(n,!0),{className:S,d:nI(u,l,c,f,h)}))};function Z6(){return Z6=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fIe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var dIe=function(t,n,r,i,o,a){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},hIe=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,a=t.top,s=a===void 0?0:a,u=t.left,l=u===void 0?0:u,c=t.width,f=c===void 0?0:c,h=t.height,p=h===void 0?0:h,m=t.className,y=cIe(t,oIe),b=aIe({x:r,y:o,top:s,left:l,width:f,height:p},y);return!Ke(r)||!Ke(o)||!Ke(f)||!Ke(p)||!Ke(s)||!Ke(l)?null:F.createElement("path",X6({},Wt(b,!0),{className:dn("recharts-cross",m),d:dIe(r,o,f,p,s,l)}))},pIe=fH,gIe=pIe(Object.getPrototypeOf,Object),mIe=gIe,vIe=Tu,yIe=mIe,bIe=Mu,xIe="[object Object]",wIe=Function.prototype,_Ie=Object.prototype,Yq=wIe.toString,SIe=_Ie.hasOwnProperty,CIe=Yq.call(Object);function EIe(e){if(!bIe(e)||vIe(e)!=xIe)return!1;var t=yIe(e);if(t===null)return!0;var n=SIe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Yq.call(n)==CIe}var OIe=EIe;const AIe=kn(OIe);var PIe=Tu,kIe=Mu,TIe="[object Boolean]";function MIe(e){return e===!0||e===!1||kIe(e)&&PIe(e)==TIe}var RIe=MIe;const DIe=kn(RIe);function Qg(e){"@babel/helpers - typeof";return Qg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qg(e)}function dx(){return dx=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:u,y:l},to:{upperWidth:c,lowerWidth:f,height:h,x:u,y:l},duration:y,animationEasing:m,isActive:w},function(S){var O=S.upperWidth,E=S.lowerWidth,C=S.height,P=S.x,M=S.y;return F.createElement(Za,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:y,easing:m},F.createElement("path",dx({},Wt(n,!0),{className:x,d:sI(P,M,O,E,C),ref:r})))}):F.createElement("g",null,F.createElement("path",dx({},Wt(n,!0),{className:x,d:sI(u,l,c,f,h)})))},VIe=["option","shapeType","propTransformer","activeClassName","isActive"];function Jg(e){"@babel/helpers - typeof";return Jg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jg(e)}function HIe(e,t){if(e==null)return{};var n=qIe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qIe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function uI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hx(e){for(var t=1;t0&&r.handleDrag(i.changedTouches[0])}),Oo(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a?.({endIndex:o,startIndex:s})}),r.detachDragEndListener()}),Oo(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Oo(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Oo(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Oo(r,"handleSlideDragStart",function(i){var o=gI(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return kNe(t,e),ENe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,a=this.state.scaleValues,s=this.props,u=s.gap,l=s.data,c=l.length-1,f=Math.min(i,o),h=Math.max(i,o),p=t.getIndexInRange(a,f),m=t.getIndexInRange(a,h);return{startIndex:p-p%u,endIndex:m===c?c:m-m%u}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,u=Kr(o[r],s,r);return qt(a)?a(u,r):u}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,u=this.props,l=u.x,c=u.width,f=u.travellerWidth,h=u.startIndex,p=u.endIndex,m=u.onChange,y=r.pageX-o;y>0?y=Math.min(y,l+c-f-s,l+c-f-a):y<0&&(y=Math.max(y,l-a,l-s));var b=this.getIndex({startX:a+y,endX:s+y});(b.startIndex!==h||b.endIndex!==p)&&m&&m(b),this.setState({startX:a+y,endX:s+y,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=gI(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,u=i.startX,l=this.state[a],c=this.props,f=c.x,h=c.width,p=c.travellerWidth,m=c.onChange,y=c.gap,b=c.data,w={startX:this.state.startX,endX:this.state.endX},x=r.pageX-o;x>0?x=Math.min(x,f+h-p-l):x<0&&(x=Math.max(x,f-l)),w[a]=l+x;var S=this.getIndex(w),O=S.startIndex,E=S.endIndex,C=function(){var M=b.length-1;return a==="startX"&&(s>u?O%y===0:E%y===0)||su?E%y===0:O%y===0)||s>u&&E===M};this.setState(Oo(Oo({},a,l+x),"brushMoveStartX",r.pageX),function(){m&&C()&&m(S)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,a=this.state,s=a.scaleValues,u=a.startX,l=a.endX,c=this.state[i],f=s.indexOf(c);if(f!==-1){var h=f+r;if(!(h===-1||h>=s.length)){var p=s[h];i==="startX"&&p>=l||i==="endX"&&p<=u||this.setState(Oo({},i,p),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,u=r.fill,l=r.stroke;return F.createElement("rect",{stroke:l,fill:u,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,u=r.data,l=r.children,c=r.padding,f=v.Children.only(l);return f?F.cloneElement(f,{x:i,y:o,width:a,height:s,margin:c,compact:!0,data:u}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,a,s=this,u=this.props,l=u.y,c=u.travellerWidth,f=u.height,h=u.traveller,p=u.ariaLabel,m=u.data,y=u.startIndex,b=u.endIndex,w=Math.max(r,this.props.x),x=T3(T3({},Wt(this.props,!1)),{},{x:w,y:l,width:c,height:f}),S=p||"Min value: ".concat((o=m[y])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=m[b])===null||a===void 0?void 0:a.name);return F.createElement(En,{tabIndex:0,role:"slider","aria-label":S,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),s.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(r,i){var o=this.props,a=o.y,s=o.height,u=o.stroke,l=o.travellerWidth,c=Math.min(r,i)+l,f=Math.max(Math.abs(i-r)-l,0);return F.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:u,fillOpacity:.2,x:c,y:a,width:f,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,a=r.y,s=r.height,u=r.travellerWidth,l=r.stroke,c=this.state,f=c.startX,h=c.endX,p=5,m={pointerEvents:"none",fill:l};return F.createElement(En,{className:"recharts-brush-texts"},F.createElement(Hb,gx({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:a+s/2},m),this.getTextOfTick(i)),F.createElement(Hb,gx({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+u+p,y:a+s/2},m),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,a=r.children,s=r.x,u=r.y,l=r.width,c=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,m=h.endX,y=h.isTextActive,b=h.isSlideMoving,w=h.isTravellerMoving,x=h.isTravellerFocused;if(!i||!i.length||!Ke(s)||!Ke(u)||!Ke(l)||!Ke(c)||l<=0||c<=0)return null;var S=dn("recharts-brush",o),O=F.Children.count(a)===1,E=SNe("userSelect","none");return F.createElement(En,{className:S,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(p,m),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(m,"endX"),(y||b||w||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,a=r.width,s=r.height,u=r.stroke,l=Math.floor(o+s/2)-1;return F.createElement(F.Fragment,null,F.createElement("rect",{x:i,y:o,width:a,height:s,fill:u,stroke:"none"}),F.createElement("line",{x1:i+1,y1:l,x2:i+a-1,y2:l,fill:"none",stroke:"#fff"}),F.createElement("line",{x1:i+1,y1:l+2,x2:i+a-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return F.isValidElement(r)?o=F.cloneElement(r,i):qt(r)?o=r(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,a=r.width,s=r.x,u=r.travellerWidth,l=r.updateId,c=r.startIndex,f=r.endIndex;if(o!==i.prevData||l!==i.prevUpdateId)return T3({prevData:o,prevTravellerWidth:u,prevUpdateId:l,prevX:s,prevWidth:a},o&&o.length?MNe({data:o,width:a,x:s,travellerWidth:u,startIndex:c,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||u!==i.prevTravellerWidth)){i.scale.range([s,s+a-u]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:o,prevTravellerWidth:u,prevUpdateId:l,prevX:s,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,a=0,s=o-1;s-a>1;){var u=Math.floor((a+s)/2);r[u]>i?s=u:a=u}return i>=r[s]?s:a}}])}(v.PureComponent);Oo(dh,"displayName","Brush");Oo(dh,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var RNe=_P;function DNe(e,t){var n;return RNe(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}var $Ne=DNe,INe=rH,NNe=Vl,LNe=$Ne,FNe=mo,jNe=u2;function BNe(e,t,n){var r=FNe(e)?INe:LNe;return n&&jNe(e,t,n)&&(t=void 0),r(e,NNe(t))}var UNe=BNe;const zNe=kn(UNe);var As=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},mI=EH;function WNe(e,t,n){t=="__proto__"&&mI?mI(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var VNe=WNe,HNe=VNe,qNe=SH,KNe=Vl;function GNe(e,t){var n={};return t=KNe(t),qNe(e,function(r,i,o){HNe(n,i,t(r,i,o))}),n}var YNe=GNe;const ZNe=kn(YNe);function XNe(e,t){for(var n=-1,r=e==null?0:e.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pLe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gLe(e,t){var n=e.x,r=e.y,i=hLe(e,lLe),o="".concat(n),a=parseInt(o,10),s="".concat(r),u=parseInt(s,10),l="".concat(t.height||i.height),c=parseInt(l,10),f="".concat(t.width||i.width),h=parseInt(f,10);return Xp(Xp(Xp(Xp(Xp({},t),i),a?{x:a}:{}),u?{y:u}:{}),{},{height:c,width:h,name:t.name,radius:t.radius})}function yI(e){return F.createElement(Q6,e4({shapeType:"rectangle",propTransformer:gLe,activeClassName:"recharts-active-bar"},e))}var mLe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var o=typeof r=="number";return o?t(r,i):(o||of(),n)}},vLe=["value","background"],tK;function hh(e){"@babel/helpers - typeof";return hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hh(e)}function yLe(e,t){if(e==null)return{};var n=bLe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bLe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function vx(){return vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(q)0&&Math.abs(Z)0&&(ne=Math.min((ue||0)-(Z[de-1]||0),ne))}),Number.isFinite(ne)){var q=ne/W,G=y.layout==="vertical"?r.height:r.width;if(y.padding==="gap"&&(P=q*G/2),y.padding==="no-gap"){var H=tf(t.barCategoryGap,q*G),j=q*G/2;P=j-H-(j-H)/G*H}}}i==="xAxis"?M=[r.left+(S.left||0)+(P||0),r.left+r.width-(S.right||0)-(P||0)]:i==="yAxis"?M=u==="horizontal"?[r.top+r.height-(S.bottom||0),r.top+(S.top||0)]:[r.top+(S.top||0)+(P||0),r.top+r.height-(S.bottom||0)-(P||0)]:M=y.range,E&&(M=[M[1],M[0]]);var K=m9e(y,o,h),Y=K.scale,oe=K.realScaleType;Y.domain(w).range(M),v9e(Y);var X=E9e(Y,$a($a({},y),{},{realScaleType:oe}));i==="xAxis"?(V=b==="top"&&!O||b==="bottom"&&O,N=r.left,B=f[C]-V*y.height):i==="yAxis"&&(V=b==="left"&&!O||b==="right"&&O,N=f[C]-V*y.width,B=r.top);var Q=$a($a($a({},y),X),{},{realScaleType:oe,x:N,y:B,scale:Y,width:i==="xAxis"?r.width:y.width,height:i==="yAxis"?r.height:y.height});return Q.bandSize=ox(Q,X),!y.hide&&i==="xAxis"?f[C]+=(V?-1:1)*Q.height:y.hide||(f[C]+=(V?-1:1)*Q.width),$a($a({},p),{},w2({},m,Q))},{})},oK=function(t,n){var r=t.x,i=t.y,o=n.x,a=n.y;return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}},MLe=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2;return oK({x:n,y:r},{x:i,y:o})},aK=function(){function e(t){ALe(this,e),this.scale=t}return PLe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var u=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+u}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();w2(aK,"EPS",1e-4);var QP=function(t){var n=Object.keys(t).reduce(function(r,i){return $a($a({},r),{},w2({},i,aK.create(t[i])))},{});return $a($a({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return ZNe(i,function(u,l){return n[l].apply(u,{bandAware:a,position:s})})},isInRange:function(i){return eK(i,function(o,a){return n[a].isInRange(o)})}})};function RLe(e){return(e%180+180)%180}var DLe=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=RLe(i),a=o*Math.PI/180,s=Math.atan(r/n),u=a>s&&a-1?i[o?t[a]:a]:void 0}}var FLe=LLe,jLe=Zq;function BLe(e){var t=jLe(e),n=t%1;return t===t?n?t-n:t:0}var ULe=BLe,zLe=vH,WLe=Vl,VLe=ULe,HLe=Math.max;function qLe(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:VLe(n);return i<0&&(i=HLe(r+i,0)),zLe(e,WLe(t),i)}var KLe=qLe,GLe=FLe,YLe=KLe,ZLe=GLe(YLe),XLe=ZLe;const QLe=kn(XLe);var JLe=tSe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),JP=v.createContext(void 0),e5=v.createContext(void 0),sK=v.createContext(void 0),uK=v.createContext({}),lK=v.createContext(void 0),cK=v.createContext(0),fK=v.createContext(0),SI=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,a=t.clipPathId,s=t.children,u=t.width,l=t.height,c=JLe(o);return F.createElement(JP.Provider,{value:r},F.createElement(e5.Provider,{value:i},F.createElement(uK.Provider,{value:o},F.createElement(sK.Provider,{value:c},F.createElement(lK.Provider,{value:a},F.createElement(cK.Provider,{value:l},F.createElement(fK.Provider,{value:u},s)))))))},eFe=function(){return v.useContext(lK)},dK=function(t){var n=v.useContext(JP);n==null&&of();var r=n[t];return r==null&&of(),r},tFe=function(){var t=v.useContext(JP);return rl(t)},nFe=function(){var t=v.useContext(e5),n=QLe(t,function(r){return eK(r.domain,Number.isFinite)});return n||rl(t)},hK=function(t){var n=v.useContext(e5);n==null&&of();var r=n[t];return r==null&&of(),r},rFe=function(){var t=v.useContext(sK);return t},iFe=function(){return v.useContext(uK)},t5=function(){return v.useContext(fK)},n5=function(){return v.useContext(cK)};function ph(e){"@babel/helpers - typeof";return ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ph(e)}function oFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aFe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:u,y:l},to:{upperWidth:c,lowerWidth:f,height:h,x:u,y:l},duration:y,animationEasing:m,isActive:w},function(S){var O=S.upperWidth,E=S.lowerWidth,C=S.height,P=S.x,M=S.y;return F.createElement(Za,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:y,easing:m},F.createElement("path",dx({},Wt(n,!0),{className:x,d:sI(P,M,O,E,C),ref:r})))}):F.createElement("g",null,F.createElement("path",dx({},Wt(n,!0),{className:x,d:sI(u,l,c,f,h)})))},VIe=["option","shapeType","propTransformer","activeClassName","isActive"];function Jg(e){"@babel/helpers - typeof";return Jg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jg(e)}function HIe(e,t){if(e==null)return{};var n=qIe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qIe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function uI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hx(e){for(var t=1;t0&&r.handleDrag(i.changedTouches[0])}),Oo(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a?.({endIndex:o,startIndex:s})}),r.detachDragEndListener()}),Oo(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Oo(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Oo(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Oo(r,"handleSlideDragStart",function(i){var o=gI(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return kNe(t,e),ENe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,a=this.state.scaleValues,s=this.props,u=s.gap,l=s.data,c=l.length-1,f=Math.min(i,o),h=Math.max(i,o),p=t.getIndexInRange(a,f),m=t.getIndexInRange(a,h);return{startIndex:p-p%u,endIndex:m===c?c:m-m%u}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,u=Kr(o[r],s,r);return qt(a)?a(u,r):u}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,u=this.props,l=u.x,c=u.width,f=u.travellerWidth,h=u.startIndex,p=u.endIndex,m=u.onChange,y=r.pageX-o;y>0?y=Math.min(y,l+c-f-s,l+c-f-a):y<0&&(y=Math.max(y,l-a,l-s));var b=this.getIndex({startX:a+y,endX:s+y});(b.startIndex!==h||b.endIndex!==p)&&m&&m(b),this.setState({startX:a+y,endX:s+y,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=gI(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,u=i.startX,l=this.state[a],c=this.props,f=c.x,h=c.width,p=c.travellerWidth,m=c.onChange,y=c.gap,b=c.data,w={startX:this.state.startX,endX:this.state.endX},x=r.pageX-o;x>0?x=Math.min(x,f+h-p-l):x<0&&(x=Math.max(x,f-l)),w[a]=l+x;var S=this.getIndex(w),O=S.startIndex,E=S.endIndex,C=function(){var M=b.length-1;return a==="startX"&&(s>u?O%y===0:E%y===0)||su?E%y===0:O%y===0)||s>u&&E===M};this.setState(Oo(Oo({},a,l+x),"brushMoveStartX",r.pageX),function(){m&&C()&&m(S)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,a=this.state,s=a.scaleValues,u=a.startX,l=a.endX,c=this.state[i],f=s.indexOf(c);if(f!==-1){var h=f+r;if(!(h===-1||h>=s.length)){var p=s[h];i==="startX"&&p>=l||i==="endX"&&p<=u||this.setState(Oo({},i,p),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,u=r.fill,l=r.stroke;return F.createElement("rect",{stroke:l,fill:u,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,u=r.data,l=r.children,c=r.padding,f=v.Children.only(l);return f?F.cloneElement(f,{x:i,y:o,width:a,height:s,margin:c,compact:!0,data:u}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,a,s=this,u=this.props,l=u.y,c=u.travellerWidth,f=u.height,h=u.traveller,p=u.ariaLabel,m=u.data,y=u.startIndex,b=u.endIndex,w=Math.max(r,this.props.x),x=T3(T3({},Wt(this.props,!1)),{},{x:w,y:l,width:c,height:f}),S=p||"Min value: ".concat((o=m[y])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=m[b])===null||a===void 0?void 0:a.name);return F.createElement(En,{tabIndex:0,role:"slider","aria-label":S,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),s.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(r,i){var o=this.props,a=o.y,s=o.height,u=o.stroke,l=o.travellerWidth,c=Math.min(r,i)+l,f=Math.max(Math.abs(i-r)-l,0);return F.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:u,fillOpacity:.2,x:c,y:a,width:f,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,a=r.y,s=r.height,u=r.travellerWidth,l=r.stroke,c=this.state,f=c.startX,h=c.endX,p=5,m={pointerEvents:"none",fill:l};return F.createElement(En,{className:"recharts-brush-texts"},F.createElement(Hb,gx({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:a+s/2},m),this.getTextOfTick(i)),F.createElement(Hb,gx({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+u+p,y:a+s/2},m),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,a=r.children,s=r.x,u=r.y,l=r.width,c=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,m=h.endX,y=h.isTextActive,b=h.isSlideMoving,w=h.isTravellerMoving,x=h.isTravellerFocused;if(!i||!i.length||!Ke(s)||!Ke(u)||!Ke(l)||!Ke(c)||l<=0||c<=0)return null;var S=dn("recharts-brush",o),O=F.Children.count(a)===1,E=SNe("userSelect","none");return F.createElement(En,{className:S,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(p,m),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(m,"endX"),(y||b||w||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,a=r.width,s=r.height,u=r.stroke,l=Math.floor(o+s/2)-1;return F.createElement(F.Fragment,null,F.createElement("rect",{x:i,y:o,width:a,height:s,fill:u,stroke:"none"}),F.createElement("line",{x1:i+1,y1:l,x2:i+a-1,y2:l,fill:"none",stroke:"#fff"}),F.createElement("line",{x1:i+1,y1:l+2,x2:i+a-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return F.isValidElement(r)?o=F.cloneElement(r,i):qt(r)?o=r(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,a=r.width,s=r.x,u=r.travellerWidth,l=r.updateId,c=r.startIndex,f=r.endIndex;if(o!==i.prevData||l!==i.prevUpdateId)return T3({prevData:o,prevTravellerWidth:u,prevUpdateId:l,prevX:s,prevWidth:a},o&&o.length?MNe({data:o,width:a,x:s,travellerWidth:u,startIndex:c,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||u!==i.prevTravellerWidth)){i.scale.range([s,s+a-u]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:o,prevTravellerWidth:u,prevUpdateId:l,prevX:s,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,a=0,s=o-1;s-a>1;){var u=Math.floor((a+s)/2);r[u]>i?s=u:a=u}return i>=r[s]?s:a}}])}(v.PureComponent);Oo(dh,"displayName","Brush");Oo(dh,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var RNe=_P;function DNe(e,t){var n;return RNe(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}var $Ne=DNe,INe=rH,NNe=Vl,LNe=$Ne,FNe=mo,jNe=u2;function BNe(e,t,n){var r=FNe(e)?INe:LNe;return n&&jNe(e,t,n)&&(t=void 0),r(e,NNe(t))}var UNe=BNe;const zNe=kn(UNe);var As=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},mI=EH;function WNe(e,t,n){t=="__proto__"&&mI?mI(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var VNe=WNe,HNe=VNe,qNe=SH,KNe=Vl;function GNe(e,t){var n={};return t=KNe(t),qNe(e,function(r,i,o){HNe(n,i,t(r,i,o))}),n}var YNe=GNe;const ZNe=kn(YNe);function XNe(e,t){for(var n=-1,r=e==null?0:e.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pLe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gLe(e,t){var n=e.x,r=e.y,i=hLe(e,lLe),o="".concat(n),a=parseInt(o,10),s="".concat(r),u=parseInt(s,10),l="".concat(t.height||i.height),c=parseInt(l,10),f="".concat(t.width||i.width),h=parseInt(f,10);return Xp(Xp(Xp(Xp(Xp({},t),i),a?{x:a}:{}),u?{y:u}:{}),{},{height:c,width:h,name:t.name,radius:t.radius})}function yI(e){return F.createElement(Q6,e4({shapeType:"rectangle",propTransformer:gLe,activeClassName:"recharts-active-bar"},e))}var mLe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var o=typeof r=="number";return o?t(r,i):(o||of(),n)}},vLe=["value","background"],tK;function hh(e){"@babel/helpers - typeof";return hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hh(e)}function yLe(e,t){if(e==null)return{};var n=bLe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bLe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function vx(){return vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(q)0&&Math.abs(Z)0&&(ne=Math.min((ue||0)-(Z[de-1]||0),ne))}),Number.isFinite(ne)){var q=ne/W,G=y.layout==="vertical"?r.height:r.width;if(y.padding==="gap"&&(P=q*G/2),y.padding==="no-gap"){var H=tf(t.barCategoryGap,q*G),j=q*G/2;P=j-H-(j-H)/G*H}}}i==="xAxis"?M=[r.left+(S.left||0)+(P||0),r.left+r.width-(S.right||0)-(P||0)]:i==="yAxis"?M=u==="horizontal"?[r.top+r.height-(S.bottom||0),r.top+(S.top||0)]:[r.top+(S.top||0)+(P||0),r.top+r.height-(S.bottom||0)-(P||0)]:M=y.range,E&&(M=[M[1],M[0]]);var K=mDe(y,o,h),Y=K.scale,oe=K.realScaleType;Y.domain(w).range(M),vDe(Y);var X=EDe(Y,$a($a({},y),{},{realScaleType:oe}));i==="xAxis"?(V=b==="top"&&!O||b==="bottom"&&O,N=r.left,B=f[C]-V*y.height):i==="yAxis"&&(V=b==="left"&&!O||b==="right"&&O,N=f[C]-V*y.width,B=r.top);var Q=$a($a($a({},y),X),{},{realScaleType:oe,x:N,y:B,scale:Y,width:i==="xAxis"?r.width:y.width,height:i==="yAxis"?r.height:y.height});return Q.bandSize=ox(Q,X),!y.hide&&i==="xAxis"?f[C]+=(V?-1:1)*Q.height:y.hide||(f[C]+=(V?-1:1)*Q.width),$a($a({},p),{},w2({},m,Q))},{})},oK=function(t,n){var r=t.x,i=t.y,o=n.x,a=n.y;return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}},MLe=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2;return oK({x:n,y:r},{x:i,y:o})},aK=function(){function e(t){ALe(this,e),this.scale=t}return PLe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var u=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+u}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();w2(aK,"EPS",1e-4);var QP=function(t){var n=Object.keys(t).reduce(function(r,i){return $a($a({},r),{},w2({},i,aK.create(t[i])))},{});return $a($a({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return ZNe(i,function(u,l){return n[l].apply(u,{bandAware:a,position:s})})},isInRange:function(i){return eK(i,function(o,a){return n[a].isInRange(o)})}})};function RLe(e){return(e%180+180)%180}var DLe=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=RLe(i),a=o*Math.PI/180,s=Math.atan(r/n),u=a>s&&a-1?i[o?t[a]:a]:void 0}}var FLe=LLe,jLe=Zq;function BLe(e){var t=jLe(e),n=t%1;return t===t?n?t-n:t:0}var ULe=BLe,zLe=vH,WLe=Vl,VLe=ULe,HLe=Math.max;function qLe(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:VLe(n);return i<0&&(i=HLe(r+i,0)),zLe(e,WLe(t),i)}var KLe=qLe,GLe=FLe,YLe=KLe,ZLe=GLe(YLe),XLe=ZLe;const QLe=kn(XLe);var JLe=tSe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),JP=v.createContext(void 0),e5=v.createContext(void 0),sK=v.createContext(void 0),uK=v.createContext({}),lK=v.createContext(void 0),cK=v.createContext(0),fK=v.createContext(0),SI=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,a=t.clipPathId,s=t.children,u=t.width,l=t.height,c=JLe(o);return F.createElement(JP.Provider,{value:r},F.createElement(e5.Provider,{value:i},F.createElement(uK.Provider,{value:o},F.createElement(sK.Provider,{value:c},F.createElement(lK.Provider,{value:a},F.createElement(cK.Provider,{value:l},F.createElement(fK.Provider,{value:u},s)))))))},eFe=function(){return v.useContext(lK)},dK=function(t){var n=v.useContext(JP);n==null&&of();var r=n[t];return r==null&&of(),r},tFe=function(){var t=v.useContext(JP);return rl(t)},nFe=function(){var t=v.useContext(e5),n=QLe(t,function(r){return eK(r.domain,Number.isFinite)});return n||rl(t)},hK=function(t){var n=v.useContext(e5);n==null&&of();var r=n[t];return r==null&&of(),r},rFe=function(){var t=v.useContext(sK);return t},iFe=function(){return v.useContext(uK)},t5=function(){return v.useContext(fK)},n5=function(){return v.useContext(cK)};function ph(e){"@babel/helpers - typeof";return ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ph(e)}function oFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aFe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function UFe(e,t){return xK(e,t+1)}function zFe(e,t,n,r,i){for(var o=(r||[]).slice(),a=t.start,s=t.end,u=0,l=1,c=a,f=function(){var m=r?.[u];if(m===void 0)return{v:xK(r,l)};var y=u,b,w=function(){return b===void 0&&(b=n(m,y)),b},x=m.coordinate,S=u===0||_x(e,x,w,c,s);S||(u=0,c=a,l+=1),S&&(c=x+e*(w()/2+i),u+=l)},h;l<=o.length;)if(h=f(),h)return h.v;return[]}function im(e){"@babel/helpers - typeof";return im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},im(e)}function MI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ei(e){for(var t=1;t0?p.coordinate-b*e:p.coordinate})}else o[h]=p=Ei(Ei({},p),{},{tickCoord:p.coordinate});var w=_x(e,p.tickCoord,y,s,u);w&&(u=p.tickCoord-e*(y()/2+i),o[h]=Ei(Ei({},p),{},{isShow:!0}))},c=a-1;c>=0;c--)l(c);return o}function KFe(e,t,n,r,i,o){var a=(r||[]).slice(),s=a.length,u=t.start,l=t.end;if(o){var c=r[s-1],f=n(c,s-1),h=e*(c.coordinate+e*f/2-l);a[s-1]=c=Ei(Ei({},c),{},{tickCoord:h>0?c.coordinate-h*e:c.coordinate});var p=_x(e,c.tickCoord,function(){return f},u,l);p&&(l=c.tickCoord-e*(f/2+i),a[s-1]=Ei(Ei({},c),{},{isShow:!0}))}for(var m=o?s-1:s,y=function(x){var S=a[x],O,E=function(){return O===void 0&&(O=n(S,x)),O};if(x===0){var C=e*(S.coordinate-e*E()/2-u);a[x]=S=Ei(Ei({},S),{},{tickCoord:C<0?S.coordinate-C*e:S.coordinate})}else a[x]=S=Ei(Ei({},S),{},{tickCoord:S.coordinate});var P=_x(e,S.tickCoord,E,u,l);P&&(u=S.tickCoord+e*(E()/2+i),a[x]=Ei(Ei({},S),{},{isShow:!0}))},b=0;b=2?za(i[1].coordinate-i[0].coordinate):1,w=BFe(o,b,p);return u==="equidistantPreserveStart"?zFe(b,w,y,i,a):(u==="preserveStart"||u==="preserveStartEnd"?h=KFe(b,w,y,i,a,u==="preserveStartEnd"):h=qFe(b,w,y,i,a),h.filter(function(x){return x.isShow}))}var GFe=["viewBox"],YFe=["viewBox"],ZFe=["ticks"];function vh(e){"@babel/helpers - typeof";return vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vh(e)}function bd(){return bd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XFe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function QFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DI(e,t){for(var n=0;n0?u(this.props):u(p)),a<=0||s<=0||!m||!m.length?null:F.createElement(En,{className:dn("recharts-cartesian-axis",l),ref:function(b){r.layerReference=b}},o&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),Ai.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var a;return F.isValidElement(r)?a=F.cloneElement(r,i):qt(r)?a=r(i):a=F.createElement(Hb,bd({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}])}(v.Component);a5(ip,"displayName","CartesianAxis");a5(ip,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var oje=["x1","y1","x2","y2","key"],aje=["offset"];function af(e){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},af(e)}function $I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pi(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cje(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var fje=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,o=t.y,a=t.width,s=t.height,u=t.ry;return F.createElement("rect",{x:i,y:o,ry:u,width:a,height:s,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function SK(e,t){var n;if(F.isValidElement(e))n=F.cloneElement(e,t);else if(qt(e))n=e(t);else{var r=t.x1,i=t.y1,o=t.x2,a=t.y2,s=t.key,u=II(t,oje),l=Wt(u,!1);l.offset;var c=II(l,aje);n=F.createElement("line",Ac({},c,{x1:r,y1:i,x2:o,y2:a,fill:"none",key:s}))}return n}function dje(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(s,u){var l=Pi(Pi({},e),{},{x1:t,y1:s,x2:t+n,y2:s,key:"line-".concat(u),index:u});return SK(i,l)});return F.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function hje(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,o=e.verticalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(s,u){var l=Pi(Pi({},e),{},{x1:s,y1:t,x2:s,y2:t+n,key:"line-".concat(u),index:u});return SK(i,l)});return F.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function pje(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,o=e.width,a=e.height,s=e.horizontalPoints,u=e.horizontal,l=u===void 0?!0:u;if(!l||!t||!t.length)return null;var c=s.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==c[0]&&c.unshift(0);var f=c.map(function(h,p){var m=!c[p+1],y=m?i+a-h:c[p+1]-h;if(y<=0)return null;var b=p%t.length;return F.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:y,width:o,stroke:"none",fill:t[b],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function gje(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,o=e.x,a=e.y,s=e.width,u=e.height,l=e.verticalPoints;if(!n||!r||!r.length)return null;var c=l.map(function(h){return Math.round(h+o-o)}).sort(function(h,p){return h-p});o!==c[0]&&c.unshift(0);var f=c.map(function(h,p){var m=!c[p+1],y=m?o+s-h:c[p+1]-h;if(y<=0)return null;var b=p%r.length;return F.createElement("rect",{key:"react-".concat(p),x:h,y:a,width:y,height:u,stroke:"none",fill:r[b],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var mje=function(t,n){var r=t.xAxis,i=t.width,o=t.height,a=t.offset;return Iq(o5(Pi(Pi(Pi({},ip.defaultProps),r),{},{ticks:su(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.left,a.left+a.width,n)},vje=function(t,n){var r=t.yAxis,i=t.width,o=t.height,a=t.offset;return Iq(o5(Pi(Pi(Pi({},ip.defaultProps),r),{},{ticks:su(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.top,a.top+a.height,n)},Xf={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function yje(e){var t,n,r,i,o,a,s=t5(),u=n5(),l=iFe(),c=Pi(Pi({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Xf.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Xf.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Xf.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Xf.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:Xf.vertical,verticalFill:(a=e.verticalFill)!==null&&a!==void 0?a:Xf.verticalFill,x:Ke(e.x)?e.x:l.left,y:Ke(e.y)?e.y:l.top,width:Ke(e.width)?e.width:l.width,height:Ke(e.height)?e.height:l.height}),f=c.x,h=c.y,p=c.width,m=c.height,y=c.syncWithTicks,b=c.horizontalValues,w=c.verticalValues,x=tFe(),S=nFe();if(!Ke(p)||p<=0||!Ke(m)||m<=0||!Ke(f)||f!==+f||!Ke(h)||h!==+h)return null;var O=c.verticalCoordinatesGenerator||mje,E=c.horizontalCoordinatesGenerator||vje,C=c.horizontalPoints,P=c.verticalPoints;if((!C||!C.length)&&qt(E)){var M=b&&b.length,N=E({yAxis:S?Pi(Pi({},S),{},{ticks:M?b:S.ticks}):void 0,width:s,height:u,offset:l},M?!0:y);du(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(af(N),"]")),Array.isArray(N)&&(C=N)}if((!P||!P.length)&&qt(O)){var B=w&&w.length,V=O({xAxis:x?Pi(Pi({},x),{},{ticks:B?w:x.ticks}):void 0,width:s,height:u,offset:l},B?!0:y);du(Array.isArray(V),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(af(V),"]")),Array.isArray(V)&&(P=V)}return F.createElement("g",{className:"recharts-cartesian-grid"},F.createElement(fje,{fill:c.fill,fillOpacity:c.fillOpacity,x:c.x,y:c.y,width:c.width,height:c.height,ry:c.ry}),F.createElement(dje,Ac({},c,{offset:l,horizontalPoints:C,xAxis:x,yAxis:S})),F.createElement(hje,Ac({},c,{offset:l,verticalPoints:P,xAxis:x,yAxis:S})),F.createElement(pje,Ac({},c,{horizontalPoints:C})),F.createElement(gje,Ac({},c,{verticalPoints:P})))}yje.displayName="CartesianGrid";var bje=["type","layout","connectNulls","ref"],xje=["key"];function yh(e){"@babel/helpers - typeof";return yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yh(e)}function NI(e,t){if(e==null)return{};var n=wje(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wje(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function M0(){return M0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);nf){p=[].concat(Qf(u.slice(0,m)),[f-y]);break}var b=p.length%2===0?[0,h]:[h];return[].concat(Qf(t.repeat(u,c)),Qf(p),b).map(function(w){return"".concat(w,"px")}).join(", ")}),Ia(n,"id",yf("recharts-line-")),Ia(n,"pathRef",function(a){n.mainCurve=a}),Ia(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ia(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Mje(t,e),Aje(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,u=o.yAxis,l=o.layout,c=o.children,f=ho(c,tp);if(!f)return null;var h=function(y,b){return{x:y.x,y:y.y,value:y.value,errorVal:Kr(y.payload,b)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return F.createElement(En,p,f.map(function(m){return F.cloneElement(m,{key:"bar-".concat(m.props.dataKey),data:a,xAxis:s,yAxis:u,layout:l,dataPointFormatter:h})}))}},{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,u=s.dot,l=s.points,c=s.dataKey,f=Wt(this.props,!1),h=Wt(u,!0),p=l.map(function(y,b){var w=Eo(Eo(Eo({key:"dot-".concat(b),r:3},f),h),{},{value:y.value,dataKey:c,cx:y.x,cy:y.y,index:b,payload:y.payload});return t.renderDotItem(u,w)}),m={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return F.createElement(En,M0({className:"recharts-line-dots",key:"dots"},m),p)}},{key:"renderCurveStatically",value:function(r,i,o,a){var s=this.props,u=s.type,l=s.layout,c=s.connectNulls;s.ref;var f=NI(s,bje),h=Eo(Eo(Eo({},Wt(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:u,layout:l,connectNulls:c});return F.createElement(Nc,M0({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,u=a.strokeDasharray,l=a.isAnimationActive,c=a.animationBegin,f=a.animationDuration,h=a.animationEasing,p=a.animationId,m=a.animateNewValues,y=a.width,b=a.height,w=this.state,x=w.prevPoints,S=w.totalLength;return F.createElement(Za,{begin:c,duration:f,isActive:l,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var E=O.t;if(x){var C=x.length/s.length,P=s.map(function(W,ne){var Z=Math.floor(ne*C);if(x[Z]){var q=x[Z],G=Or(q.x,W.x),H=Or(q.y,W.y);return Eo(Eo({},W),{},{x:G(E),y:H(E)})}if(m){var j=Or(y*2,W.x),K=Or(b/2,W.y);return Eo(Eo({},W),{},{x:j(E),y:K(E)})}return Eo(Eo({},W),{},{x:W.x,y:W.y})});return o.renderCurveStatically(P,r,i)}var M=Or(0,S),N=M(E),B;if(u){var V="".concat(u).split(/[,\s]+/gim).map(function(W){return parseFloat(W)});B=o.getStrokeDasharray(N,S,V)}else B=o.generateSimpleStrokeDasharray(S,N);return o.renderCurveStatically(s,r,i,{strokeDasharray:B})})}},{key:"renderCurve",value:function(r,i){var o=this.props,a=o.points,s=o.isAnimationActive,u=this.state,l=u.prevPoints,c=u.totalLength;return s&&a&&a.length&&(!l&&c>0||!nf(l,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,u=i.className,l=i.xAxis,c=i.yAxis,f=i.top,h=i.left,p=i.width,m=i.height,y=i.isAnimationActive,b=i.id;if(o||!s||!s.length)return null;var w=this.state.isAnimationFinished,x=s.length===1,S=dn("recharts-line",u),O=l&&l.allowDataOverflow,E=c&&c.allowDataOverflow,C=O||E,P=Vt(b)?this.id:b,M=(r=Wt(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},N=M.r,B=N===void 0?3:N,V=M.strokeWidth,W=V===void 0?2:V,ne=PV(a)?a:{},Z=ne.clipDot,q=Z===void 0?!0:Z,G=B*2+W;return F.createElement(En,{className:S},O||E?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(P)},F.createElement("rect",{x:O?h:h-p/2,y:E?f:f-m/2,width:O?p:p*2,height:E?m:m*2})),!q&&F.createElement("clipPath",{id:"clipPath-dots-".concat(P)},F.createElement("rect",{x:h-G/2,y:f-G/2,width:p+G,height:m+G}))):null,!x&&this.renderCurve(C,P),this.renderErrorBar(C,P),(x||a)&&this.renderDots(C,q,P),(!y||w)&&Os.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(Qf(r),[0]):r,a=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ije(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Pc(){return Pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!nf(c,a)||!nf(f,s))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(a,s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,u=i.className,l=i.top,c=i.left,f=i.xAxis,h=i.yAxis,p=i.width,m=i.height,y=i.isAnimationActive,b=i.id;if(o||!s||!s.length)return null;var w=this.state.isAnimationFinished,x=s.length===1,S=dn("recharts-area",u),O=f&&f.allowDataOverflow,E=h&&h.allowDataOverflow,C=O||E,P=Vt(b)?this.id:b,M=(r=Wt(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},N=M.r,B=N===void 0?3:N,V=M.strokeWidth,W=V===void 0?2:V,ne=PV(a)?a:{},Z=ne.clipDot,q=Z===void 0?!0:Z,G=B*2+W;return F.createElement(En,{className:S},O||E?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(P)},F.createElement("rect",{x:O?c:c-p/2,y:E?l:l-m/2,width:O?p:p*2,height:E?m:m*2})),!q&&F.createElement("clipPath",{id:"clipPath-dots-".concat(P)},F.createElement("rect",{x:c-G/2,y:l-G/2,width:p+G,height:m+G}))):null,x?null:this.renderArea(C,P),(a||x)&&this.renderDots(C,q,P),(!y||w)&&Os.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(v.PureComponent);OK=wf;ys(wf,"displayName","Area");ys(wf,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!qa.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});ys(wf,"getBaseValue",function(e,t,n,r){var i=e.layout,o=e.baseValue,a=t.props.baseValue,s=a??o;if(Ke(s)&&typeof s=="number")return s;var u=i==="horizontal"?r:n,l=u.scale.domain();if(u.type==="number"){var c=Math.max(l[0],l[1]),f=Math.min(l[0],l[1]);return s==="dataMin"?f:s==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]});ys(wf,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,o=e.xAxisTicks,a=e.yAxisTicks,s=e.bandSize,u=e.dataKey,l=e.stackedData,c=e.dataStartIndex,f=e.displayedData,h=e.offset,p=t.layout,m=l&&l.length,y=OK.getBaseValue(t,n,r,i),b=p==="horizontal",w=!1,x=f.map(function(O,E){var C;m?C=l[c+E]:(C=Kr(O,u),Array.isArray(C)?w=!0:C=[y,C]);var P=C[1]==null||m&&Kr(O,u)==null;return b?{x:lh({axis:r,ticks:o,bandSize:s,entry:O,index:E}),y:P?null:i.scale(C[1]),value:C,payload:O}:{x:P?null:r.scale(C[1]),y:lh({axis:i,ticks:a,bandSize:s,entry:O,index:E}),value:C,payload:O}}),S;return m||w?S=x.map(function(O){var E=Array.isArray(O.value)?O.value[0]:null;return b?{x:O.x,y:E!=null&&O.y!=null?i.scale(E):null}:{x:E!=null?r.scale(E):null,y:O.y}}):S=b?i.scale(y):r.scale(y),Yu({points:x,baseLine:S,layout:p,isRange:w},h)});ys(wf,"renderDotItem",function(e,t){var n;if(F.isValidElement(e))n=F.cloneElement(e,t);else if(qt(e))n=e(t);else{var r=dn("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,o=AK(t,$je);n=F.createElement(y2,Pc({},o,{key:i,className:r}))}return n});function xh(e){"@babel/helpers - typeof";return xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xh(e)}function Wje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vje(e,t){for(var n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jje(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function eBe(e){var t=e.option,n=e.isActive,r=Qje(e,Xje);return typeof t=="string"?F.createElement(Q6,R0({option:F.createElement(o2,R0({type:t},r)),isActive:n,shapeType:"symbols"},r)):F.createElement(Q6,R0({option:t,isActive:n,shapeType:"symbols"},r))}function wh(e){"@babel/helpers - typeof";return wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wh(e)}function D0(){return D0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GBe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function YBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZBe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?a:t&&t.length&&Ke(i)&&Ke(o)?t.slice(i,o+1):[]};function YK(e){return e==="number"?[0,"auto"]:void 0}var _4=function(t,n,r,i){var o=t.graphicalItems,a=t.tooltipAxis,s=k2(n,t);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(u,l){var c,f=(c=l.props.data)!==null&&c!==void 0?c:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(a.dataKey&&!a.allowDuplicatedCategory){var p=f===void 0?s:f;h=Tb(p,a.dataKey,i)}else h=f&&f[r]||s[r];return h?[].concat(Eh(u),[Lq(l,h)]):u},[])},GI=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},a=uUe(o,r),s=t.orderedTooltipTicks,u=t.tooltipAxis,l=t.tooltipTicks,c=c9e(a,s,l,u);if(c>=0&&l){var f=l[c]&&l[c].value,h=_4(t,n,c,f),p=lUe(r,s,c,o);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},cUe=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.layout,f=t.children,h=t.stackOffset,p=$q(c,o);return r.reduce(function(m,y){var b,w=y.type.defaultProps!==void 0?Ee(Ee({},y.type.defaultProps),y.props):y.props,x=w.type,S=w.dataKey,O=w.allowDataOverflow,E=w.allowDuplicatedCategory,C=w.scale,P=w.ticks,M=w.includeHidden,N=w[a];if(m[N])return m;var B=k2(t.data,{graphicalItems:i.filter(function(X){var Q,ue=a in X.props?X.props[a]:(Q=X.type.defaultProps)===null||Q===void 0?void 0:Q[a];return ue===N}),dataStartIndex:u,dataEndIndex:l}),V=B.length,W,ne,Z;NBe(w.domain,O,x)&&(W=N6(w.domain,null,O),p&&(x==="number"||C!=="auto")&&(Z=k0(B,S,"category")));var q=YK(x);if(!W||W.length===0){var G,H=(G=w.domain)!==null&&G!==void 0?G:q;if(S){if(W=k0(B,S,x),x==="category"&&p){var j=QSe(W);E&&j?(ne=W,W=px(0,V)):E||(W=_$(H,W,y).reduce(function(X,Q){return X.indexOf(Q)>=0?X:[].concat(Eh(X),[Q])},[]))}else if(x==="category")E?W=W.filter(function(X){return X!==""&&!Vt(X)}):W=_$(H,W,y).reduce(function(X,Q){return X.indexOf(Q)>=0||Q===""||Vt(Q)?X:[].concat(Eh(X),[Q])},[]);else if(x==="number"){var K=g9e(B,i.filter(function(X){var Q,ue,de=a in X.props?X.props[a]:(Q=X.type.defaultProps)===null||Q===void 0?void 0:Q[a],Se="hide"in X.props?X.props.hide:(ue=X.type.defaultProps)===null||ue===void 0?void 0:ue.hide;return de===N&&(M||!Se)}),S,o,c);K&&(W=K)}p&&(x==="number"||C!=="auto")&&(Z=k0(B,S,"category"))}else p?W=px(0,V):s&&s[N]&&s[N].hasStack&&x==="number"?W=h==="expand"?[0,1]:Nq(s[N].stackGroups,u,l):W=Dq(B,i.filter(function(X){var Q=a in X.props?X.props[a]:X.type.defaultProps[a],ue="hide"in X.props?X.props.hide:X.type.defaultProps.hide;return Q===N&&(M||!ue)}),x,c,!0);if(x==="number")W=b4(f,W,N,o,P),H&&(W=N6(H,W,O));else if(x==="category"&&H){var Y=H,oe=W.every(function(X){return Y.indexOf(X)>=0});oe&&(W=Y)}}return Ee(Ee({},m),{},Tt({},N,Ee(Ee({},w),{},{axisType:o,domain:W,categoricalDomain:Z,duplicateDomain:ne,originalDomain:(b=w.domain)!==null&&b!==void 0?b:q,isCategorical:p,layout:c})))},{})},fUe=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.layout,f=t.children,h=k2(t.data,{graphicalItems:r,dataStartIndex:u,dataEndIndex:l}),p=h.length,m=$q(c,o),y=-1;return r.reduce(function(b,w){var x=w.type.defaultProps!==void 0?Ee(Ee({},w.type.defaultProps),w.props):w.props,S=x[a],O=YK("number");if(!b[S]){y++;var E;return m?E=px(0,p):s&&s[S]&&s[S].hasStack?(E=Nq(s[S].stackGroups,u,l),E=b4(f,E,S,o)):(E=N6(O,Dq(h,r.filter(function(C){var P,M,N=a in C.props?C.props[a]:(P=C.type.defaultProps)===null||P===void 0?void 0:P[a],B="hide"in C.props?C.props.hide:(M=C.type.defaultProps)===null||M===void 0?void 0:M.hide;return N===S&&!B}),"number",c),i.defaultProps.allowDataOverflow),E=b4(f,E,S,o)),Ee(Ee({},b),{},Tt({},S,Ee(Ee({axisType:o},i.defaultProps),{},{hide:!0,orientation:pa(aUe,"".concat(o,".").concat(y%2),null),domain:E,originalDomain:O,isCategorical:m,layout:c})))}return b},{})},dUe=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.children,f="".concat(i,"Id"),h=ho(c,o),p={};return h.length?p=cUe(t,{axes:h,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:u,dataEndIndex:l}):a&&a.length&&(p=fUe(t,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:u,dataEndIndex:l})),p},hUe=function(t){var n=rl(t),r=su(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:SP(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:ox(n,r)}},YI=function(t){var n=t.children,r=t.defaultShowTooltip,i=ko(n,dh),o=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},pUe=function(t){return!t||!t.length?!1:t.some(function(n){var r=fu(n&&n.type);return r&&r.indexOf("Bar")>=0})},ZI=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},gUe=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,a=o===void 0?{}:o,s=t.yAxisMap,u=s===void 0?{}:s,l=r.width,c=r.height,f=r.children,h=r.margin||{},p=ko(f,dh),m=ko(f,Id),y=Object.keys(u).reduce(function(E,C){var P=u[C],M=P.orientation;return!P.mirror&&!P.hide?Ee(Ee({},E),{},Tt({},M,E[M]+P.width)):E},{left:h.left||0,right:h.right||0}),b=Object.keys(a).reduce(function(E,C){var P=a[C],M=P.orientation;return!P.mirror&&!P.hide?Ee(Ee({},E),{},Tt({},M,pa(E,"".concat(M))+P.height)):E},{top:h.top||0,bottom:h.bottom||0}),w=Ee(Ee({},b),y),x=w.bottom;p&&(w.bottom+=p.props.height||dh.defaultProps.height),m&&n&&(w=h9e(w,i,r,n));var S=l-w.left-w.right,O=c-w.top-w.bottom;return Ee(Ee({brushBottom:x},w),{},{width:Math.max(S,0),height:Math.max(O,0)})},mUe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},vUe=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,a=t.validateTooltipEventTypes,s=a===void 0?["axis"]:a,u=t.axisComponents,l=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,h=function(w,x){var S=x.graphicalItems,O=x.stackGroups,E=x.offset,C=x.updateId,P=x.dataStartIndex,M=x.dataEndIndex,N=w.barSize,B=w.layout,V=w.barGap,W=w.barCategoryGap,ne=w.maxBarSize,Z=ZI(B),q=Z.numericAxisName,G=Z.cateAxisName,H=pUe(S),j=[];return S.forEach(function(K,Y){var oe=k2(w.data,{graphicalItems:[K],dataStartIndex:P,dataEndIndex:M}),X=K.type.defaultProps!==void 0?Ee(Ee({},K.type.defaultProps),K.props):K.props,Q=X.dataKey,ue=X.maxBarSize,de=X["".concat(q,"Id")],Se=X["".concat(G,"Id")],me={},Ze=u.reduce(function(ze,je){var ke=x["".concat(je.axisType,"Map")],nt=X["".concat(je.axisType,"Id")];ke&&ke[nt]||je.axisType==="zAxis"||of();var mt=ke[nt];return Ee(Ee({},ze),{},Tt(Tt({},je.axisType,mt),"".concat(je.axisType,"Ticks"),su(mt)))},me),Ae=Ze[G],Le=Ze["".concat(G,"Ticks")],$e=O&&O[de]&&O[de].hasStack&&A9e(K,O[de].stackGroups),be=fu(K.type).indexOf("Bar")>=0,bt=ox(Ae,Le),lt=[],Ft=H&&f9e({barSize:N,stackGroups:O,totalSize:mUe(Ze,G)});if(be){var yn,nn,ie=Vt(ue)?ne:ue,pe=(yn=(nn=ox(Ae,Le,!0))!==null&&nn!==void 0?nn:ie)!==null&&yn!==void 0?yn:0;lt=d9e({barGap:V,barCategoryGap:W,bandSize:pe!==bt?pe:bt,sizeList:Ft[Se],maxBarSize:ie}),pe!==bt&&(lt=lt.map(function(ze){return Ee(Ee({},ze),{},{position:Ee(Ee({},ze.position),{},{offset:ze.position.offset-pe/2})})}))}var ye=K&&K.type&&K.type.getComposedData;ye&&j.push({props:Ee(Ee({},ye(Ee(Ee({},Ze),{},{displayedData:oe,props:w,dataKey:Q,item:K,bandSize:bt,barPosition:lt,offset:E,stackedData:$e,layout:B,dataStartIndex:P,dataEndIndex:M}))),{},Tt(Tt(Tt({key:K.key||"item-".concat(Y)},q,Ze[q]),G,Ze[G]),"animationId",C)),childIndex:c3e(K,w.children),item:K})}),j},p=function(w,x){var S=w.props,O=w.dataStartIndex,E=w.dataEndIndex,C=w.updateId;if(!m9({props:S}))return null;var P=S.children,M=S.layout,N=S.stackOffset,B=S.data,V=S.reverseStackOrder,W=ZI(M),ne=W.numericAxisName,Z=W.cateAxisName,q=ho(P,r),G=C9e(B,q,"".concat(ne,"Id"),"".concat(Z,"Id"),N,V),H=u.reduce(function(X,Q){var ue="".concat(Q.axisType,"Map");return Ee(Ee({},X),{},Tt({},ue,dUe(S,Ee(Ee({},Q),{},{graphicalItems:q,stackGroups:Q.axisType===ne&&G,dataStartIndex:O,dataEndIndex:E}))))},{}),j=gUe(Ee(Ee({},H),{},{props:S,graphicalItems:q}),x?.legendBBox);Object.keys(H).forEach(function(X){H[X]=c(S,H[X],j,X.replace("Map",""),n)});var K=H["".concat(Z,"Map")],Y=hUe(K),oe=h(S,Ee(Ee({},H),{},{dataStartIndex:O,dataEndIndex:E,updateId:C,graphicalItems:q,stackGroups:G,offset:j}));return Ee(Ee({formattedGraphicalItems:oe,graphicalItems:q,offset:j,stackGroups:G},Y),H)},m=function(b){function w(x){var S,O,E;return YBe(this,w),E=QBe(this,w,[x]),Tt(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Tt(E,"accessibilityManager",new IBe),Tt(E,"handleLegendBBoxUpdate",function(C){if(C){var P=E.state,M=P.dataStartIndex,N=P.dataEndIndex,B=P.updateId;E.setState(Ee({legendBBox:C},p({props:E.props,dataStartIndex:M,dataEndIndex:N,updateId:B},Ee(Ee({},E.state),{},{legendBBox:C}))))}}),Tt(E,"handleReceiveSyncEvent",function(C,P,M){if(E.props.syncId===C){if(M===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(P)}}),Tt(E,"handleBrushChange",function(C){var P=C.startIndex,M=C.endIndex;if(P!==E.state.dataStartIndex||M!==E.state.dataEndIndex){var N=E.state.updateId;E.setState(function(){return Ee({dataStartIndex:P,dataEndIndex:M},p({props:E.props,dataStartIndex:P,dataEndIndex:M,updateId:N},E.state))}),E.triggerSyncEvent({dataStartIndex:P,dataEndIndex:M})}}),Tt(E,"handleMouseEnter",function(C){var P=E.getMouseInfo(C);if(P){var M=Ee(Ee({},P),{},{isTooltipActive:!0});E.setState(M),E.triggerSyncEvent(M);var N=E.props.onMouseEnter;qt(N)&&N(M,C)}}),Tt(E,"triggeredAfterMouseMove",function(C){var P=E.getMouseInfo(C),M=P?Ee(Ee({},P),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(M),E.triggerSyncEvent(M);var N=E.props.onMouseMove;qt(N)&&N(M,C)}),Tt(E,"handleItemMouseEnter",function(C){E.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),Tt(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),Tt(E,"handleMouseMove",function(C){C.persist(),E.throttleTriggeredAfterMouseMove(C)}),Tt(E,"handleMouseLeave",function(C){E.throttleTriggeredAfterMouseMove.cancel();var P={isTooltipActive:!1};E.setState(P),E.triggerSyncEvent(P);var M=E.props.onMouseLeave;qt(M)&&M(P,C)}),Tt(E,"handleOuterEvent",function(C){var P=l3e(C),M=pa(E.props,"".concat(P));if(P&&qt(M)){var N,B;/.*touch.*/i.test(P)?B=E.getMouseInfo(C.changedTouches[0]):B=E.getMouseInfo(C),M((N=B)!==null&&N!==void 0?N:{},C)}}),Tt(E,"handleClick",function(C){var P=E.getMouseInfo(C);if(P){var M=Ee(Ee({},P),{},{isTooltipActive:!0});E.setState(M),E.triggerSyncEvent(M);var N=E.props.onClick;qt(N)&&N(M,C)}}),Tt(E,"handleMouseDown",function(C){var P=E.props.onMouseDown;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),Tt(E,"handleMouseUp",function(C){var P=E.props.onMouseUp;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),Tt(E,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),Tt(E,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.handleMouseDown(C.changedTouches[0])}),Tt(E,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.handleMouseUp(C.changedTouches[0])}),Tt(E,"handleDoubleClick",function(C){var P=E.props.onDoubleClick;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),Tt(E,"handleContextMenu",function(C){var P=E.props.onContextMenu;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),Tt(E,"triggerSyncEvent",function(C){E.props.syncId!==void 0&&R3.emit(D3,E.props.syncId,C,E.eventEmitterSymbol)}),Tt(E,"applySyncEvent",function(C){var P=E.props,M=P.layout,N=P.syncMethod,B=E.state.updateId,V=C.dataStartIndex,W=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)E.setState(Ee({dataStartIndex:V,dataEndIndex:W},p({props:E.props,dataStartIndex:V,dataEndIndex:W,updateId:B},E.state)));else if(C.activeTooltipIndex!==void 0){var ne=C.chartX,Z=C.chartY,q=C.activeTooltipIndex,G=E.state,H=G.offset,j=G.tooltipTicks;if(!H)return;if(typeof N=="function")q=N(j,C);else if(N==="value"){q=-1;for(var K=0;K=0){var $e,be;if(ne.dataKey&&!ne.allowDuplicatedCategory){var bt=typeof ne.dataKey=="function"?Le:"payload.".concat(ne.dataKey.toString());$e=Tb(K,bt,q),be=Y&&oe&&Tb(oe,bt,q)}else $e=K?.[Z],be=Y&&oe&&oe[Z];if(Se||de){var lt=C.props.activeIndex!==void 0?C.props.activeIndex:Z;return[v.cloneElement(C,Ee(Ee(Ee({},N.props),Ze),{},{activeIndex:lt})),null,null]}if(!Vt($e))return[Ae].concat(Eh(E.renderActivePoints({item:N,activePoint:$e,basePoint:be,childIndex:Z,isRange:Y})))}else{var Ft,yn=(Ft=E.getItemByXY(E.state.activeCoordinate))!==null&&Ft!==void 0?Ft:{graphicalItem:Ae},nn=yn.graphicalItem,ie=nn.item,pe=ie===void 0?C:ie,ye=nn.childIndex,ze=Ee(Ee(Ee({},N.props),Ze),{},{activeIndex:ye});return[v.cloneElement(pe,ze),null,null]}return Y?[Ae,null,null]:[Ae,null]}),Tt(E,"renderCustomized",function(C,P,M){return v.cloneElement(C,Ee(Ee({key:"recharts-customized-".concat(M)},E.props),E.state))}),Tt(E,"renderMap",{CartesianGrid:{handler:By,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:By},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:By},YAxis:{handler:By},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((S=x.id)!==null&&S!==void 0?S:yf("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=MH(E.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),E.state={},E}return tUe(w,b),XBe(w,[{key:"componentDidMount",value:function(){var S,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var S=this.props,O=S.children,E=S.data,C=S.height,P=S.layout,M=ko(O,Js);if(M){var N=M.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var B=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,V=_4(this.state,E,N,B),W=this.state.tooltipTicks[N].coordinate,ne=(this.state.offset.top+C)/2,Z=P==="horizontal",q=Z?{x:W,y:ne}:{y:W,x:ne},G=this.state.formattedGraphicalItems.find(function(j){var K=j.item;return K.type.name==="Scatter"});G&&(q=Ee(Ee({},q),G.props.points[N].tooltipPosition),V=G.props.points[N].tooltipPayload);var H={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:B,activePayload:V,activeCoordinate:q};this.setState(H),this.renderCursor(M),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(S,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==S.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==S.margin){var E,C;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(S){XE([ko(S.children,Js)],[ko(this.props.children,Js)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var S=ko(this.props.children,Js);if(S&&typeof S.props.shared=="boolean"){var O=S.props.shared?"axis":"item";return s.indexOf(O)>=0?O:o}return o}},{key:"getMouseInfo",value:function(S){if(!this.container)return null;var O=this.container,E=O.getBoundingClientRect(),C=Nke(E),P={chartX:Math.round(S.pageX-C.left),chartY:Math.round(S.pageY-C.top)},M=E.width/O.offsetWidth||1,N=this.inRange(P.chartX,P.chartY,M);if(!N)return null;var B=this.state,V=B.xAxisMap,W=B.yAxisMap,ne=this.getTooltipEventType();if(ne!=="axis"&&V&&W){var Z=rl(V).scale,q=rl(W).scale,G=Z&&Z.invert?Z.invert(P.chartX):null,H=q&&q.invert?q.invert(P.chartY):null;return Ee(Ee({},P),{},{xValue:G,yValue:H})}var j=GI(this.state,this.props.data,this.props.layout,N);return j?Ee(Ee({},P),j):null}},{key:"inRange",value:function(S,O){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,P=S/E,M=O/E;if(C==="horizontal"||C==="vertical"){var N=this.state.offset,B=P>=N.left&&P<=N.left+N.width&&M>=N.top&&M<=N.top+N.height;return B?{x:P,y:M}:null}var V=this.state,W=V.angleAxisMap,ne=V.radiusAxisMap;if(W&&ne){var Z=rl(W);return E$({x:P,y:M},Z)}return null}},{key:"parseEventsOfWrapper",value:function(){var S=this.props.children,O=this.getTooltipEventType(),E=ko(S,Js),C={};E&&O==="axis"&&(E.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var P=Mb(this.props,this.handleOuterEvent);return Ee(Ee({},P),C)}},{key:"addListener",value:function(){R3.on(D3,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){R3.removeListener(D3,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(S,O,E){for(var C=this.state.formattedGraphicalItems,P=0,M=C.length;P(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var bUe=[" ","Enter","ArrowUp","ArrowDown"],xUe=[" ","Enter"],Gm="Select",[T2,M2,wUe]=oA(Gm),[op,Xet]=Di(Gm,[wUe,zl]),R2=zl(),[_Ue,Gl]=op(Gm),[SUe,CUe]=op(Gm),ZK=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:u,dir:l,name:c,autoComplete:f,disabled:h,required:p,form:m}=e,y=R2(t),[b,w]=v.useState(null),[x,S]=v.useState(null),[O,E]=v.useState(!1),C=Em(l),[P=!1,M]=Ts({prop:r,defaultProp:i,onChange:o}),[N,B]=Ts({prop:a,defaultProp:s,onChange:u}),V=v.useRef(null),W=b?m||!!b.closest("form"):!0,[ne,Z]=v.useState(new Set),q=Array.from(ne).map(G=>G.props.value).join(";");return I.jsx(kw,{...y,children:I.jsxs(_Ue,{required:p,scope:t,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:O,onValueNodeHasChildrenChange:E,contentId:Lo(),value:N,onValueChange:B,open:P,onOpenChange:M,dir:C,triggerPointerDownPosRef:V,disabled:h,children:[I.jsx(T2.Provider,{scope:t,children:I.jsx(SUe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(G=>{Z(H=>new Set(H).add(G))},[]),onNativeOptionRemove:v.useCallback(G=>{Z(H=>{const j=new Set(H);return j.delete(G),j})},[]),children:n})}),W?I.jsxs(_G,{"aria-hidden":!0,required:p,tabIndex:-1,name:c,autoComplete:f,value:N,onChange:G=>B(G.target.value),disabled:h,form:m,children:[N===void 0?I.jsx("option",{value:""}):null,Array.from(ne)]},q):null]})})};ZK.displayName=Gm;var XK="SelectTrigger",QK=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=R2(n),a=Gl(XK,n),s=a.disabled||r,u=Nt(t,a.onTriggerChange),l=M2(n),c=v.useRef("touch"),[f,h,p]=SG(y=>{const b=l().filter(S=>!S.disabled),w=b.find(S=>S.value===a.value),x=CG(b,y,w);x!==void 0&&a.onValueChange(x.value)}),m=y=>{s||(a.onOpenChange(!0),p()),y&&(a.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return I.jsx(Dm,{asChild:!0,...o,children:I.jsx(gt.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:s,"data-disabled":s?"":void 0,"data-placeholder":wG(a.value)?"":void 0,...i,ref:u,onClick:Ye(i.onClick,y=>{y.currentTarget.focus(),c.current!=="mouse"&&m(y)}),onPointerDown:Ye(i.onPointerDown,y=>{c.current=y.pointerType;const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(m(y),y.preventDefault())}),onKeyDown:Ye(i.onKeyDown,y=>{const b=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(b&&y.key===" ")&&bUe.includes(y.key)&&(m(),y.preventDefault())})})})});QK.displayName=XK;var JK="SelectValue",eG=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,u=Gl(JK,n),{onValueNodeHasChildrenChange:l}=u,c=o!==void 0,f=Nt(t,u.onValueNodeChange);return On(()=>{l(c)},[l,c]),I.jsx(gt.span,{...s,ref:f,style:{pointerEvents:"none"},children:wG(u.value)?I.jsx(I.Fragment,{children:a}):o})});eG.displayName=JK;var EUe="SelectIcon",tG=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return I.jsx(gt.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});tG.displayName=EUe;var OUe="SelectPortal",nG=e=>I.jsx(jh,{asChild:!0,...e});nG.displayName=OUe;var sf="SelectContent",rG=v.forwardRef((e,t)=>{const n=Gl(sf,e.__scopeSelect),[r,i]=v.useState();if(On(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Au.createPortal(I.jsx(iG,{scope:e.__scopeSelect,children:I.jsx(T2.Slot,{scope:e.__scopeSelect,children:I.jsx("div",{children:e.children})})}),o):null}return I.jsx(oG,{...e,ref:t})});rG.displayName=sf;var Ta=10,[iG,Yl]=op(sf),AUe="SelectContentImpl",oG=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:u,align:l,alignOffset:c,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:y,avoidCollisions:b,...w}=e,x=Gl(sf,n),[S,O]=v.useState(null),[E,C]=v.useState(null),P=Nt(t,me=>O(me)),[M,N]=v.useState(null),[B,V]=v.useState(null),W=M2(n),[ne,Z]=v.useState(!1),q=v.useRef(!1);v.useEffect(()=>{if(S)return Mm(S)},[S]),Ew();const G=v.useCallback(me=>{const[Ze,...Ae]=W().map(be=>be.ref.current),[Le]=Ae.slice(-1),$e=document.activeElement;for(const be of me)if(be===$e||(be?.scrollIntoView({block:"nearest"}),be===Ze&&E&&(E.scrollTop=0),be===Le&&E&&(E.scrollTop=E.scrollHeight),be?.focus(),document.activeElement!==$e))return},[W,E]),H=v.useCallback(()=>G([M,S]),[G,M,S]);v.useEffect(()=>{ne&&H()},[ne,H]);const{onOpenChange:j,triggerPointerDownPosRef:K}=x;v.useEffect(()=>{if(S){let me={x:0,y:0};const Ze=Le=>{me={x:Math.abs(Math.round(Le.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(Le.pageY)-(K.current?.y??0))}},Ae=Le=>{me.x<=10&&me.y<=10?Le.preventDefault():S.contains(Le.target)||j(!1),document.removeEventListener("pointermove",Ze),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",Ze),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ze),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[S,j,K]),v.useEffect(()=>{const me=()=>j(!1);return window.addEventListener("blur",me),window.addEventListener("resize",me),()=>{window.removeEventListener("blur",me),window.removeEventListener("resize",me)}},[j]);const[Y,oe]=SG(me=>{const Ze=W().filter($e=>!$e.disabled),Ae=Ze.find($e=>$e.ref.current===document.activeElement),Le=CG(Ze,me,Ae);Le&&setTimeout(()=>Le.ref.current.focus())}),X=v.useCallback((me,Ze,Ae)=>{const Le=!q.current&&!Ae;(x.value!==void 0&&x.value===Ze||Le)&&(N(me),Le&&(q.current=!0))},[x.value]),Q=v.useCallback(()=>S?.focus(),[S]),ue=v.useCallback((me,Ze,Ae)=>{const Le=!q.current&&!Ae;(x.value!==void 0&&x.value===Ze||Le)&&V(me)},[x.value]),de=r==="popper"?C4:aG,Se=de===C4?{side:s,sideOffset:u,align:l,alignOffset:c,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:y,avoidCollisions:b}:{};return I.jsx(iG,{scope:n,content:S,viewport:E,onViewportChange:C,itemRefCallback:X,selectedItem:M,onItemLeave:Q,itemTextRefCallback:ue,focusSelectedItem:H,selectedItemText:B,position:r,isPositioned:ne,searchRef:Y,children:I.jsx(Tm,{as:Pl,allowPinchZoom:!0,children:I.jsx(km,{asChild:!0,trapped:x.open,onMountAutoFocus:me=>{me.preventDefault()},onUnmountAutoFocus:Ye(i,me=>{x.trigger?.focus({preventScroll:!0}),me.preventDefault()}),children:I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:me=>me.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:I.jsx(de,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:me=>me.preventDefault(),...w,...Se,onPlaced:()=>Z(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ye(w.onKeyDown,me=>{const Ze=me.ctrlKey||me.altKey||me.metaKey;if(me.key==="Tab"&&me.preventDefault(),!Ze&&me.key.length===1&&oe(me.key),["ArrowUp","ArrowDown","Home","End"].includes(me.key)){let Le=W().filter($e=>!$e.disabled).map($e=>$e.ref.current);if(["ArrowUp","End"].includes(me.key)&&(Le=Le.slice().reverse()),["ArrowUp","ArrowDown"].includes(me.key)){const $e=me.target,be=Le.indexOf($e);Le=Le.slice(be+1)}setTimeout(()=>G(Le)),me.preventDefault()}})})})})})})});oG.displayName=AUe;var PUe="SelectItemAlignedPosition",aG=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Gl(sf,n),a=Yl(sf,n),[s,u]=v.useState(null),[l,c]=v.useState(null),f=Nt(t,P=>c(P)),h=M2(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:w,focusSelectedItem:x}=a,S=v.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&l&&y&&b&&w){const P=o.trigger.getBoundingClientRect(),M=l.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),B=w.getBoundingClientRect();if(o.dir!=="rtl"){const $e=B.left-M.left,be=N.left-$e,bt=P.left-be,lt=P.width+bt,Ft=Math.max(lt,M.width),yn=window.innerWidth-Ta,nn=S4(be,[Ta,Math.max(Ta,yn-Ft)]);s.style.minWidth=lt+"px",s.style.left=nn+"px"}else{const $e=M.right-B.right,be=window.innerWidth-N.right-$e,bt=window.innerWidth-P.right-be,lt=P.width+bt,Ft=Math.max(lt,M.width),yn=window.innerWidth-Ta,nn=S4(be,[Ta,Math.max(Ta,yn-Ft)]);s.style.minWidth=lt+"px",s.style.right=nn+"px"}const V=h(),W=window.innerHeight-Ta*2,ne=y.scrollHeight,Z=window.getComputedStyle(l),q=parseInt(Z.borderTopWidth,10),G=parseInt(Z.paddingTop,10),H=parseInt(Z.borderBottomWidth,10),j=parseInt(Z.paddingBottom,10),K=q+G+ne+j+H,Y=Math.min(b.offsetHeight*5,K),oe=window.getComputedStyle(y),X=parseInt(oe.paddingTop,10),Q=parseInt(oe.paddingBottom,10),ue=P.top+P.height/2-Ta,de=W-ue,Se=b.offsetHeight/2,me=b.offsetTop+Se,Ze=q+G+me,Ae=K-Ze;if(Ze<=ue){const $e=V.length>0&&b===V[V.length-1].ref.current;s.style.bottom="0px";const be=l.clientHeight-y.offsetTop-y.offsetHeight,bt=Math.max(de,Se+($e?Q:0)+be+H),lt=Ze+bt;s.style.height=lt+"px"}else{const $e=V.length>0&&b===V[0].ref.current;s.style.top="0px";const bt=Math.max(ue,q+y.offsetTop+($e?X:0)+Se)+Ae;s.style.height=bt+"px",y.scrollTop=Ze-ue+y.offsetTop}s.style.margin=`${Ta}px 0`,s.style.minHeight=Y+"px",s.style.maxHeight=W+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[h,o.trigger,o.valueNode,s,l,y,b,w,o.dir,r]);On(()=>S(),[S]);const[O,E]=v.useState();On(()=>{l&&E(window.getComputedStyle(l).zIndex)},[l]);const C=v.useCallback(P=>{P&&m.current===!0&&(S(),x?.(),m.current=!1)},[S,x]);return I.jsx(TUe,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:I.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:I.jsx(gt.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});aG.displayName=PUe;var kUe="SelectPopperPosition",C4=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ta,...o}=e,a=R2(n);return I.jsx(Tw,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.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)"}})});C4.displayName=kUe;var[TUe,l5]=op(sf,{}),E4="SelectViewport",sG=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Yl(E4,n),a=l5(E4,n),s=Nt(t,o.onViewportChange),u=v.useRef(0);return I.jsxs(I.Fragment,{children:[I.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}),I.jsx(T2.Slot,{scope:n,children:I.jsx(gt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ye(i.onScroll,l=>{const c=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=a;if(h?.current&&f){const p=Math.abs(u.current-c.scrollTop);if(p>0){const m=window.innerHeight-Ta*2,y=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),w=Math.max(y,b);if(w0?O:0,f.style.justifyContent="flex-end")}}}u.current=c.scrollTop})})})]})});sG.displayName=E4;var uG="SelectGroup",[MUe,RUe]=op(uG),lG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Lo();return I.jsx(MUe,{scope:n,id:i,children:I.jsx(gt.div,{role:"group","aria-labelledby":i,...r,ref:t})})});lG.displayName=uG;var cG="SelectLabel",fG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=RUe(cG,n);return I.jsx(gt.div,{id:i.id,...r,ref:t})});fG.displayName=cG;var Mx="SelectItem",[DUe,dG]=op(Mx),hG=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=Gl(Mx,n),u=Yl(Mx,n),l=s.value===r,[c,f]=v.useState(o??""),[h,p]=v.useState(!1),m=Nt(t,x=>u.itemRefCallback?.(x,r,i)),y=Lo(),b=v.useRef("touch"),w=()=>{i||(s.onValueChange(r),s.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 I.jsx(DUe,{scope:n,value:r,disabled:i,textId:y,isSelected:l,onItemTextChange:v.useCallback(x=>{f(S=>S||(x?.textContent??"").trim())},[]),children:I.jsx(T2.ItemSlot,{scope:n,value:r,disabled:i,textValue:c,children:I.jsx(gt.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:m,onFocus:Ye(a.onFocus,()=>p(!0)),onBlur:Ye(a.onBlur,()=>p(!1)),onClick:Ye(a.onClick,()=>{b.current!=="mouse"&&w()}),onPointerUp:Ye(a.onPointerUp,()=>{b.current==="mouse"&&w()}),onPointerDown:Ye(a.onPointerDown,x=>{b.current=x.pointerType}),onPointerMove:Ye(a.onPointerMove,x=>{b.current=x.pointerType,i?u.onItemLeave?.():b.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ye(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Ye(a.onKeyDown,x=>{u.searchRef?.current!==""&&x.key===" "||(xUe.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})})})})});hG.displayName=Mx;var d0="SelectItemText",pG=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Gl(d0,n),s=Yl(d0,n),u=dG(d0,n),l=CUe(d0,n),[c,f]=v.useState(null),h=Nt(t,w=>f(w),u.onItemTextChange,w=>s.itemTextRefCallback?.(w,u.value,u.disabled)),p=c?.textContent,m=v.useMemo(()=>I.jsx("option",{value:u.value,disabled:u.disabled,children:p},u.value),[u.disabled,u.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return On(()=>(y(m),()=>b(m)),[y,b,m]),I.jsxs(I.Fragment,{children:[I.jsx(gt.span,{id:u.textId,...o,ref:h}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Au.createPortal(o.children,a.valueNode):null]})});pG.displayName=d0;var gG="SelectItemIndicator",mG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return dG(gG,n).isSelected?I.jsx(gt.span,{"aria-hidden":!0,...r,ref:t}):null});mG.displayName=gG;var O4="SelectScrollUpButton",vG=v.forwardRef((e,t)=>{const n=Yl(O4,e.__scopeSelect),r=l5(O4,e.__scopeSelect),[i,o]=v.useState(!1),a=Nt(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=u.scrollTop>0;o(l)};const u=n.viewport;return s(),u.addEventListener("scroll",s),()=>u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?I.jsx(bG,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop-u.offsetHeight)}}):null});vG.displayName=O4;var A4="SelectScrollDownButton",yG=v.forwardRef((e,t)=>{const n=Yl(A4,e.__scopeSelect),r=l5(A4,e.__scopeSelect),[i,o]=v.useState(!1),a=Nt(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=u.scrollHeight-u.clientHeight,c=Math.ceil(u.scrollTop)u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?I.jsx(bG,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop+u.offsetHeight)}}):null});yG.displayName=A4;var bG=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Yl("SelectScrollButton",n),a=v.useRef(null),s=M2(n),u=v.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return v.useEffect(()=>()=>u(),[u]),On(()=>{s().find(c=>c.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),I.jsx(gt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ye(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ye(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ye(i.onPointerLeave,()=>{u()})})}),$Ue="SelectSeparator",xG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return I.jsx(gt.div,{"aria-hidden":!0,...r,ref:t})});xG.displayName=$Ue;var P4="SelectArrow",IUe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=R2(n),o=Gl(P4,n),a=Yl(P4,n);return o.open&&a.position==="popper"?I.jsx(Mw,{...i,...r,ref:t}):null});IUe.displayName=P4;function wG(e){return e===""||e===void 0}var _G=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=v.useRef(null),o=Nt(t,i),a=yUe(n);return v.useEffect(()=>{const s=i.current,u=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==n&&c){const f=new Event("change",{bubbles:!0});c.call(s,n),s.dispatchEvent(f)}},[a,n]),I.jsx(KA,{asChild:!0,children:I.jsx("select",{...r,ref:o,defaultValue:n})})});_G.displayName="BubbleSelect";function SG(e){const t=Vr(e),n=v.useRef(""),r=v.useRef(0),i=v.useCallback(a=>{const s=n.current+a;t(s),function u(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(s)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function CG(e,t,n){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=NUe(e,Math.max(o,0));i.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function NUe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Qet=ZK,Jet=QK,ett=eG,ttt=tG,ntt=nG,rtt=rG,itt=sG,ott=lG,att=fG,stt=hG,utt=pG,ltt=mG,ctt=vG,ftt=yG,dtt=xG;const c5=6048e5,LUe=864e5,XI=Symbol.for("constructDateFrom");function ii(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&XI in e?e[XI](t):e instanceof Date?new e.constructor(t):new Date(t)}function $n(e,t){return ii(t||e,e)}function Ui(e,t,n){const r=$n(e,n?.in);return isNaN(t)?ii(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Xa(e,t,n){const r=$n(e,n?.in);if(isNaN(t))return ii(n?.in||e,NaN);if(!t)return r;const i=r.getDate(),o=ii(n?.in||e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const a=o.getDate();return i>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}let FUe={};function Ym(){return FUe}function ba(e,t){const n=Ym(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=$n(e,t?.in),o=i.getDay(),a=(o=o.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Rx(e){const t=$n(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function _f(e,...t){const n=ii.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function lf(e,t){const n=$n(e,t?.in);return n.setHours(0,0,0,0),n}function bs(e,t,n){const[r,i]=_f(n?.in,e,t),o=lf(r),a=lf(i),s=+o-Rx(o),u=+a-Rx(a);return Math.round((s-u)/LUe)}function jUe(e,t){const n=EG(e,t),r=ii(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),uf(r)}function k4(e,t,n){return Ui(e,t*7,n)}function BUe(e,t,n){return Xa(e,t*12,n)}function UUe(e,t){let n,r=t?.in;return e.forEach(i=>{!r&&typeof i=="object"&&(r=ii.bind(null,i));const o=$n(i,r);(!n||n{!r&&typeof i=="object"&&(r=ii.bind(null,i));const o=$n(i,r);(!n||n>o||isNaN(+o))&&(n=o)}),ii(r,n||NaN)}function so(e,t,n){const[r,i]=_f(n?.in,e,t);return+lf(r)==+lf(i)}function f5(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function WUe(e){return!(!f5(e)&&typeof e!="number"||isNaN(+$n(e)))}function sm(e,t,n){const[r,i]=_f(n?.in,e,t),o=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return o*12+a}function VUe(e,t,n){const[r,i]=_f(n?.in,e,t),o=ba(r,n),a=ba(i,n),s=+o-Rx(o),u=+a-Rx(a);return Math.round((s-u)/c5)}function d5(e,t){const n=$n(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function po(e,t){const n=$n(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function OG(e,t){const n=$n(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function h5(e,t){const n=Ym(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=$n(e,t?.in),o=i.getDay(),a=(o{let r;const i=HUe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Fd(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const KUe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},GUe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},YUe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ZUe={date:Fd({formats:KUe,defaultWidth:"full"}),time:Fd({formats:GUe,defaultWidth:"full"}),dateTime:Fd({formats:YUe,defaultWidth:"full"})},XUe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},QUe=(e,t,n,r)=>XUe[e];function hs(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=n?.width?String(n.width):a;i=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=n?.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const JUe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},eze={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tze={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"]},nze={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"]},rze={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"}},ize={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"}},oze=(e,t)=>{const n=Number(e),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"},aze={ordinalNumber:oze,era:hs({values:JUe,defaultWidth:"wide"}),quarter:hs({values:eze,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hs({values:tze,defaultWidth:"wide"}),day:hs({values:nze,defaultWidth:"wide"}),dayPeriod:hs({values:rze,defaultWidth:"wide",formattingValues:ize,defaultFormattingWidth:"wide"})};function ps(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const a=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?uze(s,f=>f.test(a)):sze(s,f=>f.test(a));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const c=t.slice(a.length);return{value:l,rest:c}}}function sze(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function uze(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(i.length);return{value:a,rest:s}}}const lze=/^(\d+)(th|st|nd|rd)?/i,cze=/\d+/i,fze={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},dze={any:[/^b/i,/^(a|c)/i]},hze={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pze={any:[/1/i,/2/i,/3/i,/4/i]},gze={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},mze={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]},vze={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},yze={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]},bze={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},xze={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}},wze={ordinalNumber:PG({matchPattern:lze,parsePattern:cze,valueCallback:e=>parseInt(e,10)}),era:ps({matchPatterns:fze,defaultMatchWidth:"wide",parsePatterns:dze,defaultParseWidth:"any"}),quarter:ps({matchPatterns:hze,defaultMatchWidth:"wide",parsePatterns:pze,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ps({matchPatterns:gze,defaultMatchWidth:"wide",parsePatterns:mze,defaultParseWidth:"any"}),day:ps({matchPatterns:vze,defaultMatchWidth:"wide",parsePatterns:yze,defaultParseWidth:"any"}),dayPeriod:ps({matchPatterns:bze,defaultMatchWidth:"any",parsePatterns:xze,defaultParseWidth:"any"})},kG={code:"en-US",formatDistance:qUe,formatLong:ZUe,formatRelative:QUe,localize:aze,match:wze,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _ze(e,t){const n=$n(e,t?.in);return bs(n,OG(n))+1}function TG(e,t){const n=$n(e,t?.in),r=+uf(n)-+jUe(n);return Math.round(r/c5)+1}function MG(e,t){const n=$n(e,t?.in),r=n.getFullYear(),i=Ym(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=ii(t?.in||e,0);a.setFullYear(r+1,0,o),a.setHours(0,0,0,0);const s=ba(a,t),u=ii(t?.in||e,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const l=ba(u,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Sze(e,t){const n=Ym(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=MG(e,t),o=ii(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),ba(o,t)}function RG(e,t){const n=$n(e,t?.in),r=+ba(n,t)-+Sze(n,t);return Math.round(r/c5)+1}function Rn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const qu={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Rn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Rn(n+1,2)},d(e,t){return Rn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){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(e,t){return Rn(e.getHours()%12||12,t.length)},H(e,t){return Rn(e.getHours(),t.length)},m(e,t){return Rn(e.getMinutes(),t.length)},s(e,t){return Rn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Rn(i,t.length)}},Jf={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},QI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){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(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return qu.y(e,t)},Y:function(e,t,n,r){const i=MG(e,r),o=i>0?i:1-i;if(t==="YY"){const a=o%100;return Rn(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Rn(o,t.length)},R:function(e,t){const n=EG(e);return Rn(n,t.length)},u:function(e,t){const n=e.getFullYear();return Rn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Rn(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(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Rn(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(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return qu.M(e,t);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(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Rn(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(e,t,n,r){const i=RG(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Rn(i,t.length)},I:function(e,t,n){const r=TG(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Rn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):qu.d(e,t)},D:function(e,t,n){const r=_ze(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Rn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){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(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Rn(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Rn(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Rn(i,t.length);case"io":return n.ordinalNumber(i,{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(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Jf.noon:r===0?i=Jf.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Jf.evening:r>=12?i=Jf.afternoon:r>=4?i=Jf.morning:i=Jf.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return qu.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):qu.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Rn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Rn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):qu.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):qu.s(e,t)},S:function(e,t){return qu.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return eN(r);case"XXXX":case"XX":return gc(r);case"XXXXX":case"XXX":default:return gc(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return eN(r);case"xxxx":case"xx":return gc(r);case"xxxxx":case"xxx":default:return gc(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+JI(r,":");case"OOOO":default:return"GMT"+gc(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+JI(r,":");case"zzzz":default:return"GMT"+gc(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Rn(r,t.length)},T:function(e,t,n){return Rn(+e,t.length)}};function JI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Rn(o,2)}function eN(e,t){return e%60===0?(e>0?"-":"+")+Rn(Math.abs(e)/60,2):gc(e,t)}function gc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Rn(Math.trunc(r/60),2),o=Rn(r%60,2);return n+i+t+o}const tN=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},DG=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Cze=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return tN(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",tN(r,t)).replace("{{time}}",DG(i,t))},Eze={p:DG,P:Cze},Oze=/^D+$/,Aze=/^Y+$/,Pze=["D","DD","YY","YYYY"];function kze(e){return Oze.test(e)}function Tze(e){return Aze.test(e)}function Mze(e,t,n){const r=Rze(e,t,n);if(console.warn(r),Pze.includes(e))throw new RangeError(r)}function Rze(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Dze=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$ze=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ize=/^'([^]*?)'?$/,Nze=/''/g,Lze=/[a-zA-Z]/;function Sf(e,t,n){const r=Ym(),i=n?.locale??r.locale??kG,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=$n(e,n?.in);if(!WUe(s))throw new RangeError("Invalid time value");let u=t.match($ze).map(c=>{const f=c[0];if(f==="p"||f==="P"){const h=Eze[f];return h(c,i.formatLong)}return c}).join("").match(Dze).map(c=>{if(c==="''")return{isToken:!1,value:"'"};const f=c[0];if(f==="'")return{isToken:!1,value:Fze(c)};if(QI[f])return{isToken:!0,value:c};if(f.match(Lze))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:c}});i.localize.preprocessor&&(u=i.localize.preprocessor(s,u));const l={firstWeekContainsDate:o,weekStartsOn:a,locale:i};return u.map(c=>{if(!c.isToken)return c.value;const f=c.value;(!n?.useAdditionalWeekYearTokens&&Tze(f)||!n?.useAdditionalDayOfYearTokens&&kze(f))&&Mze(f,t,String(e));const h=QI[f[0]];return h(s,f,i.localize,l)}).join("")}function Fze(e){const t=e.match(Ize);return t?t[1].replace(Nze,"'"):e}function jze(e,t){const n=$n(e,t?.in),r=n.getFullYear(),i=n.getMonth(),o=ii(n,0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Bze(e){return Math.trunc(+$n(e)/1e3)}function Uze(e,t){const n=$n(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(0,0,0,0),$n(n,t?.in)}function zze(e,t){const n=$n(e,t?.in);return VUe(Uze(n,t),po(n,t),t)+1}function T4(e,t){return+$n(e)>+$n(t)}function $G(e,t){return+$n(e)<+$n(t)}function Wze(e,t,n){const[r,i]=_f(n?.in,e,t);return+ba(r,n)==+ba(i,n)}function p5(e,t,n){const[r,i]=_f(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function Vze(e,t,n){const[r,i]=_f(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function I3(e,t,n){return Ui(e,-t,n)}function N3(e,t,n){const r=$n(e,n?.in),i=r.getFullYear(),o=r.getDate(),a=ii(e,0);a.setFullYear(i,t,15),a.setHours(0,0,0,0);const s=jze(a);return r.setMonth(t,Math.min(o,s)),r}function nN(e,t,n){const r=$n(e,n?.in);return isNaN(+r)?ii(e,NaN):(r.setFullYear(t),r)}function htt(e){return lf(Date.now(),e)}const Hze={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},qze=(e,t,n)=>{let r;const i=Hze[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},Kze={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},Gze={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},Yze={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Zze={date:Fd({formats:Kze,defaultWidth:"full"}),time:Fd({formats:Gze,defaultWidth:"full"}),dateTime:Fd({formats:Yze,defaultWidth:"full"})};function rN(e,t,n){const r="eeee p";return Wze(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const Xze={lastWeek:rN,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:rN,other:"PP p"},Qze=(e,t,n,r)=>{const i=Xze[e];return typeof i=="function"?i(t,n,r):i},Jze={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},eWe={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},tWe={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},nWe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},rWe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},iWe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},oWe=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},aWe={ordinalNumber:oWe,era:hs({values:Jze,defaultWidth:"wide"}),quarter:hs({values:eWe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hs({values:tWe,defaultWidth:"wide"}),day:hs({values:nWe,defaultWidth:"wide"}),dayPeriod:hs({values:rWe,defaultWidth:"wide",formattingValues:iWe,defaultFormattingWidth:"wide"})},sWe=/^(第\s*)?\d+(日|时|分|秒)?/i,uWe=/\d+/i,lWe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},cWe={any:[/^(前)/i,/^(公元)/i]},fWe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},dWe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},hWe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},pWe={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},gWe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},mWe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},vWe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},yWe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},bWe={ordinalNumber:PG({matchPattern:sWe,parsePattern:uWe,valueCallback:e=>parseInt(e,10)}),era:ps({matchPatterns:lWe,defaultMatchWidth:"wide",parsePatterns:cWe,defaultParseWidth:"any"}),quarter:ps({matchPatterns:fWe,defaultMatchWidth:"wide",parsePatterns:dWe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ps({matchPatterns:hWe,defaultMatchWidth:"wide",parsePatterns:pWe,defaultParseWidth:"any"}),day:ps({matchPatterns:gWe,defaultMatchWidth:"wide",parsePatterns:mWe,defaultParseWidth:"any"}),dayPeriod:ps({matchPatterns:vWe,defaultMatchWidth:"any",parsePatterns:yWe,defaultParseWidth:"any"})},ptt={code:"zh-CN",formatDistance:qze,formatLong:Zze,formatRelative:Qze,localize:aWe,match:bWe,options:{weekStartsOn:1,firstWeekContainsDate:4}};var Dt=function(){return Dt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r1&&(u||!l),f=t>1&&(l||!u),h=function(){r&&o(r)},p=function(){i&&o(i)};return I.jsx(QWe,{displayMonth:e.displayMonth,hideNext:c,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:h,onNextClick:p})}function JWe(e){var t,n=Kn(),r=n.classNames,i=n.disableNavigation,o=n.styles,a=n.captionLayout,s=n.components,u=(t=s?.CaptionLabel)!==null&&t!==void 0?t:LG,l;return i?l=I.jsx(u,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?l=I.jsx(iN,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?l=I.jsxs(I.Fragment,{children:[I.jsx(iN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),I.jsx(oN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):l=I.jsxs(I.Fragment,{children:[I.jsx(u,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),I.jsx(oN,{displayMonth:e.displayMonth,id:e.id})]}),I.jsx("div",{className:r.caption,style:o.caption,children:l})}function eVe(e){var t=Kn(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?I.jsx("tfoot",{className:i,style:r.tfoot,children:I.jsx("tr",{children:I.jsx("td",{colSpan:8,children:n})})}):I.jsx(I.Fragment,{})}function tVe(e,t,n){for(var r=n?uf(new Date):ba(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var a=Ui(r,o);i.push(a)}return i}function nVe(){var e=Kn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,a=e.ISOWeek,s=e.formatters.formatWeekdayName,u=e.labels.labelWeekday,l=tVe(i,o,a);return I.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&I.jsx("td",{style:n.head_cell,className:t.head_cell}),l.map(function(c,f){return I.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":u(c,{locale:i}),children:s(c,{locale:i})},f)})]})}function rVe(){var e,t=Kn(),n=t.classNames,r=t.styles,i=t.components,o=(e=i?.HeadRow)!==null&&e!==void 0?e:nVe;return I.jsx("thead",{style:r.head,className:n.head,children:I.jsx(o,{})})}function iVe(e){var t=Kn(),n=t.locale,r=t.formatters.formatDay;return I.jsx(I.Fragment,{children:r(e.date,{locale:n})})}var g5=v.createContext(void 0);function oVe(e){if(!Zm(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return I.jsx(g5.Provider,{value:t,children:e.children})}return I.jsx(aVe,{initialProps:e.initialProps,children:e.children})}function aVe(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,a=function(l,c,f){var h,p;(h=t.onDayClick)===null||h===void 0||h.call(t,l,c,f);var m=!!(c.selected&&i&&r?.length===i);if(!m){var y=!!(!c.selected&&o&&r?.length===o);if(!y){var b=r?IG([],r):[];if(c.selected){var w=b.findIndex(function(x){return so(l,x)});b.splice(w,1)}else b.push(l);(p=t.onSelect)===null||p===void 0||p.call(t,b,l,c,f)}}},s={disabled:[]};r&&s.disabled.push(function(l){var c=o&&r.length>o-1,f=r.some(function(h){return so(h,l)});return!!(c&&!f)});var u={selected:r,onDayClick:a,modifiers:s};return I.jsx(g5.Provider,{value:u,children:n})}function m5(){var e=v.useContext(g5);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function sVe(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?so(i,e)&&so(r,e)?void 0:so(i,e)?{from:i,to:void 0}:so(r,e)?void 0:T4(r,e)?{from:e,to:i}:{from:r,to:e}:i?T4(e,i)?{from:i,to:e}:{from:e,to:i}:r?$G(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var v5=v.createContext(void 0);function uVe(e){if(!Xm(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return I.jsx(v5.Provider,{value:t,children:e.children})}return I.jsx(lVe,{initialProps:e.initialProps,children:e.children})}function lVe(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,a=i.to,s=t.min,u=t.max,l=function(p,m,y){var b,w;(b=t.onDayClick)===null||b===void 0||b.call(t,p,m,y);var x=sVe(p,r);(w=t.onSelect)===null||w===void 0||w.call(t,x,p,m,y)},c={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(c.range_start=[o],a?(c.range_end=[a],so(o,a)||(c.range_middle=[{after:o,before:a}])):c.range_end=[o]):a&&(c.range_start=[a],c.range_end=[a]),s&&(o&&!a&&c.disabled.push({after:I3(o,s-1),before:Ui(o,s-1)}),o&&a&&c.disabled.push({after:o,before:Ui(o,s-1)}),!o&&a&&c.disabled.push({after:I3(a,s-1),before:Ui(a,s-1)})),u){if(o&&!a&&(c.disabled.push({before:Ui(o,-u+1)}),c.disabled.push({after:Ui(o,u-1)})),o&&a){var f=bs(a,o)+1,h=u-f;c.disabled.push({before:I3(o,h)}),c.disabled.push({after:Ui(a,h)})}!o&&a&&(c.disabled.push({before:Ui(a,-u+1)}),c.disabled.push({after:Ui(a,u-1)}))}return I.jsx(v5.Provider,{value:{selected:r,onDayClick:l,modifiers:c},children:n})}function y5(){var e=v.useContext(v5);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function x1(e){return Array.isArray(e)?IG([],e):e!==void 0?[e]:[]}function cVe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=x1(i)}),t}var Qa;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Qa||(Qa={}));var fVe=Qa.Selected,Ys=Qa.Disabled,dVe=Qa.Hidden,hVe=Qa.Today,L3=Qa.RangeEnd,F3=Qa.RangeMiddle,j3=Qa.RangeStart,pVe=Qa.Outside;function gVe(e,t,n){var r,i=(r={},r[fVe]=x1(e.selected),r[Ys]=x1(e.disabled),r[dVe]=x1(e.hidden),r[hVe]=[e.today],r[L3]=[],r[F3]=[],r[j3]=[],r[pVe]=[],r);return e.fromDate&&i[Ys].push({before:e.fromDate}),e.toDate&&i[Ys].push({after:e.toDate}),Zm(e)?i[Ys]=i[Ys].concat(t.modifiers[Ys]):Xm(e)&&(i[Ys]=i[Ys].concat(n.modifiers[Ys]),i[j3]=n.modifiers[j3],i[F3]=n.modifiers[F3],i[L3]=n.modifiers[L3]),i}var BG=v.createContext(void 0);function mVe(e){var t=Kn(),n=m5(),r=y5(),i=gVe(t,n,r),o=cVe(t.modifiers),a=Dt(Dt({},i),o);return I.jsx(BG.Provider,{value:a,children:e.children})}function UG(){var e=v.useContext(BG);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function vVe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function yVe(e){return!!(e&&typeof e=="object"&&"from"in e)}function bVe(e){return!!(e&&typeof e=="object"&&"after"in e)}function xVe(e){return!!(e&&typeof e=="object"&&"before"in e)}function wVe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function _Ve(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=bs(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var a=bs(e,r)>=0&&bs(i,e)>=0;return a}return i?so(i,e):r?so(r,e):!1}function SVe(e){return f5(e)}function CVe(e){return Array.isArray(e)&&e.every(f5)}function EVe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(SVe(n))return so(e,n);if(CVe(n))return n.includes(e);if(yVe(n))return _Ve(e,n);if(wVe(n))return n.dayOfWeek.includes(e.getDay());if(vVe(n)){var r=bs(n.before,e),i=bs(n.after,e),o=r>0,a=i<0,s=T4(n.before,n.after);return s?a&&o:o||a}return bVe(n)?bs(e,n.after)>0:xVe(n)?bs(n.before,e)>0:typeof n=="function"?n(e):!1})}function b5(e,t,n){var r=Object.keys(t).reduce(function(o,a){var s=t[a];return EVe(e,s)&&o.push(a),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!p5(e,n)&&(i.outside=!0),i}function OVe(e,t){for(var n=po(e[0]),r=d5(e[e.length-1]),i,o,a=n;a<=r;){var s=b5(a,t),u=!s.disabled&&!s.hidden;if(!u){a=Ui(a,1);continue}if(s.selected)return a;s.today&&!o&&(o=a),i||(i=a),a=Ui(a,1)}return o||i}var AVe=365;function zG(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,a=t.retry,s=a===void 0?{count:0,lastFocused:e}:a,u=i.weekStartsOn,l=i.fromDate,c=i.toDate,f=i.locale,h={day:Ui,week:k4,month:Xa,year:BUe,startOfWeek:function(b){return i.ISOWeek?uf(b):ba(b,{locale:f,weekStartsOn:u})},endOfWeek:function(b){return i.ISOWeek?AG(b):h5(b,{locale:f,weekStartsOn:u})}},p=h[n](e,r==="after"?1:-1);r==="before"&&l?p=UUe([l,p]):r==="after"&&c&&(p=zUe([c,p]));var m=!0;if(o){var y=b5(p,o);m=!y.disabled&&!y.hidden}return m?p:s.count>AVe?s.lastFocused:zG(p,{moveBy:n,direction:r,context:i,modifiers:o,retry:Dt(Dt({},s),{count:s.count+1})})}var WG=v.createContext(void 0);function PVe(e){var t=Qm(),n=UG(),r=v.useState(),i=r[0],o=r[1],a=v.useState(),s=a[0],u=a[1],l=OVe(t.displayMonths,n),c=i??(s&&t.isDateDisplayed(s))?s:l,f=function(){u(i),o(void 0)},h=function(b){o(b)},p=Kn(),m=function(b,w){if(i){var x=zG(i,{moveBy:b,direction:w,context:p,modifiers:n});so(i,x)||(t.goToDate(x,i),h(x))}},y={focusedDay:i,focusTarget:c,blur:f,focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return I.jsx(WG.Provider,{value:y,children:e.children})}function x5(){var e=v.useContext(WG);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function kVe(e,t){var n=UG(),r=b5(e,n,t);return r}var w5=v.createContext(void 0);function TVe(e){if(!D2(e.initialProps)){var t={selected:void 0};return I.jsx(w5.Provider,{value:t,children:e.children})}return I.jsx(MVe,{initialProps:e.initialProps,children:e.children})}function MVe(e){var t=e.initialProps,n=e.children,r=function(o,a,s){var u,l,c;if((u=t.onDayClick)===null||u===void 0||u.call(t,o,a,s),a.selected&&!t.required){(l=t.onSelect)===null||l===void 0||l.call(t,void 0,o,a,s);return}(c=t.onSelect)===null||c===void 0||c.call(t,o,o,a,s)},i={selected:t.selected,onDayClick:r};return I.jsx(w5.Provider,{value:i,children:n})}function VG(){var e=v.useContext(w5);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function RVe(e,t){var n=Kn(),r=VG(),i=m5(),o=y5(),a=x5(),s=a.focusDayAfter,u=a.focusDayBefore,l=a.focusWeekAfter,c=a.focusWeekBefore,f=a.blur,h=a.focus,p=a.focusMonthBefore,m=a.focusMonthAfter,y=a.focusYearBefore,b=a.focusYearAfter,w=a.focusStartOfWeek,x=a.focusEndOfWeek,S=function(H){var j,K,Y,oe;D2(n)?(j=r.onDayClick)===null||j===void 0||j.call(r,e,t,H):Zm(n)?(K=i.onDayClick)===null||K===void 0||K.call(i,e,t,H):Xm(n)?(Y=o.onDayClick)===null||Y===void 0||Y.call(o,e,t,H):(oe=n.onDayClick)===null||oe===void 0||oe.call(n,e,t,H)},O=function(H){var j;h(e),(j=n.onDayFocus)===null||j===void 0||j.call(n,e,t,H)},E=function(H){var j;f(),(j=n.onDayBlur)===null||j===void 0||j.call(n,e,t,H)},C=function(H){var j;(j=n.onDayMouseEnter)===null||j===void 0||j.call(n,e,t,H)},P=function(H){var j;(j=n.onDayMouseLeave)===null||j===void 0||j.call(n,e,t,H)},M=function(H){var j;(j=n.onDayPointerEnter)===null||j===void 0||j.call(n,e,t,H)},N=function(H){var j;(j=n.onDayPointerLeave)===null||j===void 0||j.call(n,e,t,H)},B=function(H){var j;(j=n.onDayTouchCancel)===null||j===void 0||j.call(n,e,t,H)},V=function(H){var j;(j=n.onDayTouchEnd)===null||j===void 0||j.call(n,e,t,H)},W=function(H){var j;(j=n.onDayTouchMove)===null||j===void 0||j.call(n,e,t,H)},ne=function(H){var j;(j=n.onDayTouchStart)===null||j===void 0||j.call(n,e,t,H)},Z=function(H){var j;(j=n.onDayKeyUp)===null||j===void 0||j.call(n,e,t,H)},q=function(H){var j;switch(H.key){case"ArrowLeft":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?s():u();break;case"ArrowRight":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?u():s();break;case"ArrowDown":H.preventDefault(),H.stopPropagation(),l();break;case"ArrowUp":H.preventDefault(),H.stopPropagation(),c();break;case"PageUp":H.preventDefault(),H.stopPropagation(),H.shiftKey?y():p();break;case"PageDown":H.preventDefault(),H.stopPropagation(),H.shiftKey?b():m();break;case"Home":H.preventDefault(),H.stopPropagation(),w();break;case"End":H.preventDefault(),H.stopPropagation(),x();break}(j=n.onDayKeyDown)===null||j===void 0||j.call(n,e,t,H)},G={onClick:S,onFocus:O,onBlur:E,onKeyDown:q,onKeyUp:Z,onMouseEnter:C,onMouseLeave:P,onPointerEnter:M,onPointerLeave:N,onTouchCancel:B,onTouchEnd:V,onTouchMove:W,onTouchStart:ne};return G}function DVe(){var e=Kn(),t=VG(),n=m5(),r=y5(),i=D2(e)?t.selected:Zm(e)?n.selected:Xm(e)?r.selected:void 0;return i}function $Ve(e){return Object.values(Qa).includes(e)}function IVe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if($Ve(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function NVe(e,t){var n=Dt({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Dt(Dt({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function LVe(e,t,n){var r,i,o,a=Kn(),s=x5(),u=kVe(e,t),l=RVe(e,u),c=DVe(),f=!!(a.onDayClick||a.mode!=="default");v.useEffect(function(){var C;u.outside||s.focusedDay&&f&&so(s.focusedDay,e)&&((C=n.current)===null||C===void 0||C.focus())},[s.focusedDay,e,n,f,u.outside]);var h=IVe(a,u).join(" "),p=NVe(a,u),m=!!(u.outside&&!a.showOutsideDays||u.hidden),y=(o=(i=a.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:iVe,b=I.jsx(y,{date:e,displayMonth:t,activeModifiers:u}),w={style:p,className:h,children:b,role:"gridcell"},x=s.focusTarget&&so(s.focusTarget,e)&&!u.outside,S=s.focusedDay&&so(s.focusedDay,e),O=Dt(Dt(Dt({},w),(r={disabled:u.disabled,role:"gridcell"},r["aria-selected"]=u.selected,r.tabIndex=S||x?0:-1,r)),l),E={isButton:f,isHidden:m,activeModifiers:u,selectedDays:c,buttonProps:O,divProps:w};return E}function FVe(e){var t=v.useRef(null),n=LVe(e.date,e.displayMonth,t);return n.isHidden?I.jsx("div",{role:"gridcell"}):n.isButton?I.jsx(Dx,Dt({name:"day",ref:t},n.buttonProps)):I.jsx("div",Dt({},n.divProps))}function jVe(e){var t=e.number,n=e.dates,r=Kn(),i=r.onWeekNumberClick,o=r.styles,a=r.classNames,s=r.locale,u=r.labels.labelWeekNumber,l=r.formatters.formatWeekNumber,c=l(Number(t),{locale:s});if(!i)return I.jsx("span",{className:a.weeknumber,style:o.weeknumber,children:c});var f=u(Number(t),{locale:s}),h=function(p){i(t,n,p)};return I.jsx(Dx,{name:"week-number","aria-label":f,className:a.weeknumber,style:o.weeknumber,onClick:h,children:c})}function BVe(e){var t,n,r=Kn(),i=r.styles,o=r.classNames,a=r.showWeekNumber,s=r.components,u=(t=s?.Day)!==null&&t!==void 0?t:FVe,l=(n=s?.WeekNumber)!==null&&n!==void 0?n:jVe,c;return a&&(c=I.jsx("td",{className:o.cell,style:i.cell,children:I.jsx(l,{number:e.weekNumber,dates:e.dates})})),I.jsxs("tr",{className:o.row,style:i.row,children:[c,e.dates.map(function(f){return I.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:I.jsx(u,{displayMonth:e.displayMonth,date:f})},Bze(f))})]})}function aN(e,t,n){for(var r=n?.ISOWeek?AG(t):h5(t,n),i=n?.ISOWeek?uf(e):ba(e,n),o=bs(r,i),a=[],s=0;s<=o;s++)a.push(Ui(i,s));var u=a.reduce(function(l,c){var f=n?.ISOWeek?TG(c):RG(c,n),h=l.find(function(p){return p.weekNumber===f});return h?(h.dates.push(c),l):(l.push({weekNumber:f,dates:[c]}),l)},[]);return u}function UVe(e,t){var n=aN(po(e),d5(e),t);if(t?.useFixedWeeks){var r=zze(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],a=k4(o,6-r),s=aN(k4(o,1),a,t);n.push.apply(n,s)}}return n}function zVe(e){var t,n,r,i=Kn(),o=i.locale,a=i.classNames,s=i.styles,u=i.hideHead,l=i.fixedWeeks,c=i.components,f=i.weekStartsOn,h=i.firstWeekContainsDate,p=i.ISOWeek,m=UVe(e.displayMonth,{useFixedWeeks:!!l,ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:h}),y=(t=c?.Head)!==null&&t!==void 0?t:rVe,b=(n=c?.Row)!==null&&n!==void 0?n:BVe,w=(r=c?.Footer)!==null&&r!==void 0?r:eVe;return I.jsxs("table",{id:e.id,className:a.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!u&&I.jsx(y,{}),I.jsx("tbody",{className:a.tbody,style:s.tbody,children:m.map(function(x){return I.jsx(b,{displayMonth:e.displayMonth,dates:x.dates,weekNumber:x.weekNumber},x.weekNumber)})}),I.jsx(w,{displayMonth:e.displayMonth})]})}function WVe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var VVe=WVe()?v.useLayoutEffect:v.useEffect,B3=!1,HVe=0;function sN(){return"react-day-picker-".concat(++HVe)}function qVe(e){var t,n=e??(B3?sN():null),r=v.useState(n),i=r[0],o=r[1];return VVe(function(){i===null&&o(sN())},[]),v.useEffect(function(){B3===!1&&(B3=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function KVe(e){var t,n,r=Kn(),i=r.dir,o=r.classNames,a=r.styles,s=r.components,u=Qm().displayMonths,l=qVe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),c=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],h=a.month,p=e.displayIndex===0,m=e.displayIndex===u.length-1,y=!p&&!m;i==="rtl"&&(t=[p,m],m=t[0],p=t[1]),p&&(f.push(o.caption_start),h=Dt(Dt({},h),a.caption_start)),m&&(f.push(o.caption_end),h=Dt(Dt({},h),a.caption_end)),y&&(f.push(o.caption_between),h=Dt(Dt({},h),a.caption_between));var b=(n=s?.Caption)!==null&&n!==void 0?n:JWe;return I.jsxs("div",{className:f.join(" "),style:h,children:[I.jsx(b,{id:l,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),I.jsx(zVe,{id:c,"aria-labelledby":l,displayMonth:e.displayMonth})]},e.displayIndex)}function GVe(e){var t=Kn(),n=t.classNames,r=t.styles;return I.jsx("div",{className:n.months,style:r.months,children:e.children})}function YVe(e){var t,n,r=e.initialProps,i=Kn(),o=x5(),a=Qm(),s=v.useState(!1),u=s[0],l=s[1];v.useEffect(function(){i.initialFocus&&o.focusTarget&&(u||(o.focus(o.focusTarget),l(!0)))},[i.initialFocus,u,o.focus,o.focusTarget,o]);var c=[i.classNames.root,i.className];i.numberOfMonths>1&&c.push(i.classNames.multiple_months),i.showWeekNumber&&c.push(i.classNames.with_weeknumber);var f=Dt(Dt({},i.styles.root),i.style),h=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,y){var b;return Dt(Dt({},m),(b={},b[y]=r[y],b))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:GVe;return I.jsx("div",Dt({className:c.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:I.jsx(p,{children:a.displayMonths.map(function(m,y){return I.jsx(KVe,{displayIndex:y,displayMonth:m},y)})})}))}function ZVe(e){var t=e.children,n=xWe(e,["children"]);return I.jsx(jWe,{initialProps:n,children:I.jsx(YWe,{children:I.jsx(TVe,{initialProps:n,children:I.jsx(oVe,{initialProps:n,children:I.jsx(uVe,{initialProps:n,children:I.jsx(mVe,{children:I.jsx(PVe,{children:t})})})})})})})}function gtt(e){return I.jsx(ZVe,Dt({},e,{children:I.jsx(YVe,{initialProps:e})}))}function XVe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var _5=e=>{const{present:t,children:n}=e,r=QVe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,JVe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};_5.displayName="Presence";function QVe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=XVe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Uy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Uy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=Uy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=Uy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Uy(e){return e?.animationName||"none"}function JVe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var S5="Popover",[HG,mtt]=Di(S5,[zl]),Jm=zl(),[eHe,Zl]=HG(S5),qG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!1}=e,s=Jm(t),u=v.useRef(null),[l,c]=v.useState(!1),[f=!1,h]=Ts({prop:r,defaultProp:i,onChange:o});return I.jsx(kw,{...s,children:I.jsx(eHe,{scope:t,contentId:Lo(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>c(!0),[]),onCustomAnchorRemove:v.useCallback(()=>c(!1),[]),modal:a,children:n})})};qG.displayName=S5;var KG="PopoverAnchor",tHe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(KG,n),o=Jm(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return v.useEffect(()=>(a(),()=>s()),[a,s]),I.jsx(Dm,{...o,...r,ref:t})});tHe.displayName=KG;var GG="PopoverTrigger",YG=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(GG,n),o=Jm(n),a=Nt(t,i.triggerRef),s=I.jsx(gt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":eY(i.open),...r,ref:a,onClick:Ye(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:I.jsx(Dm,{asChild:!0,...o,children:s})});YG.displayName=GG;var C5="PopoverPortal",[nHe,rHe]=HG(C5,{forceMount:void 0}),ZG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=Zl(C5,t);return I.jsx(nHe,{scope:t,forceMount:n,children:I.jsx(_5,{present:n||o.open,children:I.jsx(jh,{asChild:!0,container:i,children:r})})})};ZG.displayName=C5;var Oh="PopoverContent",XG=v.forwardRef((e,t)=>{const n=rHe(Oh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=Zl(Oh,e.__scopePopover);return I.jsx(_5,{present:r||o.open,children:o.modal?I.jsx(iHe,{...i,ref:t}):I.jsx(oHe,{...i,ref:t})})});XG.displayName=Oh;var iHe=v.forwardRef((e,t)=>{const n=Zl(Oh,e.__scopePopover),r=v.useRef(null),i=Nt(t,r),o=v.useRef(!1);return v.useEffect(()=>{const a=r.current;if(a)return Mm(a)},[]),I.jsx(Tm,{as:Pl,allowPinchZoom:!0,children:I.jsx(QG,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ye(e.onCloseAutoFocus,a=>{a.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ye(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,l=s.button===2||u;o.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Ye(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),oHe=v.forwardRef((e,t)=>{const n=Zl(Oh,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return I.jsx(QG,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),QG=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:c,...f}=e,h=Zl(Oh,n),p=Jm(n);return Ew(),I.jsx(km,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:c,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:I.jsx(Tw,{"data-state":eY(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.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)"}})})})}),JG="PopoverClose",aHe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(JG,n);return I.jsx(gt.button,{type:"button",...r,ref:t,onClick:Ye(e.onClick,()=>i.onOpenChange(!1))})});aHe.displayName=JG;var sHe="PopoverArrow",uHe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Jm(n);return I.jsx(Mw,{...i,...r,ref:t})});uHe.displayName=sHe;function eY(e){return e?"open":"closed"}var vtt=qG,ytt=YG,btt=ZG,xtt=XG;function lHe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var ev=e=>{const{present:t,children:n}=e,r=cHe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,fHe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};ev.displayName="Presence";function cHe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=lHe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=zy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=zy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=zy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=zy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function zy(e){return e?.animationName||"none"}function fHe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function dHe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var E5="ScrollArea",[tY,wtt]=Di(E5),[hHe,_a]=tY(E5),nY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[s,u]=v.useState(null),[l,c]=v.useState(null),[f,h]=v.useState(null),[p,m]=v.useState(null),[y,b]=v.useState(null),[w,x]=v.useState(0),[S,O]=v.useState(0),[E,C]=v.useState(!1),[P,M]=v.useState(!1),N=Nt(t,V=>u(V)),B=Em(i);return I.jsx(hHe,{scope:n,type:r,dir:B,scrollHideDelay:o,scrollArea:s,viewport:l,onViewportChange:c,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:b,scrollbarYEnabled:P,onScrollbarYEnabledChange:M,onCornerWidthChange:x,onCornerHeightChange:O,children:I.jsx(gt.div,{dir:B,...a,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});nY.displayName=E5;var rY="ScrollAreaViewport",iY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,a=_a(rY,n),s=v.useRef(null),u=Nt(t,s,a.onViewportChange);return I.jsxs(I.Fragment,{children:[I.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:i}),I.jsx(gt.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:I.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});iY.displayName=rY;var $s="ScrollAreaScrollbar",pHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_a($s,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,s=e.orientation==="horizontal";return v.useEffect(()=>(s?o(!0):a(!0),()=>{s?o(!1):a(!1)}),[s,o,a]),i.type==="hover"?I.jsx(gHe,{...r,ref:t,forceMount:n}):i.type==="scroll"?I.jsx(mHe,{...r,ref:t,forceMount:n}):i.type==="auto"?I.jsx(oY,{...r,ref:t,forceMount:n}):i.type==="always"?I.jsx(O5,{...r,ref:t}):null});pHe.displayName=$s;var gHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_a($s,e.__scopeScrollArea),[o,a]=v.useState(!1);return v.useEffect(()=>{const s=i.scrollArea;let u=0;if(s){const l=()=>{window.clearTimeout(u),a(!0)},c=()=>{u=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return s.addEventListener("pointerenter",l),s.addEventListener("pointerleave",c),()=>{window.clearTimeout(u),s.removeEventListener("pointerenter",l),s.removeEventListener("pointerleave",c)}}},[i.scrollArea,i.scrollHideDelay]),I.jsx(ev,{present:n||o,children:I.jsx(oY,{"data-state":o?"visible":"hidden",...r,ref:t})})}),mHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_a($s,e.__scopeScrollArea),o=e.orientation==="horizontal",a=I2(()=>u("SCROLL_END"),100),[s,u]=dHe("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 v.useEffect(()=>{if(s==="idle"){const l=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[s,i.scrollHideDelay,u]),v.useEffect(()=>{const l=i.viewport,c=o?"scrollLeft":"scrollTop";if(l){let f=l[c];const h=()=>{const p=l[c];f!==p&&(u("SCROLL"),a()),f=p};return l.addEventListener("scroll",h),()=>l.removeEventListener("scroll",h)}},[i.viewport,o,u,a]),I.jsx(ev,{present:n||s!=="hidden",children:I.jsx(O5,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ye(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ye(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),oY=v.forwardRef((e,t)=>{const n=_a($s,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=v.useState(!1),s=e.orientation==="horizontal",u=I2(()=>{if(n.viewport){const l=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=_a($s,e.__scopeScrollArea),o=v.useRef(null),a=v.useRef(0),[s,u]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=lY(s.viewport,s.content),c={...r,sizes:s,onSizesChange:u,hasThumb:l>0&&l<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function f(h,p){return SHe(h,a.current,s,p)}return n==="horizontal"?I.jsx(vHe,{...c,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const h=i.viewport.scrollLeft,p=uN(h,s,i.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=f(h,i.dir))}}):n==="vertical"?I.jsx(yHe,{...c,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const h=i.viewport.scrollTop,p=uN(h,s);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=f(h))}}):null}),vHe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=_a($s,e.__scopeScrollArea),[a,s]=v.useState(),u=v.useRef(null),l=Nt(t,u,o.onScrollbarXChange);return v.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),I.jsx(sY,{"data-orientation":"horizontal",...i,ref:l,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":$2(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,f)=>{if(o.viewport){const h=o.viewport.scrollLeft+c.deltaX;e.onWheelScroll(h),fY(h,f)&&c.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Ix(a.paddingLeft),paddingEnd:Ix(a.paddingRight)}})}})}),yHe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=_a($s,e.__scopeScrollArea),[a,s]=v.useState(),u=v.useRef(null),l=Nt(t,u,o.onScrollbarYChange);return v.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),I.jsx(sY,{"data-orientation":"vertical",...i,ref:l,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":$2(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,f)=>{if(o.viewport){const h=o.viewport.scrollTop+c.deltaY;e.onWheelScroll(h),fY(h,f)&&c.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Ix(a.paddingTop),paddingEnd:Ix(a.paddingBottom)}})}})}),[bHe,aY]=tY($s),sY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:u,onDragScroll:l,onWheelScroll:c,onResize:f,...h}=e,p=_a($s,n),[m,y]=v.useState(null),b=Nt(t,N=>y(N)),w=v.useRef(null),x=v.useRef(""),S=p.viewport,O=r.content-r.viewport,E=Vr(c),C=Vr(u),P=I2(f,10);function M(N){if(w.current){const B=N.clientX-w.current.left,V=N.clientY-w.current.top;l({x:B,y:V})}}return v.useEffect(()=>{const N=B=>{const V=B.target;m?.contains(V)&&E(B,O)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[S,m,O,E]),v.useEffect(C,[r,C]),Ah(m,P),Ah(p.content,P),I.jsx(bHe,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Vr(o),onThumbPointerUp:Vr(a),onThumbPositionChange:C,onThumbPointerDown:Vr(s),children:I.jsx(gt.div,{...h,ref:b,style:{position:"absolute",...h.style},onPointerDown:Ye(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),w.current=m.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),M(N))}),onPointerMove:Ye(e.onPointerMove,M),onPointerUp:Ye(e.onPointerUp,N=>{const B=N.target;B.hasPointerCapture(N.pointerId)&&B.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),w.current=null})})})}),$x="ScrollAreaThumb",xHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=aY($x,e.__scopeScrollArea);return I.jsx(ev,{present:n||i.hasThumb,children:I.jsx(wHe,{ref:t,...r})})}),wHe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=_a($x,n),a=aY($x,n),{onThumbPositionChange:s}=a,u=Nt(t,f=>a.onThumbChange(f)),l=v.useRef(void 0),c=I2(()=>{l.current&&(l.current(),l.current=void 0)},100);return v.useEffect(()=>{const f=o.viewport;if(f){const h=()=>{if(c(),!l.current){const p=CHe(f,s);l.current=p,s()}};return s(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[o.viewport,c,s]),I.jsx(gt.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ye(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),m=f.clientX-p.left,y=f.clientY-p.top;a.onThumbPointerDown({x:m,y})}),onPointerUp:Ye(e.onPointerUp,a.onThumbPointerUp)})});xHe.displayName=$x;var A5="ScrollAreaCorner",uY=v.forwardRef((e,t)=>{const n=_a(A5,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?I.jsx(_He,{...e,ref:t}):null});uY.displayName=A5;var _He=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=_a(A5,n),[o,a]=v.useState(0),[s,u]=v.useState(0),l=!!(o&&s);return Ah(i.scrollbarX,()=>{const c=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(c),u(c)}),Ah(i.scrollbarY,()=>{const c=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(c),a(c)}),l?I.jsx(gt.div,{...r,ref:t,style:{width:o,height:s,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ix(e){return e?parseInt(e,10):0}function lY(e,t){const n=e/t;return isNaN(n)?0:n}function $2(e){const t=lY(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function SHe(e,t,n,r="ltr"){const i=$2(n),o=i/2,a=t||o,s=i-a,u=n.scrollbar.paddingStart+a,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,c=n.content-n.viewport,f=r==="ltr"?[0,c]:[c*-1,0];return cY([u,l],f)(e)}function uN(e,t,n="ltr"){const r=$2(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,s=o-r,u=n==="ltr"?[0,a]:[a*-1,0],l=S4(e,u);return cY([0,a],[0,s])(l)}function cY(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function fY(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,s=n.top!==o.top;(a||s)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function I2(e,t){const n=Vr(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ah(e,t){const n=Vr(t);On(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var _tt=nY,Stt=iY,Ctt=uY,P5="Progress",k5=100,[EHe,Ett]=Di(P5),[OHe,AHe]=EHe(P5),dY=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=PHe,...a}=e;(i||i===0)&&!lN(i)&&console.error(kHe(`${i}`,"Progress"));const s=lN(i)?i:k5;r!==null&&!cN(r,s)&&console.error(THe(`${r}`,"Progress"));const u=cN(r,s)?r:null,l=Nx(u)?o(u,s):void 0;return I.jsx(OHe,{scope:n,value:u,max:s,children:I.jsx(gt.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Nx(u)?u:void 0,"aria-valuetext":l,role:"progressbar","data-state":gY(u,s),"data-value":u??void 0,"data-max":s,...a,ref:t})})});dY.displayName=P5;var hY="ProgressIndicator",pY=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=AHe(hY,n);return I.jsx(gt.div,{"data-state":gY(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});pY.displayName=hY;function PHe(e,t){return`${Math.round(e/t*100)}%`}function gY(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Nx(e){return typeof e=="number"}function lN(e){return Nx(e)&&!isNaN(e)&&e>0}function cN(e,t){return Nx(e)&&!isNaN(e)&&e<=t&&e>=0}function kHe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${k5}\`.`}function THe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qK(e,t){if(e){if(typeof e=="string")return w4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w4(e,t)}}function rUe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iUe(e){if(Array.isArray(e))return w4(e)}function w4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?a:t&&t.length&&Ke(i)&&Ke(o)?t.slice(i,o+1):[]};function YK(e){return e==="number"?[0,"auto"]:void 0}var _4=function(t,n,r,i){var o=t.graphicalItems,a=t.tooltipAxis,s=k2(n,t);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(u,l){var c,f=(c=l.props.data)!==null&&c!==void 0?c:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(a.dataKey&&!a.allowDuplicatedCategory){var p=f===void 0?s:f;h=Tb(p,a.dataKey,i)}else h=f&&f[r]||s[r];return h?[].concat(Eh(u),[Lq(l,h)]):u},[])},GI=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},a=uUe(o,r),s=t.orderedTooltipTicks,u=t.tooltipAxis,l=t.tooltipTicks,c=cDe(a,s,l,u);if(c>=0&&l){var f=l[c]&&l[c].value,h=_4(t,n,c,f),p=lUe(r,s,c,o);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},cUe=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.layout,f=t.children,h=t.stackOffset,p=$q(c,o);return r.reduce(function(m,y){var b,w=y.type.defaultProps!==void 0?Ee(Ee({},y.type.defaultProps),y.props):y.props,x=w.type,S=w.dataKey,O=w.allowDataOverflow,E=w.allowDuplicatedCategory,C=w.scale,P=w.ticks,M=w.includeHidden,N=w[a];if(m[N])return m;var B=k2(t.data,{graphicalItems:i.filter(function(X){var Q,ue=a in X.props?X.props[a]:(Q=X.type.defaultProps)===null||Q===void 0?void 0:Q[a];return ue===N}),dataStartIndex:u,dataEndIndex:l}),V=B.length,W,ne,Z;NBe(w.domain,O,x)&&(W=N6(w.domain,null,O),p&&(x==="number"||C!=="auto")&&(Z=k0(B,S,"category")));var q=YK(x);if(!W||W.length===0){var G,H=(G=w.domain)!==null&&G!==void 0?G:q;if(S){if(W=k0(B,S,x),x==="category"&&p){var j=QSe(W);E&&j?(ne=W,W=px(0,V)):E||(W=_$(H,W,y).reduce(function(X,Q){return X.indexOf(Q)>=0?X:[].concat(Eh(X),[Q])},[]))}else if(x==="category")E?W=W.filter(function(X){return X!==""&&!Vt(X)}):W=_$(H,W,y).reduce(function(X,Q){return X.indexOf(Q)>=0||Q===""||Vt(Q)?X:[].concat(Eh(X),[Q])},[]);else if(x==="number"){var K=gDe(B,i.filter(function(X){var Q,ue,de=a in X.props?X.props[a]:(Q=X.type.defaultProps)===null||Q===void 0?void 0:Q[a],Se="hide"in X.props?X.props.hide:(ue=X.type.defaultProps)===null||ue===void 0?void 0:ue.hide;return de===N&&(M||!Se)}),S,o,c);K&&(W=K)}p&&(x==="number"||C!=="auto")&&(Z=k0(B,S,"category"))}else p?W=px(0,V):s&&s[N]&&s[N].hasStack&&x==="number"?W=h==="expand"?[0,1]:Nq(s[N].stackGroups,u,l):W=Dq(B,i.filter(function(X){var Q=a in X.props?X.props[a]:X.type.defaultProps[a],ue="hide"in X.props?X.props.hide:X.type.defaultProps.hide;return Q===N&&(M||!ue)}),x,c,!0);if(x==="number")W=b4(f,W,N,o,P),H&&(W=N6(H,W,O));else if(x==="category"&&H){var Y=H,oe=W.every(function(X){return Y.indexOf(X)>=0});oe&&(W=Y)}}return Ee(Ee({},m),{},Tt({},N,Ee(Ee({},w),{},{axisType:o,domain:W,categoricalDomain:Z,duplicateDomain:ne,originalDomain:(b=w.domain)!==null&&b!==void 0?b:q,isCategorical:p,layout:c})))},{})},fUe=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.layout,f=t.children,h=k2(t.data,{graphicalItems:r,dataStartIndex:u,dataEndIndex:l}),p=h.length,m=$q(c,o),y=-1;return r.reduce(function(b,w){var x=w.type.defaultProps!==void 0?Ee(Ee({},w.type.defaultProps),w.props):w.props,S=x[a],O=YK("number");if(!b[S]){y++;var E;return m?E=px(0,p):s&&s[S]&&s[S].hasStack?(E=Nq(s[S].stackGroups,u,l),E=b4(f,E,S,o)):(E=N6(O,Dq(h,r.filter(function(C){var P,M,N=a in C.props?C.props[a]:(P=C.type.defaultProps)===null||P===void 0?void 0:P[a],B="hide"in C.props?C.props.hide:(M=C.type.defaultProps)===null||M===void 0?void 0:M.hide;return N===S&&!B}),"number",c),i.defaultProps.allowDataOverflow),E=b4(f,E,S,o)),Ee(Ee({},b),{},Tt({},S,Ee(Ee({axisType:o},i.defaultProps),{},{hide:!0,orientation:pa(aUe,"".concat(o,".").concat(y%2),null),domain:E,originalDomain:O,isCategorical:m,layout:c})))}return b},{})},dUe=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.children,f="".concat(i,"Id"),h=ho(c,o),p={};return h.length?p=cUe(t,{axes:h,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:u,dataEndIndex:l}):a&&a.length&&(p=fUe(t,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:u,dataEndIndex:l})),p},hUe=function(t){var n=rl(t),r=su(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:SP(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:ox(n,r)}},YI=function(t){var n=t.children,r=t.defaultShowTooltip,i=ko(n,dh),o=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},pUe=function(t){return!t||!t.length?!1:t.some(function(n){var r=fu(n&&n.type);return r&&r.indexOf("Bar")>=0})},ZI=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},gUe=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,a=o===void 0?{}:o,s=t.yAxisMap,u=s===void 0?{}:s,l=r.width,c=r.height,f=r.children,h=r.margin||{},p=ko(f,dh),m=ko(f,Id),y=Object.keys(u).reduce(function(E,C){var P=u[C],M=P.orientation;return!P.mirror&&!P.hide?Ee(Ee({},E),{},Tt({},M,E[M]+P.width)):E},{left:h.left||0,right:h.right||0}),b=Object.keys(a).reduce(function(E,C){var P=a[C],M=P.orientation;return!P.mirror&&!P.hide?Ee(Ee({},E),{},Tt({},M,pa(E,"".concat(M))+P.height)):E},{top:h.top||0,bottom:h.bottom||0}),w=Ee(Ee({},b),y),x=w.bottom;p&&(w.bottom+=p.props.height||dh.defaultProps.height),m&&n&&(w=hDe(w,i,r,n));var S=l-w.left-w.right,O=c-w.top-w.bottom;return Ee(Ee({brushBottom:x},w),{},{width:Math.max(S,0),height:Math.max(O,0)})},mUe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},vUe=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,a=t.validateTooltipEventTypes,s=a===void 0?["axis"]:a,u=t.axisComponents,l=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,h=function(w,x){var S=x.graphicalItems,O=x.stackGroups,E=x.offset,C=x.updateId,P=x.dataStartIndex,M=x.dataEndIndex,N=w.barSize,B=w.layout,V=w.barGap,W=w.barCategoryGap,ne=w.maxBarSize,Z=ZI(B),q=Z.numericAxisName,G=Z.cateAxisName,H=pUe(S),j=[];return S.forEach(function(K,Y){var oe=k2(w.data,{graphicalItems:[K],dataStartIndex:P,dataEndIndex:M}),X=K.type.defaultProps!==void 0?Ee(Ee({},K.type.defaultProps),K.props):K.props,Q=X.dataKey,ue=X.maxBarSize,de=X["".concat(q,"Id")],Se=X["".concat(G,"Id")],me={},Ze=u.reduce(function(ze,je){var ke=x["".concat(je.axisType,"Map")],nt=X["".concat(je.axisType,"Id")];ke&&ke[nt]||je.axisType==="zAxis"||of();var vt=ke[nt];return Ee(Ee({},ze),{},Tt(Tt({},je.axisType,vt),"".concat(je.axisType,"Ticks"),su(vt)))},me),Ae=Ze[G],Le=Ze["".concat(G,"Ticks")],$e=O&&O[de]&&O[de].hasStack&&ADe(K,O[de].stackGroups),be=fu(K.type).indexOf("Bar")>=0,bt=ox(Ae,Le),lt=[],Ft=H&&fDe({barSize:N,stackGroups:O,totalSize:mUe(Ze,G)});if(be){var yn,nn,ie=Vt(ue)?ne:ue,pe=(yn=(nn=ox(Ae,Le,!0))!==null&&nn!==void 0?nn:ie)!==null&&yn!==void 0?yn:0;lt=dDe({barGap:V,barCategoryGap:W,bandSize:pe!==bt?pe:bt,sizeList:Ft[Se],maxBarSize:ie}),pe!==bt&&(lt=lt.map(function(ze){return Ee(Ee({},ze),{},{position:Ee(Ee({},ze.position),{},{offset:ze.position.offset-pe/2})})}))}var ye=K&&K.type&&K.type.getComposedData;ye&&j.push({props:Ee(Ee({},ye(Ee(Ee({},Ze),{},{displayedData:oe,props:w,dataKey:Q,item:K,bandSize:bt,barPosition:lt,offset:E,stackedData:$e,layout:B,dataStartIndex:P,dataEndIndex:M}))),{},Tt(Tt(Tt({key:K.key||"item-".concat(Y)},q,Ze[q]),G,Ze[G]),"animationId",C)),childIndex:c3e(K,w.children),item:K})}),j},p=function(w,x){var S=w.props,O=w.dataStartIndex,E=w.dataEndIndex,C=w.updateId;if(!mD({props:S}))return null;var P=S.children,M=S.layout,N=S.stackOffset,B=S.data,V=S.reverseStackOrder,W=ZI(M),ne=W.numericAxisName,Z=W.cateAxisName,q=ho(P,r),G=CDe(B,q,"".concat(ne,"Id"),"".concat(Z,"Id"),N,V),H=u.reduce(function(X,Q){var ue="".concat(Q.axisType,"Map");return Ee(Ee({},X),{},Tt({},ue,dUe(S,Ee(Ee({},Q),{},{graphicalItems:q,stackGroups:Q.axisType===ne&&G,dataStartIndex:O,dataEndIndex:E}))))},{}),j=gUe(Ee(Ee({},H),{},{props:S,graphicalItems:q}),x?.legendBBox);Object.keys(H).forEach(function(X){H[X]=c(S,H[X],j,X.replace("Map",""),n)});var K=H["".concat(Z,"Map")],Y=hUe(K),oe=h(S,Ee(Ee({},H),{},{dataStartIndex:O,dataEndIndex:E,updateId:C,graphicalItems:q,stackGroups:G,offset:j}));return Ee(Ee({formattedGraphicalItems:oe,graphicalItems:q,offset:j,stackGroups:G},Y),H)},m=function(b){function w(x){var S,O,E;return YBe(this,w),E=QBe(this,w,[x]),Tt(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Tt(E,"accessibilityManager",new IBe),Tt(E,"handleLegendBBoxUpdate",function(C){if(C){var P=E.state,M=P.dataStartIndex,N=P.dataEndIndex,B=P.updateId;E.setState(Ee({legendBBox:C},p({props:E.props,dataStartIndex:M,dataEndIndex:N,updateId:B},Ee(Ee({},E.state),{},{legendBBox:C}))))}}),Tt(E,"handleReceiveSyncEvent",function(C,P,M){if(E.props.syncId===C){if(M===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(P)}}),Tt(E,"handleBrushChange",function(C){var P=C.startIndex,M=C.endIndex;if(P!==E.state.dataStartIndex||M!==E.state.dataEndIndex){var N=E.state.updateId;E.setState(function(){return Ee({dataStartIndex:P,dataEndIndex:M},p({props:E.props,dataStartIndex:P,dataEndIndex:M,updateId:N},E.state))}),E.triggerSyncEvent({dataStartIndex:P,dataEndIndex:M})}}),Tt(E,"handleMouseEnter",function(C){var P=E.getMouseInfo(C);if(P){var M=Ee(Ee({},P),{},{isTooltipActive:!0});E.setState(M),E.triggerSyncEvent(M);var N=E.props.onMouseEnter;qt(N)&&N(M,C)}}),Tt(E,"triggeredAfterMouseMove",function(C){var P=E.getMouseInfo(C),M=P?Ee(Ee({},P),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(M),E.triggerSyncEvent(M);var N=E.props.onMouseMove;qt(N)&&N(M,C)}),Tt(E,"handleItemMouseEnter",function(C){E.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),Tt(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),Tt(E,"handleMouseMove",function(C){C.persist(),E.throttleTriggeredAfterMouseMove(C)}),Tt(E,"handleMouseLeave",function(C){E.throttleTriggeredAfterMouseMove.cancel();var P={isTooltipActive:!1};E.setState(P),E.triggerSyncEvent(P);var M=E.props.onMouseLeave;qt(M)&&M(P,C)}),Tt(E,"handleOuterEvent",function(C){var P=l3e(C),M=pa(E.props,"".concat(P));if(P&&qt(M)){var N,B;/.*touch.*/i.test(P)?B=E.getMouseInfo(C.changedTouches[0]):B=E.getMouseInfo(C),M((N=B)!==null&&N!==void 0?N:{},C)}}),Tt(E,"handleClick",function(C){var P=E.getMouseInfo(C);if(P){var M=Ee(Ee({},P),{},{isTooltipActive:!0});E.setState(M),E.triggerSyncEvent(M);var N=E.props.onClick;qt(N)&&N(M,C)}}),Tt(E,"handleMouseDown",function(C){var P=E.props.onMouseDown;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),Tt(E,"handleMouseUp",function(C){var P=E.props.onMouseUp;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),Tt(E,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),Tt(E,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.handleMouseDown(C.changedTouches[0])}),Tt(E,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.handleMouseUp(C.changedTouches[0])}),Tt(E,"handleDoubleClick",function(C){var P=E.props.onDoubleClick;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),Tt(E,"handleContextMenu",function(C){var P=E.props.onContextMenu;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),Tt(E,"triggerSyncEvent",function(C){E.props.syncId!==void 0&&R3.emit(D3,E.props.syncId,C,E.eventEmitterSymbol)}),Tt(E,"applySyncEvent",function(C){var P=E.props,M=P.layout,N=P.syncMethod,B=E.state.updateId,V=C.dataStartIndex,W=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)E.setState(Ee({dataStartIndex:V,dataEndIndex:W},p({props:E.props,dataStartIndex:V,dataEndIndex:W,updateId:B},E.state)));else if(C.activeTooltipIndex!==void 0){var ne=C.chartX,Z=C.chartY,q=C.activeTooltipIndex,G=E.state,H=G.offset,j=G.tooltipTicks;if(!H)return;if(typeof N=="function")q=N(j,C);else if(N==="value"){q=-1;for(var K=0;K=0){var $e,be;if(ne.dataKey&&!ne.allowDuplicatedCategory){var bt=typeof ne.dataKey=="function"?Le:"payload.".concat(ne.dataKey.toString());$e=Tb(K,bt,q),be=Y&&oe&&Tb(oe,bt,q)}else $e=K?.[Z],be=Y&&oe&&oe[Z];if(Se||de){var lt=C.props.activeIndex!==void 0?C.props.activeIndex:Z;return[v.cloneElement(C,Ee(Ee(Ee({},N.props),Ze),{},{activeIndex:lt})),null,null]}if(!Vt($e))return[Ae].concat(Eh(E.renderActivePoints({item:N,activePoint:$e,basePoint:be,childIndex:Z,isRange:Y})))}else{var Ft,yn=(Ft=E.getItemByXY(E.state.activeCoordinate))!==null&&Ft!==void 0?Ft:{graphicalItem:Ae},nn=yn.graphicalItem,ie=nn.item,pe=ie===void 0?C:ie,ye=nn.childIndex,ze=Ee(Ee(Ee({},N.props),Ze),{},{activeIndex:ye});return[v.cloneElement(pe,ze),null,null]}return Y?[Ae,null,null]:[Ae,null]}),Tt(E,"renderCustomized",function(C,P,M){return v.cloneElement(C,Ee(Ee({key:"recharts-customized-".concat(M)},E.props),E.state))}),Tt(E,"renderMap",{CartesianGrid:{handler:By,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:By},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:By},YAxis:{handler:By},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((S=x.id)!==null&&S!==void 0?S:yf("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=MH(E.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),E.state={},E}return tUe(w,b),XBe(w,[{key:"componentDidMount",value:function(){var S,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var S=this.props,O=S.children,E=S.data,C=S.height,P=S.layout,M=ko(O,Js);if(M){var N=M.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var B=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,V=_4(this.state,E,N,B),W=this.state.tooltipTicks[N].coordinate,ne=(this.state.offset.top+C)/2,Z=P==="horizontal",q=Z?{x:W,y:ne}:{y:W,x:ne},G=this.state.formattedGraphicalItems.find(function(j){var K=j.item;return K.type.name==="Scatter"});G&&(q=Ee(Ee({},q),G.props.points[N].tooltipPosition),V=G.props.points[N].tooltipPayload);var H={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:B,activePayload:V,activeCoordinate:q};this.setState(H),this.renderCursor(M),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(S,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==S.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==S.margin){var E,C;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(S){XE([ko(S.children,Js)],[ko(this.props.children,Js)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var S=ko(this.props.children,Js);if(S&&typeof S.props.shared=="boolean"){var O=S.props.shared?"axis":"item";return s.indexOf(O)>=0?O:o}return o}},{key:"getMouseInfo",value:function(S){if(!this.container)return null;var O=this.container,E=O.getBoundingClientRect(),C=Nke(E),P={chartX:Math.round(S.pageX-C.left),chartY:Math.round(S.pageY-C.top)},M=E.width/O.offsetWidth||1,N=this.inRange(P.chartX,P.chartY,M);if(!N)return null;var B=this.state,V=B.xAxisMap,W=B.yAxisMap,ne=this.getTooltipEventType();if(ne!=="axis"&&V&&W){var Z=rl(V).scale,q=rl(W).scale,G=Z&&Z.invert?Z.invert(P.chartX):null,H=q&&q.invert?q.invert(P.chartY):null;return Ee(Ee({},P),{},{xValue:G,yValue:H})}var j=GI(this.state,this.props.data,this.props.layout,N);return j?Ee(Ee({},P),j):null}},{key:"inRange",value:function(S,O){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,P=S/E,M=O/E;if(C==="horizontal"||C==="vertical"){var N=this.state.offset,B=P>=N.left&&P<=N.left+N.width&&M>=N.top&&M<=N.top+N.height;return B?{x:P,y:M}:null}var V=this.state,W=V.angleAxisMap,ne=V.radiusAxisMap;if(W&&ne){var Z=rl(W);return E$({x:P,y:M},Z)}return null}},{key:"parseEventsOfWrapper",value:function(){var S=this.props.children,O=this.getTooltipEventType(),E=ko(S,Js),C={};E&&O==="axis"&&(E.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var P=Mb(this.props,this.handleOuterEvent);return Ee(Ee({},P),C)}},{key:"addListener",value:function(){R3.on(D3,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){R3.removeListener(D3,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(S,O,E){for(var C=this.state.formattedGraphicalItems,P=0,M=C.length;P(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var bUe=[" ","Enter","ArrowUp","ArrowDown"],xUe=[" ","Enter"],Gm="Select",[T2,M2,wUe]=oA(Gm),[op,Jet]=Di(Gm,[wUe,zl]),R2=zl(),[_Ue,Gl]=op(Gm),[SUe,CUe]=op(Gm),ZK=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:u,dir:l,name:c,autoComplete:f,disabled:h,required:p,form:m}=e,y=R2(t),[b,w]=v.useState(null),[x,S]=v.useState(null),[O,E]=v.useState(!1),C=Em(l),[P=!1,M]=Ts({prop:r,defaultProp:i,onChange:o}),[N,B]=Ts({prop:a,defaultProp:s,onChange:u}),V=v.useRef(null),W=b?m||!!b.closest("form"):!0,[ne,Z]=v.useState(new Set),q=Array.from(ne).map(G=>G.props.value).join(";");return I.jsx(kw,{...y,children:I.jsxs(_Ue,{required:p,scope:t,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:O,onValueNodeHasChildrenChange:E,contentId:Lo(),value:N,onValueChange:B,open:P,onOpenChange:M,dir:C,triggerPointerDownPosRef:V,disabled:h,children:[I.jsx(T2.Provider,{scope:t,children:I.jsx(SUe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(G=>{Z(H=>new Set(H).add(G))},[]),onNativeOptionRemove:v.useCallback(G=>{Z(H=>{const j=new Set(H);return j.delete(G),j})},[]),children:n})}),W?I.jsxs(_G,{"aria-hidden":!0,required:p,tabIndex:-1,name:c,autoComplete:f,value:N,onChange:G=>B(G.target.value),disabled:h,form:m,children:[N===void 0?I.jsx("option",{value:""}):null,Array.from(ne)]},q):null]})})};ZK.displayName=Gm;var XK="SelectTrigger",QK=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=R2(n),a=Gl(XK,n),s=a.disabled||r,u=Nt(t,a.onTriggerChange),l=M2(n),c=v.useRef("touch"),[f,h,p]=SG(y=>{const b=l().filter(S=>!S.disabled),w=b.find(S=>S.value===a.value),x=CG(b,y,w);x!==void 0&&a.onValueChange(x.value)}),m=y=>{s||(a.onOpenChange(!0),p()),y&&(a.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return I.jsx(Dm,{asChild:!0,...o,children:I.jsx(mt.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:s,"data-disabled":s?"":void 0,"data-placeholder":wG(a.value)?"":void 0,...i,ref:u,onClick:Ye(i.onClick,y=>{y.currentTarget.focus(),c.current!=="mouse"&&m(y)}),onPointerDown:Ye(i.onPointerDown,y=>{c.current=y.pointerType;const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(m(y),y.preventDefault())}),onKeyDown:Ye(i.onKeyDown,y=>{const b=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(b&&y.key===" ")&&bUe.includes(y.key)&&(m(),y.preventDefault())})})})});QK.displayName=XK;var JK="SelectValue",eG=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,u=Gl(JK,n),{onValueNodeHasChildrenChange:l}=u,c=o!==void 0,f=Nt(t,u.onValueNodeChange);return On(()=>{l(c)},[l,c]),I.jsx(mt.span,{...s,ref:f,style:{pointerEvents:"none"},children:wG(u.value)?I.jsx(I.Fragment,{children:a}):o})});eG.displayName=JK;var EUe="SelectIcon",tG=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return I.jsx(mt.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});tG.displayName=EUe;var OUe="SelectPortal",nG=e=>I.jsx(jh,{asChild:!0,...e});nG.displayName=OUe;var sf="SelectContent",rG=v.forwardRef((e,t)=>{const n=Gl(sf,e.__scopeSelect),[r,i]=v.useState();if(On(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Au.createPortal(I.jsx(iG,{scope:e.__scopeSelect,children:I.jsx(T2.Slot,{scope:e.__scopeSelect,children:I.jsx("div",{children:e.children})})}),o):null}return I.jsx(oG,{...e,ref:t})});rG.displayName=sf;var Ta=10,[iG,Yl]=op(sf),AUe="SelectContentImpl",oG=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:u,align:l,alignOffset:c,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:y,avoidCollisions:b,...w}=e,x=Gl(sf,n),[S,O]=v.useState(null),[E,C]=v.useState(null),P=Nt(t,me=>O(me)),[M,N]=v.useState(null),[B,V]=v.useState(null),W=M2(n),[ne,Z]=v.useState(!1),q=v.useRef(!1);v.useEffect(()=>{if(S)return Mm(S)},[S]),Ew();const G=v.useCallback(me=>{const[Ze,...Ae]=W().map(be=>be.ref.current),[Le]=Ae.slice(-1),$e=document.activeElement;for(const be of me)if(be===$e||(be?.scrollIntoView({block:"nearest"}),be===Ze&&E&&(E.scrollTop=0),be===Le&&E&&(E.scrollTop=E.scrollHeight),be?.focus(),document.activeElement!==$e))return},[W,E]),H=v.useCallback(()=>G([M,S]),[G,M,S]);v.useEffect(()=>{ne&&H()},[ne,H]);const{onOpenChange:j,triggerPointerDownPosRef:K}=x;v.useEffect(()=>{if(S){let me={x:0,y:0};const Ze=Le=>{me={x:Math.abs(Math.round(Le.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(Le.pageY)-(K.current?.y??0))}},Ae=Le=>{me.x<=10&&me.y<=10?Le.preventDefault():S.contains(Le.target)||j(!1),document.removeEventListener("pointermove",Ze),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",Ze),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ze),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[S,j,K]),v.useEffect(()=>{const me=()=>j(!1);return window.addEventListener("blur",me),window.addEventListener("resize",me),()=>{window.removeEventListener("blur",me),window.removeEventListener("resize",me)}},[j]);const[Y,oe]=SG(me=>{const Ze=W().filter($e=>!$e.disabled),Ae=Ze.find($e=>$e.ref.current===document.activeElement),Le=CG(Ze,me,Ae);Le&&setTimeout(()=>Le.ref.current.focus())}),X=v.useCallback((me,Ze,Ae)=>{const Le=!q.current&&!Ae;(x.value!==void 0&&x.value===Ze||Le)&&(N(me),Le&&(q.current=!0))},[x.value]),Q=v.useCallback(()=>S?.focus(),[S]),ue=v.useCallback((me,Ze,Ae)=>{const Le=!q.current&&!Ae;(x.value!==void 0&&x.value===Ze||Le)&&V(me)},[x.value]),de=r==="popper"?C4:aG,Se=de===C4?{side:s,sideOffset:u,align:l,alignOffset:c,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:y,avoidCollisions:b}:{};return I.jsx(iG,{scope:n,content:S,viewport:E,onViewportChange:C,itemRefCallback:X,selectedItem:M,onItemLeave:Q,itemTextRefCallback:ue,focusSelectedItem:H,selectedItemText:B,position:r,isPositioned:ne,searchRef:Y,children:I.jsx(Tm,{as:Pl,allowPinchZoom:!0,children:I.jsx(km,{asChild:!0,trapped:x.open,onMountAutoFocus:me=>{me.preventDefault()},onUnmountAutoFocus:Ye(i,me=>{x.trigger?.focus({preventScroll:!0}),me.preventDefault()}),children:I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:me=>me.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:I.jsx(de,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:me=>me.preventDefault(),...w,...Se,onPlaced:()=>Z(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ye(w.onKeyDown,me=>{const Ze=me.ctrlKey||me.altKey||me.metaKey;if(me.key==="Tab"&&me.preventDefault(),!Ze&&me.key.length===1&&oe(me.key),["ArrowUp","ArrowDown","Home","End"].includes(me.key)){let Le=W().filter($e=>!$e.disabled).map($e=>$e.ref.current);if(["ArrowUp","End"].includes(me.key)&&(Le=Le.slice().reverse()),["ArrowUp","ArrowDown"].includes(me.key)){const $e=me.target,be=Le.indexOf($e);Le=Le.slice(be+1)}setTimeout(()=>G(Le)),me.preventDefault()}})})})})})})});oG.displayName=AUe;var PUe="SelectItemAlignedPosition",aG=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Gl(sf,n),a=Yl(sf,n),[s,u]=v.useState(null),[l,c]=v.useState(null),f=Nt(t,P=>c(P)),h=M2(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:w,focusSelectedItem:x}=a,S=v.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&l&&y&&b&&w){const P=o.trigger.getBoundingClientRect(),M=l.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),B=w.getBoundingClientRect();if(o.dir!=="rtl"){const $e=B.left-M.left,be=N.left-$e,bt=P.left-be,lt=P.width+bt,Ft=Math.max(lt,M.width),yn=window.innerWidth-Ta,nn=S4(be,[Ta,Math.max(Ta,yn-Ft)]);s.style.minWidth=lt+"px",s.style.left=nn+"px"}else{const $e=M.right-B.right,be=window.innerWidth-N.right-$e,bt=window.innerWidth-P.right-be,lt=P.width+bt,Ft=Math.max(lt,M.width),yn=window.innerWidth-Ta,nn=S4(be,[Ta,Math.max(Ta,yn-Ft)]);s.style.minWidth=lt+"px",s.style.right=nn+"px"}const V=h(),W=window.innerHeight-Ta*2,ne=y.scrollHeight,Z=window.getComputedStyle(l),q=parseInt(Z.borderTopWidth,10),G=parseInt(Z.paddingTop,10),H=parseInt(Z.borderBottomWidth,10),j=parseInt(Z.paddingBottom,10),K=q+G+ne+j+H,Y=Math.min(b.offsetHeight*5,K),oe=window.getComputedStyle(y),X=parseInt(oe.paddingTop,10),Q=parseInt(oe.paddingBottom,10),ue=P.top+P.height/2-Ta,de=W-ue,Se=b.offsetHeight/2,me=b.offsetTop+Se,Ze=q+G+me,Ae=K-Ze;if(Ze<=ue){const $e=V.length>0&&b===V[V.length-1].ref.current;s.style.bottom="0px";const be=l.clientHeight-y.offsetTop-y.offsetHeight,bt=Math.max(de,Se+($e?Q:0)+be+H),lt=Ze+bt;s.style.height=lt+"px"}else{const $e=V.length>0&&b===V[0].ref.current;s.style.top="0px";const bt=Math.max(ue,q+y.offsetTop+($e?X:0)+Se)+Ae;s.style.height=bt+"px",y.scrollTop=Ze-ue+y.offsetTop}s.style.margin=`${Ta}px 0`,s.style.minHeight=Y+"px",s.style.maxHeight=W+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[h,o.trigger,o.valueNode,s,l,y,b,w,o.dir,r]);On(()=>S(),[S]);const[O,E]=v.useState();On(()=>{l&&E(window.getComputedStyle(l).zIndex)},[l]);const C=v.useCallback(P=>{P&&m.current===!0&&(S(),x?.(),m.current=!1)},[S,x]);return I.jsx(TUe,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:I.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:I.jsx(mt.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});aG.displayName=PUe;var kUe="SelectPopperPosition",C4=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ta,...o}=e,a=R2(n);return I.jsx(Tw,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.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)"}})});C4.displayName=kUe;var[TUe,l5]=op(sf,{}),E4="SelectViewport",sG=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Yl(E4,n),a=l5(E4,n),s=Nt(t,o.onViewportChange),u=v.useRef(0);return I.jsxs(I.Fragment,{children:[I.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}),I.jsx(T2.Slot,{scope:n,children:I.jsx(mt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ye(i.onScroll,l=>{const c=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=a;if(h?.current&&f){const p=Math.abs(u.current-c.scrollTop);if(p>0){const m=window.innerHeight-Ta*2,y=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),w=Math.max(y,b);if(w0?O:0,f.style.justifyContent="flex-end")}}}u.current=c.scrollTop})})})]})});sG.displayName=E4;var uG="SelectGroup",[MUe,RUe]=op(uG),lG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Lo();return I.jsx(MUe,{scope:n,id:i,children:I.jsx(mt.div,{role:"group","aria-labelledby":i,...r,ref:t})})});lG.displayName=uG;var cG="SelectLabel",fG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=RUe(cG,n);return I.jsx(mt.div,{id:i.id,...r,ref:t})});fG.displayName=cG;var Mx="SelectItem",[DUe,dG]=op(Mx),hG=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=Gl(Mx,n),u=Yl(Mx,n),l=s.value===r,[c,f]=v.useState(o??""),[h,p]=v.useState(!1),m=Nt(t,x=>u.itemRefCallback?.(x,r,i)),y=Lo(),b=v.useRef("touch"),w=()=>{i||(s.onValueChange(r),s.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 I.jsx(DUe,{scope:n,value:r,disabled:i,textId:y,isSelected:l,onItemTextChange:v.useCallback(x=>{f(S=>S||(x?.textContent??"").trim())},[]),children:I.jsx(T2.ItemSlot,{scope:n,value:r,disabled:i,textValue:c,children:I.jsx(mt.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:m,onFocus:Ye(a.onFocus,()=>p(!0)),onBlur:Ye(a.onBlur,()=>p(!1)),onClick:Ye(a.onClick,()=>{b.current!=="mouse"&&w()}),onPointerUp:Ye(a.onPointerUp,()=>{b.current==="mouse"&&w()}),onPointerDown:Ye(a.onPointerDown,x=>{b.current=x.pointerType}),onPointerMove:Ye(a.onPointerMove,x=>{b.current=x.pointerType,i?u.onItemLeave?.():b.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ye(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Ye(a.onKeyDown,x=>{u.searchRef?.current!==""&&x.key===" "||(xUe.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})})})})});hG.displayName=Mx;var d0="SelectItemText",pG=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Gl(d0,n),s=Yl(d0,n),u=dG(d0,n),l=CUe(d0,n),[c,f]=v.useState(null),h=Nt(t,w=>f(w),u.onItemTextChange,w=>s.itemTextRefCallback?.(w,u.value,u.disabled)),p=c?.textContent,m=v.useMemo(()=>I.jsx("option",{value:u.value,disabled:u.disabled,children:p},u.value),[u.disabled,u.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return On(()=>(y(m),()=>b(m)),[y,b,m]),I.jsxs(I.Fragment,{children:[I.jsx(mt.span,{id:u.textId,...o,ref:h}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Au.createPortal(o.children,a.valueNode):null]})});pG.displayName=d0;var gG="SelectItemIndicator",mG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return dG(gG,n).isSelected?I.jsx(mt.span,{"aria-hidden":!0,...r,ref:t}):null});mG.displayName=gG;var O4="SelectScrollUpButton",vG=v.forwardRef((e,t)=>{const n=Yl(O4,e.__scopeSelect),r=l5(O4,e.__scopeSelect),[i,o]=v.useState(!1),a=Nt(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=u.scrollTop>0;o(l)};const u=n.viewport;return s(),u.addEventListener("scroll",s),()=>u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?I.jsx(bG,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop-u.offsetHeight)}}):null});vG.displayName=O4;var A4="SelectScrollDownButton",yG=v.forwardRef((e,t)=>{const n=Yl(A4,e.__scopeSelect),r=l5(A4,e.__scopeSelect),[i,o]=v.useState(!1),a=Nt(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=u.scrollHeight-u.clientHeight,c=Math.ceil(u.scrollTop)u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?I.jsx(bG,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop+u.offsetHeight)}}):null});yG.displayName=A4;var bG=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Yl("SelectScrollButton",n),a=v.useRef(null),s=M2(n),u=v.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return v.useEffect(()=>()=>u(),[u]),On(()=>{s().find(c=>c.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),I.jsx(mt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ye(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ye(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ye(i.onPointerLeave,()=>{u()})})}),$Ue="SelectSeparator",xG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return I.jsx(mt.div,{"aria-hidden":!0,...r,ref:t})});xG.displayName=$Ue;var P4="SelectArrow",IUe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=R2(n),o=Gl(P4,n),a=Yl(P4,n);return o.open&&a.position==="popper"?I.jsx(Mw,{...i,...r,ref:t}):null});IUe.displayName=P4;function wG(e){return e===""||e===void 0}var _G=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=v.useRef(null),o=Nt(t,i),a=yUe(n);return v.useEffect(()=>{const s=i.current,u=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==n&&c){const f=new Event("change",{bubbles:!0});c.call(s,n),s.dispatchEvent(f)}},[a,n]),I.jsx(KA,{asChild:!0,children:I.jsx("select",{...r,ref:o,defaultValue:n})})});_G.displayName="BubbleSelect";function SG(e){const t=Vr(e),n=v.useRef(""),r=v.useRef(0),i=v.useCallback(a=>{const s=n.current+a;t(s),function u(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(s)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function CG(e,t,n){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=NUe(e,Math.max(o,0));i.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function NUe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ett=ZK,ttt=QK,ntt=eG,rtt=tG,itt=nG,ott=rG,att=sG,stt=lG,utt=fG,ltt=hG,ctt=pG,ftt=mG,dtt=vG,htt=yG,ptt=xG;const c5=6048e5,LUe=864e5,XI=Symbol.for("constructDateFrom");function ii(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&XI in e?e[XI](t):e instanceof Date?new e.constructor(t):new Date(t)}function $n(e,t){return ii(t||e,e)}function Ui(e,t,n){const r=$n(e,n?.in);return isNaN(t)?ii(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Xa(e,t,n){const r=$n(e,n?.in);if(isNaN(t))return ii(n?.in||e,NaN);if(!t)return r;const i=r.getDate(),o=ii(n?.in||e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const a=o.getDate();return i>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}let FUe={};function Ym(){return FUe}function ba(e,t){const n=Ym(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=$n(e,t?.in),o=i.getDay(),a=(o=o.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Rx(e){const t=$n(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function _f(e,...t){const n=ii.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function lf(e,t){const n=$n(e,t?.in);return n.setHours(0,0,0,0),n}function bs(e,t,n){const[r,i]=_f(n?.in,e,t),o=lf(r),a=lf(i),s=+o-Rx(o),u=+a-Rx(a);return Math.round((s-u)/LUe)}function jUe(e,t){const n=EG(e,t),r=ii(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),uf(r)}function k4(e,t,n){return Ui(e,t*7,n)}function BUe(e,t,n){return Xa(e,t*12,n)}function UUe(e,t){let n,r=t?.in;return e.forEach(i=>{!r&&typeof i=="object"&&(r=ii.bind(null,i));const o=$n(i,r);(!n||n{!r&&typeof i=="object"&&(r=ii.bind(null,i));const o=$n(i,r);(!n||n>o||isNaN(+o))&&(n=o)}),ii(r,n||NaN)}function so(e,t,n){const[r,i]=_f(n?.in,e,t);return+lf(r)==+lf(i)}function f5(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function WUe(e){return!(!f5(e)&&typeof e!="number"||isNaN(+$n(e)))}function sm(e,t,n){const[r,i]=_f(n?.in,e,t),o=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return o*12+a}function VUe(e,t,n){const[r,i]=_f(n?.in,e,t),o=ba(r,n),a=ba(i,n),s=+o-Rx(o),u=+a-Rx(a);return Math.round((s-u)/c5)}function d5(e,t){const n=$n(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function po(e,t){const n=$n(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function OG(e,t){const n=$n(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function h5(e,t){const n=Ym(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=$n(e,t?.in),o=i.getDay(),a=(o{let r;const i=HUe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Fd(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const KUe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},GUe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},YUe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ZUe={date:Fd({formats:KUe,defaultWidth:"full"}),time:Fd({formats:GUe,defaultWidth:"full"}),dateTime:Fd({formats:YUe,defaultWidth:"full"})},XUe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},QUe=(e,t,n,r)=>XUe[e];function hs(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=n?.width?String(n.width):a;i=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=n?.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const JUe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},eze={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tze={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"]},nze={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"]},rze={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"}},ize={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"}},oze=(e,t)=>{const n=Number(e),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"},aze={ordinalNumber:oze,era:hs({values:JUe,defaultWidth:"wide"}),quarter:hs({values:eze,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hs({values:tze,defaultWidth:"wide"}),day:hs({values:nze,defaultWidth:"wide"}),dayPeriod:hs({values:rze,defaultWidth:"wide",formattingValues:ize,defaultFormattingWidth:"wide"})};function ps(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const a=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?uze(s,f=>f.test(a)):sze(s,f=>f.test(a));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const c=t.slice(a.length);return{value:l,rest:c}}}function sze(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function uze(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(i.length);return{value:a,rest:s}}}const lze=/^(\d+)(th|st|nd|rd)?/i,cze=/\d+/i,fze={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},dze={any:[/^b/i,/^(a|c)/i]},hze={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pze={any:[/1/i,/2/i,/3/i,/4/i]},gze={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},mze={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]},vze={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},yze={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]},bze={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},xze={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}},wze={ordinalNumber:PG({matchPattern:lze,parsePattern:cze,valueCallback:e=>parseInt(e,10)}),era:ps({matchPatterns:fze,defaultMatchWidth:"wide",parsePatterns:dze,defaultParseWidth:"any"}),quarter:ps({matchPatterns:hze,defaultMatchWidth:"wide",parsePatterns:pze,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ps({matchPatterns:gze,defaultMatchWidth:"wide",parsePatterns:mze,defaultParseWidth:"any"}),day:ps({matchPatterns:vze,defaultMatchWidth:"wide",parsePatterns:yze,defaultParseWidth:"any"}),dayPeriod:ps({matchPatterns:bze,defaultMatchWidth:"any",parsePatterns:xze,defaultParseWidth:"any"})},kG={code:"en-US",formatDistance:qUe,formatLong:ZUe,formatRelative:QUe,localize:aze,match:wze,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _ze(e,t){const n=$n(e,t?.in);return bs(n,OG(n))+1}function TG(e,t){const n=$n(e,t?.in),r=+uf(n)-+jUe(n);return Math.round(r/c5)+1}function MG(e,t){const n=$n(e,t?.in),r=n.getFullYear(),i=Ym(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=ii(t?.in||e,0);a.setFullYear(r+1,0,o),a.setHours(0,0,0,0);const s=ba(a,t),u=ii(t?.in||e,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const l=ba(u,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Sze(e,t){const n=Ym(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=MG(e,t),o=ii(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),ba(o,t)}function RG(e,t){const n=$n(e,t?.in),r=+ba(n,t)-+Sze(n,t);return Math.round(r/c5)+1}function Rn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const qu={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Rn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Rn(n+1,2)},d(e,t){return Rn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){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(e,t){return Rn(e.getHours()%12||12,t.length)},H(e,t){return Rn(e.getHours(),t.length)},m(e,t){return Rn(e.getMinutes(),t.length)},s(e,t){return Rn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Rn(i,t.length)}},Jf={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},QI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){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(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return qu.y(e,t)},Y:function(e,t,n,r){const i=MG(e,r),o=i>0?i:1-i;if(t==="YY"){const a=o%100;return Rn(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Rn(o,t.length)},R:function(e,t){const n=EG(e);return Rn(n,t.length)},u:function(e,t){const n=e.getFullYear();return Rn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Rn(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(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Rn(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(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return qu.M(e,t);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(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Rn(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(e,t,n,r){const i=RG(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Rn(i,t.length)},I:function(e,t,n){const r=TG(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Rn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):qu.d(e,t)},D:function(e,t,n){const r=_ze(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Rn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){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(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Rn(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Rn(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Rn(i,t.length);case"io":return n.ordinalNumber(i,{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(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Jf.noon:r===0?i=Jf.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Jf.evening:r>=12?i=Jf.afternoon:r>=4?i=Jf.morning:i=Jf.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return qu.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):qu.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Rn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Rn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):qu.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):qu.s(e,t)},S:function(e,t){return qu.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return eN(r);case"XXXX":case"XX":return gc(r);case"XXXXX":case"XXX":default:return gc(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return eN(r);case"xxxx":case"xx":return gc(r);case"xxxxx":case"xxx":default:return gc(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+JI(r,":");case"OOOO":default:return"GMT"+gc(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+JI(r,":");case"zzzz":default:return"GMT"+gc(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Rn(r,t.length)},T:function(e,t,n){return Rn(+e,t.length)}};function JI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Rn(o,2)}function eN(e,t){return e%60===0?(e>0?"-":"+")+Rn(Math.abs(e)/60,2):gc(e,t)}function gc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Rn(Math.trunc(r/60),2),o=Rn(r%60,2);return n+i+t+o}const tN=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},DG=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Cze=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return tN(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",tN(r,t)).replace("{{time}}",DG(i,t))},Eze={p:DG,P:Cze},Oze=/^D+$/,Aze=/^Y+$/,Pze=["D","DD","YY","YYYY"];function kze(e){return Oze.test(e)}function Tze(e){return Aze.test(e)}function Mze(e,t,n){const r=Rze(e,t,n);if(console.warn(r),Pze.includes(e))throw new RangeError(r)}function Rze(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Dze=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$ze=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ize=/^'([^]*?)'?$/,Nze=/''/g,Lze=/[a-zA-Z]/;function Sf(e,t,n){const r=Ym(),i=n?.locale??r.locale??kG,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=$n(e,n?.in);if(!WUe(s))throw new RangeError("Invalid time value");let u=t.match($ze).map(c=>{const f=c[0];if(f==="p"||f==="P"){const h=Eze[f];return h(c,i.formatLong)}return c}).join("").match(Dze).map(c=>{if(c==="''")return{isToken:!1,value:"'"};const f=c[0];if(f==="'")return{isToken:!1,value:Fze(c)};if(QI[f])return{isToken:!0,value:c};if(f.match(Lze))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:c}});i.localize.preprocessor&&(u=i.localize.preprocessor(s,u));const l={firstWeekContainsDate:o,weekStartsOn:a,locale:i};return u.map(c=>{if(!c.isToken)return c.value;const f=c.value;(!n?.useAdditionalWeekYearTokens&&Tze(f)||!n?.useAdditionalDayOfYearTokens&&kze(f))&&Mze(f,t,String(e));const h=QI[f[0]];return h(s,f,i.localize,l)}).join("")}function Fze(e){const t=e.match(Ize);return t?t[1].replace(Nze,"'"):e}function jze(e,t){const n=$n(e,t?.in),r=n.getFullYear(),i=n.getMonth(),o=ii(n,0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Bze(e){return Math.trunc(+$n(e)/1e3)}function Uze(e,t){const n=$n(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(0,0,0,0),$n(n,t?.in)}function zze(e,t){const n=$n(e,t?.in);return VUe(Uze(n,t),po(n,t),t)+1}function T4(e,t){return+$n(e)>+$n(t)}function $G(e,t){return+$n(e)<+$n(t)}function Wze(e,t,n){const[r,i]=_f(n?.in,e,t);return+ba(r,n)==+ba(i,n)}function p5(e,t,n){const[r,i]=_f(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function Vze(e,t,n){const[r,i]=_f(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function I3(e,t,n){return Ui(e,-t,n)}function N3(e,t,n){const r=$n(e,n?.in),i=r.getFullYear(),o=r.getDate(),a=ii(e,0);a.setFullYear(i,t,15),a.setHours(0,0,0,0);const s=jze(a);return r.setMonth(t,Math.min(o,s)),r}function nN(e,t,n){const r=$n(e,n?.in);return isNaN(+r)?ii(e,NaN):(r.setFullYear(t),r)}function gtt(e){return lf(Date.now(),e)}const Hze={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},qze=(e,t,n)=>{let r;const i=Hze[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},Kze={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},Gze={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},Yze={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Zze={date:Fd({formats:Kze,defaultWidth:"full"}),time:Fd({formats:Gze,defaultWidth:"full"}),dateTime:Fd({formats:Yze,defaultWidth:"full"})};function rN(e,t,n){const r="eeee p";return Wze(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const Xze={lastWeek:rN,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:rN,other:"PP p"},Qze=(e,t,n,r)=>{const i=Xze[e];return typeof i=="function"?i(t,n,r):i},Jze={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},eWe={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},tWe={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},nWe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},rWe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},iWe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},oWe=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},aWe={ordinalNumber:oWe,era:hs({values:Jze,defaultWidth:"wide"}),quarter:hs({values:eWe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hs({values:tWe,defaultWidth:"wide"}),day:hs({values:nWe,defaultWidth:"wide"}),dayPeriod:hs({values:rWe,defaultWidth:"wide",formattingValues:iWe,defaultFormattingWidth:"wide"})},sWe=/^(第\s*)?\d+(日|时|分|秒)?/i,uWe=/\d+/i,lWe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},cWe={any:[/^(前)/i,/^(公元)/i]},fWe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},dWe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},hWe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},pWe={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},gWe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},mWe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},vWe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},yWe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},bWe={ordinalNumber:PG({matchPattern:sWe,parsePattern:uWe,valueCallback:e=>parseInt(e,10)}),era:ps({matchPatterns:lWe,defaultMatchWidth:"wide",parsePatterns:cWe,defaultParseWidth:"any"}),quarter:ps({matchPatterns:fWe,defaultMatchWidth:"wide",parsePatterns:dWe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ps({matchPatterns:hWe,defaultMatchWidth:"wide",parsePatterns:pWe,defaultParseWidth:"any"}),day:ps({matchPatterns:gWe,defaultMatchWidth:"wide",parsePatterns:mWe,defaultParseWidth:"any"}),dayPeriod:ps({matchPatterns:vWe,defaultMatchWidth:"any",parsePatterns:yWe,defaultParseWidth:"any"})},mtt={code:"zh-CN",formatDistance:qze,formatLong:Zze,formatRelative:Qze,localize:aWe,match:bWe,options:{weekStartsOn:1,firstWeekContainsDate:4}};var Dt=function(){return Dt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r1&&(u||!l),f=t>1&&(l||!u),h=function(){r&&o(r)},p=function(){i&&o(i)};return I.jsx(QWe,{displayMonth:e.displayMonth,hideNext:c,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:h,onNextClick:p})}function JWe(e){var t,n=Kn(),r=n.classNames,i=n.disableNavigation,o=n.styles,a=n.captionLayout,s=n.components,u=(t=s?.CaptionLabel)!==null&&t!==void 0?t:LG,l;return i?l=I.jsx(u,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?l=I.jsx(iN,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?l=I.jsxs(I.Fragment,{children:[I.jsx(iN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),I.jsx(oN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):l=I.jsxs(I.Fragment,{children:[I.jsx(u,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),I.jsx(oN,{displayMonth:e.displayMonth,id:e.id})]}),I.jsx("div",{className:r.caption,style:o.caption,children:l})}function eVe(e){var t=Kn(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?I.jsx("tfoot",{className:i,style:r.tfoot,children:I.jsx("tr",{children:I.jsx("td",{colSpan:8,children:n})})}):I.jsx(I.Fragment,{})}function tVe(e,t,n){for(var r=n?uf(new Date):ba(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var a=Ui(r,o);i.push(a)}return i}function nVe(){var e=Kn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,a=e.ISOWeek,s=e.formatters.formatWeekdayName,u=e.labels.labelWeekday,l=tVe(i,o,a);return I.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&I.jsx("td",{style:n.head_cell,className:t.head_cell}),l.map(function(c,f){return I.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":u(c,{locale:i}),children:s(c,{locale:i})},f)})]})}function rVe(){var e,t=Kn(),n=t.classNames,r=t.styles,i=t.components,o=(e=i?.HeadRow)!==null&&e!==void 0?e:nVe;return I.jsx("thead",{style:r.head,className:n.head,children:I.jsx(o,{})})}function iVe(e){var t=Kn(),n=t.locale,r=t.formatters.formatDay;return I.jsx(I.Fragment,{children:r(e.date,{locale:n})})}var g5=v.createContext(void 0);function oVe(e){if(!Zm(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return I.jsx(g5.Provider,{value:t,children:e.children})}return I.jsx(aVe,{initialProps:e.initialProps,children:e.children})}function aVe(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,a=function(l,c,f){var h,p;(h=t.onDayClick)===null||h===void 0||h.call(t,l,c,f);var m=!!(c.selected&&i&&r?.length===i);if(!m){var y=!!(!c.selected&&o&&r?.length===o);if(!y){var b=r?IG([],r):[];if(c.selected){var w=b.findIndex(function(x){return so(l,x)});b.splice(w,1)}else b.push(l);(p=t.onSelect)===null||p===void 0||p.call(t,b,l,c,f)}}},s={disabled:[]};r&&s.disabled.push(function(l){var c=o&&r.length>o-1,f=r.some(function(h){return so(h,l)});return!!(c&&!f)});var u={selected:r,onDayClick:a,modifiers:s};return I.jsx(g5.Provider,{value:u,children:n})}function m5(){var e=v.useContext(g5);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function sVe(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?so(i,e)&&so(r,e)?void 0:so(i,e)?{from:i,to:void 0}:so(r,e)?void 0:T4(r,e)?{from:e,to:i}:{from:r,to:e}:i?T4(e,i)?{from:i,to:e}:{from:e,to:i}:r?$G(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var v5=v.createContext(void 0);function uVe(e){if(!Xm(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return I.jsx(v5.Provider,{value:t,children:e.children})}return I.jsx(lVe,{initialProps:e.initialProps,children:e.children})}function lVe(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,a=i.to,s=t.min,u=t.max,l=function(p,m,y){var b,w;(b=t.onDayClick)===null||b===void 0||b.call(t,p,m,y);var x=sVe(p,r);(w=t.onSelect)===null||w===void 0||w.call(t,x,p,m,y)},c={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(c.range_start=[o],a?(c.range_end=[a],so(o,a)||(c.range_middle=[{after:o,before:a}])):c.range_end=[o]):a&&(c.range_start=[a],c.range_end=[a]),s&&(o&&!a&&c.disabled.push({after:I3(o,s-1),before:Ui(o,s-1)}),o&&a&&c.disabled.push({after:o,before:Ui(o,s-1)}),!o&&a&&c.disabled.push({after:I3(a,s-1),before:Ui(a,s-1)})),u){if(o&&!a&&(c.disabled.push({before:Ui(o,-u+1)}),c.disabled.push({after:Ui(o,u-1)})),o&&a){var f=bs(a,o)+1,h=u-f;c.disabled.push({before:I3(o,h)}),c.disabled.push({after:Ui(a,h)})}!o&&a&&(c.disabled.push({before:Ui(a,-u+1)}),c.disabled.push({after:Ui(a,u-1)}))}return I.jsx(v5.Provider,{value:{selected:r,onDayClick:l,modifiers:c},children:n})}function y5(){var e=v.useContext(v5);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function x1(e){return Array.isArray(e)?IG([],e):e!==void 0?[e]:[]}function cVe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=x1(i)}),t}var Qa;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Qa||(Qa={}));var fVe=Qa.Selected,Ys=Qa.Disabled,dVe=Qa.Hidden,hVe=Qa.Today,L3=Qa.RangeEnd,F3=Qa.RangeMiddle,j3=Qa.RangeStart,pVe=Qa.Outside;function gVe(e,t,n){var r,i=(r={},r[fVe]=x1(e.selected),r[Ys]=x1(e.disabled),r[dVe]=x1(e.hidden),r[hVe]=[e.today],r[L3]=[],r[F3]=[],r[j3]=[],r[pVe]=[],r);return e.fromDate&&i[Ys].push({before:e.fromDate}),e.toDate&&i[Ys].push({after:e.toDate}),Zm(e)?i[Ys]=i[Ys].concat(t.modifiers[Ys]):Xm(e)&&(i[Ys]=i[Ys].concat(n.modifiers[Ys]),i[j3]=n.modifiers[j3],i[F3]=n.modifiers[F3],i[L3]=n.modifiers[L3]),i}var BG=v.createContext(void 0);function mVe(e){var t=Kn(),n=m5(),r=y5(),i=gVe(t,n,r),o=cVe(t.modifiers),a=Dt(Dt({},i),o);return I.jsx(BG.Provider,{value:a,children:e.children})}function UG(){var e=v.useContext(BG);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function vVe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function yVe(e){return!!(e&&typeof e=="object"&&"from"in e)}function bVe(e){return!!(e&&typeof e=="object"&&"after"in e)}function xVe(e){return!!(e&&typeof e=="object"&&"before"in e)}function wVe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function _Ve(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=bs(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var a=bs(e,r)>=0&&bs(i,e)>=0;return a}return i?so(i,e):r?so(r,e):!1}function SVe(e){return f5(e)}function CVe(e){return Array.isArray(e)&&e.every(f5)}function EVe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(SVe(n))return so(e,n);if(CVe(n))return n.includes(e);if(yVe(n))return _Ve(e,n);if(wVe(n))return n.dayOfWeek.includes(e.getDay());if(vVe(n)){var r=bs(n.before,e),i=bs(n.after,e),o=r>0,a=i<0,s=T4(n.before,n.after);return s?a&&o:o||a}return bVe(n)?bs(e,n.after)>0:xVe(n)?bs(n.before,e)>0:typeof n=="function"?n(e):!1})}function b5(e,t,n){var r=Object.keys(t).reduce(function(o,a){var s=t[a];return EVe(e,s)&&o.push(a),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!p5(e,n)&&(i.outside=!0),i}function OVe(e,t){for(var n=po(e[0]),r=d5(e[e.length-1]),i,o,a=n;a<=r;){var s=b5(a,t),u=!s.disabled&&!s.hidden;if(!u){a=Ui(a,1);continue}if(s.selected)return a;s.today&&!o&&(o=a),i||(i=a),a=Ui(a,1)}return o||i}var AVe=365;function zG(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,a=t.retry,s=a===void 0?{count:0,lastFocused:e}:a,u=i.weekStartsOn,l=i.fromDate,c=i.toDate,f=i.locale,h={day:Ui,week:k4,month:Xa,year:BUe,startOfWeek:function(b){return i.ISOWeek?uf(b):ba(b,{locale:f,weekStartsOn:u})},endOfWeek:function(b){return i.ISOWeek?AG(b):h5(b,{locale:f,weekStartsOn:u})}},p=h[n](e,r==="after"?1:-1);r==="before"&&l?p=UUe([l,p]):r==="after"&&c&&(p=zUe([c,p]));var m=!0;if(o){var y=b5(p,o);m=!y.disabled&&!y.hidden}return m?p:s.count>AVe?s.lastFocused:zG(p,{moveBy:n,direction:r,context:i,modifiers:o,retry:Dt(Dt({},s),{count:s.count+1})})}var WG=v.createContext(void 0);function PVe(e){var t=Qm(),n=UG(),r=v.useState(),i=r[0],o=r[1],a=v.useState(),s=a[0],u=a[1],l=OVe(t.displayMonths,n),c=i??(s&&t.isDateDisplayed(s))?s:l,f=function(){u(i),o(void 0)},h=function(b){o(b)},p=Kn(),m=function(b,w){if(i){var x=zG(i,{moveBy:b,direction:w,context:p,modifiers:n});so(i,x)||(t.goToDate(x,i),h(x))}},y={focusedDay:i,focusTarget:c,blur:f,focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return I.jsx(WG.Provider,{value:y,children:e.children})}function x5(){var e=v.useContext(WG);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function kVe(e,t){var n=UG(),r=b5(e,n,t);return r}var w5=v.createContext(void 0);function TVe(e){if(!D2(e.initialProps)){var t={selected:void 0};return I.jsx(w5.Provider,{value:t,children:e.children})}return I.jsx(MVe,{initialProps:e.initialProps,children:e.children})}function MVe(e){var t=e.initialProps,n=e.children,r=function(o,a,s){var u,l,c;if((u=t.onDayClick)===null||u===void 0||u.call(t,o,a,s),a.selected&&!t.required){(l=t.onSelect)===null||l===void 0||l.call(t,void 0,o,a,s);return}(c=t.onSelect)===null||c===void 0||c.call(t,o,o,a,s)},i={selected:t.selected,onDayClick:r};return I.jsx(w5.Provider,{value:i,children:n})}function VG(){var e=v.useContext(w5);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function RVe(e,t){var n=Kn(),r=VG(),i=m5(),o=y5(),a=x5(),s=a.focusDayAfter,u=a.focusDayBefore,l=a.focusWeekAfter,c=a.focusWeekBefore,f=a.blur,h=a.focus,p=a.focusMonthBefore,m=a.focusMonthAfter,y=a.focusYearBefore,b=a.focusYearAfter,w=a.focusStartOfWeek,x=a.focusEndOfWeek,S=function(H){var j,K,Y,oe;D2(n)?(j=r.onDayClick)===null||j===void 0||j.call(r,e,t,H):Zm(n)?(K=i.onDayClick)===null||K===void 0||K.call(i,e,t,H):Xm(n)?(Y=o.onDayClick)===null||Y===void 0||Y.call(o,e,t,H):(oe=n.onDayClick)===null||oe===void 0||oe.call(n,e,t,H)},O=function(H){var j;h(e),(j=n.onDayFocus)===null||j===void 0||j.call(n,e,t,H)},E=function(H){var j;f(),(j=n.onDayBlur)===null||j===void 0||j.call(n,e,t,H)},C=function(H){var j;(j=n.onDayMouseEnter)===null||j===void 0||j.call(n,e,t,H)},P=function(H){var j;(j=n.onDayMouseLeave)===null||j===void 0||j.call(n,e,t,H)},M=function(H){var j;(j=n.onDayPointerEnter)===null||j===void 0||j.call(n,e,t,H)},N=function(H){var j;(j=n.onDayPointerLeave)===null||j===void 0||j.call(n,e,t,H)},B=function(H){var j;(j=n.onDayTouchCancel)===null||j===void 0||j.call(n,e,t,H)},V=function(H){var j;(j=n.onDayTouchEnd)===null||j===void 0||j.call(n,e,t,H)},W=function(H){var j;(j=n.onDayTouchMove)===null||j===void 0||j.call(n,e,t,H)},ne=function(H){var j;(j=n.onDayTouchStart)===null||j===void 0||j.call(n,e,t,H)},Z=function(H){var j;(j=n.onDayKeyUp)===null||j===void 0||j.call(n,e,t,H)},q=function(H){var j;switch(H.key){case"ArrowLeft":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?s():u();break;case"ArrowRight":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?u():s();break;case"ArrowDown":H.preventDefault(),H.stopPropagation(),l();break;case"ArrowUp":H.preventDefault(),H.stopPropagation(),c();break;case"PageUp":H.preventDefault(),H.stopPropagation(),H.shiftKey?y():p();break;case"PageDown":H.preventDefault(),H.stopPropagation(),H.shiftKey?b():m();break;case"Home":H.preventDefault(),H.stopPropagation(),w();break;case"End":H.preventDefault(),H.stopPropagation(),x();break}(j=n.onDayKeyDown)===null||j===void 0||j.call(n,e,t,H)},G={onClick:S,onFocus:O,onBlur:E,onKeyDown:q,onKeyUp:Z,onMouseEnter:C,onMouseLeave:P,onPointerEnter:M,onPointerLeave:N,onTouchCancel:B,onTouchEnd:V,onTouchMove:W,onTouchStart:ne};return G}function DVe(){var e=Kn(),t=VG(),n=m5(),r=y5(),i=D2(e)?t.selected:Zm(e)?n.selected:Xm(e)?r.selected:void 0;return i}function $Ve(e){return Object.values(Qa).includes(e)}function IVe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if($Ve(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function NVe(e,t){var n=Dt({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Dt(Dt({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function LVe(e,t,n){var r,i,o,a=Kn(),s=x5(),u=kVe(e,t),l=RVe(e,u),c=DVe(),f=!!(a.onDayClick||a.mode!=="default");v.useEffect(function(){var C;u.outside||s.focusedDay&&f&&so(s.focusedDay,e)&&((C=n.current)===null||C===void 0||C.focus())},[s.focusedDay,e,n,f,u.outside]);var h=IVe(a,u).join(" "),p=NVe(a,u),m=!!(u.outside&&!a.showOutsideDays||u.hidden),y=(o=(i=a.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:iVe,b=I.jsx(y,{date:e,displayMonth:t,activeModifiers:u}),w={style:p,className:h,children:b,role:"gridcell"},x=s.focusTarget&&so(s.focusTarget,e)&&!u.outside,S=s.focusedDay&&so(s.focusedDay,e),O=Dt(Dt(Dt({},w),(r={disabled:u.disabled,role:"gridcell"},r["aria-selected"]=u.selected,r.tabIndex=S||x?0:-1,r)),l),E={isButton:f,isHidden:m,activeModifiers:u,selectedDays:c,buttonProps:O,divProps:w};return E}function FVe(e){var t=v.useRef(null),n=LVe(e.date,e.displayMonth,t);return n.isHidden?I.jsx("div",{role:"gridcell"}):n.isButton?I.jsx(Dx,Dt({name:"day",ref:t},n.buttonProps)):I.jsx("div",Dt({},n.divProps))}function jVe(e){var t=e.number,n=e.dates,r=Kn(),i=r.onWeekNumberClick,o=r.styles,a=r.classNames,s=r.locale,u=r.labels.labelWeekNumber,l=r.formatters.formatWeekNumber,c=l(Number(t),{locale:s});if(!i)return I.jsx("span",{className:a.weeknumber,style:o.weeknumber,children:c});var f=u(Number(t),{locale:s}),h=function(p){i(t,n,p)};return I.jsx(Dx,{name:"week-number","aria-label":f,className:a.weeknumber,style:o.weeknumber,onClick:h,children:c})}function BVe(e){var t,n,r=Kn(),i=r.styles,o=r.classNames,a=r.showWeekNumber,s=r.components,u=(t=s?.Day)!==null&&t!==void 0?t:FVe,l=(n=s?.WeekNumber)!==null&&n!==void 0?n:jVe,c;return a&&(c=I.jsx("td",{className:o.cell,style:i.cell,children:I.jsx(l,{number:e.weekNumber,dates:e.dates})})),I.jsxs("tr",{className:o.row,style:i.row,children:[c,e.dates.map(function(f){return I.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:I.jsx(u,{displayMonth:e.displayMonth,date:f})},Bze(f))})]})}function aN(e,t,n){for(var r=n?.ISOWeek?AG(t):h5(t,n),i=n?.ISOWeek?uf(e):ba(e,n),o=bs(r,i),a=[],s=0;s<=o;s++)a.push(Ui(i,s));var u=a.reduce(function(l,c){var f=n?.ISOWeek?TG(c):RG(c,n),h=l.find(function(p){return p.weekNumber===f});return h?(h.dates.push(c),l):(l.push({weekNumber:f,dates:[c]}),l)},[]);return u}function UVe(e,t){var n=aN(po(e),d5(e),t);if(t?.useFixedWeeks){var r=zze(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],a=k4(o,6-r),s=aN(k4(o,1),a,t);n.push.apply(n,s)}}return n}function zVe(e){var t,n,r,i=Kn(),o=i.locale,a=i.classNames,s=i.styles,u=i.hideHead,l=i.fixedWeeks,c=i.components,f=i.weekStartsOn,h=i.firstWeekContainsDate,p=i.ISOWeek,m=UVe(e.displayMonth,{useFixedWeeks:!!l,ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:h}),y=(t=c?.Head)!==null&&t!==void 0?t:rVe,b=(n=c?.Row)!==null&&n!==void 0?n:BVe,w=(r=c?.Footer)!==null&&r!==void 0?r:eVe;return I.jsxs("table",{id:e.id,className:a.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!u&&I.jsx(y,{}),I.jsx("tbody",{className:a.tbody,style:s.tbody,children:m.map(function(x){return I.jsx(b,{displayMonth:e.displayMonth,dates:x.dates,weekNumber:x.weekNumber},x.weekNumber)})}),I.jsx(w,{displayMonth:e.displayMonth})]})}function WVe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var VVe=WVe()?v.useLayoutEffect:v.useEffect,B3=!1,HVe=0;function sN(){return"react-day-picker-".concat(++HVe)}function qVe(e){var t,n=e??(B3?sN():null),r=v.useState(n),i=r[0],o=r[1];return VVe(function(){i===null&&o(sN())},[]),v.useEffect(function(){B3===!1&&(B3=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function KVe(e){var t,n,r=Kn(),i=r.dir,o=r.classNames,a=r.styles,s=r.components,u=Qm().displayMonths,l=qVe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),c=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],h=a.month,p=e.displayIndex===0,m=e.displayIndex===u.length-1,y=!p&&!m;i==="rtl"&&(t=[p,m],m=t[0],p=t[1]),p&&(f.push(o.caption_start),h=Dt(Dt({},h),a.caption_start)),m&&(f.push(o.caption_end),h=Dt(Dt({},h),a.caption_end)),y&&(f.push(o.caption_between),h=Dt(Dt({},h),a.caption_between));var b=(n=s?.Caption)!==null&&n!==void 0?n:JWe;return I.jsxs("div",{className:f.join(" "),style:h,children:[I.jsx(b,{id:l,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),I.jsx(zVe,{id:c,"aria-labelledby":l,displayMonth:e.displayMonth})]},e.displayIndex)}function GVe(e){var t=Kn(),n=t.classNames,r=t.styles;return I.jsx("div",{className:n.months,style:r.months,children:e.children})}function YVe(e){var t,n,r=e.initialProps,i=Kn(),o=x5(),a=Qm(),s=v.useState(!1),u=s[0],l=s[1];v.useEffect(function(){i.initialFocus&&o.focusTarget&&(u||(o.focus(o.focusTarget),l(!0)))},[i.initialFocus,u,o.focus,o.focusTarget,o]);var c=[i.classNames.root,i.className];i.numberOfMonths>1&&c.push(i.classNames.multiple_months),i.showWeekNumber&&c.push(i.classNames.with_weeknumber);var f=Dt(Dt({},i.styles.root),i.style),h=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,y){var b;return Dt(Dt({},m),(b={},b[y]=r[y],b))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:GVe;return I.jsx("div",Dt({className:c.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:I.jsx(p,{children:a.displayMonths.map(function(m,y){return I.jsx(KVe,{displayIndex:y,displayMonth:m},y)})})}))}function ZVe(e){var t=e.children,n=xWe(e,["children"]);return I.jsx(jWe,{initialProps:n,children:I.jsx(YWe,{children:I.jsx(TVe,{initialProps:n,children:I.jsx(oVe,{initialProps:n,children:I.jsx(uVe,{initialProps:n,children:I.jsx(mVe,{children:I.jsx(PVe,{children:t})})})})})})})}function vtt(e){return I.jsx(ZVe,Dt({},e,{children:I.jsx(YVe,{initialProps:e})}))}function XVe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var _5=e=>{const{present:t,children:n}=e,r=QVe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,JVe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};_5.displayName="Presence";function QVe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=XVe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Uy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Uy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=Uy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=Uy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Uy(e){return e?.animationName||"none"}function JVe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var S5="Popover",[HG,ytt]=Di(S5,[zl]),Jm=zl(),[eHe,Zl]=HG(S5),qG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!1}=e,s=Jm(t),u=v.useRef(null),[l,c]=v.useState(!1),[f=!1,h]=Ts({prop:r,defaultProp:i,onChange:o});return I.jsx(kw,{...s,children:I.jsx(eHe,{scope:t,contentId:Lo(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>c(!0),[]),onCustomAnchorRemove:v.useCallback(()=>c(!1),[]),modal:a,children:n})})};qG.displayName=S5;var KG="PopoverAnchor",tHe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(KG,n),o=Jm(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return v.useEffect(()=>(a(),()=>s()),[a,s]),I.jsx(Dm,{...o,...r,ref:t})});tHe.displayName=KG;var GG="PopoverTrigger",YG=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(GG,n),o=Jm(n),a=Nt(t,i.triggerRef),s=I.jsx(mt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":eY(i.open),...r,ref:a,onClick:Ye(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:I.jsx(Dm,{asChild:!0,...o,children:s})});YG.displayName=GG;var C5="PopoverPortal",[nHe,rHe]=HG(C5,{forceMount:void 0}),ZG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=Zl(C5,t);return I.jsx(nHe,{scope:t,forceMount:n,children:I.jsx(_5,{present:n||o.open,children:I.jsx(jh,{asChild:!0,container:i,children:r})})})};ZG.displayName=C5;var Oh="PopoverContent",XG=v.forwardRef((e,t)=>{const n=rHe(Oh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=Zl(Oh,e.__scopePopover);return I.jsx(_5,{present:r||o.open,children:o.modal?I.jsx(iHe,{...i,ref:t}):I.jsx(oHe,{...i,ref:t})})});XG.displayName=Oh;var iHe=v.forwardRef((e,t)=>{const n=Zl(Oh,e.__scopePopover),r=v.useRef(null),i=Nt(t,r),o=v.useRef(!1);return v.useEffect(()=>{const a=r.current;if(a)return Mm(a)},[]),I.jsx(Tm,{as:Pl,allowPinchZoom:!0,children:I.jsx(QG,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ye(e.onCloseAutoFocus,a=>{a.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ye(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,l=s.button===2||u;o.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Ye(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),oHe=v.forwardRef((e,t)=>{const n=Zl(Oh,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return I.jsx(QG,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),QG=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:c,...f}=e,h=Zl(Oh,n),p=Jm(n);return Ew(),I.jsx(km,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:c,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:I.jsx(Tw,{"data-state":eY(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.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)"}})})})}),JG="PopoverClose",aHe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(JG,n);return I.jsx(mt.button,{type:"button",...r,ref:t,onClick:Ye(e.onClick,()=>i.onOpenChange(!1))})});aHe.displayName=JG;var sHe="PopoverArrow",uHe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Jm(n);return I.jsx(Mw,{...i,...r,ref:t})});uHe.displayName=sHe;function eY(e){return e?"open":"closed"}var btt=qG,xtt=YG,wtt=ZG,_tt=XG;function lHe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var ev=e=>{const{present:t,children:n}=e,r=cHe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,fHe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};ev.displayName="Presence";function cHe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=lHe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=zy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=zy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=zy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=zy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function zy(e){return e?.animationName||"none"}function fHe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function dHe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var E5="ScrollArea",[tY,Stt]=Di(E5),[hHe,_a]=tY(E5),nY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[s,u]=v.useState(null),[l,c]=v.useState(null),[f,h]=v.useState(null),[p,m]=v.useState(null),[y,b]=v.useState(null),[w,x]=v.useState(0),[S,O]=v.useState(0),[E,C]=v.useState(!1),[P,M]=v.useState(!1),N=Nt(t,V=>u(V)),B=Em(i);return I.jsx(hHe,{scope:n,type:r,dir:B,scrollHideDelay:o,scrollArea:s,viewport:l,onViewportChange:c,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:b,scrollbarYEnabled:P,onScrollbarYEnabledChange:M,onCornerWidthChange:x,onCornerHeightChange:O,children:I.jsx(mt.div,{dir:B,...a,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});nY.displayName=E5;var rY="ScrollAreaViewport",iY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,a=_a(rY,n),s=v.useRef(null),u=Nt(t,s,a.onViewportChange);return I.jsxs(I.Fragment,{children:[I.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:i}),I.jsx(mt.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:I.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});iY.displayName=rY;var $s="ScrollAreaScrollbar",pHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_a($s,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,s=e.orientation==="horizontal";return v.useEffect(()=>(s?o(!0):a(!0),()=>{s?o(!1):a(!1)}),[s,o,a]),i.type==="hover"?I.jsx(gHe,{...r,ref:t,forceMount:n}):i.type==="scroll"?I.jsx(mHe,{...r,ref:t,forceMount:n}):i.type==="auto"?I.jsx(oY,{...r,ref:t,forceMount:n}):i.type==="always"?I.jsx(O5,{...r,ref:t}):null});pHe.displayName=$s;var gHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_a($s,e.__scopeScrollArea),[o,a]=v.useState(!1);return v.useEffect(()=>{const s=i.scrollArea;let u=0;if(s){const l=()=>{window.clearTimeout(u),a(!0)},c=()=>{u=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return s.addEventListener("pointerenter",l),s.addEventListener("pointerleave",c),()=>{window.clearTimeout(u),s.removeEventListener("pointerenter",l),s.removeEventListener("pointerleave",c)}}},[i.scrollArea,i.scrollHideDelay]),I.jsx(ev,{present:n||o,children:I.jsx(oY,{"data-state":o?"visible":"hidden",...r,ref:t})})}),mHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_a($s,e.__scopeScrollArea),o=e.orientation==="horizontal",a=I2(()=>u("SCROLL_END"),100),[s,u]=dHe("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 v.useEffect(()=>{if(s==="idle"){const l=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[s,i.scrollHideDelay,u]),v.useEffect(()=>{const l=i.viewport,c=o?"scrollLeft":"scrollTop";if(l){let f=l[c];const h=()=>{const p=l[c];f!==p&&(u("SCROLL"),a()),f=p};return l.addEventListener("scroll",h),()=>l.removeEventListener("scroll",h)}},[i.viewport,o,u,a]),I.jsx(ev,{present:n||s!=="hidden",children:I.jsx(O5,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ye(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ye(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),oY=v.forwardRef((e,t)=>{const n=_a($s,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=v.useState(!1),s=e.orientation==="horizontal",u=I2(()=>{if(n.viewport){const l=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=_a($s,e.__scopeScrollArea),o=v.useRef(null),a=v.useRef(0),[s,u]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=lY(s.viewport,s.content),c={...r,sizes:s,onSizesChange:u,hasThumb:l>0&&l<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function f(h,p){return SHe(h,a.current,s,p)}return n==="horizontal"?I.jsx(vHe,{...c,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const h=i.viewport.scrollLeft,p=uN(h,s,i.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=f(h,i.dir))}}):n==="vertical"?I.jsx(yHe,{...c,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const h=i.viewport.scrollTop,p=uN(h,s);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=f(h))}}):null}),vHe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=_a($s,e.__scopeScrollArea),[a,s]=v.useState(),u=v.useRef(null),l=Nt(t,u,o.onScrollbarXChange);return v.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),I.jsx(sY,{"data-orientation":"horizontal",...i,ref:l,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":$2(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,f)=>{if(o.viewport){const h=o.viewport.scrollLeft+c.deltaX;e.onWheelScroll(h),fY(h,f)&&c.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Ix(a.paddingLeft),paddingEnd:Ix(a.paddingRight)}})}})}),yHe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=_a($s,e.__scopeScrollArea),[a,s]=v.useState(),u=v.useRef(null),l=Nt(t,u,o.onScrollbarYChange);return v.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),I.jsx(sY,{"data-orientation":"vertical",...i,ref:l,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":$2(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,f)=>{if(o.viewport){const h=o.viewport.scrollTop+c.deltaY;e.onWheelScroll(h),fY(h,f)&&c.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Ix(a.paddingTop),paddingEnd:Ix(a.paddingBottom)}})}})}),[bHe,aY]=tY($s),sY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:u,onDragScroll:l,onWheelScroll:c,onResize:f,...h}=e,p=_a($s,n),[m,y]=v.useState(null),b=Nt(t,N=>y(N)),w=v.useRef(null),x=v.useRef(""),S=p.viewport,O=r.content-r.viewport,E=Vr(c),C=Vr(u),P=I2(f,10);function M(N){if(w.current){const B=N.clientX-w.current.left,V=N.clientY-w.current.top;l({x:B,y:V})}}return v.useEffect(()=>{const N=B=>{const V=B.target;m?.contains(V)&&E(B,O)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[S,m,O,E]),v.useEffect(C,[r,C]),Ah(m,P),Ah(p.content,P),I.jsx(bHe,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Vr(o),onThumbPointerUp:Vr(a),onThumbPositionChange:C,onThumbPointerDown:Vr(s),children:I.jsx(mt.div,{...h,ref:b,style:{position:"absolute",...h.style},onPointerDown:Ye(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),w.current=m.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),M(N))}),onPointerMove:Ye(e.onPointerMove,M),onPointerUp:Ye(e.onPointerUp,N=>{const B=N.target;B.hasPointerCapture(N.pointerId)&&B.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),w.current=null})})})}),$x="ScrollAreaThumb",xHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=aY($x,e.__scopeScrollArea);return I.jsx(ev,{present:n||i.hasThumb,children:I.jsx(wHe,{ref:t,...r})})}),wHe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=_a($x,n),a=aY($x,n),{onThumbPositionChange:s}=a,u=Nt(t,f=>a.onThumbChange(f)),l=v.useRef(void 0),c=I2(()=>{l.current&&(l.current(),l.current=void 0)},100);return v.useEffect(()=>{const f=o.viewport;if(f){const h=()=>{if(c(),!l.current){const p=CHe(f,s);l.current=p,s()}};return s(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[o.viewport,c,s]),I.jsx(mt.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ye(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),m=f.clientX-p.left,y=f.clientY-p.top;a.onThumbPointerDown({x:m,y})}),onPointerUp:Ye(e.onPointerUp,a.onThumbPointerUp)})});xHe.displayName=$x;var A5="ScrollAreaCorner",uY=v.forwardRef((e,t)=>{const n=_a(A5,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?I.jsx(_He,{...e,ref:t}):null});uY.displayName=A5;var _He=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=_a(A5,n),[o,a]=v.useState(0),[s,u]=v.useState(0),l=!!(o&&s);return Ah(i.scrollbarX,()=>{const c=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(c),u(c)}),Ah(i.scrollbarY,()=>{const c=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(c),a(c)}),l?I.jsx(mt.div,{...r,ref:t,style:{width:o,height:s,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ix(e){return e?parseInt(e,10):0}function lY(e,t){const n=e/t;return isNaN(n)?0:n}function $2(e){const t=lY(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function SHe(e,t,n,r="ltr"){const i=$2(n),o=i/2,a=t||o,s=i-a,u=n.scrollbar.paddingStart+a,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,c=n.content-n.viewport,f=r==="ltr"?[0,c]:[c*-1,0];return cY([u,l],f)(e)}function uN(e,t,n="ltr"){const r=$2(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,s=o-r,u=n==="ltr"?[0,a]:[a*-1,0],l=S4(e,u);return cY([0,a],[0,s])(l)}function cY(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function fY(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,s=n.top!==o.top;(a||s)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function I2(e,t){const n=Vr(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ah(e,t){const n=Vr(t);On(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var Ctt=nY,Ett=iY,Ott=uY,P5="Progress",k5=100,[EHe,Att]=Di(P5),[OHe,AHe]=EHe(P5),dY=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=PHe,...a}=e;(i||i===0)&&!lN(i)&&console.error(kHe(`${i}`,"Progress"));const s=lN(i)?i:k5;r!==null&&!cN(r,s)&&console.error(THe(`${r}`,"Progress"));const u=cN(r,s)?r:null,l=Nx(u)?o(u,s):void 0;return I.jsx(OHe,{scope:n,value:u,max:s,children:I.jsx(mt.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Nx(u)?u:void 0,"aria-valuetext":l,role:"progressbar","data-state":gY(u,s),"data-value":u??void 0,"data-max":s,...a,ref:t})})});dY.displayName=P5;var hY="ProgressIndicator",pY=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=AHe(hY,n);return I.jsx(mt.div,{"data-state":gY(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});pY.displayName=hY;function PHe(e,t){return`${Math.round(e/t*100)}%`}function gY(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Nx(e){return typeof e=="number"}function lN(e){return Nx(e)&&!isNaN(e)&&e>0}function cN(e,t){return Nx(e)&&!isNaN(e)&&e<=t&&e>=0}function kHe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${k5}\`.`}function THe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${k5} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. -Defaulting to \`null\`.`}var Ott=dY,Att=pY;/** +Defaulting to \`null\`.`}var Ptt=dY,ktt=pY;/** * table-core * * Copyright (c) TanStack @@ -586,10 +596,10 @@ Defaulting to \`null\`.`}var Ott=dY,Att=pY;/** * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ptt(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function fl(e,t){return typeof e=="function"?e(t):e}function Wo(e,t){return n=>{t.setState(r=>({...r,[e]:fl(n,r[e])}))}}function N2(e){return e instanceof Function}function MHe(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function RHe(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const a=t(o);a!=null&&a.length&&r(a)})};return r(e),n}function Ct(e,t,n){let r=[],i;return o=>{let a;n.key&&n.debug&&(a=Date.now());const s=e(o);if(!(s.length!==r.length||s.some((c,f)=>r[f]!==c)))return i;r=s;let l;if(n.key&&n.debug&&(l=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-a)*100)/100,f=Math.round((Date.now()-l)*100)/100,h=f/16,p=(m,y)=>{for(m=String(m);m.lengthtypeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function fl(e,t){return typeof e=="function"?e(t):e}function Wo(e,t){return n=>{t.setState(r=>({...r,[e]:fl(n,r[e])}))}}function N2(e){return e instanceof Function}function MHe(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function RHe(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const a=t(o);a!=null&&a.length&&r(a)})};return r(e),n}function Ct(e,t,n){let r=[],i;return o=>{let a;n.key&&n.debug&&(a=Date.now());const s=e(o);if(!(s.length!==r.length||s.some((c,f)=>r[f]!==c)))return i;r=s;let l;if(n.key&&n.debug&&(l=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-a)*100)/100,f=Math.round((Date.now()-l)*100)/100,h=f/16,p=(m,y)=>{for(m=String(m);m.length{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function DHe(e,t,n,r){const i=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:Ct(()=>[e,n,t,o],(a,s,u,l)=>({table:a,column:s,row:u,cell:l,getValue:l.getValue,renderValue:l.renderValue}),Et(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function $He(e,t,n,r){var i,o;const s={...e._getDefaultColumnDef(),...t},u=s.accessorKey;let l=(i=(o=s.id)!=null?o:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?i:typeof s.header=="string"?s.header:void 0,c;if(s.accessorFn?c=s.accessorFn:u&&(u.includes(".")?c=h=>{let p=h;for(const y of u.split(".")){var m;p=(m=p)==null?void 0:m[y]}return p}:c=h=>h[s.accessorKey]),!l)throw new Error;let f={id:`${String(l)}`,accessorFn:c,parent:r,depth:n,columnDef:s,columns:[],getFlatColumns:Ct(()=>[!0],()=>{var h;return[f,...(h=f.columns)==null?void 0:h.flatMap(p=>p.getFlatColumns())]},Et(e.options,"debugColumns")),getLeafColumns:Ct(()=>[e._getOrderColumnsFn()],h=>{var p;if((p=f.columns)!=null&&p.length){let m=f.columns.flatMap(y=>y.getLeafColumns());return h(m)}return[f]},Et(e.options,"debugColumns"))};for(const h of e._features)h.createColumn==null||h.createColumn(f,e);return f}const Si="debugHeaders";function fN(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],s=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(s),a.push(u)};return s(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const IHe={createTable:e=>{e.getHeaderGroups=Ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;const s=(o=r?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?o:[],u=(a=i?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?a:[],l=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(i!=null&&i.includes(f.id)));return Wy(t,[...s,...l,...u],e)},Et(e.options,Si)),e.getCenterHeaderGroups=Ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),Wy(t,n,e,"center")),Et(e.options,Si)),e.getLeftHeaderGroups=Ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?i:[];return Wy(t,o,e,"left")},Et(e.options,Si)),e.getRightHeaderGroups=Ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?i:[];return Wy(t,o,e,"right")},Et(e.options,Si)),e.getFooterGroups=Ct(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Et(e.options,Si)),e.getLeftFooterGroups=Ct(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Et(e.options,Si)),e.getCenterFooterGroups=Ct(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Et(e.options,Si)),e.getRightFooterGroups=Ct(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Et(e.options,Si)),e.getFlatHeaders=Ct(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Et(e.options,Si)),e.getLeftFlatHeaders=Ct(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Et(e.options,Si)),e.getCenterFlatHeaders=Ct(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Et(e.options,Si)),e.getRightFlatHeaders=Ct(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Et(e.options,Si)),e.getCenterLeafHeaders=Ct(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Et(e.options,Si)),e.getLeftLeafHeaders=Ct(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Et(e.options,Si)),e.getRightLeafHeaders=Ct(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Et(e.options,Si)),e.getLeafHeaders=Ct(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,a,s,u,l;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(a=(s=n[0])==null?void 0:s.headers)!=null?a:[],...(u=(l=r[0])==null?void 0:l.headers)!=null?u:[]].map(c=>c.getLeafHeaders()).flat()},Et(e.options,Si))}};function Wy(e,t,n,r){var i,o;let a=0;const s=function(h,p){p===void 0&&(p=1),a=Math.max(a,p),h.filter(m=>m.getIsVisible()).forEach(m=>{var y;(y=m.columns)!=null&&y.length&&s(m.columns,p+1)},0)};s(e);let u=[];const l=(h,p)=>{const m={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},y=[];h.forEach(b=>{const w=[...y].reverse()[0],x=b.column.depth===m.depth;let S,O=!1;if(x&&b.column.parent?S=b.column.parent:(S=b.column,O=!0),w&&w?.column===S)w.subHeaders.push(b);else{const E=fN(n,S,{id:[r,p,S.id,b?.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${y.filter(C=>C.column===S).length}`:void 0,depth:p,index:y.length});E.subHeaders.push(b),y.push(E)}m.headers.push(b),b.headerGroup=m}),u.push(m),p>0&&l(y,p-1)},c=t.map((h,p)=>fN(n,h,{depth:a,index:p}));l(c,a-1),u.reverse();const f=h=>h.filter(m=>m.column.getIsVisible()).map(m=>{let y=0,b=0,w=[0];m.subHeaders&&m.subHeaders.length?(w=[],f(m.subHeaders).forEach(S=>{let{colSpan:O,rowSpan:E}=S;y+=O,w.push(E)})):y=1;const x=Math.min(...w);return b=b+x,m.colSpan=y,m.rowSpan=b,{colSpan:y,rowSpan:b}});return f((i=(o=u[0])==null?void 0:o.headers)!=null?i:[]),u}const T5=(e,t,n,r,i,o,a)=>{let s={id:t,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(s._valuesCache.hasOwnProperty(u))return s._valuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return s._valuesCache[u]=l.accessorFn(s.original,r),s._valuesCache[u]},getUniqueValues:u=>{if(s._uniqueValuesCache.hasOwnProperty(u))return s._uniqueValuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return l.columnDef.getUniqueValues?(s._uniqueValuesCache[u]=l.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[u]):(s._uniqueValuesCache[u]=[s.getValue(u)],s._uniqueValuesCache[u])},renderValue:u=>{var l;return(l=s.getValue(u))!=null?l:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>RHe(s.subRows,u=>u.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let u=[],l=s;for(;;){const c=l.getParentRow();if(!c)break;u.push(c),l=c}return u.reverse()},getAllCells:Ct(()=>[e.getAllLeafColumns()],u=>u.map(l=>DHe(e,s,l,l.id)),Et(e.options,"debugRows")),_getAllCellsByColumnId:Ct(()=>[s.getAllCells()],u=>u.reduce((l,c)=>(l[c.column.id]=c,l),{}),Et(e.options,"debugRows"))};for(let u=0;u{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},mY=(e,t,n)=>{var r,i;const o=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(o))};mY.autoRemove=e=>Ka(e);const vY=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};vY.autoRemove=e=>Ka(e);const yY=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};yY.autoRemove=e=>Ka(e);const bY=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};bY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const xY=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});xY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const wY=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});wY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const _Y=(e,t,n)=>e.getValue(t)===n;_Y.autoRemove=e=>Ka(e);const SY=(e,t,n)=>e.getValue(t)==n;SY.autoRemove=e=>Ka(e);const M5=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};M5.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(i)?1/0:i;if(o>a){const s=o;o=a,a=s}return[o,a]};M5.autoRemove=e=>Ka(e)||Ka(e[0])&&Ka(e[1]);const eu={includesString:mY,includesStringSensitive:vY,equalsString:yY,arrIncludes:bY,arrIncludesAll:xY,arrIncludesSome:wY,equals:_Y,weakEquals:SY,inNumberRange:M5};function Ka(e){return e==null||e===""}const LHe={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Wo("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?eu.includesString:typeof r=="number"?eu.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?eu.equals:Array.isArray(r)?eu.arrIncludes:eu.weakEquals},e.getFilterFn=()=>{var n,r;return N2(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:eu[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r?.find(c=>c.id===e.id),a=fl(n,o?o.value:void 0);if(dN(i,a,e)){var s;return(s=r?.filter(c=>c.id!==e.id))!=null?s:[]}const u={id:e.id,value:a};if(o){var l;return(l=r?.map(c=>c.id===e.id?u:c))!=null?l:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=fl(t,i))==null?void 0:o.filter(a=>{const s=n.find(u=>u.id===a.id);if(s){const u=s.getFilterFn();if(dN(u,a.value,s))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function dN(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const FHe=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),jHe=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},BHe=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r=o)&&(r=o)}),r},UHe=(e,t,n)=>{let r,i;return n.forEach(o=>{const a=o.getValue(e);a!=null&&(r===void 0?a>=a&&(r=i=a):(r>a&&(r=a),i{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},WHe=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!MHe(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,a)=>o-a);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},VHe=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),HHe=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,qHe=(e,t)=>t.length,U3={sum:FHe,min:jHe,max:BHe,extent:UHe,mean:zHe,median:WHe,unique:VHe,uniqueCount:HHe,count:qHe},KHe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Wo("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return U3.sum;if(Object.prototype.toString.call(r)==="[object Date]")return U3.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return N2(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:U3[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function GHe(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(a=>a.id===o)).filter(Boolean),...r]}const YHe={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Wo("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ct(n=>[$0(t,n)],n=>n.findIndex(r=>r.id===e.id),Et(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=$0(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=$0(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ct(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const a=[...t],s=[...i];for(;s.length&&a.length;){const u=a.shift(),l=s.findIndex(c=>c.id===u);l>-1&&o.push(s.splice(l,1)[0])}o=[...o,...s]}return GHe(o,n,r)},Et(e.options,"debugTable"))}},z3=()=>({left:[],right:[]}),ZHe={getInitialState:e=>({columnPinning:z3(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Wo("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,a;if(n==="right"){var s,u;return{left:((s=i?.left)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((u=i?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var l,c;return{left:[...((l=i?.left)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((c=i?.right)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((o=i?.left)!=null?o:[]).filter(f=>!(r!=null&&r.includes(f))),right:((a=i?.right)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,a;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(s=>s.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(s=>r?.includes(s)),a=n.some(s=>i?.includes(s));return o?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(a=>!o.includes(a.column.id))},Et(t.options,"debugRows")),e.getLeftVisibleCells=Ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Et(t.options,"debugRows")),e.getRightVisibleCells=Ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Et(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?z3():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:z3())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Et(e.options,"debugColumns")),e.getRightLeafColumns=Ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Et(e.options,"debugColumns")),e.getCenterLeafColumns=Ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},Et(e.options,"debugColumns"))}},Vy={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},W3=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),XHe={getDefaultColumnDef:()=>Vy,getInitialState:e=>({columnSizing:{},columnSizingInfo:W3(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Wo("columnSizing",e),onColumnSizingInfoChange:Wo("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Vy.minSize,(r=o??e.columnDef.size)!=null?r:Vy.size),(i=e.columnDef.maxSize)!=null?i:Vy.maxSize)},e.getStart=Ct(n=>[n,$0(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Et(t.options,"debugColumns")),e.getAfter=Ct(n=>[n,$0(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Et(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r?.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),V3(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),s=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=V3(o)?Math.round(o.touches[0].clientX):o.clientX,l={},c=(w,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(S=>{var O,E;const C=t.options.columnResizeDirection==="rtl"?-1:1,P=(x-((O=S?.startOffset)!=null?O:0))*C,M=Math.max(P/((E=S?.startSize)!=null?E:0),-.999999);return S.columnSizingStart.forEach(N=>{let[B,V]=N;l[B]=Math.round(Math.max(V+V*M,0)*100)/100}),{...S,deltaOffset:P,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...l})))},f=w=>c("move",w),h=w=>{c("end",w),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,m={moveHandler:w=>f(w.clientX),upHandler:w=>{p?.removeEventListener("mousemove",m.moveHandler),p?.removeEventListener("mouseup",m.upHandler),h(w.clientX)}},y={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),f(w.touches[0].clientX),!1),upHandler:w=>{var x;p?.removeEventListener("touchmove",y.moveHandler),p?.removeEventListener("touchend",y.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),h((x=w.touches[0])==null?void 0:x.clientX)}},b=QHe()?{passive:!1}:!1;V3(o)?(p?.addEventListener("touchmove",y.moveHandler,b),p?.addEventListener("touchend",y.upHandler,b)):(p?.addEventListener("mousemove",m.moveHandler,b),p?.addEventListener("mouseup",m.upHandler,b)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?W3():(n=e.initialState.columnSizingInfo)!=null?n:W3())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let Hy=null;function QHe(){if(typeof Hy=="boolean")return Hy;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Hy=e,Hy}function V3(e){return e.type==="touchstart"}const JHe={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Wo("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const i=e.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ct(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Et(t.options,"debugRows")),e.getVisibleCells=Ct(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],Et(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Ct(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Et(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function $0(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const eqe={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},tqe={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Wo("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>eu.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return N2(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:eu[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},nqe={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Wo("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const a=o.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(s=>{a[s]=!0}):a=r,n=(i=n)!=null?i:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:s,...u}=a;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},M4=0,R4=10,H3=()=>({pageIndex:M4,pageSize:R4}),rqe={getInitialState:e=>({...e,pagination:{...H3(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Wo("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>fl(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?H3():(i=e.initialState.pagination)!=null?i:H3())},e.setPageIndex=r=>{e.setPagination(i=>{let o=fl(r,i.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,a)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?M4:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:M4)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?R4:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:R4)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,fl(r,i.pageSize)),a=i.pageSize*i.pageIndex,s=Math.floor(a/o);return{...i,pageIndex:s,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let a=fl(r,(o=e.options.pageCount)!=null?o:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),e.getPageOptions=Ct(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,a)=>a)),i},Et(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},q3=()=>({top:[],bottom:[]}),iqe={getInitialState:e=>({rowPinning:q3(),...e}),getDefaultOptions:e=>({onRowPinningChange:Wo("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(u=>{let{id:l}=u;return l}):[],a=i?e.getParentRows().map(u=>{let{id:l}=u;return l}):[],s=new Set([...a,e.id,...o]);t.setRowPinning(u=>{var l,c;if(n==="bottom"){var f,h;return{top:((f=u?.top)!=null?f:[]).filter(y=>!(s!=null&&s.has(y))),bottom:[...((h=u?.bottom)!=null?h:[]).filter(y=>!(s!=null&&s.has(y))),...Array.from(s)]}}if(n==="top"){var p,m;return{top:[...((p=u?.top)!=null?p:[]).filter(y=>!(s!=null&&s.has(y))),...Array.from(s)],bottom:((m=u?.bottom)!=null?m:[]).filter(y=>!(s!=null&&s.has(y)))}}return{top:((l=u?.top)!=null?l:[]).filter(y=>!(s!=null&&s.has(y))),bottom:((c=u?.bottom)!=null?c:[]).filter(y=>!(s!=null&&s.has(y)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(s=>r?.includes(s)),a=n.some(s=>i?.includes(s));return o?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:s}=a;return s});return(r=o?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?q3():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:q3())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(a=>{const s=e.getRow(a,!0);return s.getIsAllParentsExpanded()?s:null}):(n??[]).map(a=>t.find(s=>s.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=Ct(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Et(e.options,"debugRows")),e.getBottomRows=Ct(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Et(e.options,"debugRows")),e.getCenterRows=Ct(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},Et(e.options,"debugRows"))}},oqe={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Wo("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{D4(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ct(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Et(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ct(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Et(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ct(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Et(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const s={...o};return D4(s,e.id,n,(a=r?.selectChildren)!=null?a:!0,t),s})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return R5(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return $4(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return $4(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},D4=(e,t,n,r,i)=>{var o;const a=i.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(s=>D4(e,s.id,n,r,i))};function K3(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(a,s){return a.map(u=>{var l;const c=R5(u,n);if(c&&(r.push(u),i[u.id]=u),(l=u.subRows)!=null&&l.length&&(u={...u,subRows:o(u.subRows)}),c)return u}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function R5(e,t){var n;return(n=t[e.id])!=null?n:!1}function $4(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(a=>{if(!(o&&!i)&&(a.getCanSelect()&&(R5(a,t)?o=!0:i=!1),a.subRows&&a.subRows.length)){const s=$4(a,t);s==="all"?o=!0:(s==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const I4=/([0-9]+)/gm,aqe=(e,t,n)=>CY(Nl(e.getValue(n)).toLowerCase(),Nl(t.getValue(n)).toLowerCase()),sqe=(e,t,n)=>CY(Nl(e.getValue(n)),Nl(t.getValue(n))),uqe=(e,t,n)=>D5(Nl(e.getValue(n)).toLowerCase(),Nl(t.getValue(n)).toLowerCase()),lqe=(e,t,n)=>D5(Nl(e.getValue(n)),Nl(t.getValue(n))),cqe=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:rD5(e.getValue(n),t.getValue(n));function D5(e,t){return e===t?0:e>t?1:-1}function Nl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function CY(e,t){const n=e.split(I4).filter(Boolean),r=t.split(I4).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),a=parseInt(i,10),s=parseInt(o,10),u=[a,s].sort();if(isNaN(u[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(u[1]))return isNaN(a)?-1:1;if(a>s)return 1;if(s>a)return-1}return n.length-r.length}const Qp={alphanumeric:aqe,alphanumericCaseSensitive:sqe,text:uqe,textCaseSensitive:lqe,datetime:cqe,basic:fqe},dqe={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Wo("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i?.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Qp.datetime;if(typeof o=="string"&&(r=!0,o.split(I4).length>1))return Qp.alphanumeric}return r?Qp.text:Qp.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return N2(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Qp[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const s=a?.find(p=>p.id===e.id),u=a?.findIndex(p=>p.id===e.id);let l=[],c,f=o?n:i==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?s?c="toggle":c="add":a!=null&&a.length&&u!==a.length-1?c="replace":s?c="toggle":c="replace",c==="toggle"&&(o||i||(c="remove")),c==="add"){var h;l=[...a,{id:e.id,desc:f}],l.splice(0,l.length-((h=t.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else c==="toggle"?l=a.map(p=>p.id===e.id?{...p,desc:f}:p):c==="remove"?l=a.filter(p=>p.id!==e.id):l=[{id:e.id,desc:f}];return l})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},hqe=[IHe,JHe,YHe,ZHe,NHe,LHe,eqe,tqe,dqe,KHe,nqe,rqe,iqe,oqe,XHe];function pqe(e){var t,n;const r=[...hqe,...(t=e._features)!=null?t:[]];let i={_features:r};const o=i._features.reduce((h,p)=>Object.assign(h,p.getDefaultOptions==null?void 0:p.getDefaultOptions(i)),{}),a=h=>i.options.mergeOptions?i.options.mergeOptions(o,h):{...o,...h};let u={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(h=>{var p;u=(p=h.getInitialState==null?void 0:h.getInitialState(u))!=null?p:u});const l=[];let c=!1;const f={_features:r,options:{...o,...e},initialState:u,_queue:h=>{l.push(h),c||(c=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();c=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{i.setState(i.initialState)},setOptions:h=>{const p=fl(h,i.options);i.options=a(p)},getState:()=>i.options.state,setState:h=>{i.options.onStateChange==null||i.options.onStateChange(h)},_getRowId:(h,p,m)=>{var y;return(y=i.options.getRowId==null?void 0:i.options.getRowId(h,p,m))!=null?y:`${m?[m.id,p].join("."):p}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(h,p)=>{let m=(p?i.getPrePaginationRowModel():i.getRowModel()).rowsById[h];if(!m&&(m=i.getCoreRowModel().rowsById[h],!m))throw new Error;return m},_getDefaultColumnDef:Ct(()=>[i.options.defaultColumn],h=>{var p;return h=(p=h)!=null?p:{},{header:m=>{const y=m.header.column.columnDef;return y.accessorKey?y.accessorKey:y.accessorFn?y.id:null},cell:m=>{var y,b;return(y=(b=m.renderValue())==null||b.toString==null?void 0:b.toString())!=null?y:null},...i._features.reduce((m,y)=>Object.assign(m,y.getDefaultColumnDef==null?void 0:y.getDefaultColumnDef()),{}),...h}},Et(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:Ct(()=>[i._getColumnDefs()],h=>{const p=function(m,y,b){return b===void 0&&(b=0),m.map(w=>{const x=$He(i,w,b,y),S=w;return x.columns=S.columns?p(S.columns,x,b+1):[],x})};return p(h)},Et(e,"debugColumns")),getAllFlatColumns:Ct(()=>[i.getAllColumns()],h=>h.flatMap(p=>p.getFlatColumns()),Et(e,"debugColumns")),_getAllFlatColumnsById:Ct(()=>[i.getAllFlatColumns()],h=>h.reduce((p,m)=>(p[m.id]=m,p),{}),Et(e,"debugColumns")),getAllLeafColumns:Ct(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(h,p)=>{let m=h.flatMap(y=>y.getLeafColumns());return p(m)},Et(e,"debugColumns")),getColumn:h=>i._getAllFlatColumnsById()[h]};Object.assign(i,f);for(let h=0;hCt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,a){o===void 0&&(o=0);const s=[];for(let l=0;le._autoResetPageIndex()))}function gqe(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function EY(e,t,n){return n.options.filterFromLeafRows?mqe(e,t,n):vqe(e,t,n)}function mqe(e,t,n){var r;const i=[],o={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,s=function(u,l){l===void 0&&(l=0);const c=[];for(let h=0;hCt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,i)=>{if(!n.rows.length||!(r!=null&&r.length)&&!i)return n;const o=[...r.map(s=>s.id).filter(s=>s!==t),i?"__global__":void 0].filter(Boolean),a=s=>{for(let u=0;uCt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let o=0;oCt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let h=0;h{var p;const m=e.getColumn(h.id);if(!m)return;const y=m.getFilterFn();y&&i.push({id:h.id,filterFn:y,resolvedValue:(p=y.resolveFilterValue==null?void 0:y.resolveFilterValue(h.value))!=null?p:h.value})});const a=(n??[]).map(h=>h.id),s=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());r&&s&&u.length&&(a.push("__global__"),u.forEach(h=>{var p;o.push({id:h.id,filterFn:s,resolvedValue:(p=s.resolveFilterValue==null?void 0:s.resolveFilterValue(r))!=null?p:r})}));let l,c;for(let h=0;h{p.columnFiltersMeta[y]=b})}if(o.length){for(let m=0;m{p.columnFiltersMeta[y]=b})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const f=h=>{for(let p=0;pe._autoResetPageIndex()))}function Dtt(e){return t=>Ct(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:a,flatRows:s,rowsById:u}=r;const l=i*o,c=l+i;a=a.slice(l,c);let f;t.options.paginateExpandedRows?f={rows:a,flatRows:s,rowsById:u}:f=gqe({rows:a,flatRows:s,rowsById:u}),f.flatRows=[];const h=p=>{f.flatRows.push(p),p.subRows.length&&p.subRows.forEach(h)};return f.rows.forEach(h),f},Et(t.options,"debugTable"))}function $tt(){return e=>Ct(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(u=>{var l;return(l=e.getColumn(u.id))==null?void 0:l.getCanSort()}),a={};o.forEach(u=>{const l=e.getColumn(u.id);l&&(a[u.id]={sortUndefined:l.columnDef.sortUndefined,invertSorting:l.columnDef.invertSorting,sortingFn:l.getSortingFn()})});const s=u=>{const l=u.map(c=>({...c}));return l.sort((c,f)=>{for(let p=0;p{var f;i.push(c),(f=c.subRows)!=null&&f.length&&(c.subRows=s(c.subRows))}),l};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},Et(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** + color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n?.key)}return i}}function Et(e,t,n,r){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function DHe(e,t,n,r){const i=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:Ct(()=>[e,n,t,o],(a,s,u,l)=>({table:a,column:s,row:u,cell:l,getValue:l.getValue,renderValue:l.renderValue}),Et(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function $He(e,t,n,r){var i,o;const s={...e._getDefaultColumnDef(),...t},u=s.accessorKey;let l=(i=(o=s.id)!=null?o:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?i:typeof s.header=="string"?s.header:void 0,c;if(s.accessorFn?c=s.accessorFn:u&&(u.includes(".")?c=h=>{let p=h;for(const y of u.split(".")){var m;p=(m=p)==null?void 0:m[y]}return p}:c=h=>h[s.accessorKey]),!l)throw new Error;let f={id:`${String(l)}`,accessorFn:c,parent:r,depth:n,columnDef:s,columns:[],getFlatColumns:Ct(()=>[!0],()=>{var h;return[f,...(h=f.columns)==null?void 0:h.flatMap(p=>p.getFlatColumns())]},Et(e.options,"debugColumns")),getLeafColumns:Ct(()=>[e._getOrderColumnsFn()],h=>{var p;if((p=f.columns)!=null&&p.length){let m=f.columns.flatMap(y=>y.getLeafColumns());return h(m)}return[f]},Et(e.options,"debugColumns"))};for(const h of e._features)h.createColumn==null||h.createColumn(f,e);return f}const Si="debugHeaders";function fN(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],s=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(s),a.push(u)};return s(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const IHe={createTable:e=>{e.getHeaderGroups=Ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;const s=(o=r?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?o:[],u=(a=i?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?a:[],l=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(i!=null&&i.includes(f.id)));return Wy(t,[...s,...l,...u],e)},Et(e.options,Si)),e.getCenterHeaderGroups=Ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),Wy(t,n,e,"center")),Et(e.options,Si)),e.getLeftHeaderGroups=Ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?i:[];return Wy(t,o,e,"left")},Et(e.options,Si)),e.getRightHeaderGroups=Ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?i:[];return Wy(t,o,e,"right")},Et(e.options,Si)),e.getFooterGroups=Ct(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Et(e.options,Si)),e.getLeftFooterGroups=Ct(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Et(e.options,Si)),e.getCenterFooterGroups=Ct(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Et(e.options,Si)),e.getRightFooterGroups=Ct(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Et(e.options,Si)),e.getFlatHeaders=Ct(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Et(e.options,Si)),e.getLeftFlatHeaders=Ct(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Et(e.options,Si)),e.getCenterFlatHeaders=Ct(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Et(e.options,Si)),e.getRightFlatHeaders=Ct(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Et(e.options,Si)),e.getCenterLeafHeaders=Ct(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Et(e.options,Si)),e.getLeftLeafHeaders=Ct(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Et(e.options,Si)),e.getRightLeafHeaders=Ct(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Et(e.options,Si)),e.getLeafHeaders=Ct(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,a,s,u,l;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(a=(s=n[0])==null?void 0:s.headers)!=null?a:[],...(u=(l=r[0])==null?void 0:l.headers)!=null?u:[]].map(c=>c.getLeafHeaders()).flat()},Et(e.options,Si))}};function Wy(e,t,n,r){var i,o;let a=0;const s=function(h,p){p===void 0&&(p=1),a=Math.max(a,p),h.filter(m=>m.getIsVisible()).forEach(m=>{var y;(y=m.columns)!=null&&y.length&&s(m.columns,p+1)},0)};s(e);let u=[];const l=(h,p)=>{const m={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},y=[];h.forEach(b=>{const w=[...y].reverse()[0],x=b.column.depth===m.depth;let S,O=!1;if(x&&b.column.parent?S=b.column.parent:(S=b.column,O=!0),w&&w?.column===S)w.subHeaders.push(b);else{const E=fN(n,S,{id:[r,p,S.id,b?.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${y.filter(C=>C.column===S).length}`:void 0,depth:p,index:y.length});E.subHeaders.push(b),y.push(E)}m.headers.push(b),b.headerGroup=m}),u.push(m),p>0&&l(y,p-1)},c=t.map((h,p)=>fN(n,h,{depth:a,index:p}));l(c,a-1),u.reverse();const f=h=>h.filter(m=>m.column.getIsVisible()).map(m=>{let y=0,b=0,w=[0];m.subHeaders&&m.subHeaders.length?(w=[],f(m.subHeaders).forEach(S=>{let{colSpan:O,rowSpan:E}=S;y+=O,w.push(E)})):y=1;const x=Math.min(...w);return b=b+x,m.colSpan=y,m.rowSpan=b,{colSpan:y,rowSpan:b}});return f((i=(o=u[0])==null?void 0:o.headers)!=null?i:[]),u}const T5=(e,t,n,r,i,o,a)=>{let s={id:t,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(s._valuesCache.hasOwnProperty(u))return s._valuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return s._valuesCache[u]=l.accessorFn(s.original,r),s._valuesCache[u]},getUniqueValues:u=>{if(s._uniqueValuesCache.hasOwnProperty(u))return s._uniqueValuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return l.columnDef.getUniqueValues?(s._uniqueValuesCache[u]=l.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[u]):(s._uniqueValuesCache[u]=[s.getValue(u)],s._uniqueValuesCache[u])},renderValue:u=>{var l;return(l=s.getValue(u))!=null?l:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>RHe(s.subRows,u=>u.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let u=[],l=s;for(;;){const c=l.getParentRow();if(!c)break;u.push(c),l=c}return u.reverse()},getAllCells:Ct(()=>[e.getAllLeafColumns()],u=>u.map(l=>DHe(e,s,l,l.id)),Et(e.options,"debugRows")),_getAllCellsByColumnId:Ct(()=>[s.getAllCells()],u=>u.reduce((l,c)=>(l[c.column.id]=c,l),{}),Et(e.options,"debugRows"))};for(let u=0;u{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},mY=(e,t,n)=>{var r,i;const o=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(o))};mY.autoRemove=e=>Ka(e);const vY=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};vY.autoRemove=e=>Ka(e);const yY=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};yY.autoRemove=e=>Ka(e);const bY=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};bY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const xY=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});xY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const wY=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});wY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const _Y=(e,t,n)=>e.getValue(t)===n;_Y.autoRemove=e=>Ka(e);const SY=(e,t,n)=>e.getValue(t)==n;SY.autoRemove=e=>Ka(e);const M5=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};M5.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(i)?1/0:i;if(o>a){const s=o;o=a,a=s}return[o,a]};M5.autoRemove=e=>Ka(e)||Ka(e[0])&&Ka(e[1]);const eu={includesString:mY,includesStringSensitive:vY,equalsString:yY,arrIncludes:bY,arrIncludesAll:xY,arrIncludesSome:wY,equals:_Y,weakEquals:SY,inNumberRange:M5};function Ka(e){return e==null||e===""}const LHe={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Wo("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?eu.includesString:typeof r=="number"?eu.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?eu.equals:Array.isArray(r)?eu.arrIncludes:eu.weakEquals},e.getFilterFn=()=>{var n,r;return N2(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:eu[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r?.find(c=>c.id===e.id),a=fl(n,o?o.value:void 0);if(dN(i,a,e)){var s;return(s=r?.filter(c=>c.id!==e.id))!=null?s:[]}const u={id:e.id,value:a};if(o){var l;return(l=r?.map(c=>c.id===e.id?u:c))!=null?l:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=fl(t,i))==null?void 0:o.filter(a=>{const s=n.find(u=>u.id===a.id);if(s){const u=s.getFilterFn();if(dN(u,a.value,s))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function dN(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const FHe=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),jHe=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},BHe=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r=o)&&(r=o)}),r},UHe=(e,t,n)=>{let r,i;return n.forEach(o=>{const a=o.getValue(e);a!=null&&(r===void 0?a>=a&&(r=i=a):(r>a&&(r=a),i{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},WHe=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!MHe(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,a)=>o-a);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},VHe=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),HHe=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,qHe=(e,t)=>t.length,U3={sum:FHe,min:jHe,max:BHe,extent:UHe,mean:zHe,median:WHe,unique:VHe,uniqueCount:HHe,count:qHe},KHe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Wo("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return U3.sum;if(Object.prototype.toString.call(r)==="[object Date]")return U3.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return N2(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:U3[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function GHe(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(a=>a.id===o)).filter(Boolean),...r]}const YHe={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Wo("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ct(n=>[$0(t,n)],n=>n.findIndex(r=>r.id===e.id),Et(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=$0(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=$0(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ct(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const a=[...t],s=[...i];for(;s.length&&a.length;){const u=a.shift(),l=s.findIndex(c=>c.id===u);l>-1&&o.push(s.splice(l,1)[0])}o=[...o,...s]}return GHe(o,n,r)},Et(e.options,"debugTable"))}},z3=()=>({left:[],right:[]}),ZHe={getInitialState:e=>({columnPinning:z3(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Wo("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,a;if(n==="right"){var s,u;return{left:((s=i?.left)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((u=i?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var l,c;return{left:[...((l=i?.left)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((c=i?.right)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((o=i?.left)!=null?o:[]).filter(f=>!(r!=null&&r.includes(f))),right:((a=i?.right)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,a;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(s=>s.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(s=>r?.includes(s)),a=n.some(s=>i?.includes(s));return o?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(a=>!o.includes(a.column.id))},Et(t.options,"debugRows")),e.getLeftVisibleCells=Ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Et(t.options,"debugRows")),e.getRightVisibleCells=Ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Et(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?z3():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:z3())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Et(e.options,"debugColumns")),e.getRightLeafColumns=Ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Et(e.options,"debugColumns")),e.getCenterLeafColumns=Ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},Et(e.options,"debugColumns"))}},Vy={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},W3=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),XHe={getDefaultColumnDef:()=>Vy,getInitialState:e=>({columnSizing:{},columnSizingInfo:W3(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Wo("columnSizing",e),onColumnSizingInfoChange:Wo("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Vy.minSize,(r=o??e.columnDef.size)!=null?r:Vy.size),(i=e.columnDef.maxSize)!=null?i:Vy.maxSize)},e.getStart=Ct(n=>[n,$0(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Et(t.options,"debugColumns")),e.getAfter=Ct(n=>[n,$0(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Et(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r?.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),V3(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),s=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=V3(o)?Math.round(o.touches[0].clientX):o.clientX,l={},c=(w,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(S=>{var O,E;const C=t.options.columnResizeDirection==="rtl"?-1:1,P=(x-((O=S?.startOffset)!=null?O:0))*C,M=Math.max(P/((E=S?.startSize)!=null?E:0),-.999999);return S.columnSizingStart.forEach(N=>{let[B,V]=N;l[B]=Math.round(Math.max(V+V*M,0)*100)/100}),{...S,deltaOffset:P,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...l})))},f=w=>c("move",w),h=w=>{c("end",w),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,m={moveHandler:w=>f(w.clientX),upHandler:w=>{p?.removeEventListener("mousemove",m.moveHandler),p?.removeEventListener("mouseup",m.upHandler),h(w.clientX)}},y={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),f(w.touches[0].clientX),!1),upHandler:w=>{var x;p?.removeEventListener("touchmove",y.moveHandler),p?.removeEventListener("touchend",y.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),h((x=w.touches[0])==null?void 0:x.clientX)}},b=QHe()?{passive:!1}:!1;V3(o)?(p?.addEventListener("touchmove",y.moveHandler,b),p?.addEventListener("touchend",y.upHandler,b)):(p?.addEventListener("mousemove",m.moveHandler,b),p?.addEventListener("mouseup",m.upHandler,b)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?W3():(n=e.initialState.columnSizingInfo)!=null?n:W3())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let Hy=null;function QHe(){if(typeof Hy=="boolean")return Hy;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Hy=e,Hy}function V3(e){return e.type==="touchstart"}const JHe={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Wo("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const i=e.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ct(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Et(t.options,"debugRows")),e.getVisibleCells=Ct(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],Et(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Ct(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Et(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function $0(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const eqe={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},tqe={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Wo("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>eu.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return N2(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:eu[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},nqe={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Wo("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const a=o.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(s=>{a[s]=!0}):a=r,n=(i=n)!=null?i:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:s,...u}=a;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},M4=0,R4=10,H3=()=>({pageIndex:M4,pageSize:R4}),rqe={getInitialState:e=>({...e,pagination:{...H3(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Wo("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>fl(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?H3():(i=e.initialState.pagination)!=null?i:H3())},e.setPageIndex=r=>{e.setPagination(i=>{let o=fl(r,i.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,a)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?M4:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:M4)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?R4:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:R4)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,fl(r,i.pageSize)),a=i.pageSize*i.pageIndex,s=Math.floor(a/o);return{...i,pageIndex:s,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let a=fl(r,(o=e.options.pageCount)!=null?o:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),e.getPageOptions=Ct(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,a)=>a)),i},Et(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},q3=()=>({top:[],bottom:[]}),iqe={getInitialState:e=>({rowPinning:q3(),...e}),getDefaultOptions:e=>({onRowPinningChange:Wo("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(u=>{let{id:l}=u;return l}):[],a=i?e.getParentRows().map(u=>{let{id:l}=u;return l}):[],s=new Set([...a,e.id,...o]);t.setRowPinning(u=>{var l,c;if(n==="bottom"){var f,h;return{top:((f=u?.top)!=null?f:[]).filter(y=>!(s!=null&&s.has(y))),bottom:[...((h=u?.bottom)!=null?h:[]).filter(y=>!(s!=null&&s.has(y))),...Array.from(s)]}}if(n==="top"){var p,m;return{top:[...((p=u?.top)!=null?p:[]).filter(y=>!(s!=null&&s.has(y))),...Array.from(s)],bottom:((m=u?.bottom)!=null?m:[]).filter(y=>!(s!=null&&s.has(y)))}}return{top:((l=u?.top)!=null?l:[]).filter(y=>!(s!=null&&s.has(y))),bottom:((c=u?.bottom)!=null?c:[]).filter(y=>!(s!=null&&s.has(y)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(s=>r?.includes(s)),a=n.some(s=>i?.includes(s));return o?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:s}=a;return s});return(r=o?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?q3():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:q3())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(a=>{const s=e.getRow(a,!0);return s.getIsAllParentsExpanded()?s:null}):(n??[]).map(a=>t.find(s=>s.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=Ct(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Et(e.options,"debugRows")),e.getBottomRows=Ct(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Et(e.options,"debugRows")),e.getCenterRows=Ct(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},Et(e.options,"debugRows"))}},oqe={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Wo("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{D4(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ct(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Et(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ct(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Et(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ct(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Et(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const s={...o};return D4(s,e.id,n,(a=r?.selectChildren)!=null?a:!0,t),s})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return R5(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return $4(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return $4(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},D4=(e,t,n,r,i)=>{var o;const a=i.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(s=>D4(e,s.id,n,r,i))};function K3(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(a,s){return a.map(u=>{var l;const c=R5(u,n);if(c&&(r.push(u),i[u.id]=u),(l=u.subRows)!=null&&l.length&&(u={...u,subRows:o(u.subRows)}),c)return u}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function R5(e,t){var n;return(n=t[e.id])!=null?n:!1}function $4(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(a=>{if(!(o&&!i)&&(a.getCanSelect()&&(R5(a,t)?o=!0:i=!1),a.subRows&&a.subRows.length)){const s=$4(a,t);s==="all"?o=!0:(s==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const I4=/([0-9]+)/gm,aqe=(e,t,n)=>CY(Nl(e.getValue(n)).toLowerCase(),Nl(t.getValue(n)).toLowerCase()),sqe=(e,t,n)=>CY(Nl(e.getValue(n)),Nl(t.getValue(n))),uqe=(e,t,n)=>D5(Nl(e.getValue(n)).toLowerCase(),Nl(t.getValue(n)).toLowerCase()),lqe=(e,t,n)=>D5(Nl(e.getValue(n)),Nl(t.getValue(n))),cqe=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:rD5(e.getValue(n),t.getValue(n));function D5(e,t){return e===t?0:e>t?1:-1}function Nl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function CY(e,t){const n=e.split(I4).filter(Boolean),r=t.split(I4).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),a=parseInt(i,10),s=parseInt(o,10),u=[a,s].sort();if(isNaN(u[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(u[1]))return isNaN(a)?-1:1;if(a>s)return 1;if(s>a)return-1}return n.length-r.length}const Qp={alphanumeric:aqe,alphanumericCaseSensitive:sqe,text:uqe,textCaseSensitive:lqe,datetime:cqe,basic:fqe},dqe={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Wo("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i?.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Qp.datetime;if(typeof o=="string"&&(r=!0,o.split(I4).length>1))return Qp.alphanumeric}return r?Qp.text:Qp.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return N2(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Qp[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const s=a?.find(p=>p.id===e.id),u=a?.findIndex(p=>p.id===e.id);let l=[],c,f=o?n:i==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?s?c="toggle":c="add":a!=null&&a.length&&u!==a.length-1?c="replace":s?c="toggle":c="replace",c==="toggle"&&(o||i||(c="remove")),c==="add"){var h;l=[...a,{id:e.id,desc:f}],l.splice(0,l.length-((h=t.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else c==="toggle"?l=a.map(p=>p.id===e.id?{...p,desc:f}:p):c==="remove"?l=a.filter(p=>p.id!==e.id):l=[{id:e.id,desc:f}];return l})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},hqe=[IHe,JHe,YHe,ZHe,NHe,LHe,eqe,tqe,dqe,KHe,nqe,rqe,iqe,oqe,XHe];function pqe(e){var t,n;const r=[...hqe,...(t=e._features)!=null?t:[]];let i={_features:r};const o=i._features.reduce((h,p)=>Object.assign(h,p.getDefaultOptions==null?void 0:p.getDefaultOptions(i)),{}),a=h=>i.options.mergeOptions?i.options.mergeOptions(o,h):{...o,...h};let u={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(h=>{var p;u=(p=h.getInitialState==null?void 0:h.getInitialState(u))!=null?p:u});const l=[];let c=!1;const f={_features:r,options:{...o,...e},initialState:u,_queue:h=>{l.push(h),c||(c=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();c=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{i.setState(i.initialState)},setOptions:h=>{const p=fl(h,i.options);i.options=a(p)},getState:()=>i.options.state,setState:h=>{i.options.onStateChange==null||i.options.onStateChange(h)},_getRowId:(h,p,m)=>{var y;return(y=i.options.getRowId==null?void 0:i.options.getRowId(h,p,m))!=null?y:`${m?[m.id,p].join("."):p}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(h,p)=>{let m=(p?i.getPrePaginationRowModel():i.getRowModel()).rowsById[h];if(!m&&(m=i.getCoreRowModel().rowsById[h],!m))throw new Error;return m},_getDefaultColumnDef:Ct(()=>[i.options.defaultColumn],h=>{var p;return h=(p=h)!=null?p:{},{header:m=>{const y=m.header.column.columnDef;return y.accessorKey?y.accessorKey:y.accessorFn?y.id:null},cell:m=>{var y,b;return(y=(b=m.renderValue())==null||b.toString==null?void 0:b.toString())!=null?y:null},...i._features.reduce((m,y)=>Object.assign(m,y.getDefaultColumnDef==null?void 0:y.getDefaultColumnDef()),{}),...h}},Et(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:Ct(()=>[i._getColumnDefs()],h=>{const p=function(m,y,b){return b===void 0&&(b=0),m.map(w=>{const x=$He(i,w,b,y),S=w;return x.columns=S.columns?p(S.columns,x,b+1):[],x})};return p(h)},Et(e,"debugColumns")),getAllFlatColumns:Ct(()=>[i.getAllColumns()],h=>h.flatMap(p=>p.getFlatColumns()),Et(e,"debugColumns")),_getAllFlatColumnsById:Ct(()=>[i.getAllFlatColumns()],h=>h.reduce((p,m)=>(p[m.id]=m,p),{}),Et(e,"debugColumns")),getAllLeafColumns:Ct(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(h,p)=>{let m=h.flatMap(y=>y.getLeafColumns());return p(m)},Et(e,"debugColumns")),getColumn:h=>i._getAllFlatColumnsById()[h]};Object.assign(i,f);for(let h=0;hCt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,a){o===void 0&&(o=0);const s=[];for(let l=0;le._autoResetPageIndex()))}function gqe(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function EY(e,t,n){return n.options.filterFromLeafRows?mqe(e,t,n):vqe(e,t,n)}function mqe(e,t,n){var r;const i=[],o={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,s=function(u,l){l===void 0&&(l=0);const c=[];for(let h=0;hCt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,i)=>{if(!n.rows.length||!(r!=null&&r.length)&&!i)return n;const o=[...r.map(s=>s.id).filter(s=>s!==t),i?"__global__":void 0].filter(Boolean),a=s=>{for(let u=0;uCt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let o=0;oCt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let h=0;h{var p;const m=e.getColumn(h.id);if(!m)return;const y=m.getFilterFn();y&&i.push({id:h.id,filterFn:y,resolvedValue:(p=y.resolveFilterValue==null?void 0:y.resolveFilterValue(h.value))!=null?p:h.value})});const a=(n??[]).map(h=>h.id),s=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());r&&s&&u.length&&(a.push("__global__"),u.forEach(h=>{var p;o.push({id:h.id,filterFn:s,resolvedValue:(p=s.resolveFilterValue==null?void 0:s.resolveFilterValue(r))!=null?p:r})}));let l,c;for(let h=0;h{p.columnFiltersMeta[y]=b})}if(o.length){for(let m=0;m{p.columnFiltersMeta[y]=b})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const f=h=>{for(let p=0;pe._autoResetPageIndex()))}function Itt(e){return t=>Ct(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:a,flatRows:s,rowsById:u}=r;const l=i*o,c=l+i;a=a.slice(l,c);let f;t.options.paginateExpandedRows?f={rows:a,flatRows:s,rowsById:u}:f=gqe({rows:a,flatRows:s,rowsById:u}),f.flatRows=[];const h=p=>{f.flatRows.push(p),p.subRows.length&&p.subRows.forEach(h)};return f.rows.forEach(h),f},Et(t.options,"debugTable"))}function Ntt(){return e=>Ct(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(u=>{var l;return(l=e.getColumn(u.id))==null?void 0:l.getCanSort()}),a={};o.forEach(u=>{const l=e.getColumn(u.id);l&&(a[u.id]={sortUndefined:l.columnDef.sortUndefined,invertSorting:l.columnDef.invertSorting,sortingFn:l.getSortingFn()})});const s=u=>{const l=u.map(c=>({...c}));return l.sort((c,f)=>{for(let p=0;p{var f;i.push(c),(f=c.subRows)!=null&&f.length&&(c.subRows=s(c.subRows))}),l};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},Et(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** * react-table * * Copyright (c) TanStack @@ -598,13 +608,13 @@ Defaulting to \`null\`.`}var Ott=dY,Att=pY;/** * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Itt(e,t){return e?yqe(e)?v.createElement(e,t):e:null}function yqe(e){return bqe(e)||typeof e=="function"||xqe(e)}function bqe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function xqe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Ntt(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=v.useState(()=>({current:pqe(t)})),[r,i]=v.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:a=>{i(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}function wqe(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function _qe(e){const[t,n]=v.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var $5="Switch",[Sqe,Ltt]=Di($5),[Cqe,Eqe]=Sqe($5),OY=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:u="on",onCheckedChange:l,form:c,...f}=e,[h,p]=v.useState(null),m=Nt(t,S=>p(S)),y=v.useRef(!1),b=h?c||!!h.closest("form"):!0,[w=!1,x]=Ts({prop:i,defaultProp:o,onChange:l});return I.jsxs(Cqe,{scope:n,checked:w,disabled:s,children:[I.jsx(gt.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":kY(w),"data-disabled":s?"":void 0,disabled:s,value:u,...f,ref:m,onClick:Ye(e.onClick,S=>{x(O=>!O),b&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),b&&I.jsx(Oqe,{control:h,bubbles:!y.current,name:r,value:u,checked:w,required:a,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});OY.displayName=$5;var AY="SwitchThumb",PY=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Eqe(AY,n);return I.jsx(gt.span,{"data-state":kY(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});PY.displayName=AY;var Oqe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=v.useRef(null),a=wqe(n),s=_qe(t);return v.useEffect(()=>{const u=o.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(a!==n&&f){const h=new Event("click",{bubbles:r});f.call(u,n),u.dispatchEvent(h)}},[a,n,r]),I.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function kY(e){return e?"checked":"unchecked"}var Ftt=OY,jtt=PY;const TY=Object.freeze({left:0,top:0,width:16,height:16}),Lx=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),I5=Object.freeze({...TY,...Lx}),N4=Object.freeze({...I5,body:"",hidden:!1});function Aqe(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function hN(e,t){const n=Aqe(e,t);for(const r in N4)r in Lx?r in e&&!(r in n)&&(n[r]=Lx[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Pqe(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function o(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const s=r[a]&&r[a].parent,u=s&&o(s);u&&(i[a]=[s].concat(u))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(o),i}function kqe(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let o={};function a(s){o=hN(r[s]||i[s],o)}return a(t),n.forEach(a),hN(e,o)}function MY(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=Pqe(e);for(const i in r){const o=r[i];o&&(t(i,kqe(e,i,o)),n.push(i))}return n}const Tqe={provider:"",aliases:{},not_found:{},...TY};function G3(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function RY(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!G3(e,Tqe))return null;const n=t.icons;for(const i in n){const o=n[i];if(!i||typeof o.body!="string"||!G3(o,N4))return null}const r=t.aliases||Object.create(null);for(const i in r){const o=r[i],a=o.parent;if(!i||typeof a!="string"||!n[a]&&!r[a]||!G3(o,N4))return null}return t}const DY=/^[a-z0-9]+(-[a-z0-9]+)*$/,L2=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const s=i.pop(),u=i.pop(),l={provider:i.length>0?i[0]:r,prefix:u,name:s};return t&&!w1(l)?null:l}const o=i[0],a=o.split("-");if(a.length>1){const s={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!w1(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:o};return t&&!w1(s,n)?null:s}return null},w1=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,pN=Object.create(null);function Mqe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function cf(e,t){const n=pN[e]||(pN[e]=Object.create(null));return n[t]||(n[t]=Mqe(e,t))}function N5(e,t){return RY(t)?MY(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Rqe(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let um=!1;function $Y(e){return typeof e=="boolean"&&(um=e),um}function gN(e){const t=typeof e=="string"?L2(e,!0,um):e;if(t){const n=cf(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Dqe(e,t){const n=L2(e,!0,um);if(!n)return!1;const r=cf(n.provider,n.prefix);return t?Rqe(r,n.name,t):(r.missing.add(n.name),!0)}function $qe(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),um&&!t&&!e.prefix){let i=!1;return RY(e)&&(e.prefix="",MY(e,(o,a)=>{Dqe(o,a)&&(i=!0)})),i}const n=e.prefix;if(!w1({provider:t,prefix:n,name:"a"}))return!1;const r=cf(t,n);return!!N5(r,e)}const IY=Object.freeze({width:null,height:null}),NY=Object.freeze({...IY,...Lx}),Iqe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Nqe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function mN(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Iqe);if(r===null||!r.length)return e;const i=[];let o=r.shift(),a=Nqe.test(o);for(;;){if(a){const s=parseFloat(o);isNaN(s)?i.push(o):i.push(Math.ceil(s*t*n)/n)}else i.push(o);if(o=r.shift(),o===void 0)return i.join("");a=!a}}function Lqe(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),o=e.indexOf("",o);if(a===-1)break;n+=e.slice(i+1,o).trim(),e=e.slice(0,r).trim()+e.slice(a+1)}return{defs:n,content:e}}function Fqe(e,t){return e?""+e+""+t:t}function jqe(e,t,n){const r=Lqe(e);return Fqe(r.defs,t+r.content+n)}const Bqe=e=>e==="unset"||e==="undefined"||e==="none";function Uqe(e,t){const n={...I5,...e},r={...NY,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,r].forEach(y=>{const b=[],w=y.hFlip,x=y.vFlip;let S=y.rotate;w?x?S+=2:(b.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),b.push("scale(-1 1)"),i.top=i.left=0):x&&(b.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),b.push("scale(1 -1)"),i.top=i.left=0);let O;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:O=i.height/2+i.top,b.unshift("rotate(90 "+O.toString()+" "+O.toString()+")");break;case 2:b.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:O=i.width/2+i.left,b.unshift("rotate(-90 "+O.toString()+" "+O.toString()+")");break}S%2===1&&(i.left!==i.top&&(O=i.left,i.left=i.top,i.top=O),i.width!==i.height&&(O=i.width,i.width=i.height,i.height=O)),b.length&&(o=jqe(o,'',""))});const a=r.width,s=r.height,u=i.width,l=i.height;let c,f;a===null?(f=s===null?"1em":s==="auto"?l:s,c=mN(f,u/l)):(c=a==="auto"?u:a,f=s===null?mN(c,l/u):s==="auto"?l:s);const h={},p=(y,b)=>{Bqe(b)||(h[y]=b.toString())};p("width",c),p("height",f);const m=[i.left,i.top,u,l];return h.viewBox=m.join(" "),{attributes:h,viewBox:m,body:o}}const zqe=/\sid="(\S+)"/g,Wqe="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Vqe=0;function Hqe(e,t=Wqe){const n=[];let r;for(;r=zqe.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(o=>{const a=typeof t=="function"?t(o):t+(Vqe++).toString(),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const L4=Object.create(null);function qqe(e,t){L4[e]=t}function F4(e){return L4[e]||L4[""]}function L5(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const F5=Object.create(null),Jp=["https://api.simplesvg.com","https://api.unisvg.com"],_1=[];for(;Jp.length>0;)Jp.length===1||Math.random()>.5?_1.push(Jp.shift()):_1.push(Jp.pop());F5[""]=L5({resources:["https://api.iconify.design"].concat(_1)});function Kqe(e,t){const n=L5(t);return n===null?!1:(F5[e]=n,!0)}function j5(e){return F5[e]}const Gqe=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let vN=Gqe();function Yqe(e,t){const n=j5(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const o=t+".json?icons=";r=n.maxURL-i-n.path.length-o.length}return r}function Zqe(e){return e===404}const Xqe=(e,t,n)=>{const r=[],i=Yqe(e,t),o="icons";let a={type:o,provider:e,prefix:t,icons:[]},s=0;return n.forEach((u,l)=>{s+=u.length+1,s>=i&&l>0&&(r.push(a),a={type:o,provider:e,prefix:t,icons:[]},s=u.length),a.icons.push(u)}),r.push(a),r};function Qqe(e){if(typeof e=="string"){const t=j5(e);if(t)return t.path}return"/"}const Jqe=(e,t,n)=>{if(!vN){n("abort",424);return}let r=Qqe(t.provider);switch(t.type){case"icons":{const o=t.prefix,s=t.icons.join(","),u=new URLSearchParams({icons:s});r+=o+".json?"+u.toString();break}case"custom":{const o=t.uri;r+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n("abort",400);return}let i=503;vN(e+r).then(o=>{const a=o.status;if(a!==200){setTimeout(()=>{n(Zqe(a)?"abort":"next",a)});return}return i=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?n("abort",o):n("next",i)});return}setTimeout(()=>{n("success",o)})}).catch(()=>{n("next",i)})},eKe={prepare:Xqe,send:Jqe};function tKe(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,o)=>i.provider!==o.provider?i.provider.localeCompare(o.provider):i.prefix!==o.prefix?i.prefix.localeCompare(o.prefix):i.name.localeCompare(o.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const o=i.provider,a=i.prefix,s=i.name,u=n[o]||(n[o]=Object.create(null)),l=u[a]||(u[a]=cf(o,a));let c;s in l.icons?c=t.loaded:a===""||l.missing.has(s)?c=t.missing:c=t.pending;const f={provider:o,prefix:a,name:s};c.push(f)}),t}function LY(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function nKe(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(o=>{const a=o.icons,s=a.pending.length;a.pending=a.pending.filter(u=>{if(u.prefix!==i)return!0;const l=u.name;if(e.icons[l])a.loaded.push({provider:r,prefix:i,name:l});else if(e.missing.has(l))a.missing.push({provider:r,prefix:i,name:l});else return n=!0,!0;return!1}),a.pending.length!==s&&(n||LY([e],o.id),o.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),o.abort))})}))}let rKe=0;function iKe(e,t,n){const r=rKe++,i=LY.bind(null,n,r);if(!t.pending.length)return i;const o={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(o)}),i}function oKe(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const o=typeof i=="string"?L2(i,t,n):i;o&&r.push(o)}),r}var aKe={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function sKe(e,t,n,r){const i=e.resources.length,o=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let C=e.resources.slice(0);for(a=[];C.length>1;){const P=Math.floor(Math.random()*C.length);a.push(C[P]),C=C.slice(0,P).concat(C.slice(P+1))}a=a.concat(C)}else a=e.resources.slice(o).concat(e.resources.slice(0,o));const s=Date.now();let u="pending",l=0,c,f=null,h=[],p=[];typeof r=="function"&&p.push(r);function m(){f&&(clearTimeout(f),f=null)}function y(){u==="pending"&&(u="aborted"),m(),h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function b(C,P){P&&(p=[]),typeof C=="function"&&p.push(C)}function w(){return{startTime:s,payload:t,status:u,queriesSent:l,queriesPending:h.length,subscribe:b,abort:y}}function x(){u="failed",p.forEach(C=>{C(void 0,c)})}function S(){h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function O(C,P,M){const N=P!=="success";switch(h=h.filter(B=>B!==C),u){case"pending":break;case"failed":if(N||!e.dataAfterTimeout)return;break;default:return}if(P==="abort"){c=M,x();return}if(N){c=M,h.length||(a.length?E():x());return}if(m(),S(),!e.random){const B=e.resources.indexOf(C.resource);B!==-1&&B!==e.index&&(e.index=B)}u="completed",p.forEach(B=>{B(M)})}function E(){if(u!=="pending")return;m();const C=a.shift();if(C===void 0){if(h.length){f=setTimeout(()=>{m(),u==="pending"&&(S(),x())},e.timeout);return}x();return}const P={status:"pending",resource:C,callback:(M,N)=>{O(P,M,N)}};h.push(P),l++,f=setTimeout(E,e.rotate),n(C,t,P.callback)}return setTimeout(E),w}function FY(e){const t={...aKe,...e};let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,u,l){const c=sKe(t,s,u,(f,h)=>{r(),l&&l(f,h)});return n.push(c),c}function o(s){return n.find(u=>s(u))||null}return{query:i,find:o,setIndex:s=>{t.index=s},getIndex:()=>t.index,cleanup:r}}function yN(){}const Y3=Object.create(null);function uKe(e){if(!Y3[e]){const t=j5(e);if(!t)return;const n=FY(t),r={config:t,redundancy:n};Y3[e]=r}return Y3[e]}function lKe(e,t,n){let r,i;if(typeof e=="string"){const o=F4(e);if(!o)return n(void 0,424),yN;i=o.send;const a=uKe(e);a&&(r=a.redundancy)}else{const o=L5(e);if(o){r=FY(o);const a=e.resources?e.resources[0]:"",s=F4(a);s&&(i=s.send)}}return!r||!i?(n(void 0,424),yN):r.query(t,i,n)().abort}const bN="iconify2",lm="iconify",jY=lm+"-count",xN=lm+"-version",BY=36e5,cKe=168,fKe=50;function j4(e,t){try{return e.getItem(t)}catch{}}function B5(e,t,n){try{return e.setItem(t,n),!0}catch{}}function wN(e,t){try{e.removeItem(t)}catch{}}function B4(e,t){return B5(e,jY,t.toString())}function U4(e){return parseInt(j4(e,jY))||0}const F2={local:!0,session:!0},UY={local:new Set,session:new Set};let U5=!1;function dKe(e){U5=e}let qy=typeof window>"u"?{}:window;function zY(e){const t=e+"Storage";try{if(qy&&qy[t]&&typeof qy[t].length=="number")return qy[t]}catch{}F2[e]=!1}function WY(e,t){const n=zY(e);if(!n)return;const r=j4(n,xN);if(r!==bN){if(r){const s=U4(n);for(let u=0;u{const u=lm+s.toString(),l=j4(n,u);if(typeof l=="string"){try{const c=JSON.parse(l);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>i&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,s))return!0}catch{}wN(n,u)}};let a=U4(n);for(let s=a-1;s>=0;s--)o(s)||(s===a-1?(a--,B4(n,a)):UY[e].add(s))}function VY(){if(!U5){dKe(!0);for(const e in F2)WY(e,t=>{const n=t.data,r=t.provider,i=n.prefix,o=cf(r,i);if(!N5(o,n).length)return!1;const a=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,a):a,!0})}}function hKe(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in F2)WY(r,i=>{const o=i.data;return i.provider!==e.provider||o.prefix!==e.prefix||o.lastModified===t});return!0}function pKe(e,t){U5||VY();function n(r){let i;if(!F2[r]||!(i=zY(r)))return;const o=UY[r];let a;if(o.size)o.delete(a=Array.from(o).shift());else if(a=U4(i),a>=fKe||!B4(i,a+1))return;const s={cached:Math.floor(Date.now()/BY),provider:e.provider,data:t};return B5(i,lm+a.toString(),JSON.stringify(s))}t.lastModified&&!hKe(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function gKe(){}function mKe(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,nKe(e)}))}function vKe(e){const t=[],n=[];return e.forEach(r=>{(r.match(DY)?t:n).push(r)}),{valid:t,invalid:n}}function e0(e,t,n,r){function i(){const o=e.pendingIcons;t.forEach(a=>{o&&o.delete(a),e.icons[a]||e.missing.add(a)})}if(n&&typeof n=="object")try{if(!N5(e,n).length){i();return}r&&pKe(e,n)}catch(o){console.error(o)}i(),mKe(e)}function _N(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function yKe(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const o=e.loadIcon;if(e.loadIcons&&(i.length>1||!o)){_N(e.loadIcons(i,r,n),c=>{e0(e,i,c,!1)});return}if(o){i.forEach(c=>{const f=o(c,r,n);_N(f,h=>{const p=h?{prefix:r,icons:{[c]:h}}:null;e0(e,[c],p,!1)})});return}const{valid:a,invalid:s}=vKe(i);if(s.length&&e0(e,s,null,!1),!a.length)return;const u=r.match(DY)?F4(n):null;if(!u){e0(e,a,null,!1);return}u.prepare(n,r,a).forEach(c=>{lKe(n,c,f=>{e0(e,c.icons,f,!0)})})}))}const bKe=(e,t)=>{const n=oKe(e,!0,$Y()),r=tKe(n);if(!r.pending.length){let u=!0;return setTimeout(()=>{u&&t(r.loaded,r.missing,r.pending,gKe)}),()=>{u=!1}}const i=Object.create(null),o=[];let a,s;return r.pending.forEach(u=>{const{provider:l,prefix:c}=u;if(c===s&&l===a)return;a=l,s=c,o.push(cf(l,c));const f=i[l]||(i[l]=Object.create(null));f[c]||(f[c]=[])}),r.pending.forEach(u=>{const{provider:l,prefix:c,name:f}=u,h=cf(l,c),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(f)||(p.add(f),i[l][c].push(f))}),o.forEach(u=>{const l=i[u.provider][u.prefix];l.length&&yKe(u,l)}),iKe(t,r,o)};function xKe(e,t){const n={...e};for(const r in t){const i=t[r],o=typeof i;r in IY?(i===null||i&&(o==="string"||o==="number"))&&(n[r]=i):o===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const wKe=/[\s,]+/;function _Ke(e,t){t.split(wKe).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function SKe(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o=o/i,o%1===0?r(o):0)}}return t}function CKe(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}function EKe(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function OKe(e){return"data:image/svg+xml,"+EKe(e)}function AKe(e){return'url("'+OKe(e)+'")'}let I0;function PKe(){try{I0=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{I0=null}}function kKe(e){return I0===void 0&&PKe(),I0?I0.createHTML(e):e}const HY={...NY,inline:!1},TKe={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},MKe={display:"inline-block"},z4={backgroundColor:"currentColor"},qY={backgroundColor:"transparent"},SN={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},CN={WebkitMask:z4,mask:z4,background:qY};for(const e in CN){const t=CN[e];for(const n in SN)t[e+n]=SN[n]}const RKe={...HY,inline:!0};function EN(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const DKe=(e,t,n)=>{const r=t.inline?RKe:HY,i=xKe(r,t),o=t.mode||"svg",a={},s=t.style||{},u={...o==="svg"?TKe:{}};if(n){const b=L2(n,!1,!0);if(b){const w=["iconify"],x=["provider","prefix"];for(const S of x)b[S]&&w.push("iconify--"+b[S]);u.className=w.join(" ")}}for(let b in t){const w=t[b];if(w!==void 0)switch(b){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":u.ref=w;break;case"className":u[b]=(u[b]?u[b]+" ":"")+w;break;case"inline":case"hFlip":case"vFlip":i[b]=w===!0||w==="true"||w===1;break;case"flip":typeof w=="string"&&_Ke(i,w);break;case"color":a.color=w;break;case"rotate":typeof w=="string"?i[b]=SKe(w):typeof w=="number"&&(i[b]=w);break;case"ariaHidden":case"aria-hidden":w!==!0&&w!=="true"&&delete u["aria-hidden"];break;default:r[b]===void 0&&(u[b]=w)}}const l=Uqe(e,i),c=l.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),o==="svg"){u.style={...a,...s},Object.assign(u,c);let b=0,w=t.id;return typeof w=="string"&&(w=w.replace(/-/g,"_")),u.dangerouslySetInnerHTML={__html:kKe(Hqe(l.body,w?()=>w+"ID"+b++:"iconifyReact"))},v.createElement("svg",u)}const{body:f,width:h,height:p}=e,m=o==="mask"||(o==="bg"?!1:f.indexOf("currentColor")!==-1),y=CKe(f,{...c,width:h+"",height:p+""});return u.style={...a,"--svg":AKe(y),width:EN(c.width),height:EN(c.height),...MKe,...m?z4:qY,...s},v.createElement("span",u)};$Y(!0);qqe("",eKe);if(typeof document<"u"&&typeof window<"u"){VY();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!$qe(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;Kqe(n,i)||console.error(r)}catch{console.error(r)}}}}function KY(e){const[t,n]=v.useState(!!e.ssr),[r,i]=v.useState({});function o(p){if(p){const m=e.icon;if(typeof m=="object")return{name:"",data:m};const y=gN(m);if(y)return{name:m,data:y}}return{name:""}}const[a,s]=v.useState(o(!!e.ssr));function u(){const p=r.callback;p&&(p(),i({}))}function l(p){if(JSON.stringify(a)!==JSON.stringify(p))return u(),s(p),!0}function c(){var p;const m=e.icon;if(typeof m=="object"){l({name:"",data:m});return}const y=gN(m);if(l({name:m,data:y}))if(y===void 0){const b=bKe([m],c);i({callback:b})}else y&&((p=e.onLoad)===null||p===void 0||p.call(e,m))}v.useEffect(()=>(n(!0),u),[]),v.useEffect(()=>{t&&c()},[e.icon,t]);const{name:f,data:h}=a;return h?DKe({...I5,...h},e,f):e.children?e.children:v.createElement("span",{})}const Btt=v.forwardRef((e,t)=>KY({...e,_ref:t}));v.forwardRef((e,t)=>KY({inline:!0,...e,_ref:t}));var GY="AlertDialog",[$Ke,Utt]=Di(GY,[lz]),Du=lz(),YY=e=>{const{__scopeAlertDialog:t,...n}=e,r=Du(t);return I.jsx(xve,{...r,...n,modal:!0})};YY.displayName=GY;var IKe="AlertDialogTrigger",ZY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(wve,{...i,...r,ref:t})});ZY.displayName=IKe;var NKe="AlertDialogPortal",XY=e=>{const{__scopeAlertDialog:t,...n}=e,r=Du(t);return I.jsx(_ve,{...r,...n})};XY.displayName=NKe;var LKe="AlertDialogOverlay",QY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Sve,{...i,...r,ref:t})});QY.displayName=LKe;var jd="AlertDialogContent",[FKe,jKe]=$Ke(jd),JY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Du(n),a=v.useRef(null),s=Nt(t,a),u=v.useRef(null);return I.jsx(mve,{contentName:jd,titleName:eZ,docsSlug:"alert-dialog",children:I.jsx(FKe,{scope:n,cancelRef:u,children:I.jsxs(Cve,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Ye(i.onOpenAutoFocus,l=>{l.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[I.jsx(ZO,{children:r}),I.jsx(UKe,{contentRef:a})]})})})});JY.displayName=jd;var eZ="AlertDialogTitle",tZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Eve,{...i,...r,ref:t})});tZ.displayName=eZ;var nZ="AlertDialogDescription",rZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Ove,{...i,...r,ref:t})});rZ.displayName=nZ;var BKe="AlertDialogAction",iZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Ez,{...i,...r,ref:t})});iZ.displayName=BKe;var oZ="AlertDialogCancel",aZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=jKe(oZ,n),o=Du(n),a=Nt(t,i);return I.jsx(Ez,{...o,...r,ref:a})});aZ.displayName=oZ;var UKe=({contentRef:e})=>{const t=`\`${jd}\` requires a description for the component to be accessible for screen reader users. + */function Ltt(e,t){return e?yqe(e)?v.createElement(e,t):e:null}function yqe(e){return bqe(e)||typeof e=="function"||xqe(e)}function bqe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function xqe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Ftt(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=v.useState(()=>({current:pqe(t)})),[r,i]=v.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:a=>{i(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}function wqe(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function _qe(e){const[t,n]=v.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var $5="Switch",[Sqe,jtt]=Di($5),[Cqe,Eqe]=Sqe($5),OY=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:u="on",onCheckedChange:l,form:c,...f}=e,[h,p]=v.useState(null),m=Nt(t,S=>p(S)),y=v.useRef(!1),b=h?c||!!h.closest("form"):!0,[w=!1,x]=Ts({prop:i,defaultProp:o,onChange:l});return I.jsxs(Cqe,{scope:n,checked:w,disabled:s,children:[I.jsx(mt.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":kY(w),"data-disabled":s?"":void 0,disabled:s,value:u,...f,ref:m,onClick:Ye(e.onClick,S=>{x(O=>!O),b&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),b&&I.jsx(Oqe,{control:h,bubbles:!y.current,name:r,value:u,checked:w,required:a,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});OY.displayName=$5;var AY="SwitchThumb",PY=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Eqe(AY,n);return I.jsx(mt.span,{"data-state":kY(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});PY.displayName=AY;var Oqe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=v.useRef(null),a=wqe(n),s=_qe(t);return v.useEffect(()=>{const u=o.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(a!==n&&f){const h=new Event("click",{bubbles:r});f.call(u,n),u.dispatchEvent(h)}},[a,n,r]),I.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function kY(e){return e?"checked":"unchecked"}var Btt=OY,Utt=PY;const TY=Object.freeze({left:0,top:0,width:16,height:16}),Lx=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),I5=Object.freeze({...TY,...Lx}),N4=Object.freeze({...I5,body:"",hidden:!1});function Aqe(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function hN(e,t){const n=Aqe(e,t);for(const r in N4)r in Lx?r in e&&!(r in n)&&(n[r]=Lx[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Pqe(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function o(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const s=r[a]&&r[a].parent,u=s&&o(s);u&&(i[a]=[s].concat(u))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(o),i}function kqe(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let o={};function a(s){o=hN(r[s]||i[s],o)}return a(t),n.forEach(a),hN(e,o)}function MY(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=Pqe(e);for(const i in r){const o=r[i];o&&(t(i,kqe(e,i,o)),n.push(i))}return n}const Tqe={provider:"",aliases:{},not_found:{},...TY};function G3(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function RY(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!G3(e,Tqe))return null;const n=t.icons;for(const i in n){const o=n[i];if(!i||typeof o.body!="string"||!G3(o,N4))return null}const r=t.aliases||Object.create(null);for(const i in r){const o=r[i],a=o.parent;if(!i||typeof a!="string"||!n[a]&&!r[a]||!G3(o,N4))return null}return t}const DY=/^[a-z0-9]+(-[a-z0-9]+)*$/,L2=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const s=i.pop(),u=i.pop(),l={provider:i.length>0?i[0]:r,prefix:u,name:s};return t&&!w1(l)?null:l}const o=i[0],a=o.split("-");if(a.length>1){const s={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!w1(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:o};return t&&!w1(s,n)?null:s}return null},w1=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,pN=Object.create(null);function Mqe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function cf(e,t){const n=pN[e]||(pN[e]=Object.create(null));return n[t]||(n[t]=Mqe(e,t))}function N5(e,t){return RY(t)?MY(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Rqe(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let um=!1;function $Y(e){return typeof e=="boolean"&&(um=e),um}function gN(e){const t=typeof e=="string"?L2(e,!0,um):e;if(t){const n=cf(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Dqe(e,t){const n=L2(e,!0,um);if(!n)return!1;const r=cf(n.provider,n.prefix);return t?Rqe(r,n.name,t):(r.missing.add(n.name),!0)}function $qe(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),um&&!t&&!e.prefix){let i=!1;return RY(e)&&(e.prefix="",MY(e,(o,a)=>{Dqe(o,a)&&(i=!0)})),i}const n=e.prefix;if(!w1({provider:t,prefix:n,name:"a"}))return!1;const r=cf(t,n);return!!N5(r,e)}const IY=Object.freeze({width:null,height:null}),NY=Object.freeze({...IY,...Lx}),Iqe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Nqe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function mN(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Iqe);if(r===null||!r.length)return e;const i=[];let o=r.shift(),a=Nqe.test(o);for(;;){if(a){const s=parseFloat(o);isNaN(s)?i.push(o):i.push(Math.ceil(s*t*n)/n)}else i.push(o);if(o=r.shift(),o===void 0)return i.join("");a=!a}}function Lqe(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),o=e.indexOf("",o);if(a===-1)break;n+=e.slice(i+1,o).trim(),e=e.slice(0,r).trim()+e.slice(a+1)}return{defs:n,content:e}}function Fqe(e,t){return e?""+e+""+t:t}function jqe(e,t,n){const r=Lqe(e);return Fqe(r.defs,t+r.content+n)}const Bqe=e=>e==="unset"||e==="undefined"||e==="none";function Uqe(e,t){const n={...I5,...e},r={...NY,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,r].forEach(y=>{const b=[],w=y.hFlip,x=y.vFlip;let S=y.rotate;w?x?S+=2:(b.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),b.push("scale(-1 1)"),i.top=i.left=0):x&&(b.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),b.push("scale(1 -1)"),i.top=i.left=0);let O;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:O=i.height/2+i.top,b.unshift("rotate(90 "+O.toString()+" "+O.toString()+")");break;case 2:b.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:O=i.width/2+i.left,b.unshift("rotate(-90 "+O.toString()+" "+O.toString()+")");break}S%2===1&&(i.left!==i.top&&(O=i.left,i.left=i.top,i.top=O),i.width!==i.height&&(O=i.width,i.width=i.height,i.height=O)),b.length&&(o=jqe(o,'',""))});const a=r.width,s=r.height,u=i.width,l=i.height;let c,f;a===null?(f=s===null?"1em":s==="auto"?l:s,c=mN(f,u/l)):(c=a==="auto"?u:a,f=s===null?mN(c,l/u):s==="auto"?l:s);const h={},p=(y,b)=>{Bqe(b)||(h[y]=b.toString())};p("width",c),p("height",f);const m=[i.left,i.top,u,l];return h.viewBox=m.join(" "),{attributes:h,viewBox:m,body:o}}const zqe=/\sid="(\S+)"/g,Wqe="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Vqe=0;function Hqe(e,t=Wqe){const n=[];let r;for(;r=zqe.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(o=>{const a=typeof t=="function"?t(o):t+(Vqe++).toString(),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const L4=Object.create(null);function qqe(e,t){L4[e]=t}function F4(e){return L4[e]||L4[""]}function L5(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const F5=Object.create(null),Jp=["https://api.simplesvg.com","https://api.unisvg.com"],_1=[];for(;Jp.length>0;)Jp.length===1||Math.random()>.5?_1.push(Jp.shift()):_1.push(Jp.pop());F5[""]=L5({resources:["https://api.iconify.design"].concat(_1)});function Kqe(e,t){const n=L5(t);return n===null?!1:(F5[e]=n,!0)}function j5(e){return F5[e]}const Gqe=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let vN=Gqe();function Yqe(e,t){const n=j5(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const o=t+".json?icons=";r=n.maxURL-i-n.path.length-o.length}return r}function Zqe(e){return e===404}const Xqe=(e,t,n)=>{const r=[],i=Yqe(e,t),o="icons";let a={type:o,provider:e,prefix:t,icons:[]},s=0;return n.forEach((u,l)=>{s+=u.length+1,s>=i&&l>0&&(r.push(a),a={type:o,provider:e,prefix:t,icons:[]},s=u.length),a.icons.push(u)}),r.push(a),r};function Qqe(e){if(typeof e=="string"){const t=j5(e);if(t)return t.path}return"/"}const Jqe=(e,t,n)=>{if(!vN){n("abort",424);return}let r=Qqe(t.provider);switch(t.type){case"icons":{const o=t.prefix,s=t.icons.join(","),u=new URLSearchParams({icons:s});r+=o+".json?"+u.toString();break}case"custom":{const o=t.uri;r+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n("abort",400);return}let i=503;vN(e+r).then(o=>{const a=o.status;if(a!==200){setTimeout(()=>{n(Zqe(a)?"abort":"next",a)});return}return i=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?n("abort",o):n("next",i)});return}setTimeout(()=>{n("success",o)})}).catch(()=>{n("next",i)})},eKe={prepare:Xqe,send:Jqe};function tKe(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,o)=>i.provider!==o.provider?i.provider.localeCompare(o.provider):i.prefix!==o.prefix?i.prefix.localeCompare(o.prefix):i.name.localeCompare(o.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const o=i.provider,a=i.prefix,s=i.name,u=n[o]||(n[o]=Object.create(null)),l=u[a]||(u[a]=cf(o,a));let c;s in l.icons?c=t.loaded:a===""||l.missing.has(s)?c=t.missing:c=t.pending;const f={provider:o,prefix:a,name:s};c.push(f)}),t}function LY(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function nKe(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(o=>{const a=o.icons,s=a.pending.length;a.pending=a.pending.filter(u=>{if(u.prefix!==i)return!0;const l=u.name;if(e.icons[l])a.loaded.push({provider:r,prefix:i,name:l});else if(e.missing.has(l))a.missing.push({provider:r,prefix:i,name:l});else return n=!0,!0;return!1}),a.pending.length!==s&&(n||LY([e],o.id),o.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),o.abort))})}))}let rKe=0;function iKe(e,t,n){const r=rKe++,i=LY.bind(null,n,r);if(!t.pending.length)return i;const o={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(o)}),i}function oKe(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const o=typeof i=="string"?L2(i,t,n):i;o&&r.push(o)}),r}var aKe={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function sKe(e,t,n,r){const i=e.resources.length,o=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let C=e.resources.slice(0);for(a=[];C.length>1;){const P=Math.floor(Math.random()*C.length);a.push(C[P]),C=C.slice(0,P).concat(C.slice(P+1))}a=a.concat(C)}else a=e.resources.slice(o).concat(e.resources.slice(0,o));const s=Date.now();let u="pending",l=0,c,f=null,h=[],p=[];typeof r=="function"&&p.push(r);function m(){f&&(clearTimeout(f),f=null)}function y(){u==="pending"&&(u="aborted"),m(),h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function b(C,P){P&&(p=[]),typeof C=="function"&&p.push(C)}function w(){return{startTime:s,payload:t,status:u,queriesSent:l,queriesPending:h.length,subscribe:b,abort:y}}function x(){u="failed",p.forEach(C=>{C(void 0,c)})}function S(){h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function O(C,P,M){const N=P!=="success";switch(h=h.filter(B=>B!==C),u){case"pending":break;case"failed":if(N||!e.dataAfterTimeout)return;break;default:return}if(P==="abort"){c=M,x();return}if(N){c=M,h.length||(a.length?E():x());return}if(m(),S(),!e.random){const B=e.resources.indexOf(C.resource);B!==-1&&B!==e.index&&(e.index=B)}u="completed",p.forEach(B=>{B(M)})}function E(){if(u!=="pending")return;m();const C=a.shift();if(C===void 0){if(h.length){f=setTimeout(()=>{m(),u==="pending"&&(S(),x())},e.timeout);return}x();return}const P={status:"pending",resource:C,callback:(M,N)=>{O(P,M,N)}};h.push(P),l++,f=setTimeout(E,e.rotate),n(C,t,P.callback)}return setTimeout(E),w}function FY(e){const t={...aKe,...e};let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,u,l){const c=sKe(t,s,u,(f,h)=>{r(),l&&l(f,h)});return n.push(c),c}function o(s){return n.find(u=>s(u))||null}return{query:i,find:o,setIndex:s=>{t.index=s},getIndex:()=>t.index,cleanup:r}}function yN(){}const Y3=Object.create(null);function uKe(e){if(!Y3[e]){const t=j5(e);if(!t)return;const n=FY(t),r={config:t,redundancy:n};Y3[e]=r}return Y3[e]}function lKe(e,t,n){let r,i;if(typeof e=="string"){const o=F4(e);if(!o)return n(void 0,424),yN;i=o.send;const a=uKe(e);a&&(r=a.redundancy)}else{const o=L5(e);if(o){r=FY(o);const a=e.resources?e.resources[0]:"",s=F4(a);s&&(i=s.send)}}return!r||!i?(n(void 0,424),yN):r.query(t,i,n)().abort}const bN="iconify2",lm="iconify",jY=lm+"-count",xN=lm+"-version",BY=36e5,cKe=168,fKe=50;function j4(e,t){try{return e.getItem(t)}catch{}}function B5(e,t,n){try{return e.setItem(t,n),!0}catch{}}function wN(e,t){try{e.removeItem(t)}catch{}}function B4(e,t){return B5(e,jY,t.toString())}function U4(e){return parseInt(j4(e,jY))||0}const F2={local:!0,session:!0},UY={local:new Set,session:new Set};let U5=!1;function dKe(e){U5=e}let qy=typeof window>"u"?{}:window;function zY(e){const t=e+"Storage";try{if(qy&&qy[t]&&typeof qy[t].length=="number")return qy[t]}catch{}F2[e]=!1}function WY(e,t){const n=zY(e);if(!n)return;const r=j4(n,xN);if(r!==bN){if(r){const s=U4(n);for(let u=0;u{const u=lm+s.toString(),l=j4(n,u);if(typeof l=="string"){try{const c=JSON.parse(l);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>i&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,s))return!0}catch{}wN(n,u)}};let a=U4(n);for(let s=a-1;s>=0;s--)o(s)||(s===a-1?(a--,B4(n,a)):UY[e].add(s))}function VY(){if(!U5){dKe(!0);for(const e in F2)WY(e,t=>{const n=t.data,r=t.provider,i=n.prefix,o=cf(r,i);if(!N5(o,n).length)return!1;const a=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,a):a,!0})}}function hKe(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in F2)WY(r,i=>{const o=i.data;return i.provider!==e.provider||o.prefix!==e.prefix||o.lastModified===t});return!0}function pKe(e,t){U5||VY();function n(r){let i;if(!F2[r]||!(i=zY(r)))return;const o=UY[r];let a;if(o.size)o.delete(a=Array.from(o).shift());else if(a=U4(i),a>=fKe||!B4(i,a+1))return;const s={cached:Math.floor(Date.now()/BY),provider:e.provider,data:t};return B5(i,lm+a.toString(),JSON.stringify(s))}t.lastModified&&!hKe(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function gKe(){}function mKe(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,nKe(e)}))}function vKe(e){const t=[],n=[];return e.forEach(r=>{(r.match(DY)?t:n).push(r)}),{valid:t,invalid:n}}function e0(e,t,n,r){function i(){const o=e.pendingIcons;t.forEach(a=>{o&&o.delete(a),e.icons[a]||e.missing.add(a)})}if(n&&typeof n=="object")try{if(!N5(e,n).length){i();return}r&&pKe(e,n)}catch(o){console.error(o)}i(),mKe(e)}function _N(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function yKe(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const o=e.loadIcon;if(e.loadIcons&&(i.length>1||!o)){_N(e.loadIcons(i,r,n),c=>{e0(e,i,c,!1)});return}if(o){i.forEach(c=>{const f=o(c,r,n);_N(f,h=>{const p=h?{prefix:r,icons:{[c]:h}}:null;e0(e,[c],p,!1)})});return}const{valid:a,invalid:s}=vKe(i);if(s.length&&e0(e,s,null,!1),!a.length)return;const u=r.match(DY)?F4(n):null;if(!u){e0(e,a,null,!1);return}u.prepare(n,r,a).forEach(c=>{lKe(n,c,f=>{e0(e,c.icons,f,!0)})})}))}const bKe=(e,t)=>{const n=oKe(e,!0,$Y()),r=tKe(n);if(!r.pending.length){let u=!0;return setTimeout(()=>{u&&t(r.loaded,r.missing,r.pending,gKe)}),()=>{u=!1}}const i=Object.create(null),o=[];let a,s;return r.pending.forEach(u=>{const{provider:l,prefix:c}=u;if(c===s&&l===a)return;a=l,s=c,o.push(cf(l,c));const f=i[l]||(i[l]=Object.create(null));f[c]||(f[c]=[])}),r.pending.forEach(u=>{const{provider:l,prefix:c,name:f}=u,h=cf(l,c),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(f)||(p.add(f),i[l][c].push(f))}),o.forEach(u=>{const l=i[u.provider][u.prefix];l.length&&yKe(u,l)}),iKe(t,r,o)};function xKe(e,t){const n={...e};for(const r in t){const i=t[r],o=typeof i;r in IY?(i===null||i&&(o==="string"||o==="number"))&&(n[r]=i):o===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const wKe=/[\s,]+/;function _Ke(e,t){t.split(wKe).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function SKe(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o=o/i,o%1===0?r(o):0)}}return t}function CKe(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}function EKe(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function OKe(e){return"data:image/svg+xml,"+EKe(e)}function AKe(e){return'url("'+OKe(e)+'")'}let I0;function PKe(){try{I0=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{I0=null}}function kKe(e){return I0===void 0&&PKe(),I0?I0.createHTML(e):e}const HY={...NY,inline:!1},TKe={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},MKe={display:"inline-block"},z4={backgroundColor:"currentColor"},qY={backgroundColor:"transparent"},SN={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},CN={WebkitMask:z4,mask:z4,background:qY};for(const e in CN){const t=CN[e];for(const n in SN)t[e+n]=SN[n]}const RKe={...HY,inline:!0};function EN(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const DKe=(e,t,n)=>{const r=t.inline?RKe:HY,i=xKe(r,t),o=t.mode||"svg",a={},s=t.style||{},u={...o==="svg"?TKe:{}};if(n){const b=L2(n,!1,!0);if(b){const w=["iconify"],x=["provider","prefix"];for(const S of x)b[S]&&w.push("iconify--"+b[S]);u.className=w.join(" ")}}for(let b in t){const w=t[b];if(w!==void 0)switch(b){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":u.ref=w;break;case"className":u[b]=(u[b]?u[b]+" ":"")+w;break;case"inline":case"hFlip":case"vFlip":i[b]=w===!0||w==="true"||w===1;break;case"flip":typeof w=="string"&&_Ke(i,w);break;case"color":a.color=w;break;case"rotate":typeof w=="string"?i[b]=SKe(w):typeof w=="number"&&(i[b]=w);break;case"ariaHidden":case"aria-hidden":w!==!0&&w!=="true"&&delete u["aria-hidden"];break;default:r[b]===void 0&&(u[b]=w)}}const l=Uqe(e,i),c=l.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),o==="svg"){u.style={...a,...s},Object.assign(u,c);let b=0,w=t.id;return typeof w=="string"&&(w=w.replace(/-/g,"_")),u.dangerouslySetInnerHTML={__html:kKe(Hqe(l.body,w?()=>w+"ID"+b++:"iconifyReact"))},v.createElement("svg",u)}const{body:f,width:h,height:p}=e,m=o==="mask"||(o==="bg"?!1:f.indexOf("currentColor")!==-1),y=CKe(f,{...c,width:h+"",height:p+""});return u.style={...a,"--svg":AKe(y),width:EN(c.width),height:EN(c.height),...MKe,...m?z4:qY,...s},v.createElement("span",u)};$Y(!0);qqe("",eKe);if(typeof document<"u"&&typeof window<"u"){VY();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!$qe(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;Kqe(n,i)||console.error(r)}catch{console.error(r)}}}}function KY(e){const[t,n]=v.useState(!!e.ssr),[r,i]=v.useState({});function o(p){if(p){const m=e.icon;if(typeof m=="object")return{name:"",data:m};const y=gN(m);if(y)return{name:m,data:y}}return{name:""}}const[a,s]=v.useState(o(!!e.ssr));function u(){const p=r.callback;p&&(p(),i({}))}function l(p){if(JSON.stringify(a)!==JSON.stringify(p))return u(),s(p),!0}function c(){var p;const m=e.icon;if(typeof m=="object"){l({name:"",data:m});return}const y=gN(m);if(l({name:m,data:y}))if(y===void 0){const b=bKe([m],c);i({callback:b})}else y&&((p=e.onLoad)===null||p===void 0||p.call(e,m))}v.useEffect(()=>(n(!0),u),[]),v.useEffect(()=>{t&&c()},[e.icon,t]);const{name:f,data:h}=a;return h?DKe({...I5,...h},e,f):e.children?e.children:v.createElement("span",{})}const ztt=v.forwardRef((e,t)=>KY({...e,_ref:t}));v.forwardRef((e,t)=>KY({inline:!0,...e,_ref:t}));var GY="AlertDialog",[$Ke,Wtt]=Di(GY,[lz]),Du=lz(),YY=e=>{const{__scopeAlertDialog:t,...n}=e,r=Du(t);return I.jsx(xve,{...r,...n,modal:!0})};YY.displayName=GY;var IKe="AlertDialogTrigger",ZY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(wve,{...i,...r,ref:t})});ZY.displayName=IKe;var NKe="AlertDialogPortal",XY=e=>{const{__scopeAlertDialog:t,...n}=e,r=Du(t);return I.jsx(_ve,{...r,...n})};XY.displayName=NKe;var LKe="AlertDialogOverlay",QY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Sve,{...i,...r,ref:t})});QY.displayName=LKe;var jd="AlertDialogContent",[FKe,jKe]=$Ke(jd),JY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Du(n),a=v.useRef(null),s=Nt(t,a),u=v.useRef(null);return I.jsx(mve,{contentName:jd,titleName:eZ,docsSlug:"alert-dialog",children:I.jsx(FKe,{scope:n,cancelRef:u,children:I.jsxs(Cve,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Ye(i.onOpenAutoFocus,l=>{l.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[I.jsx(ZO,{children:r}),I.jsx(UKe,{contentRef:a})]})})})});JY.displayName=jd;var eZ="AlertDialogTitle",tZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Eve,{...i,...r,ref:t})});tZ.displayName=eZ;var nZ="AlertDialogDescription",rZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Ove,{...i,...r,ref:t})});rZ.displayName=nZ;var BKe="AlertDialogAction",iZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Ez,{...i,...r,ref:t})});iZ.displayName=BKe;var oZ="AlertDialogCancel",aZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=jKe(oZ,n),o=Du(n),a=Nt(t,i);return I.jsx(Ez,{...o,...r,ref:a})});aZ.displayName=oZ;var UKe=({contentRef:e})=>{const t=`\`${jd}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${jd}\` by passing a \`${nZ}\` 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 \`${jd}\`. 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 v.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},ztt=YY,Wtt=ZY,Vtt=XY,Htt=QY,qtt=JY,Ktt=iZ,Gtt=aZ,Ytt=tZ,Ztt=rZ;function cs(){return cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:0,n=(li[e[t+0]]+li[e[t+1]]+li[e[t+2]]+li[e[t+3]]+"-"+li[e[t+4]]+li[e[t+5]]+"-"+li[e[t+6]]+li[e[t+7]]+"-"+li[e[t+8]]+li[e[t+9]]+"-"+li[e[t+10]]+li[e[t+11]]+li[e[t+12]]+li[e[t+13]]+li[e[t+14]]+li[e[t+15]]).toLowerCase();if(!HKe(n))throw TypeError("Stringified UUID is invalid");return n}function sZ(e,t,n){e=e||{};var r=e.random||(e.rng||WKe)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,qKe(r)}function Pr(e){return v.createElement("i",{className:"rmel-iconfont rmel-icon-"+e.type})}function KKe(e){return v.createElement("div",{className:"rc-md-navigation "+(e.visible?"visible":"in-visible")},v.createElement("div",{className:"navigation-nav left"},v.createElement("div",{className:"button-wrap"},e.left)),v.createElement("div",{className:"navigation-nav right"},v.createElement("div",{className:"button-wrap"},e.right)))}function GKe(e){return v.createElement("div",{className:"tool-bar",style:e.style},e.children)}var uZ=function(e){jn(t,e);function t(){for(var n,r=arguments.length,i=new Array(r),o=0;o"u")){var r="enUS";if(navigator.language){var i=navigator.language.split("-");r=i[0],i.length!==1&&(r+=i[i.length-1].toUpperCase())}if(navigator.browserLanguage){var o=navigator.browserLanguage.split("-");r=o[0],o[1]&&(r+=o[1].toUpperCase())}this.current!==r&&this.isAvailable(r)&&(this.current=r,dl.emit(dl.EVENT_LANG_CHANGE,this,r,this.langs[r]))}},t.isAvailable=function(r){return typeof this.langs[r]<"u"},t.add=function(r,i){this.langs[r]=i},t.setCurrent=function(r){if(!this.isAvailable(r))throw new Error("Language "+r+" is not exists");this.current!==r&&(this.current=r,dl.emit(dl.EVENT_LANG_CHANGE,this,r,this.langs[r]))},t.get=function(r,i){var o=this.langs[this.current][r]||"";return i&&Object.keys(i).forEach(function(a){o=o.replace(new RegExp("\\{"+a+"\\}","g"),i[a])}),o},t.getCurrent=function(){return this.current},e}(),Fn=new XKe;function cm(e){"@babel/helpers - typeof";return cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cm(e)}function QKe(e,t){if(cm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function JKe(e){var t=QKe(e,"string");return cm(t)=="symbol"?t:t+""}function eGe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Vtt=YY,Htt=ZY,qtt=XY,Ktt=QY,Gtt=JY,Ytt=iZ,Ztt=aZ,Xtt=tZ,Qtt=rZ;function cs(){return cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:0,n=(li[e[t+0]]+li[e[t+1]]+li[e[t+2]]+li[e[t+3]]+"-"+li[e[t+4]]+li[e[t+5]]+"-"+li[e[t+6]]+li[e[t+7]]+"-"+li[e[t+8]]+li[e[t+9]]+"-"+li[e[t+10]]+li[e[t+11]]+li[e[t+12]]+li[e[t+13]]+li[e[t+14]]+li[e[t+15]]).toLowerCase();if(!HKe(n))throw TypeError("Stringified UUID is invalid");return n}function sZ(e,t,n){e=e||{};var r=e.random||(e.rng||WKe)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,qKe(r)}function Pr(e){return v.createElement("i",{className:"rmel-iconfont rmel-icon-"+e.type})}function KKe(e){return v.createElement("div",{className:"rc-md-navigation "+(e.visible?"visible":"in-visible")},v.createElement("div",{className:"navigation-nav left"},v.createElement("div",{className:"button-wrap"},e.left)),v.createElement("div",{className:"navigation-nav right"},v.createElement("div",{className:"button-wrap"},e.right)))}function GKe(e){return v.createElement("div",{className:"tool-bar",style:e.style},e.children)}var uZ=function(e){jn(t,e);function t(){for(var n,r=arguments.length,i=new Array(r),o=0;o"u")){var r="enUS";if(navigator.language){var i=navigator.language.split("-");r=i[0],i.length!==1&&(r+=i[i.length-1].toUpperCase())}if(navigator.browserLanguage){var o=navigator.browserLanguage.split("-");r=o[0],o[1]&&(r+=o[1].toUpperCase())}this.current!==r&&this.isAvailable(r)&&(this.current=r,dl.emit(dl.EVENT_LANG_CHANGE,this,r,this.langs[r]))}},t.isAvailable=function(r){return typeof this.langs[r]<"u"},t.add=function(r,i){this.langs[r]=i},t.setCurrent=function(r){if(!this.isAvailable(r))throw new Error("Language "+r+" is not exists");this.current!==r&&(this.current=r,dl.emit(dl.EVENT_LANG_CHANGE,this,r,this.langs[r]))},t.get=function(r,i){var o=this.langs[this.current][r]||"";return i&&Object.keys(i).forEach(function(a){o=o.replace(new RegExp("\\{"+a+"\\}","g"),i[a])}),o},t.getCurrent=function(){return this.current},e}(),Fn=new XKe;function cm(e){"@babel/helpers - typeof";return cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cm(e)}function QKe(e,t){if(cm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function JKe(e){var t=QKe(e,"string");return cm(t)=="symbol"?t:t+""}function eGe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rGe(e,t){if(e){if(typeof e=="string")return ON(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ON(e,t)}}function ON(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)for(var s=nGe(n),u;!(u=s()).done;){var l=u.value;if(typeof a[l]<"u"&&!a[l])return!1}else if(a.metaKey||a.ctrlKey||a.shiftKey||a.altKey)return!1;return a.key?a.key===i:a.keyCode===r}function X3(e,t){var n=e.split(` `),r=e.substr(0,t).split(` `),i=r.length,o=r[r.length-1].length,a=n[r.length-1],s=r.length>1?r[r.length-2]:null,u=n.length>r.length?n[r.length]:null;return{line:i,col:o,beforeText:e.substr(0,t),afterText:e.substr(t),curLine:a,prevLine:s,nextLine:u}}var rd={bold:["**","**"],italic:["*","*"],underline:["++","++"],strikethrough:["~~","~~"],quote:[` @@ -650,4 +660,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `:">",o};ap.prototype.renderInline=function(e,t,n){let r="";const i=this.rules;for(let o=0,a=e.length;o=0&&(r=this.attrs[n][1]),r};rs.prototype.attrJoin=function(t,n){const r=this.attrIndex(t);r<0?this.attrPush([t,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function NZ(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}NZ.prototype.Token=rs;const uYe=/\r\n?|\n/g,lYe=/\0/g;function cYe(e){let t;t=e.src.replace(uYe,` `),t=t.replace(lYe,"�"),e.src=t}function fYe(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function dYe(e){const t=e.tokens;for(let n=0,r=t.length;n\s]/i.test(e)}function pYe(e){return/^<\/a\s*>/i.test(e)}function gYe(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n=0;a--){const s=i[a];if(s.type==="link_close"){for(a--;i[a].level!==s.level&&i[a].type!=="link_open";)a--;continue}if(s.type==="html_inline"&&(hYe(s.content)&&o>0&&o--,pYe(s.content)&&o++),!(o>0)&&s.type==="text"&&e.md.linkify.test(s.content)){const u=s.content;let l=e.md.linkify.match(u);const c=[];let f=s.level,h=0;l.length>0&&l[0].index===0&&a>0&&i[a-1].type==="text_special"&&(l=l.slice(1));for(let p=0;ph){const E=new e.Token("text","",0);E.content=u.slice(h,w),E.level=f,c.push(E)}const x=new e.Token("link_open","a",1);x.attrs=[["href",y]],x.level=f++,x.markup="linkify",x.info="auto",c.push(x);const S=new e.Token("text","",0);S.content=b,S.level=f,c.push(S);const O=new e.Token("link_close","a",-1);O.level=--f,O.markup="linkify",O.info="auto",c.push(O),h=l[p].lastIndex}if(h=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(vYe,bYe)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function wYe(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&LZ.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function _Ye(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(mYe.test(e.tokens[t].content)&&xYe(e.tokens[t].children),LZ.test(e.tokens[t].content)&&wYe(e.tokens[t].children))}const SYe=/['"]/,LN=/['"]/g,FN="’";function Yy(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function CYe(e,t){let n;const r=[];for(let i=0;i=0&&!(r[n].level<=a);n--);if(r.length=n+1,o.type!=="text")continue;let s=o.content,u=0,l=s.length;e:for(;u=0)m=s.charCodeAt(c.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(u=48&&m<=57&&(h=f=!1),f&&h&&(f=b,h=w),!f&&!h){p&&(o.content=Yy(o.content,c.index,FN));continue}if(h)for(n=r.length-1;n>=0;n--){let O=r[n];if(r[n].level=0;t--)e.tokens[t].type!=="inline"||!SYe.test(e.tokens[t].content)||CYe(e.tokens[t].children,e)}function OYe(e){let t,n;const r=e.tokens,i=r.length;for(let o=0;o0&&this.level++,this.tokens.push(r),r};Ns.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};Ns.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;tn;)if(!qn(this.src.charCodeAt(--t)))return t+1;return t};Ns.prototype.skipChars=function(t,n){for(let r=this.src.length;tr;)if(n!==this.src.charCodeAt(--t))return t+1;return t};Ns.prototype.getLines=function(t,n,r,i){if(t>=n)return"";const o=new Array(n-t);for(let a=0,s=t;sr?o[a]=new Array(u-r+1).join(" ")+this.src.slice(c,f):o[a]=this.src.slice(c,f)}return o.join("")};Ns.prototype.Token=rs;const AYe=65536;function nC(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function jN(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),o=!1,a=0,s="";for(;rn)return!1;let i=t+1;if(e.sCount[i]=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const a=e.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58||o>=e.eMarks[i])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58&&!qn(s)||a===45&&qn(s))return!1;for(;o=4)return!1;l=jN(u),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop();const f=l.length;if(f===0||f!==c.length)return!1;if(r)return!0;const h=e.parentType;e.parentType="table";const p=e.md.block.ruler.getRules("blockquote"),m=e.push("table_open","table",1),y=[t,0];m.map=y;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const w=e.push("tr_open","tr",1);w.map=[t,t+1];for(let O=0;O=4||(l=jN(u),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),S+=f-l.length,S>AYe))break;if(i===t+2){const C=e.push("tbody_open","tbody",1);C.map=x=[t+2,0]}const E=e.push("tr_open","tr",1);E.map=[i,i+1];for(let C=0;C=4){r++,i=r;continue}break}e.line=i;const o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+` -`,o.map=[t,e.line],!0}function TYe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const a=e.src.charCodeAt(i);if(a!==126&&a!==96)return!1;let s=i;i=e.skipChars(i,a);let u=i-s;if(u<3)return!1;const l=e.src.slice(s,i),c=e.src.slice(i,o);if(a===96&&c.indexOf(String.fromCharCode(a))>=0)return!1;if(r)return!0;let f=t,h=!1;for(;f++,!(f>=n||(i=s=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],i=4)&&(i=e.skipChars(i,a),!(i-s=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;const s=[],u=[],l=[],c=[],f=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let p=!1,m;for(m=t;m=o)break;if(e.src.charCodeAt(i++)===62&&!S){let E=e.sCount[m]+1,C,P;e.src.charCodeAt(i)===32?(i++,E++,P=!1,C=!0):e.src.charCodeAt(i)===9?(C=!0,(e.bsCount[m]+E)%4===3?(i++,E++,P=!1):P=!0):C=!1;let M=E;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i=o,u.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+(C?1:0),l.push(e.sCount[m]),e.sCount[m]=M-E,c.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let O=!1;for(let E=0,C=f.length;E";const w=[t,0];b.map=w,e.md.block.tokenize(e,t,m);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=a,e.parentType=h,w[1]=e.line;for(let S=0;S=4)return!1;let o=e.bMarks[t]+e.tShift[t];const a=e.src.charCodeAt(o++);if(a!==42&&a!==45&&a!==95)return!1;let s=1;for(;o=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=e.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i=4||e.listIndent>=0&&e.sCount[u]-e.listIndent>=4&&e.sCount[u]=e.blkIndent&&(c=!0);let f,h,p;if((p=UN(e,u))>=0){if(f=!0,a=e.bMarks[u]+e.tShift[u],h=Number(e.src.slice(a,p-1)),c&&h!==1)return!1}else if((p=BN(e,u))>=0)f=!1;else return!1;if(c&&e.skipSpaces(p)>=e.eMarks[u])return!1;if(r)return!0;const m=e.src.charCodeAt(p-1),y=e.tokens.length;f?(s=e.push("ordered_list_open","ol",1),h!==1&&(s.attrs=[["start",h]])):s=e.push("bullet_list_open","ul",1);const b=[u,0];s.map=b,s.markup=String.fromCharCode(m);let w=!1;const x=e.md.block.ruler.getRules("list"),S=e.parentType;for(e.parentType="list";u=i?P=1:P=E-O,P>4&&(P=1);const M=O+P;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(m);const N=[u,0];s.map=N,f&&(s.info=e.src.slice(a,p-1));const B=e.tight,V=e.tShift[u],W=e.sCount[u],ne=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=M,e.tight=!0,e.tShift[u]=C-e.bMarks[u],e.sCount[u]=E,C>=i&&e.isEmpty(u+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,u,n,!0),(!e.tight||w)&&(l=!1),w=e.line-u>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ne,e.tShift[u]=V,e.sCount[u]=W,e.tight=B,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(m),u=e.line,N[1]=u,u>=n||e.sCount[u]=4)break;let Z=!1;for(let q=0,G=x.length;q=4||e.src.charCodeAt(i)!==91)return!1;function s(x){const S=e.lineMax;if(x>=S||e.isEmpty(x))return null;let O=!1;if(e.sCount[x]-e.blkIndent>3&&(O=!0),e.sCount[x]<0&&(O=!0),!O){const P=e.md.block.ruler.getRules("reference"),M=e.parentType;e.parentType="reference";let N=!1;for(let B=0,V=P.length;B"u"&&(e.env.references={}),typeof e.env.references[w]>"u"&&(e.env.references[w]={title:b,href:f}),e.line=a),!0):!1}const NYe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],LYe="[a-zA-Z_:][a-zA-Z0-9:._-]*",FYe="[^\"'=<>`\\x00-\\x20]+",jYe="'[^']*'",BYe='"[^"]*"',UYe="(?:"+FYe+"|"+jYe+"|"+BYe+")",zYe="(?:\\s+"+LYe+"(?:\\s*=\\s*"+UYe+")?)",FZ="<[A-Za-z][A-Za-z0-9\\-]*"+zYe+"*\\s*\\/?>",jZ="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",WYe="",VYe="<[?][\\s\\S]*?[?]>",HYe="]*>",qYe="",KYe=new RegExp("^(?:"+FZ+"|"+jZ+"|"+WYe+"|"+VYe+"|"+HYe+"|"+qYe+")"),GYe=new RegExp("^(?:"+FZ+"|"+jZ+")"),ed=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(GYe.source+"\\s*$"),/^$/,!1]];function YYe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let a=e.src.slice(i,o),s=0;for(;s=4)return!1;let a=e.src.charCodeAt(i);if(a!==35||i>=o)return!1;let s=1;for(a=e.src.charCodeAt(++i);a===35&&i6||ii&&qn(e.src.charCodeAt(u-1))&&(o=u),e.line=t+1;const l=e.push("heading_open","h"+String(s),1);l.markup="########".slice(0,s),l.map=[t,e.line];const c=e.push("inline","",0);c.content=e.src.slice(i,o).trim(),c.map=[t,e.line],c.children=[];const f=e.push("heading_close","h"+String(s),-1);return f.markup="########".slice(0,s),!0}function XYe(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o=0,a,s=t+1;for(;s3)continue;if(e.sCount[s]>=e.blkIndent){let p=e.bMarks[s]+e.tShift[s];const m=e.eMarks[s];if(p=m))){o=a===61?1:2;break}}if(e.sCount[s]<0)continue;let h=!1;for(let p=0,m=r.length;p3||e.sCount[o]<0)continue;let l=!1;for(let c=0,f=r.length;c=n||e.sCount[a]=o){e.line=n;break}const u=e.line;let l=!1;for(let c=0;c=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),a=e.line,a0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};nv.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=e.pending.match(tZe);if(!i)return!1;const o=i[1],a=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!a)return!1;let s=a.url;if(s.length<=o.length)return!1;s=s.replace(/\*+$/,"");const u=e.md.normalizeLink(s);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const l=e.push("link_open","a",1);l.attrs=[["href",u]],l.markup="linkify",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=s.length-o.length,!0}function rZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(e){Q5[e.charCodeAt(0)]=1});function iZe(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&s<=57343&&(o+=e.src[n+1],n++)}const a="\\"+o;if(!t){const s=e.push("text_special","",0);i<256&&Q5[i]!==0?s.content=o:s.content=a,s.markup=a,s.info="escape"}return e.pos=n+1,!0}function oZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=e.posMax;for(;n=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=t[i.end],a=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===o.token+1,s=String.fromCharCode(i.marker),u=e.tokens[i.token];u.type=a?"strong_open":"em_open",u.tag=a?"strong":"em",u.nesting=1,u.markup=a?s+s:s,u.content="";const l=e.tokens[o.token];l.type=a?"strong_close":"em_close",l.tag=a?"strong":"em",l.nesting=-1,l.markup=a?s+s:s,l.content="",a&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function lZe(e){const t=e.tokens_meta,n=e.tokens_meta.length;WN(e,e.delimiters);for(let r=0;r=f)return!1;if(u=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(a=e.md.normalizeLink(i.str),e.md.validateLink(a)?m=i.pos:a="",u=m;m=f||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(typeof e.env.references>"u")return!1;if(m=0?r=e.src.slice(u,m++):m=p+1):m=p+1,r||(r=e.src.slice(h,p)),o=e.env.references[B2(r)],!o)return e.pos=c,!1;a=o.href,s=o.title}if(!t){e.pos=h,e.posMax=p;const y=e.push("link_open","a",1),b=[["href",a]];y.attrs=b,s&&b.push(["title",s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=m,e.posMax=f,!0}function fZe(e,t){let n,r,i,o,a,s,u,l,c="";const f=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(o=m+1,o=h)return!1;for(l=o,s=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),s.ok&&(c=e.md.normalizeLink(s.str),e.md.validateLink(c)?o=s.pos:c=""),l=o;o=h||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o=0?i=e.src.slice(l,o++):o=m+1):o=m+1,i||(i=e.src.slice(p,m)),a=e.env.references[B2(i)],!a)return e.pos=f,!1;c=a.href,u=a.title}if(!t){r=e.src.slice(p,m);const y=[];e.md.inline.parse(r,e.md,e.env,y);const b=e.push("image","img",0),w=[["src",c],["alt",""]];b.attrs=w,b.children=y,b.content=r,u&&w.push(["title",u])}return e.pos=o,e.posMax=h,!0}const dZe=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,hZe=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function pZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const a=e.src.charCodeAt(n);if(a===60)return!1;if(a===62)break}const o=e.src.slice(r+1,n);if(hZe.test(o)){const a=e.md.normalizeLink(o);if(!e.md.validateLink(a))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}if(dZe.test(o)){const a=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(a))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}return!1}function gZe(e){return/^\s]/i.test(e)}function mZe(e){return/^<\/a\s*>/i.test(e)}function vZe(e){const t=e|32;return t>=97&&t<=122}function yZe(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!vZe(i))return!1;const o=e.src.slice(r).match(KYe);if(!o)return!1;if(!t){const a=e.push("html_inline","",0);a.content=o[0],gZe(a.content)&&e.linkLevel++,mZe(a.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const bZe=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,xZe=/^&([a-z][a-z0-9]{1,31});/i;function wZe(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(bZe);if(o){if(!t){const a=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),s=e.push("text_special","",0);s.content=Z5(a)?jx(a):jx(65533),s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(xZe);if(o){const a=DZ(o[0]);if(a!==o[0]){if(!t){const s=e.push("text_special","",0);s.content=a,s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function VN(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let a=0;au;l-=o[l]+1){const f=e[l];if(f.marker===s.marker&&f.open&&f.end<0){let h=!1;if((f.close||s.open)&&(f.length+s.length)%3===0&&(f.length%3!==0||s.length%3!==0)&&(h=!0),!h){const p=l>0&&!e[l-1].open?o[l-1]+1:0;o[a]=a-l+p,o[l]=p,s.open=!1,f.end=a,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(t[s.marker][(s.open?3:0)+(s.length||0)%3]=c)}}function _Ze(e){const t=e.tokens_meta,n=e.tokens_meta.length;VN(e.delimiters);for(let r=0;r0&&r++,i[t].type==="text"&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,o[t]=e.pos};rv.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};rv.prototype.parse=function(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),a=o.length;for(let s=0;s|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function K4(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function z2(e){return Object.prototype.toString.call(e)}function EZe(e){return z2(e)==="[object String]"}function OZe(e){return z2(e)==="[object Object]"}function AZe(e){return z2(e)==="[object RegExp]"}function HN(e){return z2(e)==="[object Function]"}function PZe(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const zZ={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function kZe(e){return Object.keys(e||{}).reduce(function(t,n){return t||zZ.hasOwnProperty(n)},!1)}const TZe={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},MZe="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",RZe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function DZe(e){e.__index__=-1,e.__text_cache__=""}function $Ze(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function qN(){return function(e,t){t.normalize(e)}}function Bx(e){const t=e.re=CZe(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(MZe),n.push(t.src_xn),t.src_tlds=n.join("|");function r(s){return s.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function o(s,u){throw new Error('(LinkifyIt) Invalid schema "'+s+'": '+u)}Object.keys(e.__schemas__).forEach(function(s){const u=e.__schemas__[s];if(u===null)return;const l={validate:null,link:null};if(e.__compiled__[s]=l,OZe(u)){AZe(u.validate)?l.validate=$Ze(u.validate):HN(u.validate)?l.validate=u.validate:o(s,u),HN(u.normalize)?l.normalize=u.normalize:u.normalize?o(s,u):l.normalize=qN();return}if(EZe(u)){i.push(s);return}o(s,u)}),i.forEach(function(s){e.__compiled__[e.__schemas__[s]]&&(e.__compiled__[s].validate=e.__compiled__[e.__schemas__[s]].validate,e.__compiled__[s].normalize=e.__compiled__[e.__schemas__[s]].normalize)}),e.__compiled__[""]={validate:null,normalize:qN()};const a=Object.keys(e.__compiled__).filter(function(s){return s.length>0&&e.__compiled__[s]}).map(PZe).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),DZe(e)}function IZe(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function G4(e,t){const n=new IZe(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Vo(e,t){if(!(this instanceof Vo))return new Vo(e,t);t||kZe(e)&&(t=e,e={}),this.__opts__=K4({},zZ,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=K4({},TZe,e),this.__compiled__={},this.__tlds__=RZe,this.__tlds_replaced__=!1,this.re={},Bx(this)}Vo.prototype.add=function(t,n){return this.__schemas__[t]=n,Bx(this),this};Vo.prototype.set=function(t){return this.__opts__=K4(this.__opts__,t),this};Vo.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,r,i,o,a,s,u,l,c;if(this.re.schema_test.test(t)){for(u=this.re.schema_search,u.lastIndex=0;(n=u.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],u.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&(i=t.match(this.re.email_fuzzy))!==null&&(a=i.index+i[1].length,s=i.index+i[0].length,(this.__index__<0||athis.__last_index__)&&(this.__schema__="mailto:",this.__index__=a,this.__last_index__=s))),this.__index__>=0};Vo.prototype.pretest=function(t){return this.re.pretest.test(t)};Vo.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};Vo.prototype.match=function(t){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(G4(this,r)),r=this.__last_index__);let i=r?t.slice(r):t;for(;this.test(i);)n.push(G4(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Vo.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,G4(this,0)):null};Vo.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),Bx(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Bx(this),this)};Vo.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Vo.prototype.onCompile=function(){};const Bd=2147483647,xs=36,J5=1,pm=26,NZe=38,LZe=700,WZ=72,VZ=128,HZ="-",FZe=/^xn--/,jZe=/[^\0-\x7F]/,BZe=/[\x2E\u3002\uFF0E\uFF61]/g,UZe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},oC=xs-J5,ws=Math.floor,aC=String.fromCharCode;function Ju(e){throw new RangeError(UZe[e])}function zZe(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function qZ(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(BZe,".");const i=e.split("."),o=zZe(i,t).join(".");return r+o}function KZ(e){const t=[];let n=0;const r=e.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...e),VZe=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:xs},KN=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},GZ=function(e,t,n){let r=0;for(e=n?ws(e/LZe):e>>1,e+=ws(e/t);e>oC*pm>>1;r+=xs)e=ws(e/oC);return ws(r+(oC+1)*e/(e+NZe))},YZ=function(e){const t=[],n=e.length;let r=0,i=VZ,o=WZ,a=e.lastIndexOf(HZ);a<0&&(a=0);for(let s=0;s=128&&Ju("not-basic"),t.push(e.charCodeAt(s));for(let s=a>0?a+1:0;s=n&&Ju("invalid-input");const h=VZe(e.charCodeAt(s++));h>=xs&&Ju("invalid-input"),h>ws((Bd-r)/c)&&Ju("overflow"),r+=h*c;const p=f<=o?J5:f>=o+pm?pm:f-o;if(hws(Bd/m)&&Ju("overflow"),c*=m}const l=t.length+1;o=GZ(r-u,l,u==0),ws(r/l)>Bd-i&&Ju("overflow"),i+=ws(r/l),r%=l,t.splice(r++,0,i)}return String.fromCodePoint(...t)},ZZ=function(e){const t=[];e=KZ(e);const n=e.length;let r=VZ,i=0,o=WZ;for(const u of e)u<128&&t.push(aC(u));const a=t.length;let s=a;for(a&&t.push(HZ);s=r&&cws((Bd-i)/l)&&Ju("overflow"),i+=(u-r)*l,r=u;for(const c of e)if(cBd&&Ju("overflow"),c===r){let f=i;for(let h=xs;;h+=xs){const p=h<=o?J5:h>=o+pm?pm:h-o;if(f=0))try{t.hostname=XZ.toASCII(t.hostname)}catch{}return tv(q5(t))}function tXe(e){const t=K5(e,!0);if(t.hostname&&(!t.protocol||QZ.indexOf(t.protocol)>=0))try{t.hostname=XZ.toUnicode(t.hostname)}catch{}return Ph(q5(t),Ph.defaultChars+"%")}function Ja(e,t){if(!(this instanceof Ja))return new Ja(e,t);t||Y5(e)||(t=e||{},e="default"),this.inline=new rv,this.block=new U2,this.core=new X5,this.renderer=new ap,this.linkify=new Vo,this.validateLink=JZe,this.normalizeLink=eXe,this.normalizeLinkText=tXe,this.utils=rYe,this.helpers=j2({},sYe),this.options={},this.configure(e),t&&this.set(t)}Ja.prototype.set=function(e){return j2(this.options,e),this};Ja.prototype.configure=function(e){const t=this;if(Y5(e)){const n=e;if(e=ZZe[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Ja.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Ja.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Ja.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Ja.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Ja.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Ja.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Ja.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var JZ={exports:{}};(function(e){(function(t){var n=function(T){var D,$=new Float64Array(16);if(T)for(D=0;D>24&255,T[D+1]=$>>16&255,T[D+2]=$>>8&255,T[D+3]=$&255,T[D+4]=A>>24&255,T[D+5]=A>>16&255,T[D+6]=A>>8&255,T[D+7]=A&255}function y(T,D,$,A,L){var ee,re=0;for(ee=0;ee>>8)-1}function b(T,D,$,A){return y(T,D,$,A,16)}function w(T,D,$,A){return y(T,D,$,A,32)}function x(T,D,$,A){for(var L=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,ee=$[0]&255|($[1]&255)<<8|($[2]&255)<<16|($[3]&255)<<24,re=$[4]&255|($[5]&255)<<8|($[6]&255)<<16|($[7]&255)<<24,he=$[8]&255|($[9]&255)<<8|($[10]&255)<<16|($[11]&255)<<24,Ce=$[12]&255|($[13]&255)<<8|($[14]&255)<<16|($[15]&255)<<24,Be=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,He=D[0]&255|(D[1]&255)<<8|(D[2]&255)<<16|(D[3]&255)<<24,ct=D[4]&255|(D[5]&255)<<8|(D[6]&255)<<16|(D[7]&255)<<24,Ne=D[8]&255|(D[9]&255)<<8|(D[10]&255)<<16|(D[11]&255)<<24,rt=D[12]&255|(D[13]&255)<<8|(D[14]&255)<<16|(D[15]&255)<<24,xt=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,At=$[16]&255|($[17]&255)<<8|($[18]&255)<<16|($[19]&255)<<24,pt=$[20]&255|($[21]&255)<<8|($[22]&255)<<16|($[23]&255)<<24,ht=$[24]&255|($[25]&255)<<8|($[26]&255)<<16|($[27]&255)<<24,wt=$[28]&255|($[29]&255)<<8|($[30]&255)<<16|($[31]&255)<<24,_t=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Je=L,ut=ee,Qe=re,Fe=he,qe=Ce,Ge=Be,ve=He,ge=ct,De=Ne,Pe=rt,Te=xt,Ue=At,vt=pt,jt=ht,Bt=wt,It=_t,te,Zt=0;Zt<20;Zt+=2)te=Je+vt|0,qe^=te<<7|te>>>25,te=qe+Je|0,De^=te<<9|te>>>23,te=De+qe|0,vt^=te<<13|te>>>19,te=vt+De|0,Je^=te<<18|te>>>14,te=Ge+ut|0,Pe^=te<<7|te>>>25,te=Pe+Ge|0,jt^=te<<9|te>>>23,te=jt+Pe|0,ut^=te<<13|te>>>19,te=ut+jt|0,Ge^=te<<18|te>>>14,te=Te+ve|0,Bt^=te<<7|te>>>25,te=Bt+Te|0,Qe^=te<<9|te>>>23,te=Qe+Bt|0,ve^=te<<13|te>>>19,te=ve+Qe|0,Te^=te<<18|te>>>14,te=It+Ue|0,Fe^=te<<7|te>>>25,te=Fe+It|0,ge^=te<<9|te>>>23,te=ge+Fe|0,Ue^=te<<13|te>>>19,te=Ue+ge|0,It^=te<<18|te>>>14,te=Je+Fe|0,ut^=te<<7|te>>>25,te=ut+Je|0,Qe^=te<<9|te>>>23,te=Qe+ut|0,Fe^=te<<13|te>>>19,te=Fe+Qe|0,Je^=te<<18|te>>>14,te=Ge+qe|0,ve^=te<<7|te>>>25,te=ve+Ge|0,ge^=te<<9|te>>>23,te=ge+ve|0,qe^=te<<13|te>>>19,te=qe+ge|0,Ge^=te<<18|te>>>14,te=Te+Pe|0,Ue^=te<<7|te>>>25,te=Ue+Te|0,De^=te<<9|te>>>23,te=De+Ue|0,Pe^=te<<13|te>>>19,te=Pe+De|0,Te^=te<<18|te>>>14,te=It+Bt|0,vt^=te<<7|te>>>25,te=vt+It|0,jt^=te<<9|te>>>23,te=jt+vt|0,Bt^=te<<13|te>>>19,te=Bt+jt|0,It^=te<<18|te>>>14;Je=Je+L|0,ut=ut+ee|0,Qe=Qe+re|0,Fe=Fe+he|0,qe=qe+Ce|0,Ge=Ge+Be|0,ve=ve+He|0,ge=ge+ct|0,De=De+Ne|0,Pe=Pe+rt|0,Te=Te+xt|0,Ue=Ue+At|0,vt=vt+pt|0,jt=jt+ht|0,Bt=Bt+wt|0,It=It+_t|0,T[0]=Je>>>0&255,T[1]=Je>>>8&255,T[2]=Je>>>16&255,T[3]=Je>>>24&255,T[4]=ut>>>0&255,T[5]=ut>>>8&255,T[6]=ut>>>16&255,T[7]=ut>>>24&255,T[8]=Qe>>>0&255,T[9]=Qe>>>8&255,T[10]=Qe>>>16&255,T[11]=Qe>>>24&255,T[12]=Fe>>>0&255,T[13]=Fe>>>8&255,T[14]=Fe>>>16&255,T[15]=Fe>>>24&255,T[16]=qe>>>0&255,T[17]=qe>>>8&255,T[18]=qe>>>16&255,T[19]=qe>>>24&255,T[20]=Ge>>>0&255,T[21]=Ge>>>8&255,T[22]=Ge>>>16&255,T[23]=Ge>>>24&255,T[24]=ve>>>0&255,T[25]=ve>>>8&255,T[26]=ve>>>16&255,T[27]=ve>>>24&255,T[28]=ge>>>0&255,T[29]=ge>>>8&255,T[30]=ge>>>16&255,T[31]=ge>>>24&255,T[32]=De>>>0&255,T[33]=De>>>8&255,T[34]=De>>>16&255,T[35]=De>>>24&255,T[36]=Pe>>>0&255,T[37]=Pe>>>8&255,T[38]=Pe>>>16&255,T[39]=Pe>>>24&255,T[40]=Te>>>0&255,T[41]=Te>>>8&255,T[42]=Te>>>16&255,T[43]=Te>>>24&255,T[44]=Ue>>>0&255,T[45]=Ue>>>8&255,T[46]=Ue>>>16&255,T[47]=Ue>>>24&255,T[48]=vt>>>0&255,T[49]=vt>>>8&255,T[50]=vt>>>16&255,T[51]=vt>>>24&255,T[52]=jt>>>0&255,T[53]=jt>>>8&255,T[54]=jt>>>16&255,T[55]=jt>>>24&255,T[56]=Bt>>>0&255,T[57]=Bt>>>8&255,T[58]=Bt>>>16&255,T[59]=Bt>>>24&255,T[60]=It>>>0&255,T[61]=It>>>8&255,T[62]=It>>>16&255,T[63]=It>>>24&255}function S(T,D,$,A){for(var L=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,ee=$[0]&255|($[1]&255)<<8|($[2]&255)<<16|($[3]&255)<<24,re=$[4]&255|($[5]&255)<<8|($[6]&255)<<16|($[7]&255)<<24,he=$[8]&255|($[9]&255)<<8|($[10]&255)<<16|($[11]&255)<<24,Ce=$[12]&255|($[13]&255)<<8|($[14]&255)<<16|($[15]&255)<<24,Be=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,He=D[0]&255|(D[1]&255)<<8|(D[2]&255)<<16|(D[3]&255)<<24,ct=D[4]&255|(D[5]&255)<<8|(D[6]&255)<<16|(D[7]&255)<<24,Ne=D[8]&255|(D[9]&255)<<8|(D[10]&255)<<16|(D[11]&255)<<24,rt=D[12]&255|(D[13]&255)<<8|(D[14]&255)<<16|(D[15]&255)<<24,xt=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,At=$[16]&255|($[17]&255)<<8|($[18]&255)<<16|($[19]&255)<<24,pt=$[20]&255|($[21]&255)<<8|($[22]&255)<<16|($[23]&255)<<24,ht=$[24]&255|($[25]&255)<<8|($[26]&255)<<16|($[27]&255)<<24,wt=$[28]&255|($[29]&255)<<8|($[30]&255)<<16|($[31]&255)<<24,_t=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Je=L,ut=ee,Qe=re,Fe=he,qe=Ce,Ge=Be,ve=He,ge=ct,De=Ne,Pe=rt,Te=xt,Ue=At,vt=pt,jt=ht,Bt=wt,It=_t,te,Zt=0;Zt<20;Zt+=2)te=Je+vt|0,qe^=te<<7|te>>>25,te=qe+Je|0,De^=te<<9|te>>>23,te=De+qe|0,vt^=te<<13|te>>>19,te=vt+De|0,Je^=te<<18|te>>>14,te=Ge+ut|0,Pe^=te<<7|te>>>25,te=Pe+Ge|0,jt^=te<<9|te>>>23,te=jt+Pe|0,ut^=te<<13|te>>>19,te=ut+jt|0,Ge^=te<<18|te>>>14,te=Te+ve|0,Bt^=te<<7|te>>>25,te=Bt+Te|0,Qe^=te<<9|te>>>23,te=Qe+Bt|0,ve^=te<<13|te>>>19,te=ve+Qe|0,Te^=te<<18|te>>>14,te=It+Ue|0,Fe^=te<<7|te>>>25,te=Fe+It|0,ge^=te<<9|te>>>23,te=ge+Fe|0,Ue^=te<<13|te>>>19,te=Ue+ge|0,It^=te<<18|te>>>14,te=Je+Fe|0,ut^=te<<7|te>>>25,te=ut+Je|0,Qe^=te<<9|te>>>23,te=Qe+ut|0,Fe^=te<<13|te>>>19,te=Fe+Qe|0,Je^=te<<18|te>>>14,te=Ge+qe|0,ve^=te<<7|te>>>25,te=ve+Ge|0,ge^=te<<9|te>>>23,te=ge+ve|0,qe^=te<<13|te>>>19,te=qe+ge|0,Ge^=te<<18|te>>>14,te=Te+Pe|0,Ue^=te<<7|te>>>25,te=Ue+Te|0,De^=te<<9|te>>>23,te=De+Ue|0,Pe^=te<<13|te>>>19,te=Pe+De|0,Te^=te<<18|te>>>14,te=It+Bt|0,vt^=te<<7|te>>>25,te=vt+It|0,jt^=te<<9|te>>>23,te=jt+vt|0,Bt^=te<<13|te>>>19,te=Bt+jt|0,It^=te<<18|te>>>14;T[0]=Je>>>0&255,T[1]=Je>>>8&255,T[2]=Je>>>16&255,T[3]=Je>>>24&255,T[4]=Ge>>>0&255,T[5]=Ge>>>8&255,T[6]=Ge>>>16&255,T[7]=Ge>>>24&255,T[8]=Te>>>0&255,T[9]=Te>>>8&255,T[10]=Te>>>16&255,T[11]=Te>>>24&255,T[12]=It>>>0&255,T[13]=It>>>8&255,T[14]=It>>>16&255,T[15]=It>>>24&255,T[16]=ve>>>0&255,T[17]=ve>>>8&255,T[18]=ve>>>16&255,T[19]=ve>>>24&255,T[20]=ge>>>0&255,T[21]=ge>>>8&255,T[22]=ge>>>16&255,T[23]=ge>>>24&255,T[24]=De>>>0&255,T[25]=De>>>8&255,T[26]=De>>>16&255,T[27]=De>>>24&255,T[28]=Pe>>>0&255,T[29]=Pe>>>8&255,T[30]=Pe>>>16&255,T[31]=Pe>>>24&255}function O(T,D,$,A){x(T,D,$,A)}function E(T,D,$,A){S(T,D,$,A)}var C=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function P(T,D,$,A,L,ee,re){var he=new Uint8Array(16),Ce=new Uint8Array(64),Be,He;for(He=0;He<16;He++)he[He]=0;for(He=0;He<8;He++)he[He]=ee[He];for(;L>=64;){for(O(Ce,he,re,C),He=0;He<64;He++)T[D+He]=$[A+He]^Ce[He];for(Be=1,He=8;He<16;He++)Be=Be+(he[He]&255)|0,he[He]=Be&255,Be>>>=8;L-=64,D+=64,A+=64}if(L>0)for(O(Ce,he,re,C),He=0;He=64;){for(O(re,ee,L,C),Ce=0;Ce<64;Ce++)T[D+Ce]=re[Ce];for(he=1,Ce=8;Ce<16;Ce++)he=he+(ee[Ce]&255)|0,ee[Ce]=he&255,he>>>=8;$-=64,D+=64}if($>0)for(O(re,ee,L,C),Ce=0;Ce<$;Ce++)T[D+Ce]=re[Ce];return 0}function N(T,D,$,A,L){var ee=new Uint8Array(32);E(ee,A,L,C);for(var re=new Uint8Array(8),he=0;he<8;he++)re[he]=A[he+16];return M(T,D,$,re,ee)}function B(T,D,$,A,L,ee,re){var he=new Uint8Array(32);E(he,ee,re,C);for(var Ce=new Uint8Array(8),Be=0;Be<8;Be++)Ce[Be]=ee[Be+16];return P(T,D,$,A,L,Ce,he)}var V=function(T){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var D,$,A,L,ee,re,he,Ce;D=T[0]&255|(T[1]&255)<<8,this.r[0]=D&8191,$=T[2]&255|(T[3]&255)<<8,this.r[1]=(D>>>13|$<<3)&8191,A=T[4]&255|(T[5]&255)<<8,this.r[2]=($>>>10|A<<6)&7939,L=T[6]&255|(T[7]&255)<<8,this.r[3]=(A>>>7|L<<9)&8191,ee=T[8]&255|(T[9]&255)<<8,this.r[4]=(L>>>4|ee<<12)&255,this.r[5]=ee>>>1&8190,re=T[10]&255|(T[11]&255)<<8,this.r[6]=(ee>>>14|re<<2)&8191,he=T[12]&255|(T[13]&255)<<8,this.r[7]=(re>>>11|he<<5)&8065,Ce=T[14]&255|(T[15]&255)<<8,this.r[8]=(he>>>8|Ce<<8)&8191,this.r[9]=Ce>>>5&127,this.pad[0]=T[16]&255|(T[17]&255)<<8,this.pad[1]=T[18]&255|(T[19]&255)<<8,this.pad[2]=T[20]&255|(T[21]&255)<<8,this.pad[3]=T[22]&255|(T[23]&255)<<8,this.pad[4]=T[24]&255|(T[25]&255)<<8,this.pad[5]=T[26]&255|(T[27]&255)<<8,this.pad[6]=T[28]&255|(T[29]&255)<<8,this.pad[7]=T[30]&255|(T[31]&255)<<8};V.prototype.blocks=function(T,D,$){for(var A=this.fin?0:2048,L,ee,re,he,Ce,Be,He,ct,Ne,rt,xt,At,pt,ht,wt,_t,Je,ut,Qe,Fe=this.h[0],qe=this.h[1],Ge=this.h[2],ve=this.h[3],ge=this.h[4],De=this.h[5],Pe=this.h[6],Te=this.h[7],Ue=this.h[8],vt=this.h[9],jt=this.r[0],Bt=this.r[1],It=this.r[2],te=this.r[3],Zt=this.r[4],sn=this.r[5],un=this.r[6],Ut=this.r[7],ln=this.r[8],rn=this.r[9];$>=16;)L=T[D+0]&255|(T[D+1]&255)<<8,Fe+=L&8191,ee=T[D+2]&255|(T[D+3]&255)<<8,qe+=(L>>>13|ee<<3)&8191,re=T[D+4]&255|(T[D+5]&255)<<8,Ge+=(ee>>>10|re<<6)&8191,he=T[D+6]&255|(T[D+7]&255)<<8,ve+=(re>>>7|he<<9)&8191,Ce=T[D+8]&255|(T[D+9]&255)<<8,ge+=(he>>>4|Ce<<12)&8191,De+=Ce>>>1&8191,Be=T[D+10]&255|(T[D+11]&255)<<8,Pe+=(Ce>>>14|Be<<2)&8191,He=T[D+12]&255|(T[D+13]&255)<<8,Te+=(Be>>>11|He<<5)&8191,ct=T[D+14]&255|(T[D+15]&255)<<8,Ue+=(He>>>8|ct<<8)&8191,vt+=ct>>>5|A,Ne=0,rt=Ne,rt+=Fe*jt,rt+=qe*(5*rn),rt+=Ge*(5*ln),rt+=ve*(5*Ut),rt+=ge*(5*un),Ne=rt>>>13,rt&=8191,rt+=De*(5*sn),rt+=Pe*(5*Zt),rt+=Te*(5*te),rt+=Ue*(5*It),rt+=vt*(5*Bt),Ne+=rt>>>13,rt&=8191,xt=Ne,xt+=Fe*Bt,xt+=qe*jt,xt+=Ge*(5*rn),xt+=ve*(5*ln),xt+=ge*(5*Ut),Ne=xt>>>13,xt&=8191,xt+=De*(5*un),xt+=Pe*(5*sn),xt+=Te*(5*Zt),xt+=Ue*(5*te),xt+=vt*(5*It),Ne+=xt>>>13,xt&=8191,At=Ne,At+=Fe*It,At+=qe*Bt,At+=Ge*jt,At+=ve*(5*rn),At+=ge*(5*ln),Ne=At>>>13,At&=8191,At+=De*(5*Ut),At+=Pe*(5*un),At+=Te*(5*sn),At+=Ue*(5*Zt),At+=vt*(5*te),Ne+=At>>>13,At&=8191,pt=Ne,pt+=Fe*te,pt+=qe*It,pt+=Ge*Bt,pt+=ve*jt,pt+=ge*(5*rn),Ne=pt>>>13,pt&=8191,pt+=De*(5*ln),pt+=Pe*(5*Ut),pt+=Te*(5*un),pt+=Ue*(5*sn),pt+=vt*(5*Zt),Ne+=pt>>>13,pt&=8191,ht=Ne,ht+=Fe*Zt,ht+=qe*te,ht+=Ge*It,ht+=ve*Bt,ht+=ge*jt,Ne=ht>>>13,ht&=8191,ht+=De*(5*rn),ht+=Pe*(5*ln),ht+=Te*(5*Ut),ht+=Ue*(5*un),ht+=vt*(5*sn),Ne+=ht>>>13,ht&=8191,wt=Ne,wt+=Fe*sn,wt+=qe*Zt,wt+=Ge*te,wt+=ve*It,wt+=ge*Bt,Ne=wt>>>13,wt&=8191,wt+=De*jt,wt+=Pe*(5*rn),wt+=Te*(5*ln),wt+=Ue*(5*Ut),wt+=vt*(5*un),Ne+=wt>>>13,wt&=8191,_t=Ne,_t+=Fe*un,_t+=qe*sn,_t+=Ge*Zt,_t+=ve*te,_t+=ge*It,Ne=_t>>>13,_t&=8191,_t+=De*Bt,_t+=Pe*jt,_t+=Te*(5*rn),_t+=Ue*(5*ln),_t+=vt*(5*Ut),Ne+=_t>>>13,_t&=8191,Je=Ne,Je+=Fe*Ut,Je+=qe*un,Je+=Ge*sn,Je+=ve*Zt,Je+=ge*te,Ne=Je>>>13,Je&=8191,Je+=De*It,Je+=Pe*Bt,Je+=Te*jt,Je+=Ue*(5*rn),Je+=vt*(5*ln),Ne+=Je>>>13,Je&=8191,ut=Ne,ut+=Fe*ln,ut+=qe*Ut,ut+=Ge*un,ut+=ve*sn,ut+=ge*Zt,Ne=ut>>>13,ut&=8191,ut+=De*te,ut+=Pe*It,ut+=Te*Bt,ut+=Ue*jt,ut+=vt*(5*rn),Ne+=ut>>>13,ut&=8191,Qe=Ne,Qe+=Fe*rn,Qe+=qe*ln,Qe+=Ge*Ut,Qe+=ve*un,Qe+=ge*sn,Ne=Qe>>>13,Qe&=8191,Qe+=De*Zt,Qe+=Pe*te,Qe+=Te*It,Qe+=Ue*Bt,Qe+=vt*jt,Ne+=Qe>>>13,Qe&=8191,Ne=(Ne<<2)+Ne|0,Ne=Ne+rt|0,rt=Ne&8191,Ne=Ne>>>13,xt+=Ne,Fe=rt,qe=xt,Ge=At,ve=pt,ge=ht,De=wt,Pe=_t,Te=Je,Ue=ut,vt=Qe,D+=16,$-=16;this.h[0]=Fe,this.h[1]=qe,this.h[2]=Ge,this.h[3]=ve,this.h[4]=ge,this.h[5]=De,this.h[6]=Pe,this.h[7]=Te,this.h[8]=Ue,this.h[9]=vt},V.prototype.finish=function(T,D){var $=new Uint16Array(10),A,L,ee,re;if(this.leftover){for(re=this.leftover,this.buffer[re++]=1;re<16;re++)this.buffer[re]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(A=this.h[1]>>>13,this.h[1]&=8191,re=2;re<10;re++)this.h[re]+=A,A=this.h[re]>>>13,this.h[re]&=8191;for(this.h[0]+=A*5,A=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=A,A=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=A,$[0]=this.h[0]+5,A=$[0]>>>13,$[0]&=8191,re=1;re<10;re++)$[re]=this.h[re]+A,A=$[re]>>>13,$[re]&=8191;for($[9]-=8192,L=(A^1)-1,re=0;re<10;re++)$[re]&=L;for(L=~L,re=0;re<10;re++)this.h[re]=this.h[re]&L|$[re];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,ee=this.h[0]+this.pad[0],this.h[0]=ee&65535,re=1;re<8;re++)ee=(this.h[re]+this.pad[re]|0)+(ee>>>16)|0,this.h[re]=ee&65535;T[D+0]=this.h[0]>>>0&255,T[D+1]=this.h[0]>>>8&255,T[D+2]=this.h[1]>>>0&255,T[D+3]=this.h[1]>>>8&255,T[D+4]=this.h[2]>>>0&255,T[D+5]=this.h[2]>>>8&255,T[D+6]=this.h[3]>>>0&255,T[D+7]=this.h[3]>>>8&255,T[D+8]=this.h[4]>>>0&255,T[D+9]=this.h[4]>>>8&255,T[D+10]=this.h[5]>>>0&255,T[D+11]=this.h[5]>>>8&255,T[D+12]=this.h[6]>>>0&255,T[D+13]=this.h[6]>>>8&255,T[D+14]=this.h[7]>>>0&255,T[D+15]=this.h[7]>>>8&255},V.prototype.update=function(T,D,$){var A,L;if(this.leftover){for(L=16-this.leftover,L>$&&(L=$),A=0;A=16&&(L=$-$%16,this.blocks(T,D,L),D+=L,$-=L),$){for(A=0;A<$;A++)this.buffer[this.leftover+A]=T[D+A];this.leftover+=$}};function W(T,D,$,A,L,ee){var re=new V(ee);return re.update($,A,L),re.finish(T,D),0}function ne(T,D,$,A,L,ee){var re=new Uint8Array(16);return W(re,0,$,A,L,ee),b(T,D,re,0)}function Z(T,D,$,A,L){var ee;if($<32)return-1;for(B(T,0,D,0,$,A,L),W(T,16,T,32,$-32,T),ee=0;ee<16;ee++)T[ee]=0;return 0}function q(T,D,$,A,L){var ee,re=new Uint8Array(32);if($<32||(N(re,0,32,A,L),ne(D,16,D,32,$-32,re)!==0))return-1;for(B(T,0,D,0,$,A,L),ee=0;ee<32;ee++)T[ee]=0;return 0}function G(T,D){var $;for($=0;$<16;$++)T[$]=D[$]|0}function H(T){var D,$,A=1;for(D=0;D<16;D++)$=T[D]+A+65535,A=Math.floor($/65536),T[D]=$-A*65536;T[0]+=A-1+37*(A-1)}function j(T,D,$){for(var A,L=~($-1),ee=0;ee<16;ee++)A=L&(T[ee]^D[ee]),T[ee]^=A,D[ee]^=A}function K(T,D){var $,A,L,ee=n(),re=n();for($=0;$<16;$++)re[$]=D[$];for(H(re),H(re),H(re),A=0;A<2;A++){for(ee[0]=re[0]-65517,$=1;$<15;$++)ee[$]=re[$]-65535-(ee[$-1]>>16&1),ee[$-1]&=65535;ee[15]=re[15]-32767-(ee[14]>>16&1),L=ee[15]>>16&1,ee[14]&=65535,j(re,ee,1-L)}for($=0;$<16;$++)T[2*$]=re[$]&255,T[2*$+1]=re[$]>>8}function Y(T,D){var $=new Uint8Array(32),A=new Uint8Array(32);return K($,T),K(A,D),w($,0,A,0)}function oe(T){var D=new Uint8Array(32);return K(D,T),D[0]&1}function X(T,D){var $;for($=0;$<16;$++)T[$]=D[2*$]+(D[2*$+1]<<8);T[15]&=32767}function Q(T,D,$){for(var A=0;A<16;A++)T[A]=D[A]+$[A]}function ue(T,D,$){for(var A=0;A<16;A++)T[A]=D[A]-$[A]}function de(T,D,$){var A,L,ee=0,re=0,he=0,Ce=0,Be=0,He=0,ct=0,Ne=0,rt=0,xt=0,At=0,pt=0,ht=0,wt=0,_t=0,Je=0,ut=0,Qe=0,Fe=0,qe=0,Ge=0,ve=0,ge=0,De=0,Pe=0,Te=0,Ue=0,vt=0,jt=0,Bt=0,It=0,te=$[0],Zt=$[1],sn=$[2],un=$[3],Ut=$[4],ln=$[5],rn=$[6],Yn=$[7],mn=$[8],Tn=$[9],Zn=$[10],Xn=$[11],wr=$[12],Ir=$[13],Nr=$[14],Lr=$[15];A=D[0],ee+=A*te,re+=A*Zt,he+=A*sn,Ce+=A*un,Be+=A*Ut,He+=A*ln,ct+=A*rn,Ne+=A*Yn,rt+=A*mn,xt+=A*Tn,At+=A*Zn,pt+=A*Xn,ht+=A*wr,wt+=A*Ir,_t+=A*Nr,Je+=A*Lr,A=D[1],re+=A*te,he+=A*Zt,Ce+=A*sn,Be+=A*un,He+=A*Ut,ct+=A*ln,Ne+=A*rn,rt+=A*Yn,xt+=A*mn,At+=A*Tn,pt+=A*Zn,ht+=A*Xn,wt+=A*wr,_t+=A*Ir,Je+=A*Nr,ut+=A*Lr,A=D[2],he+=A*te,Ce+=A*Zt,Be+=A*sn,He+=A*un,ct+=A*Ut,Ne+=A*ln,rt+=A*rn,xt+=A*Yn,At+=A*mn,pt+=A*Tn,ht+=A*Zn,wt+=A*Xn,_t+=A*wr,Je+=A*Ir,ut+=A*Nr,Qe+=A*Lr,A=D[3],Ce+=A*te,Be+=A*Zt,He+=A*sn,ct+=A*un,Ne+=A*Ut,rt+=A*ln,xt+=A*rn,At+=A*Yn,pt+=A*mn,ht+=A*Tn,wt+=A*Zn,_t+=A*Xn,Je+=A*wr,ut+=A*Ir,Qe+=A*Nr,Fe+=A*Lr,A=D[4],Be+=A*te,He+=A*Zt,ct+=A*sn,Ne+=A*un,rt+=A*Ut,xt+=A*ln,At+=A*rn,pt+=A*Yn,ht+=A*mn,wt+=A*Tn,_t+=A*Zn,Je+=A*Xn,ut+=A*wr,Qe+=A*Ir,Fe+=A*Nr,qe+=A*Lr,A=D[5],He+=A*te,ct+=A*Zt,Ne+=A*sn,rt+=A*un,xt+=A*Ut,At+=A*ln,pt+=A*rn,ht+=A*Yn,wt+=A*mn,_t+=A*Tn,Je+=A*Zn,ut+=A*Xn,Qe+=A*wr,Fe+=A*Ir,qe+=A*Nr,Ge+=A*Lr,A=D[6],ct+=A*te,Ne+=A*Zt,rt+=A*sn,xt+=A*un,At+=A*Ut,pt+=A*ln,ht+=A*rn,wt+=A*Yn,_t+=A*mn,Je+=A*Tn,ut+=A*Zn,Qe+=A*Xn,Fe+=A*wr,qe+=A*Ir,Ge+=A*Nr,ve+=A*Lr,A=D[7],Ne+=A*te,rt+=A*Zt,xt+=A*sn,At+=A*un,pt+=A*Ut,ht+=A*ln,wt+=A*rn,_t+=A*Yn,Je+=A*mn,ut+=A*Tn,Qe+=A*Zn,Fe+=A*Xn,qe+=A*wr,Ge+=A*Ir,ve+=A*Nr,ge+=A*Lr,A=D[8],rt+=A*te,xt+=A*Zt,At+=A*sn,pt+=A*un,ht+=A*Ut,wt+=A*ln,_t+=A*rn,Je+=A*Yn,ut+=A*mn,Qe+=A*Tn,Fe+=A*Zn,qe+=A*Xn,Ge+=A*wr,ve+=A*Ir,ge+=A*Nr,De+=A*Lr,A=D[9],xt+=A*te,At+=A*Zt,pt+=A*sn,ht+=A*un,wt+=A*Ut,_t+=A*ln,Je+=A*rn,ut+=A*Yn,Qe+=A*mn,Fe+=A*Tn,qe+=A*Zn,Ge+=A*Xn,ve+=A*wr,ge+=A*Ir,De+=A*Nr,Pe+=A*Lr,A=D[10],At+=A*te,pt+=A*Zt,ht+=A*sn,wt+=A*un,_t+=A*Ut,Je+=A*ln,ut+=A*rn,Qe+=A*Yn,Fe+=A*mn,qe+=A*Tn,Ge+=A*Zn,ve+=A*Xn,ge+=A*wr,De+=A*Ir,Pe+=A*Nr,Te+=A*Lr,A=D[11],pt+=A*te,ht+=A*Zt,wt+=A*sn,_t+=A*un,Je+=A*Ut,ut+=A*ln,Qe+=A*rn,Fe+=A*Yn,qe+=A*mn,Ge+=A*Tn,ve+=A*Zn,ge+=A*Xn,De+=A*wr,Pe+=A*Ir,Te+=A*Nr,Ue+=A*Lr,A=D[12],ht+=A*te,wt+=A*Zt,_t+=A*sn,Je+=A*un,ut+=A*Ut,Qe+=A*ln,Fe+=A*rn,qe+=A*Yn,Ge+=A*mn,ve+=A*Tn,ge+=A*Zn,De+=A*Xn,Pe+=A*wr,Te+=A*Ir,Ue+=A*Nr,vt+=A*Lr,A=D[13],wt+=A*te,_t+=A*Zt,Je+=A*sn,ut+=A*un,Qe+=A*Ut,Fe+=A*ln,qe+=A*rn,Ge+=A*Yn,ve+=A*mn,ge+=A*Tn,De+=A*Zn,Pe+=A*Xn,Te+=A*wr,Ue+=A*Ir,vt+=A*Nr,jt+=A*Lr,A=D[14],_t+=A*te,Je+=A*Zt,ut+=A*sn,Qe+=A*un,Fe+=A*Ut,qe+=A*ln,Ge+=A*rn,ve+=A*Yn,ge+=A*mn,De+=A*Tn,Pe+=A*Zn,Te+=A*Xn,Ue+=A*wr,vt+=A*Ir,jt+=A*Nr,Bt+=A*Lr,A=D[15],Je+=A*te,ut+=A*Zt,Qe+=A*sn,Fe+=A*un,qe+=A*Ut,Ge+=A*ln,ve+=A*rn,ge+=A*Yn,De+=A*mn,Pe+=A*Tn,Te+=A*Zn,Ue+=A*Xn,vt+=A*wr,jt+=A*Ir,Bt+=A*Nr,It+=A*Lr,ee+=38*ut,re+=38*Qe,he+=38*Fe,Ce+=38*qe,Be+=38*Ge,He+=38*ve,ct+=38*ge,Ne+=38*De,rt+=38*Pe,xt+=38*Te,At+=38*Ue,pt+=38*vt,ht+=38*jt,wt+=38*Bt,_t+=38*It,L=1,A=ee+L+65535,L=Math.floor(A/65536),ee=A-L*65536,A=re+L+65535,L=Math.floor(A/65536),re=A-L*65536,A=he+L+65535,L=Math.floor(A/65536),he=A-L*65536,A=Ce+L+65535,L=Math.floor(A/65536),Ce=A-L*65536,A=Be+L+65535,L=Math.floor(A/65536),Be=A-L*65536,A=He+L+65535,L=Math.floor(A/65536),He=A-L*65536,A=ct+L+65535,L=Math.floor(A/65536),ct=A-L*65536,A=Ne+L+65535,L=Math.floor(A/65536),Ne=A-L*65536,A=rt+L+65535,L=Math.floor(A/65536),rt=A-L*65536,A=xt+L+65535,L=Math.floor(A/65536),xt=A-L*65536,A=At+L+65535,L=Math.floor(A/65536),At=A-L*65536,A=pt+L+65535,L=Math.floor(A/65536),pt=A-L*65536,A=ht+L+65535,L=Math.floor(A/65536),ht=A-L*65536,A=wt+L+65535,L=Math.floor(A/65536),wt=A-L*65536,A=_t+L+65535,L=Math.floor(A/65536),_t=A-L*65536,A=Je+L+65535,L=Math.floor(A/65536),Je=A-L*65536,ee+=L-1+37*(L-1),L=1,A=ee+L+65535,L=Math.floor(A/65536),ee=A-L*65536,A=re+L+65535,L=Math.floor(A/65536),re=A-L*65536,A=he+L+65535,L=Math.floor(A/65536),he=A-L*65536,A=Ce+L+65535,L=Math.floor(A/65536),Ce=A-L*65536,A=Be+L+65535,L=Math.floor(A/65536),Be=A-L*65536,A=He+L+65535,L=Math.floor(A/65536),He=A-L*65536,A=ct+L+65535,L=Math.floor(A/65536),ct=A-L*65536,A=Ne+L+65535,L=Math.floor(A/65536),Ne=A-L*65536,A=rt+L+65535,L=Math.floor(A/65536),rt=A-L*65536,A=xt+L+65535,L=Math.floor(A/65536),xt=A-L*65536,A=At+L+65535,L=Math.floor(A/65536),At=A-L*65536,A=pt+L+65535,L=Math.floor(A/65536),pt=A-L*65536,A=ht+L+65535,L=Math.floor(A/65536),ht=A-L*65536,A=wt+L+65535,L=Math.floor(A/65536),wt=A-L*65536,A=_t+L+65535,L=Math.floor(A/65536),_t=A-L*65536,A=Je+L+65535,L=Math.floor(A/65536),Je=A-L*65536,ee+=L-1+37*(L-1),T[0]=ee,T[1]=re,T[2]=he,T[3]=Ce,T[4]=Be,T[5]=He,T[6]=ct,T[7]=Ne,T[8]=rt,T[9]=xt,T[10]=At,T[11]=pt,T[12]=ht,T[13]=wt,T[14]=_t,T[15]=Je}function Se(T,D){de(T,D,D)}function me(T,D){var $=n(),A;for(A=0;A<16;A++)$[A]=D[A];for(A=253;A>=0;A--)Se($,$),A!==2&&A!==4&&de($,$,D);for(A=0;A<16;A++)T[A]=$[A]}function Ze(T,D){var $=n(),A;for(A=0;A<16;A++)$[A]=D[A];for(A=250;A>=0;A--)Se($,$),A!==1&&de($,$,D);for(A=0;A<16;A++)T[A]=$[A]}function Ae(T,D,$){var A=new Uint8Array(32),L=new Float64Array(80),ee,re,he=n(),Ce=n(),Be=n(),He=n(),ct=n(),Ne=n();for(re=0;re<31;re++)A[re]=D[re];for(A[31]=D[31]&127|64,A[0]&=248,X(L,$),re=0;re<16;re++)Ce[re]=L[re],He[re]=he[re]=Be[re]=0;for(he[0]=He[0]=1,re=254;re>=0;--re)ee=A[re>>>3]>>>(re&7)&1,j(he,Ce,ee),j(Be,He,ee),Q(ct,he,Be),ue(he,he,Be),Q(Be,Ce,He),ue(Ce,Ce,He),Se(He,ct),Se(Ne,he),de(he,Be,he),de(Be,Ce,ct),Q(ct,he,Be),ue(he,he,Be),Se(Ce,he),ue(Be,He,Ne),de(he,Be,u),Q(he,he,He),de(Be,Be,he),de(he,He,Ne),de(He,Ce,L),Se(Ce,ct),j(he,Ce,ee),j(Be,He,ee);for(re=0;re<16;re++)L[re+16]=he[re],L[re+32]=Be[re],L[re+48]=Ce[re],L[re+64]=He[re];var rt=L.subarray(32),xt=L.subarray(16);return me(rt,rt),de(xt,xt,rt),K(T,xt),0}function Le(T,D){return Ae(T,D,o)}function $e(T,D){return r(D,32),Le(T,D)}function be(T,D,$){var A=new Uint8Array(32);return Ae(A,$,D),E(T,i,A,C)}var bt=Z,lt=q;function Ft(T,D,$,A,L,ee){var re=new Uint8Array(32);return be(re,L,ee),bt(T,D,$,A,re)}function yn(T,D,$,A,L,ee){var re=new Uint8Array(32);return be(re,L,ee),lt(T,D,$,A,re)}var nn=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ie(T,D,$,A){for(var L=new Int32Array(16),ee=new Int32Array(16),re,he,Ce,Be,He,ct,Ne,rt,xt,At,pt,ht,wt,_t,Je,ut,Qe,Fe,qe,Ge,ve,ge,De,Pe,Te,Ue,vt=T[0],jt=T[1],Bt=T[2],It=T[3],te=T[4],Zt=T[5],sn=T[6],un=T[7],Ut=D[0],ln=D[1],rn=D[2],Yn=D[3],mn=D[4],Tn=D[5],Zn=D[6],Xn=D[7],wr=0;A>=128;){for(qe=0;qe<16;qe++)Ge=8*qe+wr,L[qe]=$[Ge+0]<<24|$[Ge+1]<<16|$[Ge+2]<<8|$[Ge+3],ee[qe]=$[Ge+4]<<24|$[Ge+5]<<16|$[Ge+6]<<8|$[Ge+7];for(qe=0;qe<80;qe++)if(re=vt,he=jt,Ce=Bt,Be=It,He=te,ct=Zt,Ne=sn,rt=un,xt=Ut,At=ln,pt=rn,ht=Yn,wt=mn,_t=Tn,Je=Zn,ut=Xn,ve=un,ge=Xn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=(te>>>14|mn<<18)^(te>>>18|mn<<14)^(mn>>>9|te<<23),ge=(mn>>>14|te<<18)^(mn>>>18|te<<14)^(te>>>9|mn<<23),De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,ve=te&Zt^~te&sn,ge=mn&Tn^~mn&Zn,De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,ve=nn[qe*2],ge=nn[qe*2+1],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,ve=L[qe%16],ge=ee[qe%16],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,Qe=Te&65535|Ue<<16,Fe=De&65535|Pe<<16,ve=Qe,ge=Fe,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=(vt>>>28|Ut<<4)^(Ut>>>2|vt<<30)^(Ut>>>7|vt<<25),ge=(Ut>>>28|vt<<4)^(vt>>>2|Ut<<30)^(vt>>>7|Ut<<25),De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,ve=vt&jt^vt&Bt^jt&Bt,ge=Ut&ln^Ut&rn^ln&rn,De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,rt=Te&65535|Ue<<16,ut=De&65535|Pe<<16,ve=Be,ge=ht,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=Qe,ge=Fe,De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,Be=Te&65535|Ue<<16,ht=De&65535|Pe<<16,jt=re,Bt=he,It=Ce,te=Be,Zt=He,sn=ct,un=Ne,vt=rt,ln=xt,rn=At,Yn=pt,mn=ht,Tn=wt,Zn=_t,Xn=Je,Ut=ut,qe%16===15)for(Ge=0;Ge<16;Ge++)ve=L[Ge],ge=ee[Ge],De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=L[(Ge+9)%16],ge=ee[(Ge+9)%16],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Qe=L[(Ge+1)%16],Fe=ee[(Ge+1)%16],ve=(Qe>>>1|Fe<<31)^(Qe>>>8|Fe<<24)^Qe>>>7,ge=(Fe>>>1|Qe<<31)^(Fe>>>8|Qe<<24)^(Fe>>>7|Qe<<25),De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Qe=L[(Ge+14)%16],Fe=ee[(Ge+14)%16],ve=(Qe>>>19|Fe<<13)^(Fe>>>29|Qe<<3)^Qe>>>6,ge=(Fe>>>19|Qe<<13)^(Qe>>>29|Fe<<3)^(Fe>>>6|Qe<<26),De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,L[Ge]=Te&65535|Ue<<16,ee[Ge]=De&65535|Pe<<16;ve=vt,ge=Ut,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[0],ge=D[0],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[0]=vt=Te&65535|Ue<<16,D[0]=Ut=De&65535|Pe<<16,ve=jt,ge=ln,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[1],ge=D[1],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[1]=jt=Te&65535|Ue<<16,D[1]=ln=De&65535|Pe<<16,ve=Bt,ge=rn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[2],ge=D[2],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[2]=Bt=Te&65535|Ue<<16,D[2]=rn=De&65535|Pe<<16,ve=It,ge=Yn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[3],ge=D[3],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[3]=It=Te&65535|Ue<<16,D[3]=Yn=De&65535|Pe<<16,ve=te,ge=mn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[4],ge=D[4],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[4]=te=Te&65535|Ue<<16,D[4]=mn=De&65535|Pe<<16,ve=Zt,ge=Tn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[5],ge=D[5],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[5]=Zt=Te&65535|Ue<<16,D[5]=Tn=De&65535|Pe<<16,ve=sn,ge=Zn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[6],ge=D[6],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[6]=sn=Te&65535|Ue<<16,D[6]=Zn=De&65535|Pe<<16,ve=un,ge=Xn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[7],ge=D[7],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[7]=un=Te&65535|Ue<<16,D[7]=Xn=De&65535|Pe<<16,wr+=128,A-=128}return A}function pe(T,D,$){var A=new Int32Array(8),L=new Int32Array(8),ee=new Uint8Array(256),re,he=$;for(A[0]=1779033703,A[1]=3144134277,A[2]=1013904242,A[3]=2773480762,A[4]=1359893119,A[5]=2600822924,A[6]=528734635,A[7]=1541459225,L[0]=4089235720,L[1]=2227873595,L[2]=4271175723,L[3]=1595750129,L[4]=2917565137,L[5]=725511199,L[6]=4215389547,L[7]=327033209,ie(A,L,D,$),$%=128,re=0;re<$;re++)ee[re]=D[he-$+re];for(ee[$]=128,$=256-128*($<112?1:0),ee[$-9]=0,m(ee,$-8,he/536870912|0,he<<3),ie(A,L,ee,$),re=0;re<8;re++)m(T,8*re,A[re],L[re]);return 0}function ye(T,D){var $=n(),A=n(),L=n(),ee=n(),re=n(),he=n(),Ce=n(),Be=n(),He=n();ue($,T[1],T[0]),ue(He,D[1],D[0]),de($,$,He),Q(A,T[0],T[1]),Q(He,D[0],D[1]),de(A,A,He),de(L,T[3],D[3]),de(L,L,c),de(ee,T[2],D[2]),Q(ee,ee,ee),ue(re,A,$),ue(he,ee,L),Q(Ce,ee,L),Q(Be,A,$),de(T[0],re,he),de(T[1],Be,Ce),de(T[2],Ce,he),de(T[3],re,Be)}function ze(T,D,$){var A;for(A=0;A<4;A++)j(T[A],D[A],$)}function je(T,D){var $=n(),A=n(),L=n();me(L,D[2]),de($,D[0],L),de(A,D[1],L),K(T,A),T[31]^=oe($)<<7}function ke(T,D,$){var A,L;for(G(T[0],a),G(T[1],s),G(T[2],s),G(T[3],a),L=255;L>=0;--L)A=$[L/8|0]>>(L&7)&1,ze(T,D,A),ye(D,T),ye(T,T),ze(T,D,A)}function nt(T,D){var $=[n(),n(),n(),n()];G($[0],f),G($[1],h),G($[2],s),de($[3],f,h),ke(T,$,D)}function mt(T,D,$){var A=new Uint8Array(64),L=[n(),n(),n(),n()],ee;for($||r(D,32),pe(A,D,32),A[0]&=248,A[31]&=127,A[31]|=64,nt(L,A),je(T,L),ee=0;ee<32;ee++)D[ee+32]=T[ee];return 0}var wn=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Kt(T,D){var $,A,L,ee;for(A=63;A>=32;--A){for($=0,L=A-32,ee=A-12;L>4)*wn[L],$=D[L]>>8,D[L]&=255;for(L=0;L<32;L++)D[L]-=$*wn[L];for(A=0;A<32;A++)D[A+1]+=D[A]>>8,T[A]=D[A]&255}function _n(T){var D=new Float64Array(64),$;for($=0;$<64;$++)D[$]=T[$];for($=0;$<64;$++)T[$]=0;Kt(T,D)}function $i(T,D,$,A){var L=new Uint8Array(64),ee=new Uint8Array(64),re=new Uint8Array(64),he,Ce,Be=new Float64Array(64),He=[n(),n(),n(),n()];pe(L,A,32),L[0]&=248,L[31]&=127,L[31]|=64;var ct=$+64;for(he=0;he<$;he++)T[64+he]=D[he];for(he=0;he<32;he++)T[32+he]=L[32+he];for(pe(re,T.subarray(32),$+32),_n(re),nt(He,re),je(T,He),he=32;he<64;he++)T[he]=A[he];for(pe(ee,T,$+64),_n(ee),he=0;he<64;he++)Be[he]=0;for(he=0;he<32;he++)Be[he]=re[he];for(he=0;he<32;he++)for(Ce=0;Ce<32;Ce++)Be[he+Ce]+=ee[he]*L[Ce];return Kt(T.subarray(32),Be),ct}function xr(T,D){var $=n(),A=n(),L=n(),ee=n(),re=n(),he=n(),Ce=n();return G(T[2],s),X(T[1],D),Se(L,T[1]),de(ee,L,l),ue(L,L,T[2]),Q(ee,T[2],ee),Se(re,ee),Se(he,re),de(Ce,he,re),de($,Ce,L),de($,$,ee),Ze($,$),de($,$,L),de($,$,ee),de($,$,ee),de(T[0],$,ee),Se(A,T[0]),de(A,A,ee),Y(A,L)&&de(T[0],T[0],p),Se(A,T[0]),de(A,A,ee),Y(A,L)?-1:(oe(T[0])===D[31]>>7&&ue(T[0],a,T[0]),de(T[3],T[0],T[1]),0)}function mi(T,D,$,A){var L,ee=new Uint8Array(32),re=new Uint8Array(64),he=[n(),n(),n(),n()],Ce=[n(),n(),n(),n()];if($<64||xr(Ce,A))return-1;for(L=0;L<$;L++)T[L]=D[L];for(L=0;L<32;L++)T[L+32]=A[L];if(pe(re,T,$),_n(re),ke(he,Ce,re),nt(Ce,D.subarray(32)),ye(he,Ce),je(ee,he),$-=64,w(D,0,ee,0)){for(L=0;L<$;L++)T[L]=0;return-1}for(L=0;L<$;L++)T[L]=D[L+64];return $}var ur=32,ai=24,vi=32,Dr=16,Zi=32,vo=32,yi=32,$r=32,Sa=32,St=ai,hn=vi,Sn=Dr,Gn=64,lr=32,Xr=64,yo=32,Xl=64;t.lowlevel={crypto_core_hsalsa20:E,crypto_stream_xor:B,crypto_stream:N,crypto_stream_salsa20_xor:P,crypto_stream_salsa20:M,crypto_onetimeauth:W,crypto_onetimeauth_verify:ne,crypto_verify_16:b,crypto_verify_32:w,crypto_secretbox:Z,crypto_secretbox_open:q,crypto_scalarmult:Ae,crypto_scalarmult_base:Le,crypto_box_beforenm:be,crypto_box_afternm:bt,crypto_box:Ft,crypto_box_open:yn,crypto_box_keypair:$e,crypto_hash:pe,crypto_sign:$i,crypto_sign_keypair:mt,crypto_sign_open:mi,crypto_secretbox_KEYBYTES:ur,crypto_secretbox_NONCEBYTES:ai,crypto_secretbox_ZEROBYTES:vi,crypto_secretbox_BOXZEROBYTES:Dr,crypto_scalarmult_BYTES:Zi,crypto_scalarmult_SCALARBYTES:vo,crypto_box_PUBLICKEYBYTES:yi,crypto_box_SECRETKEYBYTES:$r,crypto_box_BEFORENMBYTES:Sa,crypto_box_NONCEBYTES:St,crypto_box_ZEROBYTES:hn,crypto_box_BOXZEROBYTES:Sn,crypto_sign_BYTES:Gn,crypto_sign_PUBLICKEYBYTES:lr,crypto_sign_SECRETKEYBYTES:Xr,crypto_sign_SEEDBYTES:yo,crypto_hash_BYTES:Xl,gf:n,D:l,L:wn,pack25519:K,unpack25519:X,M:de,A:Q,S:Se,Z:ue,pow2523:Ze,add:ye,set25519:G,modL:Kt,scalarmult:ke,scalarbase:nt};function Cf(T,D){if(T.length!==ur)throw new Error("bad key size");if(D.length!==ai)throw new Error("bad nonce size")}function ae(T,D){if(T.length!==yi)throw new Error("bad public key size");if(D.length!==$r)throw new Error("bad secret key size")}function le(){for(var T=0;T=0},t.sign.keyPair=function(){var T=new Uint8Array(lr),D=new Uint8Array(Xr);return mt(T,D),{publicKey:T,secretKey:D}},t.sign.keyPair.fromSecretKey=function(T){if(le(T),T.length!==Xr)throw new Error("bad secret key size");for(var D=new Uint8Array(lr),$=0;$"u"?typeof Buffer.from<"u"?(t.encodeBase64=function(r){return Buffer.from(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(Buffer.from(r,"base64"),0))}):(t.encodeBase64=function(r){return new Buffer(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0))}):(t.encodeBase64=function(r){var i,o=[],a=r.length;for(i=0;i{let n=!1;const r=e.map(i=>{const o=GN(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{scope:h,children:p,...m}=f,y=h?.[e]?.[u]||s,b=v.useMemo(()=>m,Object.values(m));return I.jsx(y.Provider,{value:b,children:p})};l.displayName=o+"Provider";function c(f,h){const p=h?.[e]?.[u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,rXe(i,...t)]}function rXe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function YN(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}var iXe=globalThis?.document?v.useLayoutEffect:()=>{},oXe=zx[" useInsertionEffect ".trim().toString()]||iXe;function aXe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=sXe({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:i;{const c=v.useRef(e!==void 0);v.useEffect(()=>{const f=c.current;f!==s&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=s},[s,r])}const l=v.useCallback(c=>{if(s){const f=uXe(c)?c(e):c;f!==e&&a.current?.(f)}else o(c)},[s,e,o,a]);return[u,l]}function sXe({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),i=v.useRef(n),o=v.useRef(t);return oXe(()=>{o.current=t},[t]),v.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function uXe(e){return typeof e=="function"}function lXe(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cXe=globalThis?.document?v.useLayoutEffect:()=>{};function fXe(e){const[t,n]=v.useState(void 0);return cXe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function ZN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dXe(...e){return t=>{let n=!1;const r=e.map(i=>{const o=ZN(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{};function pXe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var rX=e=>{const{present:t,children:n}=e,r=gXe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=hXe(r.ref,mXe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};rX.displayName="Presence";function gXe(e){const[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=pXe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Xy(r.current);o.current=s==="mounted"?l:"none"},[s]),XN(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Xy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),XN(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=Xy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=Xy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Xy(e){return e?.animationName||"none"}function mXe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function vXe(e){const t=yXe(e),n=v.forwardRef((r,i)=>{const{children:o,...a}=r,s=v.Children.toArray(o),u=s.find(xXe);if(u){const l=u.props.children,c=s.map(f=>f===u?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:f);return I.jsx(t,{...a,ref:i,children:v.isValidElement(l)?v.cloneElement(l,void 0,c):null})}return I.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function yXe(e){const t=v.forwardRef((n,r)=>{const{children:i,...o}=n;if(v.isValidElement(i)){const a=_Xe(i),s=wXe(o,i.props);return i.type!==v.Fragment&&(s.ref=r?tX(r,a):a),v.cloneElement(i,s)}return v.Children.count(i)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bXe=Symbol("radix.slottable");function xXe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bXe}function wXe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const u=o(...s);return i(...s),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function _Xe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var SXe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],e8=SXe.reduce((e,t)=>{const n=vXe(`Primitive.${t}`),r=v.forwardRef((i,o)=>{const{asChild:a,...s}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(u,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),W2="Checkbox",[CXe,Jtt]=nXe(W2),[EXe,t8]=CXe(W2);function OXe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:a,name:s,onCheckedChange:u,required:l,value:c="on",internal_do_not_use_render:f}=e,[h,p]=aXe({prop:n,defaultProp:i??!1,onChange:u,caller:W2}),[m,y]=v.useState(null),[b,w]=v.useState(null),x=v.useRef(!1),S=m?!!a||!!m.closest("form"):!0,O={checked:h,disabled:o,setChecked:p,control:m,setControl:y,name:s,form:a,value:c,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:Cl(i)?!1:i,isFormControl:S,bubbleInput:b,setBubbleInput:w};return I.jsx(EXe,{scope:t,...O,children:kXe(f)?f(O):r})}var iX="CheckboxTrigger",oX=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:a,disabled:s,checked:u,required:l,setControl:c,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:m}=t8(iX,e),y=nX(i,c),b=v.useRef(u);return v.useEffect(()=>{const w=o?.form;if(w){const x=()=>f(b.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[o,f]),I.jsx(e8.button,{type:"button",role:"checkbox","aria-checked":Cl(u)?"mixed":u,"aria-required":l,"data-state":lX(u),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:y,onKeyDown:YN(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:YN(n,w=>{f(x=>Cl(x)?!0:!x),m&&p&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})})});oX.displayName=iX;var AXe=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:u,onCheckedChange:l,form:c,...f}=e;return I.jsx(OXe,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:s,required:a,onCheckedChange:l,name:r,form:c,value:u,internal_do_not_use_render:({isFormControl:h})=>I.jsxs(I.Fragment,{children:[I.jsx(oX,{...f,ref:t,__scopeCheckbox:n}),h&&I.jsx(uX,{__scopeCheckbox:n})]})})});AXe.displayName=W2;var aX="CheckboxIndicator",PXe=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=t8(aX,n);return I.jsx(rX,{present:r||Cl(o.checked)||o.checked===!0,children:I.jsx(e8.span,{"data-state":lX(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});PXe.displayName=aX;var sX="CheckboxBubbleInput",uX=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:a,required:s,disabled:u,name:l,value:c,form:f,bubbleInput:h,setBubbleInput:p}=t8(sX,e),m=nX(n,p),y=lXe(o),b=fXe(r);v.useEffect(()=>{const x=h;if(!x)return;const S=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(S,"checked").set,C=!i.current;if(y!==o&&E){const P=new Event("click",{bubbles:C});x.indeterminate=Cl(o),E.call(x,Cl(o)?!1:o),x.dispatchEvent(P)}},[h,y,o,i]);const w=v.useRef(Cl(o)?!1:o);return I.jsx(e8.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:s,disabled:u,name:l,value:c,form:f,...t,tabIndex:-1,ref:m,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});uX.displayName=sX;function kXe(e){return typeof e=="function"}function Cl(e){return e==="indeterminate"}function lX(e){return Cl(e)?"indeterminate":e?"checked":"unchecked"}export{tJe as $,qQe as A,VQe as B,wQe as C,Gi as D,rme as E,xQe as F,EQe as G,pT as H,nQe as I,F as J,IQe as K,TQe as L,DXe as M,UQe as N,MXe as O,NXe as P,DQe as Q,bQe as R,Pl as S,MQe as T,eQe as U,JXe as V,LXe as W,xve as X,Sve as Y,Cve as Z,Ez as _,jXe as a,Qet as a$,Eve as a0,Ove as a1,wve as a2,_ve as a3,kJe as a4,QQe as a5,TJe as a6,xJe as a7,wJe as a8,CJe as a9,wet as aA,XXe as aB,sQe as aC,YXe as aD,tQe as aE,cQe as aF,lQe as aG,rQe as aH,uQe as aI,HXe as aJ,WXe as aK,QXe as aL,vQe as aM,mQe as aN,pQe as aO,yQe as aP,oQe as aQ,KXe as aR,Vet as aS,sJe as aT,ket as aU,aQe as aV,dQe as aW,qet as aX,Ket as aY,Get as aZ,FXe as a_,EJe as aa,AJe as ab,GQe as ac,OJe as ad,rJe as ae,SJe as af,PJe as ag,yJe as ah,bJe as ai,_Je as aj,pJe as ak,hJe as al,gJe as am,GXe as an,RJe as ao,sbe as ap,ube as aq,$Je as ar,FJe as as,IJe as at,NJe as au,$Xe as av,qXe as aw,ZXe as ax,fQe as ay,UXe as az,zse as b,oet as b$,ett as b0,Jet as b1,ttt as b2,ZQe as b3,ctt as b4,JQe as b5,ftt as b6,ntt as b7,rtt as b8,itt as b9,bet as bA,HJe as bB,Uet as bC,Fet as bD,aet as bE,Net as bF,_tt as bG,Stt as bH,Ctt as bI,pHe as bJ,xHe as bK,xet as bL,jJe as bM,WJe as bN,UJe as bO,htt as bP,Ui as bQ,Ott as bR,Att as bS,iJe as bT,oJe as bU,Itt as bV,cet as bW,Ntt as bX,yet as bY,$et as bZ,Pet as b_,att as ba,stt as bb,ltt as bc,utt as bd,dtt as be,ott as bf,gtt as bg,XQe as bh,btt as bi,xtt as bj,vtt as bk,ytt as bl,I3 as bm,Sf as bn,qJe as bo,Yet as bp,Zet as bq,s5 as br,u5 as bs,yje as bt,Js as bu,wf as bv,rp as bw,ptt as bx,BJe as by,VJe as bz,dn as c,PXe as c$,fet as c0,Iet as c1,vet as c2,Let as c3,tet as c4,Ptt as c5,ktt as c6,Dtt as c7,QJe as c8,XJe as c9,Rce as cA,Cet as cB,Met as cC,Eet as cD,met as cE,YJe as cF,ZJe as cG,zet as cH,Ja as cI,br as cJ,pet as cK,Ttt as cL,Mtt as cM,cJe as cN,ef as cO,LJe as cP,Xtt as cQ,Qtt as cR,Tet as cS,net as cT,set as cU,_et as cV,iet as cW,Ret as cX,het as cY,jet as cZ,AXe as c_,VXe as ca,gQe as cb,iQe as cc,zXe as cd,hQe as ce,Ftt as cf,jtt as cg,Oet as ch,Btt as ci,JJe as cj,zJe as ck,Htt as cl,qtt as cm,Ytt as cn,Ztt as co,Ktt as cp,Gtt as cq,ztt as cr,Wtt as cs,Vtt as ct,aJe as cu,lJe as cv,Rtt as cw,$tt as cx,Lce as cy,Wce as cz,wm as d,eJe as d0,dJe as d1,YQe as d2,nJe as d3,fJe as d4,uet as d5,IXe as d6,GJe as d7,Aet as d8,ret as d9,aHe as da,uJe as db,get as dc,Bet as dd,eet as de,KJe as df,Det as dg,det as dh,AQe as e,eA as f,RQe as g,kQe as h,FQe as i,I as j,jQe as k,Gr as l,BQe as m,OQe as n,_Qe as o,SQe as p,NQe as q,v as r,LQe as s,BXe as t,Sj as u,zQe as v,WQe as w,RXe as x,HQe as y,CQe as z}; +`,o.map=[t,e.line],!0}function TYe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const a=e.src.charCodeAt(i);if(a!==126&&a!==96)return!1;let s=i;i=e.skipChars(i,a);let u=i-s;if(u<3)return!1;const l=e.src.slice(s,i),c=e.src.slice(i,o);if(a===96&&c.indexOf(String.fromCharCode(a))>=0)return!1;if(r)return!0;let f=t,h=!1;for(;f++,!(f>=n||(i=s=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],i=4)&&(i=e.skipChars(i,a),!(i-s=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;const s=[],u=[],l=[],c=[],f=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let p=!1,m;for(m=t;m=o)break;if(e.src.charCodeAt(i++)===62&&!S){let E=e.sCount[m]+1,C,P;e.src.charCodeAt(i)===32?(i++,E++,P=!1,C=!0):e.src.charCodeAt(i)===9?(C=!0,(e.bsCount[m]+E)%4===3?(i++,E++,P=!1):P=!0):C=!1;let M=E;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i=o,u.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+(C?1:0),l.push(e.sCount[m]),e.sCount[m]=M-E,c.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let O=!1;for(let E=0,C=f.length;E";const w=[t,0];b.map=w,e.md.block.tokenize(e,t,m);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=a,e.parentType=h,w[1]=e.line;for(let S=0;S=4)return!1;let o=e.bMarks[t]+e.tShift[t];const a=e.src.charCodeAt(o++);if(a!==42&&a!==45&&a!==95)return!1;let s=1;for(;o=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=e.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i=4||e.listIndent>=0&&e.sCount[u]-e.listIndent>=4&&e.sCount[u]=e.blkIndent&&(c=!0);let f,h,p;if((p=UN(e,u))>=0){if(f=!0,a=e.bMarks[u]+e.tShift[u],h=Number(e.src.slice(a,p-1)),c&&h!==1)return!1}else if((p=BN(e,u))>=0)f=!1;else return!1;if(c&&e.skipSpaces(p)>=e.eMarks[u])return!1;if(r)return!0;const m=e.src.charCodeAt(p-1),y=e.tokens.length;f?(s=e.push("ordered_list_open","ol",1),h!==1&&(s.attrs=[["start",h]])):s=e.push("bullet_list_open","ul",1);const b=[u,0];s.map=b,s.markup=String.fromCharCode(m);let w=!1;const x=e.md.block.ruler.getRules("list"),S=e.parentType;for(e.parentType="list";u=i?P=1:P=E-O,P>4&&(P=1);const M=O+P;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(m);const N=[u,0];s.map=N,f&&(s.info=e.src.slice(a,p-1));const B=e.tight,V=e.tShift[u],W=e.sCount[u],ne=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=M,e.tight=!0,e.tShift[u]=C-e.bMarks[u],e.sCount[u]=E,C>=i&&e.isEmpty(u+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,u,n,!0),(!e.tight||w)&&(l=!1),w=e.line-u>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ne,e.tShift[u]=V,e.sCount[u]=W,e.tight=B,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(m),u=e.line,N[1]=u,u>=n||e.sCount[u]=4)break;let Z=!1;for(let q=0,G=x.length;q=4||e.src.charCodeAt(i)!==91)return!1;function s(x){const S=e.lineMax;if(x>=S||e.isEmpty(x))return null;let O=!1;if(e.sCount[x]-e.blkIndent>3&&(O=!0),e.sCount[x]<0&&(O=!0),!O){const P=e.md.block.ruler.getRules("reference"),M=e.parentType;e.parentType="reference";let N=!1;for(let B=0,V=P.length;B"u"&&(e.env.references={}),typeof e.env.references[w]>"u"&&(e.env.references[w]={title:b,href:f}),e.line=a),!0):!1}const NYe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],LYe="[a-zA-Z_:][a-zA-Z0-9:._-]*",FYe="[^\"'=<>`\\x00-\\x20]+",jYe="'[^']*'",BYe='"[^"]*"',UYe="(?:"+FYe+"|"+jYe+"|"+BYe+")",zYe="(?:\\s+"+LYe+"(?:\\s*=\\s*"+UYe+")?)",FZ="<[A-Za-z][A-Za-z0-9\\-]*"+zYe+"*\\s*\\/?>",jZ="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",WYe="",VYe="<[?][\\s\\S]*?[?]>",HYe="]*>",qYe="",KYe=new RegExp("^(?:"+FZ+"|"+jZ+"|"+WYe+"|"+VYe+"|"+HYe+"|"+qYe+")"),GYe=new RegExp("^(?:"+FZ+"|"+jZ+")"),ed=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(GYe.source+"\\s*$"),/^$/,!1]];function YYe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let a=e.src.slice(i,o),s=0;for(;s=4)return!1;let a=e.src.charCodeAt(i);if(a!==35||i>=o)return!1;let s=1;for(a=e.src.charCodeAt(++i);a===35&&i6||ii&&qn(e.src.charCodeAt(u-1))&&(o=u),e.line=t+1;const l=e.push("heading_open","h"+String(s),1);l.markup="########".slice(0,s),l.map=[t,e.line];const c=e.push("inline","",0);c.content=e.src.slice(i,o).trim(),c.map=[t,e.line],c.children=[];const f=e.push("heading_close","h"+String(s),-1);return f.markup="########".slice(0,s),!0}function XYe(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o=0,a,s=t+1;for(;s3)continue;if(e.sCount[s]>=e.blkIndent){let p=e.bMarks[s]+e.tShift[s];const m=e.eMarks[s];if(p=m))){o=a===61?1:2;break}}if(e.sCount[s]<0)continue;let h=!1;for(let p=0,m=r.length;p3||e.sCount[o]<0)continue;let l=!1;for(let c=0,f=r.length;c=n||e.sCount[a]=o){e.line=n;break}const u=e.line;let l=!1;for(let c=0;c=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),a=e.line,a0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};nv.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=e.pending.match(tZe);if(!i)return!1;const o=i[1],a=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!a)return!1;let s=a.url;if(s.length<=o.length)return!1;s=s.replace(/\*+$/,"");const u=e.md.normalizeLink(s);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const l=e.push("link_open","a",1);l.attrs=[["href",u]],l.markup="linkify",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=s.length-o.length,!0}function rZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(e){Q5[e.charCodeAt(0)]=1});function iZe(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&s<=57343&&(o+=e.src[n+1],n++)}const a="\\"+o;if(!t){const s=e.push("text_special","",0);i<256&&Q5[i]!==0?s.content=o:s.content=a,s.markup=a,s.info="escape"}return e.pos=n+1,!0}function oZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=e.posMax;for(;n=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=t[i.end],a=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===o.token+1,s=String.fromCharCode(i.marker),u=e.tokens[i.token];u.type=a?"strong_open":"em_open",u.tag=a?"strong":"em",u.nesting=1,u.markup=a?s+s:s,u.content="";const l=e.tokens[o.token];l.type=a?"strong_close":"em_close",l.tag=a?"strong":"em",l.nesting=-1,l.markup=a?s+s:s,l.content="",a&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function lZe(e){const t=e.tokens_meta,n=e.tokens_meta.length;WN(e,e.delimiters);for(let r=0;r=f)return!1;if(u=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(a=e.md.normalizeLink(i.str),e.md.validateLink(a)?m=i.pos:a="",u=m;m=f||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(typeof e.env.references>"u")return!1;if(m=0?r=e.src.slice(u,m++):m=p+1):m=p+1,r||(r=e.src.slice(h,p)),o=e.env.references[B2(r)],!o)return e.pos=c,!1;a=o.href,s=o.title}if(!t){e.pos=h,e.posMax=p;const y=e.push("link_open","a",1),b=[["href",a]];y.attrs=b,s&&b.push(["title",s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=m,e.posMax=f,!0}function fZe(e,t){let n,r,i,o,a,s,u,l,c="";const f=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(o=m+1,o=h)return!1;for(l=o,s=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),s.ok&&(c=e.md.normalizeLink(s.str),e.md.validateLink(c)?o=s.pos:c=""),l=o;o=h||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o=0?i=e.src.slice(l,o++):o=m+1):o=m+1,i||(i=e.src.slice(p,m)),a=e.env.references[B2(i)],!a)return e.pos=f,!1;c=a.href,u=a.title}if(!t){r=e.src.slice(p,m);const y=[];e.md.inline.parse(r,e.md,e.env,y);const b=e.push("image","img",0),w=[["src",c],["alt",""]];b.attrs=w,b.children=y,b.content=r,u&&w.push(["title",u])}return e.pos=o,e.posMax=h,!0}const dZe=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,hZe=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function pZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const a=e.src.charCodeAt(n);if(a===60)return!1;if(a===62)break}const o=e.src.slice(r+1,n);if(hZe.test(o)){const a=e.md.normalizeLink(o);if(!e.md.validateLink(a))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}if(dZe.test(o)){const a=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(a))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}return!1}function gZe(e){return/^\s]/i.test(e)}function mZe(e){return/^<\/a\s*>/i.test(e)}function vZe(e){const t=e|32;return t>=97&&t<=122}function yZe(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!vZe(i))return!1;const o=e.src.slice(r).match(KYe);if(!o)return!1;if(!t){const a=e.push("html_inline","",0);a.content=o[0],gZe(a.content)&&e.linkLevel++,mZe(a.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const bZe=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,xZe=/^&([a-z][a-z0-9]{1,31});/i;function wZe(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(bZe);if(o){if(!t){const a=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),s=e.push("text_special","",0);s.content=Z5(a)?jx(a):jx(65533),s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(xZe);if(o){const a=DZ(o[0]);if(a!==o[0]){if(!t){const s=e.push("text_special","",0);s.content=a,s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function VN(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let a=0;au;l-=o[l]+1){const f=e[l];if(f.marker===s.marker&&f.open&&f.end<0){let h=!1;if((f.close||s.open)&&(f.length+s.length)%3===0&&(f.length%3!==0||s.length%3!==0)&&(h=!0),!h){const p=l>0&&!e[l-1].open?o[l-1]+1:0;o[a]=a-l+p,o[l]=p,s.open=!1,f.end=a,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(t[s.marker][(s.open?3:0)+(s.length||0)%3]=c)}}function _Ze(e){const t=e.tokens_meta,n=e.tokens_meta.length;VN(e.delimiters);for(let r=0;r0&&r++,i[t].type==="text"&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,o[t]=e.pos};rv.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};rv.prototype.parse=function(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),a=o.length;for(let s=0;s|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function K4(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function z2(e){return Object.prototype.toString.call(e)}function EZe(e){return z2(e)==="[object String]"}function OZe(e){return z2(e)==="[object Object]"}function AZe(e){return z2(e)==="[object RegExp]"}function HN(e){return z2(e)==="[object Function]"}function PZe(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const zZ={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function kZe(e){return Object.keys(e||{}).reduce(function(t,n){return t||zZ.hasOwnProperty(n)},!1)}const TZe={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},MZe="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",RZe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function DZe(e){e.__index__=-1,e.__text_cache__=""}function $Ze(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function qN(){return function(e,t){t.normalize(e)}}function Bx(e){const t=e.re=CZe(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(MZe),n.push(t.src_xn),t.src_tlds=n.join("|");function r(s){return s.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function o(s,u){throw new Error('(LinkifyIt) Invalid schema "'+s+'": '+u)}Object.keys(e.__schemas__).forEach(function(s){const u=e.__schemas__[s];if(u===null)return;const l={validate:null,link:null};if(e.__compiled__[s]=l,OZe(u)){AZe(u.validate)?l.validate=$Ze(u.validate):HN(u.validate)?l.validate=u.validate:o(s,u),HN(u.normalize)?l.normalize=u.normalize:u.normalize?o(s,u):l.normalize=qN();return}if(EZe(u)){i.push(s);return}o(s,u)}),i.forEach(function(s){e.__compiled__[e.__schemas__[s]]&&(e.__compiled__[s].validate=e.__compiled__[e.__schemas__[s]].validate,e.__compiled__[s].normalize=e.__compiled__[e.__schemas__[s]].normalize)}),e.__compiled__[""]={validate:null,normalize:qN()};const a=Object.keys(e.__compiled__).filter(function(s){return s.length>0&&e.__compiled__[s]}).map(PZe).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),DZe(e)}function IZe(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function G4(e,t){const n=new IZe(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Vo(e,t){if(!(this instanceof Vo))return new Vo(e,t);t||kZe(e)&&(t=e,e={}),this.__opts__=K4({},zZ,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=K4({},TZe,e),this.__compiled__={},this.__tlds__=RZe,this.__tlds_replaced__=!1,this.re={},Bx(this)}Vo.prototype.add=function(t,n){return this.__schemas__[t]=n,Bx(this),this};Vo.prototype.set=function(t){return this.__opts__=K4(this.__opts__,t),this};Vo.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,r,i,o,a,s,u,l,c;if(this.re.schema_test.test(t)){for(u=this.re.schema_search,u.lastIndex=0;(n=u.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],u.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&(i=t.match(this.re.email_fuzzy))!==null&&(a=i.index+i[1].length,s=i.index+i[0].length,(this.__index__<0||athis.__last_index__)&&(this.__schema__="mailto:",this.__index__=a,this.__last_index__=s))),this.__index__>=0};Vo.prototype.pretest=function(t){return this.re.pretest.test(t)};Vo.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};Vo.prototype.match=function(t){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(G4(this,r)),r=this.__last_index__);let i=r?t.slice(r):t;for(;this.test(i);)n.push(G4(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Vo.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,G4(this,0)):null};Vo.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),Bx(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Bx(this),this)};Vo.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Vo.prototype.onCompile=function(){};const Bd=2147483647,xs=36,J5=1,pm=26,NZe=38,LZe=700,WZ=72,VZ=128,HZ="-",FZe=/^xn--/,jZe=/[^\0-\x7F]/,BZe=/[\x2E\u3002\uFF0E\uFF61]/g,UZe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},oC=xs-J5,ws=Math.floor,aC=String.fromCharCode;function Ju(e){throw new RangeError(UZe[e])}function zZe(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function qZ(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(BZe,".");const i=e.split("."),o=zZe(i,t).join(".");return r+o}function KZ(e){const t=[];let n=0;const r=e.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...e),VZe=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:xs},KN=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},GZ=function(e,t,n){let r=0;for(e=n?ws(e/LZe):e>>1,e+=ws(e/t);e>oC*pm>>1;r+=xs)e=ws(e/oC);return ws(r+(oC+1)*e/(e+NZe))},YZ=function(e){const t=[],n=e.length;let r=0,i=VZ,o=WZ,a=e.lastIndexOf(HZ);a<0&&(a=0);for(let s=0;s=128&&Ju("not-basic"),t.push(e.charCodeAt(s));for(let s=a>0?a+1:0;s=n&&Ju("invalid-input");const h=VZe(e.charCodeAt(s++));h>=xs&&Ju("invalid-input"),h>ws((Bd-r)/c)&&Ju("overflow"),r+=h*c;const p=f<=o?J5:f>=o+pm?pm:f-o;if(hws(Bd/m)&&Ju("overflow"),c*=m}const l=t.length+1;o=GZ(r-u,l,u==0),ws(r/l)>Bd-i&&Ju("overflow"),i+=ws(r/l),r%=l,t.splice(r++,0,i)}return String.fromCodePoint(...t)},ZZ=function(e){const t=[];e=KZ(e);const n=e.length;let r=VZ,i=0,o=WZ;for(const u of e)u<128&&t.push(aC(u));const a=t.length;let s=a;for(a&&t.push(HZ);s=r&&cws((Bd-i)/l)&&Ju("overflow"),i+=(u-r)*l,r=u;for(const c of e)if(cBd&&Ju("overflow"),c===r){let f=i;for(let h=xs;;h+=xs){const p=h<=o?J5:h>=o+pm?pm:h-o;if(f=0))try{t.hostname=XZ.toASCII(t.hostname)}catch{}return tv(q5(t))}function tXe(e){const t=K5(e,!0);if(t.hostname&&(!t.protocol||QZ.indexOf(t.protocol)>=0))try{t.hostname=XZ.toUnicode(t.hostname)}catch{}return Ph(q5(t),Ph.defaultChars+"%")}function Ja(e,t){if(!(this instanceof Ja))return new Ja(e,t);t||Y5(e)||(t=e||{},e="default"),this.inline=new rv,this.block=new U2,this.core=new X5,this.renderer=new ap,this.linkify=new Vo,this.validateLink=JZe,this.normalizeLink=eXe,this.normalizeLinkText=tXe,this.utils=rYe,this.helpers=j2({},sYe),this.options={},this.configure(e),t&&this.set(t)}Ja.prototype.set=function(e){return j2(this.options,e),this};Ja.prototype.configure=function(e){const t=this;if(Y5(e)){const n=e;if(e=ZZe[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Ja.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Ja.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Ja.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Ja.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Ja.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Ja.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Ja.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var JZ={exports:{}};(function(e){(function(t){var n=function(T){var D,$=new Float64Array(16);if(T)for(D=0;D>24&255,T[D+1]=$>>16&255,T[D+2]=$>>8&255,T[D+3]=$&255,T[D+4]=A>>24&255,T[D+5]=A>>16&255,T[D+6]=A>>8&255,T[D+7]=A&255}function y(T,D,$,A,L){var ee,re=0;for(ee=0;ee>>8)-1}function b(T,D,$,A){return y(T,D,$,A,16)}function w(T,D,$,A){return y(T,D,$,A,32)}function x(T,D,$,A){for(var L=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,ee=$[0]&255|($[1]&255)<<8|($[2]&255)<<16|($[3]&255)<<24,re=$[4]&255|($[5]&255)<<8|($[6]&255)<<16|($[7]&255)<<24,he=$[8]&255|($[9]&255)<<8|($[10]&255)<<16|($[11]&255)<<24,Ce=$[12]&255|($[13]&255)<<8|($[14]&255)<<16|($[15]&255)<<24,Be=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,He=D[0]&255|(D[1]&255)<<8|(D[2]&255)<<16|(D[3]&255)<<24,ct=D[4]&255|(D[5]&255)<<8|(D[6]&255)<<16|(D[7]&255)<<24,Ne=D[8]&255|(D[9]&255)<<8|(D[10]&255)<<16|(D[11]&255)<<24,rt=D[12]&255|(D[13]&255)<<8|(D[14]&255)<<16|(D[15]&255)<<24,xt=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,At=$[16]&255|($[17]&255)<<8|($[18]&255)<<16|($[19]&255)<<24,pt=$[20]&255|($[21]&255)<<8|($[22]&255)<<16|($[23]&255)<<24,ht=$[24]&255|($[25]&255)<<8|($[26]&255)<<16|($[27]&255)<<24,wt=$[28]&255|($[29]&255)<<8|($[30]&255)<<16|($[31]&255)<<24,_t=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Je=L,ut=ee,Qe=re,Fe=he,qe=Ce,Ge=Be,ve=He,ge=ct,De=Ne,Pe=rt,Te=xt,Ue=At,yt=pt,jt=ht,Bt=wt,It=_t,te,Zt=0;Zt<20;Zt+=2)te=Je+yt|0,qe^=te<<7|te>>>25,te=qe+Je|0,De^=te<<9|te>>>23,te=De+qe|0,yt^=te<<13|te>>>19,te=yt+De|0,Je^=te<<18|te>>>14,te=Ge+ut|0,Pe^=te<<7|te>>>25,te=Pe+Ge|0,jt^=te<<9|te>>>23,te=jt+Pe|0,ut^=te<<13|te>>>19,te=ut+jt|0,Ge^=te<<18|te>>>14,te=Te+ve|0,Bt^=te<<7|te>>>25,te=Bt+Te|0,Qe^=te<<9|te>>>23,te=Qe+Bt|0,ve^=te<<13|te>>>19,te=ve+Qe|0,Te^=te<<18|te>>>14,te=It+Ue|0,Fe^=te<<7|te>>>25,te=Fe+It|0,ge^=te<<9|te>>>23,te=ge+Fe|0,Ue^=te<<13|te>>>19,te=Ue+ge|0,It^=te<<18|te>>>14,te=Je+Fe|0,ut^=te<<7|te>>>25,te=ut+Je|0,Qe^=te<<9|te>>>23,te=Qe+ut|0,Fe^=te<<13|te>>>19,te=Fe+Qe|0,Je^=te<<18|te>>>14,te=Ge+qe|0,ve^=te<<7|te>>>25,te=ve+Ge|0,ge^=te<<9|te>>>23,te=ge+ve|0,qe^=te<<13|te>>>19,te=qe+ge|0,Ge^=te<<18|te>>>14,te=Te+Pe|0,Ue^=te<<7|te>>>25,te=Ue+Te|0,De^=te<<9|te>>>23,te=De+Ue|0,Pe^=te<<13|te>>>19,te=Pe+De|0,Te^=te<<18|te>>>14,te=It+Bt|0,yt^=te<<7|te>>>25,te=yt+It|0,jt^=te<<9|te>>>23,te=jt+yt|0,Bt^=te<<13|te>>>19,te=Bt+jt|0,It^=te<<18|te>>>14;Je=Je+L|0,ut=ut+ee|0,Qe=Qe+re|0,Fe=Fe+he|0,qe=qe+Ce|0,Ge=Ge+Be|0,ve=ve+He|0,ge=ge+ct|0,De=De+Ne|0,Pe=Pe+rt|0,Te=Te+xt|0,Ue=Ue+At|0,yt=yt+pt|0,jt=jt+ht|0,Bt=Bt+wt|0,It=It+_t|0,T[0]=Je>>>0&255,T[1]=Je>>>8&255,T[2]=Je>>>16&255,T[3]=Je>>>24&255,T[4]=ut>>>0&255,T[5]=ut>>>8&255,T[6]=ut>>>16&255,T[7]=ut>>>24&255,T[8]=Qe>>>0&255,T[9]=Qe>>>8&255,T[10]=Qe>>>16&255,T[11]=Qe>>>24&255,T[12]=Fe>>>0&255,T[13]=Fe>>>8&255,T[14]=Fe>>>16&255,T[15]=Fe>>>24&255,T[16]=qe>>>0&255,T[17]=qe>>>8&255,T[18]=qe>>>16&255,T[19]=qe>>>24&255,T[20]=Ge>>>0&255,T[21]=Ge>>>8&255,T[22]=Ge>>>16&255,T[23]=Ge>>>24&255,T[24]=ve>>>0&255,T[25]=ve>>>8&255,T[26]=ve>>>16&255,T[27]=ve>>>24&255,T[28]=ge>>>0&255,T[29]=ge>>>8&255,T[30]=ge>>>16&255,T[31]=ge>>>24&255,T[32]=De>>>0&255,T[33]=De>>>8&255,T[34]=De>>>16&255,T[35]=De>>>24&255,T[36]=Pe>>>0&255,T[37]=Pe>>>8&255,T[38]=Pe>>>16&255,T[39]=Pe>>>24&255,T[40]=Te>>>0&255,T[41]=Te>>>8&255,T[42]=Te>>>16&255,T[43]=Te>>>24&255,T[44]=Ue>>>0&255,T[45]=Ue>>>8&255,T[46]=Ue>>>16&255,T[47]=Ue>>>24&255,T[48]=yt>>>0&255,T[49]=yt>>>8&255,T[50]=yt>>>16&255,T[51]=yt>>>24&255,T[52]=jt>>>0&255,T[53]=jt>>>8&255,T[54]=jt>>>16&255,T[55]=jt>>>24&255,T[56]=Bt>>>0&255,T[57]=Bt>>>8&255,T[58]=Bt>>>16&255,T[59]=Bt>>>24&255,T[60]=It>>>0&255,T[61]=It>>>8&255,T[62]=It>>>16&255,T[63]=It>>>24&255}function S(T,D,$,A){for(var L=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,ee=$[0]&255|($[1]&255)<<8|($[2]&255)<<16|($[3]&255)<<24,re=$[4]&255|($[5]&255)<<8|($[6]&255)<<16|($[7]&255)<<24,he=$[8]&255|($[9]&255)<<8|($[10]&255)<<16|($[11]&255)<<24,Ce=$[12]&255|($[13]&255)<<8|($[14]&255)<<16|($[15]&255)<<24,Be=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,He=D[0]&255|(D[1]&255)<<8|(D[2]&255)<<16|(D[3]&255)<<24,ct=D[4]&255|(D[5]&255)<<8|(D[6]&255)<<16|(D[7]&255)<<24,Ne=D[8]&255|(D[9]&255)<<8|(D[10]&255)<<16|(D[11]&255)<<24,rt=D[12]&255|(D[13]&255)<<8|(D[14]&255)<<16|(D[15]&255)<<24,xt=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,At=$[16]&255|($[17]&255)<<8|($[18]&255)<<16|($[19]&255)<<24,pt=$[20]&255|($[21]&255)<<8|($[22]&255)<<16|($[23]&255)<<24,ht=$[24]&255|($[25]&255)<<8|($[26]&255)<<16|($[27]&255)<<24,wt=$[28]&255|($[29]&255)<<8|($[30]&255)<<16|($[31]&255)<<24,_t=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Je=L,ut=ee,Qe=re,Fe=he,qe=Ce,Ge=Be,ve=He,ge=ct,De=Ne,Pe=rt,Te=xt,Ue=At,yt=pt,jt=ht,Bt=wt,It=_t,te,Zt=0;Zt<20;Zt+=2)te=Je+yt|0,qe^=te<<7|te>>>25,te=qe+Je|0,De^=te<<9|te>>>23,te=De+qe|0,yt^=te<<13|te>>>19,te=yt+De|0,Je^=te<<18|te>>>14,te=Ge+ut|0,Pe^=te<<7|te>>>25,te=Pe+Ge|0,jt^=te<<9|te>>>23,te=jt+Pe|0,ut^=te<<13|te>>>19,te=ut+jt|0,Ge^=te<<18|te>>>14,te=Te+ve|0,Bt^=te<<7|te>>>25,te=Bt+Te|0,Qe^=te<<9|te>>>23,te=Qe+Bt|0,ve^=te<<13|te>>>19,te=ve+Qe|0,Te^=te<<18|te>>>14,te=It+Ue|0,Fe^=te<<7|te>>>25,te=Fe+It|0,ge^=te<<9|te>>>23,te=ge+Fe|0,Ue^=te<<13|te>>>19,te=Ue+ge|0,It^=te<<18|te>>>14,te=Je+Fe|0,ut^=te<<7|te>>>25,te=ut+Je|0,Qe^=te<<9|te>>>23,te=Qe+ut|0,Fe^=te<<13|te>>>19,te=Fe+Qe|0,Je^=te<<18|te>>>14,te=Ge+qe|0,ve^=te<<7|te>>>25,te=ve+Ge|0,ge^=te<<9|te>>>23,te=ge+ve|0,qe^=te<<13|te>>>19,te=qe+ge|0,Ge^=te<<18|te>>>14,te=Te+Pe|0,Ue^=te<<7|te>>>25,te=Ue+Te|0,De^=te<<9|te>>>23,te=De+Ue|0,Pe^=te<<13|te>>>19,te=Pe+De|0,Te^=te<<18|te>>>14,te=It+Bt|0,yt^=te<<7|te>>>25,te=yt+It|0,jt^=te<<9|te>>>23,te=jt+yt|0,Bt^=te<<13|te>>>19,te=Bt+jt|0,It^=te<<18|te>>>14;T[0]=Je>>>0&255,T[1]=Je>>>8&255,T[2]=Je>>>16&255,T[3]=Je>>>24&255,T[4]=Ge>>>0&255,T[5]=Ge>>>8&255,T[6]=Ge>>>16&255,T[7]=Ge>>>24&255,T[8]=Te>>>0&255,T[9]=Te>>>8&255,T[10]=Te>>>16&255,T[11]=Te>>>24&255,T[12]=It>>>0&255,T[13]=It>>>8&255,T[14]=It>>>16&255,T[15]=It>>>24&255,T[16]=ve>>>0&255,T[17]=ve>>>8&255,T[18]=ve>>>16&255,T[19]=ve>>>24&255,T[20]=ge>>>0&255,T[21]=ge>>>8&255,T[22]=ge>>>16&255,T[23]=ge>>>24&255,T[24]=De>>>0&255,T[25]=De>>>8&255,T[26]=De>>>16&255,T[27]=De>>>24&255,T[28]=Pe>>>0&255,T[29]=Pe>>>8&255,T[30]=Pe>>>16&255,T[31]=Pe>>>24&255}function O(T,D,$,A){x(T,D,$,A)}function E(T,D,$,A){S(T,D,$,A)}var C=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function P(T,D,$,A,L,ee,re){var he=new Uint8Array(16),Ce=new Uint8Array(64),Be,He;for(He=0;He<16;He++)he[He]=0;for(He=0;He<8;He++)he[He]=ee[He];for(;L>=64;){for(O(Ce,he,re,C),He=0;He<64;He++)T[D+He]=$[A+He]^Ce[He];for(Be=1,He=8;He<16;He++)Be=Be+(he[He]&255)|0,he[He]=Be&255,Be>>>=8;L-=64,D+=64,A+=64}if(L>0)for(O(Ce,he,re,C),He=0;He=64;){for(O(re,ee,L,C),Ce=0;Ce<64;Ce++)T[D+Ce]=re[Ce];for(he=1,Ce=8;Ce<16;Ce++)he=he+(ee[Ce]&255)|0,ee[Ce]=he&255,he>>>=8;$-=64,D+=64}if($>0)for(O(re,ee,L,C),Ce=0;Ce<$;Ce++)T[D+Ce]=re[Ce];return 0}function N(T,D,$,A,L){var ee=new Uint8Array(32);E(ee,A,L,C);for(var re=new Uint8Array(8),he=0;he<8;he++)re[he]=A[he+16];return M(T,D,$,re,ee)}function B(T,D,$,A,L,ee,re){var he=new Uint8Array(32);E(he,ee,re,C);for(var Ce=new Uint8Array(8),Be=0;Be<8;Be++)Ce[Be]=ee[Be+16];return P(T,D,$,A,L,Ce,he)}var V=function(T){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var D,$,A,L,ee,re,he,Ce;D=T[0]&255|(T[1]&255)<<8,this.r[0]=D&8191,$=T[2]&255|(T[3]&255)<<8,this.r[1]=(D>>>13|$<<3)&8191,A=T[4]&255|(T[5]&255)<<8,this.r[2]=($>>>10|A<<6)&7939,L=T[6]&255|(T[7]&255)<<8,this.r[3]=(A>>>7|L<<9)&8191,ee=T[8]&255|(T[9]&255)<<8,this.r[4]=(L>>>4|ee<<12)&255,this.r[5]=ee>>>1&8190,re=T[10]&255|(T[11]&255)<<8,this.r[6]=(ee>>>14|re<<2)&8191,he=T[12]&255|(T[13]&255)<<8,this.r[7]=(re>>>11|he<<5)&8065,Ce=T[14]&255|(T[15]&255)<<8,this.r[8]=(he>>>8|Ce<<8)&8191,this.r[9]=Ce>>>5&127,this.pad[0]=T[16]&255|(T[17]&255)<<8,this.pad[1]=T[18]&255|(T[19]&255)<<8,this.pad[2]=T[20]&255|(T[21]&255)<<8,this.pad[3]=T[22]&255|(T[23]&255)<<8,this.pad[4]=T[24]&255|(T[25]&255)<<8,this.pad[5]=T[26]&255|(T[27]&255)<<8,this.pad[6]=T[28]&255|(T[29]&255)<<8,this.pad[7]=T[30]&255|(T[31]&255)<<8};V.prototype.blocks=function(T,D,$){for(var A=this.fin?0:2048,L,ee,re,he,Ce,Be,He,ct,Ne,rt,xt,At,pt,ht,wt,_t,Je,ut,Qe,Fe=this.h[0],qe=this.h[1],Ge=this.h[2],ve=this.h[3],ge=this.h[4],De=this.h[5],Pe=this.h[6],Te=this.h[7],Ue=this.h[8],yt=this.h[9],jt=this.r[0],Bt=this.r[1],It=this.r[2],te=this.r[3],Zt=this.r[4],sn=this.r[5],un=this.r[6],Ut=this.r[7],ln=this.r[8],rn=this.r[9];$>=16;)L=T[D+0]&255|(T[D+1]&255)<<8,Fe+=L&8191,ee=T[D+2]&255|(T[D+3]&255)<<8,qe+=(L>>>13|ee<<3)&8191,re=T[D+4]&255|(T[D+5]&255)<<8,Ge+=(ee>>>10|re<<6)&8191,he=T[D+6]&255|(T[D+7]&255)<<8,ve+=(re>>>7|he<<9)&8191,Ce=T[D+8]&255|(T[D+9]&255)<<8,ge+=(he>>>4|Ce<<12)&8191,De+=Ce>>>1&8191,Be=T[D+10]&255|(T[D+11]&255)<<8,Pe+=(Ce>>>14|Be<<2)&8191,He=T[D+12]&255|(T[D+13]&255)<<8,Te+=(Be>>>11|He<<5)&8191,ct=T[D+14]&255|(T[D+15]&255)<<8,Ue+=(He>>>8|ct<<8)&8191,yt+=ct>>>5|A,Ne=0,rt=Ne,rt+=Fe*jt,rt+=qe*(5*rn),rt+=Ge*(5*ln),rt+=ve*(5*Ut),rt+=ge*(5*un),Ne=rt>>>13,rt&=8191,rt+=De*(5*sn),rt+=Pe*(5*Zt),rt+=Te*(5*te),rt+=Ue*(5*It),rt+=yt*(5*Bt),Ne+=rt>>>13,rt&=8191,xt=Ne,xt+=Fe*Bt,xt+=qe*jt,xt+=Ge*(5*rn),xt+=ve*(5*ln),xt+=ge*(5*Ut),Ne=xt>>>13,xt&=8191,xt+=De*(5*un),xt+=Pe*(5*sn),xt+=Te*(5*Zt),xt+=Ue*(5*te),xt+=yt*(5*It),Ne+=xt>>>13,xt&=8191,At=Ne,At+=Fe*It,At+=qe*Bt,At+=Ge*jt,At+=ve*(5*rn),At+=ge*(5*ln),Ne=At>>>13,At&=8191,At+=De*(5*Ut),At+=Pe*(5*un),At+=Te*(5*sn),At+=Ue*(5*Zt),At+=yt*(5*te),Ne+=At>>>13,At&=8191,pt=Ne,pt+=Fe*te,pt+=qe*It,pt+=Ge*Bt,pt+=ve*jt,pt+=ge*(5*rn),Ne=pt>>>13,pt&=8191,pt+=De*(5*ln),pt+=Pe*(5*Ut),pt+=Te*(5*un),pt+=Ue*(5*sn),pt+=yt*(5*Zt),Ne+=pt>>>13,pt&=8191,ht=Ne,ht+=Fe*Zt,ht+=qe*te,ht+=Ge*It,ht+=ve*Bt,ht+=ge*jt,Ne=ht>>>13,ht&=8191,ht+=De*(5*rn),ht+=Pe*(5*ln),ht+=Te*(5*Ut),ht+=Ue*(5*un),ht+=yt*(5*sn),Ne+=ht>>>13,ht&=8191,wt=Ne,wt+=Fe*sn,wt+=qe*Zt,wt+=Ge*te,wt+=ve*It,wt+=ge*Bt,Ne=wt>>>13,wt&=8191,wt+=De*jt,wt+=Pe*(5*rn),wt+=Te*(5*ln),wt+=Ue*(5*Ut),wt+=yt*(5*un),Ne+=wt>>>13,wt&=8191,_t=Ne,_t+=Fe*un,_t+=qe*sn,_t+=Ge*Zt,_t+=ve*te,_t+=ge*It,Ne=_t>>>13,_t&=8191,_t+=De*Bt,_t+=Pe*jt,_t+=Te*(5*rn),_t+=Ue*(5*ln),_t+=yt*(5*Ut),Ne+=_t>>>13,_t&=8191,Je=Ne,Je+=Fe*Ut,Je+=qe*un,Je+=Ge*sn,Je+=ve*Zt,Je+=ge*te,Ne=Je>>>13,Je&=8191,Je+=De*It,Je+=Pe*Bt,Je+=Te*jt,Je+=Ue*(5*rn),Je+=yt*(5*ln),Ne+=Je>>>13,Je&=8191,ut=Ne,ut+=Fe*ln,ut+=qe*Ut,ut+=Ge*un,ut+=ve*sn,ut+=ge*Zt,Ne=ut>>>13,ut&=8191,ut+=De*te,ut+=Pe*It,ut+=Te*Bt,ut+=Ue*jt,ut+=yt*(5*rn),Ne+=ut>>>13,ut&=8191,Qe=Ne,Qe+=Fe*rn,Qe+=qe*ln,Qe+=Ge*Ut,Qe+=ve*un,Qe+=ge*sn,Ne=Qe>>>13,Qe&=8191,Qe+=De*Zt,Qe+=Pe*te,Qe+=Te*It,Qe+=Ue*Bt,Qe+=yt*jt,Ne+=Qe>>>13,Qe&=8191,Ne=(Ne<<2)+Ne|0,Ne=Ne+rt|0,rt=Ne&8191,Ne=Ne>>>13,xt+=Ne,Fe=rt,qe=xt,Ge=At,ve=pt,ge=ht,De=wt,Pe=_t,Te=Je,Ue=ut,yt=Qe,D+=16,$-=16;this.h[0]=Fe,this.h[1]=qe,this.h[2]=Ge,this.h[3]=ve,this.h[4]=ge,this.h[5]=De,this.h[6]=Pe,this.h[7]=Te,this.h[8]=Ue,this.h[9]=yt},V.prototype.finish=function(T,D){var $=new Uint16Array(10),A,L,ee,re;if(this.leftover){for(re=this.leftover,this.buffer[re++]=1;re<16;re++)this.buffer[re]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(A=this.h[1]>>>13,this.h[1]&=8191,re=2;re<10;re++)this.h[re]+=A,A=this.h[re]>>>13,this.h[re]&=8191;for(this.h[0]+=A*5,A=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=A,A=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=A,$[0]=this.h[0]+5,A=$[0]>>>13,$[0]&=8191,re=1;re<10;re++)$[re]=this.h[re]+A,A=$[re]>>>13,$[re]&=8191;for($[9]-=8192,L=(A^1)-1,re=0;re<10;re++)$[re]&=L;for(L=~L,re=0;re<10;re++)this.h[re]=this.h[re]&L|$[re];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,ee=this.h[0]+this.pad[0],this.h[0]=ee&65535,re=1;re<8;re++)ee=(this.h[re]+this.pad[re]|0)+(ee>>>16)|0,this.h[re]=ee&65535;T[D+0]=this.h[0]>>>0&255,T[D+1]=this.h[0]>>>8&255,T[D+2]=this.h[1]>>>0&255,T[D+3]=this.h[1]>>>8&255,T[D+4]=this.h[2]>>>0&255,T[D+5]=this.h[2]>>>8&255,T[D+6]=this.h[3]>>>0&255,T[D+7]=this.h[3]>>>8&255,T[D+8]=this.h[4]>>>0&255,T[D+9]=this.h[4]>>>8&255,T[D+10]=this.h[5]>>>0&255,T[D+11]=this.h[5]>>>8&255,T[D+12]=this.h[6]>>>0&255,T[D+13]=this.h[6]>>>8&255,T[D+14]=this.h[7]>>>0&255,T[D+15]=this.h[7]>>>8&255},V.prototype.update=function(T,D,$){var A,L;if(this.leftover){for(L=16-this.leftover,L>$&&(L=$),A=0;A=16&&(L=$-$%16,this.blocks(T,D,L),D+=L,$-=L),$){for(A=0;A<$;A++)this.buffer[this.leftover+A]=T[D+A];this.leftover+=$}};function W(T,D,$,A,L,ee){var re=new V(ee);return re.update($,A,L),re.finish(T,D),0}function ne(T,D,$,A,L,ee){var re=new Uint8Array(16);return W(re,0,$,A,L,ee),b(T,D,re,0)}function Z(T,D,$,A,L){var ee;if($<32)return-1;for(B(T,0,D,0,$,A,L),W(T,16,T,32,$-32,T),ee=0;ee<16;ee++)T[ee]=0;return 0}function q(T,D,$,A,L){var ee,re=new Uint8Array(32);if($<32||(N(re,0,32,A,L),ne(D,16,D,32,$-32,re)!==0))return-1;for(B(T,0,D,0,$,A,L),ee=0;ee<32;ee++)T[ee]=0;return 0}function G(T,D){var $;for($=0;$<16;$++)T[$]=D[$]|0}function H(T){var D,$,A=1;for(D=0;D<16;D++)$=T[D]+A+65535,A=Math.floor($/65536),T[D]=$-A*65536;T[0]+=A-1+37*(A-1)}function j(T,D,$){for(var A,L=~($-1),ee=0;ee<16;ee++)A=L&(T[ee]^D[ee]),T[ee]^=A,D[ee]^=A}function K(T,D){var $,A,L,ee=n(),re=n();for($=0;$<16;$++)re[$]=D[$];for(H(re),H(re),H(re),A=0;A<2;A++){for(ee[0]=re[0]-65517,$=1;$<15;$++)ee[$]=re[$]-65535-(ee[$-1]>>16&1),ee[$-1]&=65535;ee[15]=re[15]-32767-(ee[14]>>16&1),L=ee[15]>>16&1,ee[14]&=65535,j(re,ee,1-L)}for($=0;$<16;$++)T[2*$]=re[$]&255,T[2*$+1]=re[$]>>8}function Y(T,D){var $=new Uint8Array(32),A=new Uint8Array(32);return K($,T),K(A,D),w($,0,A,0)}function oe(T){var D=new Uint8Array(32);return K(D,T),D[0]&1}function X(T,D){var $;for($=0;$<16;$++)T[$]=D[2*$]+(D[2*$+1]<<8);T[15]&=32767}function Q(T,D,$){for(var A=0;A<16;A++)T[A]=D[A]+$[A]}function ue(T,D,$){for(var A=0;A<16;A++)T[A]=D[A]-$[A]}function de(T,D,$){var A,L,ee=0,re=0,he=0,Ce=0,Be=0,He=0,ct=0,Ne=0,rt=0,xt=0,At=0,pt=0,ht=0,wt=0,_t=0,Je=0,ut=0,Qe=0,Fe=0,qe=0,Ge=0,ve=0,ge=0,De=0,Pe=0,Te=0,Ue=0,yt=0,jt=0,Bt=0,It=0,te=$[0],Zt=$[1],sn=$[2],un=$[3],Ut=$[4],ln=$[5],rn=$[6],Yn=$[7],mn=$[8],Tn=$[9],Zn=$[10],Xn=$[11],wr=$[12],Ir=$[13],Nr=$[14],Lr=$[15];A=D[0],ee+=A*te,re+=A*Zt,he+=A*sn,Ce+=A*un,Be+=A*Ut,He+=A*ln,ct+=A*rn,Ne+=A*Yn,rt+=A*mn,xt+=A*Tn,At+=A*Zn,pt+=A*Xn,ht+=A*wr,wt+=A*Ir,_t+=A*Nr,Je+=A*Lr,A=D[1],re+=A*te,he+=A*Zt,Ce+=A*sn,Be+=A*un,He+=A*Ut,ct+=A*ln,Ne+=A*rn,rt+=A*Yn,xt+=A*mn,At+=A*Tn,pt+=A*Zn,ht+=A*Xn,wt+=A*wr,_t+=A*Ir,Je+=A*Nr,ut+=A*Lr,A=D[2],he+=A*te,Ce+=A*Zt,Be+=A*sn,He+=A*un,ct+=A*Ut,Ne+=A*ln,rt+=A*rn,xt+=A*Yn,At+=A*mn,pt+=A*Tn,ht+=A*Zn,wt+=A*Xn,_t+=A*wr,Je+=A*Ir,ut+=A*Nr,Qe+=A*Lr,A=D[3],Ce+=A*te,Be+=A*Zt,He+=A*sn,ct+=A*un,Ne+=A*Ut,rt+=A*ln,xt+=A*rn,At+=A*Yn,pt+=A*mn,ht+=A*Tn,wt+=A*Zn,_t+=A*Xn,Je+=A*wr,ut+=A*Ir,Qe+=A*Nr,Fe+=A*Lr,A=D[4],Be+=A*te,He+=A*Zt,ct+=A*sn,Ne+=A*un,rt+=A*Ut,xt+=A*ln,At+=A*rn,pt+=A*Yn,ht+=A*mn,wt+=A*Tn,_t+=A*Zn,Je+=A*Xn,ut+=A*wr,Qe+=A*Ir,Fe+=A*Nr,qe+=A*Lr,A=D[5],He+=A*te,ct+=A*Zt,Ne+=A*sn,rt+=A*un,xt+=A*Ut,At+=A*ln,pt+=A*rn,ht+=A*Yn,wt+=A*mn,_t+=A*Tn,Je+=A*Zn,ut+=A*Xn,Qe+=A*wr,Fe+=A*Ir,qe+=A*Nr,Ge+=A*Lr,A=D[6],ct+=A*te,Ne+=A*Zt,rt+=A*sn,xt+=A*un,At+=A*Ut,pt+=A*ln,ht+=A*rn,wt+=A*Yn,_t+=A*mn,Je+=A*Tn,ut+=A*Zn,Qe+=A*Xn,Fe+=A*wr,qe+=A*Ir,Ge+=A*Nr,ve+=A*Lr,A=D[7],Ne+=A*te,rt+=A*Zt,xt+=A*sn,At+=A*un,pt+=A*Ut,ht+=A*ln,wt+=A*rn,_t+=A*Yn,Je+=A*mn,ut+=A*Tn,Qe+=A*Zn,Fe+=A*Xn,qe+=A*wr,Ge+=A*Ir,ve+=A*Nr,ge+=A*Lr,A=D[8],rt+=A*te,xt+=A*Zt,At+=A*sn,pt+=A*un,ht+=A*Ut,wt+=A*ln,_t+=A*rn,Je+=A*Yn,ut+=A*mn,Qe+=A*Tn,Fe+=A*Zn,qe+=A*Xn,Ge+=A*wr,ve+=A*Ir,ge+=A*Nr,De+=A*Lr,A=D[9],xt+=A*te,At+=A*Zt,pt+=A*sn,ht+=A*un,wt+=A*Ut,_t+=A*ln,Je+=A*rn,ut+=A*Yn,Qe+=A*mn,Fe+=A*Tn,qe+=A*Zn,Ge+=A*Xn,ve+=A*wr,ge+=A*Ir,De+=A*Nr,Pe+=A*Lr,A=D[10],At+=A*te,pt+=A*Zt,ht+=A*sn,wt+=A*un,_t+=A*Ut,Je+=A*ln,ut+=A*rn,Qe+=A*Yn,Fe+=A*mn,qe+=A*Tn,Ge+=A*Zn,ve+=A*Xn,ge+=A*wr,De+=A*Ir,Pe+=A*Nr,Te+=A*Lr,A=D[11],pt+=A*te,ht+=A*Zt,wt+=A*sn,_t+=A*un,Je+=A*Ut,ut+=A*ln,Qe+=A*rn,Fe+=A*Yn,qe+=A*mn,Ge+=A*Tn,ve+=A*Zn,ge+=A*Xn,De+=A*wr,Pe+=A*Ir,Te+=A*Nr,Ue+=A*Lr,A=D[12],ht+=A*te,wt+=A*Zt,_t+=A*sn,Je+=A*un,ut+=A*Ut,Qe+=A*ln,Fe+=A*rn,qe+=A*Yn,Ge+=A*mn,ve+=A*Tn,ge+=A*Zn,De+=A*Xn,Pe+=A*wr,Te+=A*Ir,Ue+=A*Nr,yt+=A*Lr,A=D[13],wt+=A*te,_t+=A*Zt,Je+=A*sn,ut+=A*un,Qe+=A*Ut,Fe+=A*ln,qe+=A*rn,Ge+=A*Yn,ve+=A*mn,ge+=A*Tn,De+=A*Zn,Pe+=A*Xn,Te+=A*wr,Ue+=A*Ir,yt+=A*Nr,jt+=A*Lr,A=D[14],_t+=A*te,Je+=A*Zt,ut+=A*sn,Qe+=A*un,Fe+=A*Ut,qe+=A*ln,Ge+=A*rn,ve+=A*Yn,ge+=A*mn,De+=A*Tn,Pe+=A*Zn,Te+=A*Xn,Ue+=A*wr,yt+=A*Ir,jt+=A*Nr,Bt+=A*Lr,A=D[15],Je+=A*te,ut+=A*Zt,Qe+=A*sn,Fe+=A*un,qe+=A*Ut,Ge+=A*ln,ve+=A*rn,ge+=A*Yn,De+=A*mn,Pe+=A*Tn,Te+=A*Zn,Ue+=A*Xn,yt+=A*wr,jt+=A*Ir,Bt+=A*Nr,It+=A*Lr,ee+=38*ut,re+=38*Qe,he+=38*Fe,Ce+=38*qe,Be+=38*Ge,He+=38*ve,ct+=38*ge,Ne+=38*De,rt+=38*Pe,xt+=38*Te,At+=38*Ue,pt+=38*yt,ht+=38*jt,wt+=38*Bt,_t+=38*It,L=1,A=ee+L+65535,L=Math.floor(A/65536),ee=A-L*65536,A=re+L+65535,L=Math.floor(A/65536),re=A-L*65536,A=he+L+65535,L=Math.floor(A/65536),he=A-L*65536,A=Ce+L+65535,L=Math.floor(A/65536),Ce=A-L*65536,A=Be+L+65535,L=Math.floor(A/65536),Be=A-L*65536,A=He+L+65535,L=Math.floor(A/65536),He=A-L*65536,A=ct+L+65535,L=Math.floor(A/65536),ct=A-L*65536,A=Ne+L+65535,L=Math.floor(A/65536),Ne=A-L*65536,A=rt+L+65535,L=Math.floor(A/65536),rt=A-L*65536,A=xt+L+65535,L=Math.floor(A/65536),xt=A-L*65536,A=At+L+65535,L=Math.floor(A/65536),At=A-L*65536,A=pt+L+65535,L=Math.floor(A/65536),pt=A-L*65536,A=ht+L+65535,L=Math.floor(A/65536),ht=A-L*65536,A=wt+L+65535,L=Math.floor(A/65536),wt=A-L*65536,A=_t+L+65535,L=Math.floor(A/65536),_t=A-L*65536,A=Je+L+65535,L=Math.floor(A/65536),Je=A-L*65536,ee+=L-1+37*(L-1),L=1,A=ee+L+65535,L=Math.floor(A/65536),ee=A-L*65536,A=re+L+65535,L=Math.floor(A/65536),re=A-L*65536,A=he+L+65535,L=Math.floor(A/65536),he=A-L*65536,A=Ce+L+65535,L=Math.floor(A/65536),Ce=A-L*65536,A=Be+L+65535,L=Math.floor(A/65536),Be=A-L*65536,A=He+L+65535,L=Math.floor(A/65536),He=A-L*65536,A=ct+L+65535,L=Math.floor(A/65536),ct=A-L*65536,A=Ne+L+65535,L=Math.floor(A/65536),Ne=A-L*65536,A=rt+L+65535,L=Math.floor(A/65536),rt=A-L*65536,A=xt+L+65535,L=Math.floor(A/65536),xt=A-L*65536,A=At+L+65535,L=Math.floor(A/65536),At=A-L*65536,A=pt+L+65535,L=Math.floor(A/65536),pt=A-L*65536,A=ht+L+65535,L=Math.floor(A/65536),ht=A-L*65536,A=wt+L+65535,L=Math.floor(A/65536),wt=A-L*65536,A=_t+L+65535,L=Math.floor(A/65536),_t=A-L*65536,A=Je+L+65535,L=Math.floor(A/65536),Je=A-L*65536,ee+=L-1+37*(L-1),T[0]=ee,T[1]=re,T[2]=he,T[3]=Ce,T[4]=Be,T[5]=He,T[6]=ct,T[7]=Ne,T[8]=rt,T[9]=xt,T[10]=At,T[11]=pt,T[12]=ht,T[13]=wt,T[14]=_t,T[15]=Je}function Se(T,D){de(T,D,D)}function me(T,D){var $=n(),A;for(A=0;A<16;A++)$[A]=D[A];for(A=253;A>=0;A--)Se($,$),A!==2&&A!==4&&de($,$,D);for(A=0;A<16;A++)T[A]=$[A]}function Ze(T,D){var $=n(),A;for(A=0;A<16;A++)$[A]=D[A];for(A=250;A>=0;A--)Se($,$),A!==1&&de($,$,D);for(A=0;A<16;A++)T[A]=$[A]}function Ae(T,D,$){var A=new Uint8Array(32),L=new Float64Array(80),ee,re,he=n(),Ce=n(),Be=n(),He=n(),ct=n(),Ne=n();for(re=0;re<31;re++)A[re]=D[re];for(A[31]=D[31]&127|64,A[0]&=248,X(L,$),re=0;re<16;re++)Ce[re]=L[re],He[re]=he[re]=Be[re]=0;for(he[0]=He[0]=1,re=254;re>=0;--re)ee=A[re>>>3]>>>(re&7)&1,j(he,Ce,ee),j(Be,He,ee),Q(ct,he,Be),ue(he,he,Be),Q(Be,Ce,He),ue(Ce,Ce,He),Se(He,ct),Se(Ne,he),de(he,Be,he),de(Be,Ce,ct),Q(ct,he,Be),ue(he,he,Be),Se(Ce,he),ue(Be,He,Ne),de(he,Be,u),Q(he,he,He),de(Be,Be,he),de(he,He,Ne),de(He,Ce,L),Se(Ce,ct),j(he,Ce,ee),j(Be,He,ee);for(re=0;re<16;re++)L[re+16]=he[re],L[re+32]=Be[re],L[re+48]=Ce[re],L[re+64]=He[re];var rt=L.subarray(32),xt=L.subarray(16);return me(rt,rt),de(xt,xt,rt),K(T,xt),0}function Le(T,D){return Ae(T,D,o)}function $e(T,D){return r(D,32),Le(T,D)}function be(T,D,$){var A=new Uint8Array(32);return Ae(A,$,D),E(T,i,A,C)}var bt=Z,lt=q;function Ft(T,D,$,A,L,ee){var re=new Uint8Array(32);return be(re,L,ee),bt(T,D,$,A,re)}function yn(T,D,$,A,L,ee){var re=new Uint8Array(32);return be(re,L,ee),lt(T,D,$,A,re)}var nn=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ie(T,D,$,A){for(var L=new Int32Array(16),ee=new Int32Array(16),re,he,Ce,Be,He,ct,Ne,rt,xt,At,pt,ht,wt,_t,Je,ut,Qe,Fe,qe,Ge,ve,ge,De,Pe,Te,Ue,yt=T[0],jt=T[1],Bt=T[2],It=T[3],te=T[4],Zt=T[5],sn=T[6],un=T[7],Ut=D[0],ln=D[1],rn=D[2],Yn=D[3],mn=D[4],Tn=D[5],Zn=D[6],Xn=D[7],wr=0;A>=128;){for(qe=0;qe<16;qe++)Ge=8*qe+wr,L[qe]=$[Ge+0]<<24|$[Ge+1]<<16|$[Ge+2]<<8|$[Ge+3],ee[qe]=$[Ge+4]<<24|$[Ge+5]<<16|$[Ge+6]<<8|$[Ge+7];for(qe=0;qe<80;qe++)if(re=yt,he=jt,Ce=Bt,Be=It,He=te,ct=Zt,Ne=sn,rt=un,xt=Ut,At=ln,pt=rn,ht=Yn,wt=mn,_t=Tn,Je=Zn,ut=Xn,ve=un,ge=Xn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=(te>>>14|mn<<18)^(te>>>18|mn<<14)^(mn>>>9|te<<23),ge=(mn>>>14|te<<18)^(mn>>>18|te<<14)^(te>>>9|mn<<23),De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,ve=te&Zt^~te&sn,ge=mn&Tn^~mn&Zn,De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,ve=nn[qe*2],ge=nn[qe*2+1],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,ve=L[qe%16],ge=ee[qe%16],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,Qe=Te&65535|Ue<<16,Fe=De&65535|Pe<<16,ve=Qe,ge=Fe,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=(yt>>>28|Ut<<4)^(Ut>>>2|yt<<30)^(Ut>>>7|yt<<25),ge=(Ut>>>28|yt<<4)^(yt>>>2|Ut<<30)^(yt>>>7|Ut<<25),De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,ve=yt&jt^yt&Bt^jt&Bt,ge=Ut&ln^Ut&rn^ln&rn,De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,rt=Te&65535|Ue<<16,ut=De&65535|Pe<<16,ve=Be,ge=ht,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=Qe,ge=Fe,De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,Be=Te&65535|Ue<<16,ht=De&65535|Pe<<16,jt=re,Bt=he,It=Ce,te=Be,Zt=He,sn=ct,un=Ne,yt=rt,ln=xt,rn=At,Yn=pt,mn=ht,Tn=wt,Zn=_t,Xn=Je,Ut=ut,qe%16===15)for(Ge=0;Ge<16;Ge++)ve=L[Ge],ge=ee[Ge],De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=L[(Ge+9)%16],ge=ee[(Ge+9)%16],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Qe=L[(Ge+1)%16],Fe=ee[(Ge+1)%16],ve=(Qe>>>1|Fe<<31)^(Qe>>>8|Fe<<24)^Qe>>>7,ge=(Fe>>>1|Qe<<31)^(Fe>>>8|Qe<<24)^(Fe>>>7|Qe<<25),De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Qe=L[(Ge+14)%16],Fe=ee[(Ge+14)%16],ve=(Qe>>>19|Fe<<13)^(Fe>>>29|Qe<<3)^Qe>>>6,ge=(Fe>>>19|Qe<<13)^(Qe>>>29|Fe<<3)^(Fe>>>6|Qe<<26),De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,L[Ge]=Te&65535|Ue<<16,ee[Ge]=De&65535|Pe<<16;ve=yt,ge=Ut,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[0],ge=D[0],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[0]=yt=Te&65535|Ue<<16,D[0]=Ut=De&65535|Pe<<16,ve=jt,ge=ln,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[1],ge=D[1],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[1]=jt=Te&65535|Ue<<16,D[1]=ln=De&65535|Pe<<16,ve=Bt,ge=rn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[2],ge=D[2],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[2]=Bt=Te&65535|Ue<<16,D[2]=rn=De&65535|Pe<<16,ve=It,ge=Yn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[3],ge=D[3],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[3]=It=Te&65535|Ue<<16,D[3]=Yn=De&65535|Pe<<16,ve=te,ge=mn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[4],ge=D[4],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[4]=te=Te&65535|Ue<<16,D[4]=mn=De&65535|Pe<<16,ve=Zt,ge=Tn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[5],ge=D[5],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[5]=Zt=Te&65535|Ue<<16,D[5]=Tn=De&65535|Pe<<16,ve=sn,ge=Zn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[6],ge=D[6],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[6]=sn=Te&65535|Ue<<16,D[6]=Zn=De&65535|Pe<<16,ve=un,ge=Xn,De=ge&65535,Pe=ge>>>16,Te=ve&65535,Ue=ve>>>16,ve=T[7],ge=D[7],De+=ge&65535,Pe+=ge>>>16,Te+=ve&65535,Ue+=ve>>>16,Pe+=De>>>16,Te+=Pe>>>16,Ue+=Te>>>16,T[7]=un=Te&65535|Ue<<16,D[7]=Xn=De&65535|Pe<<16,wr+=128,A-=128}return A}function pe(T,D,$){var A=new Int32Array(8),L=new Int32Array(8),ee=new Uint8Array(256),re,he=$;for(A[0]=1779033703,A[1]=3144134277,A[2]=1013904242,A[3]=2773480762,A[4]=1359893119,A[5]=2600822924,A[6]=528734635,A[7]=1541459225,L[0]=4089235720,L[1]=2227873595,L[2]=4271175723,L[3]=1595750129,L[4]=2917565137,L[5]=725511199,L[6]=4215389547,L[7]=327033209,ie(A,L,D,$),$%=128,re=0;re<$;re++)ee[re]=D[he-$+re];for(ee[$]=128,$=256-128*($<112?1:0),ee[$-9]=0,m(ee,$-8,he/536870912|0,he<<3),ie(A,L,ee,$),re=0;re<8;re++)m(T,8*re,A[re],L[re]);return 0}function ye(T,D){var $=n(),A=n(),L=n(),ee=n(),re=n(),he=n(),Ce=n(),Be=n(),He=n();ue($,T[1],T[0]),ue(He,D[1],D[0]),de($,$,He),Q(A,T[0],T[1]),Q(He,D[0],D[1]),de(A,A,He),de(L,T[3],D[3]),de(L,L,c),de(ee,T[2],D[2]),Q(ee,ee,ee),ue(re,A,$),ue(he,ee,L),Q(Ce,ee,L),Q(Be,A,$),de(T[0],re,he),de(T[1],Be,Ce),de(T[2],Ce,he),de(T[3],re,Be)}function ze(T,D,$){var A;for(A=0;A<4;A++)j(T[A],D[A],$)}function je(T,D){var $=n(),A=n(),L=n();me(L,D[2]),de($,D[0],L),de(A,D[1],L),K(T,A),T[31]^=oe($)<<7}function ke(T,D,$){var A,L;for(G(T[0],a),G(T[1],s),G(T[2],s),G(T[3],a),L=255;L>=0;--L)A=$[L/8|0]>>(L&7)&1,ze(T,D,A),ye(D,T),ye(T,T),ze(T,D,A)}function nt(T,D){var $=[n(),n(),n(),n()];G($[0],f),G($[1],h),G($[2],s),de($[3],f,h),ke(T,$,D)}function vt(T,D,$){var A=new Uint8Array(64),L=[n(),n(),n(),n()],ee;for($||r(D,32),pe(A,D,32),A[0]&=248,A[31]&=127,A[31]|=64,nt(L,A),je(T,L),ee=0;ee<32;ee++)D[ee+32]=T[ee];return 0}var wn=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Kt(T,D){var $,A,L,ee;for(A=63;A>=32;--A){for($=0,L=A-32,ee=A-12;L>4)*wn[L],$=D[L]>>8,D[L]&=255;for(L=0;L<32;L++)D[L]-=$*wn[L];for(A=0;A<32;A++)D[A+1]+=D[A]>>8,T[A]=D[A]&255}function _n(T){var D=new Float64Array(64),$;for($=0;$<64;$++)D[$]=T[$];for($=0;$<64;$++)T[$]=0;Kt(T,D)}function $i(T,D,$,A){var L=new Uint8Array(64),ee=new Uint8Array(64),re=new Uint8Array(64),he,Ce,Be=new Float64Array(64),He=[n(),n(),n(),n()];pe(L,A,32),L[0]&=248,L[31]&=127,L[31]|=64;var ct=$+64;for(he=0;he<$;he++)T[64+he]=D[he];for(he=0;he<32;he++)T[32+he]=L[32+he];for(pe(re,T.subarray(32),$+32),_n(re),nt(He,re),je(T,He),he=32;he<64;he++)T[he]=A[he];for(pe(ee,T,$+64),_n(ee),he=0;he<64;he++)Be[he]=0;for(he=0;he<32;he++)Be[he]=re[he];for(he=0;he<32;he++)for(Ce=0;Ce<32;Ce++)Be[he+Ce]+=ee[he]*L[Ce];return Kt(T.subarray(32),Be),ct}function xr(T,D){var $=n(),A=n(),L=n(),ee=n(),re=n(),he=n(),Ce=n();return G(T[2],s),X(T[1],D),Se(L,T[1]),de(ee,L,l),ue(L,L,T[2]),Q(ee,T[2],ee),Se(re,ee),Se(he,re),de(Ce,he,re),de($,Ce,L),de($,$,ee),Ze($,$),de($,$,L),de($,$,ee),de($,$,ee),de(T[0],$,ee),Se(A,T[0]),de(A,A,ee),Y(A,L)&&de(T[0],T[0],p),Se(A,T[0]),de(A,A,ee),Y(A,L)?-1:(oe(T[0])===D[31]>>7&&ue(T[0],a,T[0]),de(T[3],T[0],T[1]),0)}function mi(T,D,$,A){var L,ee=new Uint8Array(32),re=new Uint8Array(64),he=[n(),n(),n(),n()],Ce=[n(),n(),n(),n()];if($<64||xr(Ce,A))return-1;for(L=0;L<$;L++)T[L]=D[L];for(L=0;L<32;L++)T[L+32]=A[L];if(pe(re,T,$),_n(re),ke(he,Ce,re),nt(Ce,D.subarray(32)),ye(he,Ce),je(ee,he),$-=64,w(D,0,ee,0)){for(L=0;L<$;L++)T[L]=0;return-1}for(L=0;L<$;L++)T[L]=D[L+64];return $}var ur=32,ai=24,vi=32,Dr=16,Zi=32,vo=32,yi=32,$r=32,Sa=32,St=ai,hn=vi,Sn=Dr,Gn=64,lr=32,Xr=64,yo=32,Xl=64;t.lowlevel={crypto_core_hsalsa20:E,crypto_stream_xor:B,crypto_stream:N,crypto_stream_salsa20_xor:P,crypto_stream_salsa20:M,crypto_onetimeauth:W,crypto_onetimeauth_verify:ne,crypto_verify_16:b,crypto_verify_32:w,crypto_secretbox:Z,crypto_secretbox_open:q,crypto_scalarmult:Ae,crypto_scalarmult_base:Le,crypto_box_beforenm:be,crypto_box_afternm:bt,crypto_box:Ft,crypto_box_open:yn,crypto_box_keypair:$e,crypto_hash:pe,crypto_sign:$i,crypto_sign_keypair:vt,crypto_sign_open:mi,crypto_secretbox_KEYBYTES:ur,crypto_secretbox_NONCEBYTES:ai,crypto_secretbox_ZEROBYTES:vi,crypto_secretbox_BOXZEROBYTES:Dr,crypto_scalarmult_BYTES:Zi,crypto_scalarmult_SCALARBYTES:vo,crypto_box_PUBLICKEYBYTES:yi,crypto_box_SECRETKEYBYTES:$r,crypto_box_BEFORENMBYTES:Sa,crypto_box_NONCEBYTES:St,crypto_box_ZEROBYTES:hn,crypto_box_BOXZEROBYTES:Sn,crypto_sign_BYTES:Gn,crypto_sign_PUBLICKEYBYTES:lr,crypto_sign_SECRETKEYBYTES:Xr,crypto_sign_SEEDBYTES:yo,crypto_hash_BYTES:Xl,gf:n,D:l,L:wn,pack25519:K,unpack25519:X,M:de,A:Q,S:Se,Z:ue,pow2523:Ze,add:ye,set25519:G,modL:Kt,scalarmult:ke,scalarbase:nt};function Cf(T,D){if(T.length!==ur)throw new Error("bad key size");if(D.length!==ai)throw new Error("bad nonce size")}function ae(T,D){if(T.length!==yi)throw new Error("bad public key size");if(D.length!==$r)throw new Error("bad secret key size")}function le(){for(var T=0;T=0},t.sign.keyPair=function(){var T=new Uint8Array(lr),D=new Uint8Array(Xr);return vt(T,D),{publicKey:T,secretKey:D}},t.sign.keyPair.fromSecretKey=function(T){if(le(T),T.length!==Xr)throw new Error("bad secret key size");for(var D=new Uint8Array(lr),$=0;$"u"?typeof Buffer.from<"u"?(t.encodeBase64=function(r){return Buffer.from(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(Buffer.from(r,"base64"),0))}):(t.encodeBase64=function(r){return new Buffer(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0))}):(t.encodeBase64=function(r){var i,o=[],a=r.length;for(i=0;i{let n=!1;const r=e.map(i=>{const o=GN(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{scope:h,children:p,...m}=f,y=h?.[e]?.[u]||s,b=v.useMemo(()=>m,Object.values(m));return I.jsx(y.Provider,{value:b,children:p})};l.displayName=o+"Provider";function c(f,h){const p=h?.[e]?.[u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,rXe(i,...t)]}function rXe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function YN(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}var iXe=globalThis?.document?v.useLayoutEffect:()=>{},oXe=zx[" useInsertionEffect ".trim().toString()]||iXe;function aXe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=sXe({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:i;{const c=v.useRef(e!==void 0);v.useEffect(()=>{const f=c.current;f!==s&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=s},[s,r])}const l=v.useCallback(c=>{if(s){const f=uXe(c)?c(e):c;f!==e&&a.current?.(f)}else o(c)},[s,e,o,a]);return[u,l]}function sXe({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),i=v.useRef(n),o=v.useRef(t);return oXe(()=>{o.current=t},[t]),v.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function uXe(e){return typeof e=="function"}function lXe(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cXe=globalThis?.document?v.useLayoutEffect:()=>{};function fXe(e){const[t,n]=v.useState(void 0);return cXe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function ZN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dXe(...e){return t=>{let n=!1;const r=e.map(i=>{const o=ZN(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{};function pXe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var rX=e=>{const{present:t,children:n}=e,r=gXe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=hXe(r.ref,mXe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};rX.displayName="Presence";function gXe(e){const[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=pXe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Xy(r.current);o.current=s==="mounted"?l:"none"},[s]),XN(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Xy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),XN(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=Xy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=Xy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Xy(e){return e?.animationName||"none"}function mXe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function vXe(e){const t=yXe(e),n=v.forwardRef((r,i)=>{const{children:o,...a}=r,s=v.Children.toArray(o),u=s.find(xXe);if(u){const l=u.props.children,c=s.map(f=>f===u?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:f);return I.jsx(t,{...a,ref:i,children:v.isValidElement(l)?v.cloneElement(l,void 0,c):null})}return I.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function yXe(e){const t=v.forwardRef((n,r)=>{const{children:i,...o}=n;if(v.isValidElement(i)){const a=_Xe(i),s=wXe(o,i.props);return i.type!==v.Fragment&&(s.ref=r?tX(r,a):a),v.cloneElement(i,s)}return v.Children.count(i)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bXe=Symbol("radix.slottable");function xXe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bXe}function wXe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const u=o(...s);return i(...s),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function _Xe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var SXe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],e8=SXe.reduce((e,t)=>{const n=vXe(`Primitive.${t}`),r=v.forwardRef((i,o)=>{const{asChild:a,...s}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(u,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),W2="Checkbox",[CXe,tnt]=nXe(W2),[EXe,t8]=CXe(W2);function OXe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:a,name:s,onCheckedChange:u,required:l,value:c="on",internal_do_not_use_render:f}=e,[h,p]=aXe({prop:n,defaultProp:i??!1,onChange:u,caller:W2}),[m,y]=v.useState(null),[b,w]=v.useState(null),x=v.useRef(!1),S=m?!!a||!!m.closest("form"):!0,O={checked:h,disabled:o,setChecked:p,control:m,setControl:y,name:s,form:a,value:c,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:Cl(i)?!1:i,isFormControl:S,bubbleInput:b,setBubbleInput:w};return I.jsx(EXe,{scope:t,...O,children:kXe(f)?f(O):r})}var iX="CheckboxTrigger",oX=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:a,disabled:s,checked:u,required:l,setControl:c,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:m}=t8(iX,e),y=nX(i,c),b=v.useRef(u);return v.useEffect(()=>{const w=o?.form;if(w){const x=()=>f(b.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[o,f]),I.jsx(e8.button,{type:"button",role:"checkbox","aria-checked":Cl(u)?"mixed":u,"aria-required":l,"data-state":lX(u),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:y,onKeyDown:YN(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:YN(n,w=>{f(x=>Cl(x)?!0:!x),m&&p&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})})});oX.displayName=iX;var AXe=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:u,onCheckedChange:l,form:c,...f}=e;return I.jsx(OXe,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:s,required:a,onCheckedChange:l,name:r,form:c,value:u,internal_do_not_use_render:({isFormControl:h})=>I.jsxs(I.Fragment,{children:[I.jsx(oX,{...f,ref:t,__scopeCheckbox:n}),h&&I.jsx(uX,{__scopeCheckbox:n})]})})});AXe.displayName=W2;var aX="CheckboxIndicator",PXe=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=t8(aX,n);return I.jsx(rX,{present:r||Cl(o.checked)||o.checked===!0,children:I.jsx(e8.span,{"data-state":lX(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});PXe.displayName=aX;var sX="CheckboxBubbleInput",uX=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:a,required:s,disabled:u,name:l,value:c,form:f,bubbleInput:h,setBubbleInput:p}=t8(sX,e),m=nX(n,p),y=lXe(o),b=fXe(r);v.useEffect(()=>{const x=h;if(!x)return;const S=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(S,"checked").set,C=!i.current;if(y!==o&&E){const P=new Event("click",{bubbles:C});x.indeterminate=Cl(o),E.call(x,Cl(o)?!1:o),x.dispatchEvent(P)}},[h,y,o,i]);const w=v.useRef(Cl(o)?!1:o);return I.jsx(e8.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:s,disabled:u,name:l,value:c,form:f,...t,tabIndex:-1,ref:m,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});uX.displayName=sX;function kXe(e){return typeof e=="function"}function Cl(e){return e==="indeterminate"}function lX(e){return Cl(e)?"indeterminate":e?"checked":"unchecked"}export{tJe as $,qQe as A,VQe as B,wQe as C,Gi as D,rme as E,xQe as F,EQe as G,pT as H,nQe as I,F as J,IQe as K,TQe as L,DXe as M,UQe as N,MXe as O,NXe as P,DQe as Q,bQe as R,Pl as S,MQe as T,eQe as U,JXe as V,LXe as W,xve as X,Sve as Y,Cve as Z,Ez as _,jXe as a,ett as a$,Eve as a0,Ove as a1,wve as a2,_ve as a3,kJe as a4,QQe as a5,TJe as a6,xJe as a7,wJe as a8,CJe as a9,_et as aA,XXe as aB,sQe as aC,YXe as aD,tQe as aE,cQe as aF,lQe as aG,rQe as aH,uQe as aI,HXe as aJ,WXe as aK,QXe as aL,vQe as aM,mQe as aN,pQe as aO,yQe as aP,oQe as aQ,KXe as aR,qet as aS,sJe as aT,Tet as aU,aQe as aV,dQe as aW,Get as aX,Yet as aY,Zet as aZ,FXe as a_,EJe as aa,AJe as ab,GQe as ac,OJe as ad,rJe as ae,SJe as af,PJe as ag,yJe as ah,bJe as ai,_Je as aj,pJe as ak,hJe as al,gJe as am,GXe as an,RJe as ao,sbe as ap,ube as aq,$Je as ar,FJe as as,IJe as at,NJe as au,$Xe as av,qXe as aw,ZXe as ax,fQe as ay,UXe as az,zse as b,aet as b$,ntt as b0,ttt as b1,rtt as b2,ZQe as b3,dtt as b4,JQe as b5,htt as b6,itt as b7,ott as b8,att as b9,xet as bA,HJe as bB,zet as bC,jet as bD,set as bE,Let as bF,Ctt as bG,Ett as bH,Ott as bI,pHe as bJ,xHe as bK,wet as bL,jJe as bM,WJe as bN,UJe as bO,gtt as bP,Ui as bQ,Ptt as bR,ktt as bS,iJe as bT,oJe as bU,Ltt as bV,fet as bW,Ftt as bX,bet as bY,Iet as bZ,ket as b_,utt as ba,ltt as bb,ftt as bc,ctt as bd,ptt as be,stt as bf,vtt as bg,XQe as bh,wtt as bi,_tt as bj,btt as bk,xtt as bl,I3 as bm,Sf as bn,qJe as bo,Xet as bp,Qet as bq,s5 as br,u5 as bs,yje as bt,Js as bu,wf as bv,rp as bw,mtt as bx,BJe as by,VJe as bz,dn as c,PXe as c$,det as c0,Net as c1,yet as c2,Fet as c3,tet as c4,Ttt as c5,Mtt as c6,Itt as c7,QJe as c8,XJe as c9,Rce as cA,Eet as cB,Ret as cC,Oet as cD,vet as cE,YJe as cF,ZJe as cG,Wet as cH,Ja as cI,br as cJ,get as cK,Rtt as cL,Dtt as cM,cJe as cN,ef as cO,LJe as cP,Jtt as cQ,ent as cR,Met as cS,net as cT,uet as cU,Cet as cV,oet as cW,Det as cX,pet as cY,Bet as cZ,AXe as c_,VXe as ca,gQe as cb,iQe as cc,zXe as cd,hQe as ce,Btt as cf,Utt as cg,Aet as ch,ztt as ci,JJe as cj,zJe as ck,Ktt as cl,Gtt as cm,Xtt as cn,Qtt as co,Ytt as cp,Ztt as cq,Vtt as cr,Htt as cs,qtt as ct,aJe as cu,lJe as cv,$tt as cw,Ntt as cx,Lce as cy,Wce as cz,wm as d,eJe as d0,dJe as d1,YQe as d2,nJe as d3,fJe as d4,cet as d5,IXe as d6,GJe as d7,Pet as d8,ret as d9,aHe as da,uJe as db,met as dc,Uet as dd,eet as de,KJe as df,$et as dg,het as dh,Vet as di,iet as dj,AQe as e,eA as f,RQe as g,kQe as h,FQe as i,I as j,jQe as k,Gr as l,BQe as m,OQe as n,_Qe as o,SQe as p,NQe as q,v as r,LQe as s,BXe as t,Sj as u,zQe as v,WQe as w,RXe as x,HQe as y,CQe as z}; diff --git a/public/assets/admin/locales/en-US.js b/public/assets/admin/locales/en-US.js index 53c43cc..63cb41e 100644 --- a/public/assets/admin/locales/en-US.js +++ b/public/assets/admin/locales/en-US.js @@ -2276,6 +2276,12 @@ window.XBOARD_TRANSLATIONS['en-US'] = { "exporting": "Exporting...", "export_success": "Export successful", "export_failed": "Export failed" + }, + "trigger_descriptions": { + "manual": "Manually executed traffic reset by administrator", + "cron": "Automatically executed by system scheduled task", + "auto": "Automatically triggered by system based on conditions", + "other": "Triggered by other methods" } }, "send_mail": { diff --git a/public/assets/admin/locales/ko-KR.js b/public/assets/admin/locales/ko-KR.js index 222699d..d751608 100644 --- a/public/assets/admin/locales/ko-KR.js +++ b/public/assets/admin/locales/ko-KR.js @@ -2245,6 +2245,12 @@ window.XBOARD_TRANSLATIONS['ko-KR'] = { "exporting": "내보내는 중...", "export_success": "내보내기 성공", "export_failed": "내보내기 실패" + }, + "trigger_descriptions": { + "manual": "관리자가 수동으로 실행한 트래픽 재설정", + "cron": "시스템 예약 작업에 의한 자동 실행", + "auto": "시스템이 조건에 따라 자동 트리거", + "other": "기타 방법으로 트리거" } }, "send_mail": { diff --git a/public/assets/admin/locales/zh-CN.js b/public/assets/admin/locales/zh-CN.js index 82c9413..a1953e6 100644 --- a/public/assets/admin/locales/zh-CN.js +++ b/public/assets/admin/locales/zh-CN.js @@ -2225,6 +2225,12 @@ window.XBOARD_TRANSLATIONS['zh-CN'] = { "exporting": "导出中...", "export_success": "导出成功", "export_failed": "导出失败" + }, + "trigger_descriptions": { + "manual": "管理员手动执行的流量重置", + "cron": "系统定时任务自动执行", + "auto": "系统根据条件自动触发", + "other": "其他方式触发" } }, "messages": {