better-auth-studio 1.0.36-beta.4 → 1.0.36-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -400,7 +400,7 @@ Error generating stack: `+i.message+`
|
|
|
400
400
|
|
|
401
401
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
402
402
|
|
|
403
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},n$="DialogDescriptionWarning",r$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t2(n$).contentName}}.`;return m.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},s$=Vj,a$=qj,i$=Gj,o$=Kj,wo='[cmdk-group=""]',df='[cmdk-group-items=""]',l$='[cmdk-group-heading=""]',n2='[cmdk-item=""]',Vv=`${n2}:not([aria-disabled="true"])`,Wm="cmdk-item-select",Qa="data-value",c$=(e,t,n)=>Z6(e,t,n),r2=m.createContext(void 0),Fl=()=>m.useContext(r2),s2=m.createContext(void 0),Ax=()=>m.useContext(s2),a2=m.createContext(void 0),i2=m.forwardRef((e,t)=>{let n=Za(()=>{var P,B;return{search:"",value:(B=(P=e.value)!=null?P:e.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Za(()=>new Set),a=Za(()=>new Map),i=Za(()=>new Map),o=Za(()=>new Set),l=o2(e),{label:c,children:d,value:h,onValueChange:u,filter:f,shouldFilter:p,loop:w,disablePointerSelection:v=!1,vimBindings:b=!0,...g}=e,y=nr(),x=nr(),N=nr(),j=m.useRef(null),k=y$();Pa(()=>{if(h!==void 0){let P=h.trim();n.current.value=P,S.emit()}},[h]),Pa(()=>{k(6,L)},[]);let S=m.useMemo(()=>({subscribe:P=>(o.current.add(P),()=>o.current.delete(P)),snapshot:()=>n.current,setState:(P,B,q)=>{var G,se,re,Z;if(!Object.is(n.current[P],B)){if(n.current[P]=B,P==="search")$(),I(),k(1,U);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let R=document.getElementById(N);R?R.focus():(G=document.getElementById(y))==null||G.focus()}if(k(7,()=>{var R;n.current.selectedItemId=(R=E())==null?void 0:R.id,S.emit()}),q||k(5,L),((se=l.current)==null?void 0:se.value)!==void 0){let R=B??"";(Z=(re=l.current).onValueChange)==null||Z.call(re,R);return}}S.emit()}},emit:()=>{o.current.forEach(P=>P())}}),[]),M=m.useMemo(()=>({value:(P,B,q)=>{var G;B!==((G=i.current.get(P))==null?void 0:G.value)&&(i.current.set(P,{value:B,keywords:q}),n.current.filtered.items.set(P,A(B,q)),k(2,()=>{I(),S.emit()}))},item:(P,B)=>(r.current.add(P),B&&(a.current.has(B)?a.current.get(B).add(P):a.current.set(B,new Set([P]))),k(3,()=>{$(),I(),n.current.value||U(),S.emit()}),()=>{i.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let q=E();k(4,()=>{$(),(q==null?void 0:q.getAttribute("id"))===P&&U(),S.emit()})}),group:P=>(a.current.has(P)||a.current.set(P,new Set),()=>{i.current.delete(P),a.current.delete(P)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:N,labelId:x,listInnerRef:j}),[]);function A(P,B){var q,G;let se=(G=(q=l.current)==null?void 0:q.filter)!=null?G:c$;return P?se(P,n.current.search,B):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let P=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(G=>{let se=a.current.get(G),re=0;se.forEach(Z=>{let R=P.get(Z);re=Math.max(R,re)}),B.push([G,re])});let q=j.current;O().sort((G,se)=>{var re,Z;let R=G.getAttribute("id"),ee=se.getAttribute("id");return((re=P.get(ee))!=null?re:0)-((Z=P.get(R))!=null?Z:0)}).forEach(G=>{let se=G.closest(df);se?se.appendChild(G.parentElement===se?G:G.closest(`${df} > *`)):q.appendChild(G.parentElement===q?G:G.closest(`${df} > *`))}),B.sort((G,se)=>se[1]-G[1]).forEach(G=>{var se;let re=(se=j.current)==null?void 0:se.querySelector(`${wo}[${Qa}="${encodeURIComponent(G[0])}"]`);re==null||re.parentElement.appendChild(re)})}function U(){let P=O().find(q=>q.getAttribute("aria-disabled")!=="true"),B=P==null?void 0:P.getAttribute(Qa);S.setState("value",B||void 0)}function $(){var P,B,q,G;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let re of r.current){let Z=(B=(P=i.current.get(re))==null?void 0:P.value)!=null?B:"",R=(G=(q=i.current.get(re))==null?void 0:q.keywords)!=null?G:[],ee=A(Z,R);n.current.filtered.items.set(re,ee),ee>0&&se++}for(let[re,Z]of a.current)for(let R of Z)if(n.current.filtered.items.get(R)>0){n.current.filtered.groups.add(re);break}n.current.filtered.count=se}function L(){var P,B,q;let G=E();G&&(((P=G.parentElement)==null?void 0:P.firstChild)===G&&((q=(B=G.closest(wo))==null?void 0:B.querySelector(l$))==null||q.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function E(){var P;return(P=j.current)==null?void 0:P.querySelector(`${n2}[aria-selected="true"]`)}function O(){var P;return Array.from(((P=j.current)==null?void 0:P.querySelectorAll(Vv))||[])}function D(P){let B=O()[P];B&&S.setState("value",B.getAttribute(Qa))}function T(P){var B;let q=E(),G=O(),se=G.findIndex(Z=>Z===q),re=G[se+P];(B=l.current)!=null&&B.loop&&(re=se+P<0?G[G.length-1]:se+P===G.length?G[0]:G[se+P]),re&&S.setState("value",re.getAttribute(Qa))}function C(P){let B=E(),q=B==null?void 0:B.closest(wo),G;for(;q&&!G;)q=P>0?v$(q,wo):w$(q,wo),G=q==null?void 0:q.querySelector(Vv);G?S.setState("value",G.getAttribute(Qa)):T(P)}let _=()=>D(O().length-1),z=P=>{P.preventDefault(),P.metaKey?_():P.altKey?C(1):T(1)},H=P=>{P.preventDefault(),P.metaKey?D(0):P.altKey?C(-1):T(-1)};return m.createElement(dt.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:P=>{var B;(B=g.onKeyDown)==null||B.call(g,P);let q=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||q))switch(P.key){case"n":case"j":{b&&P.ctrlKey&&z(P);break}case"ArrowDown":{z(P);break}case"p":case"k":{b&&P.ctrlKey&&H(P);break}case"ArrowUp":{H(P);break}case"Home":{P.preventDefault(),D(0);break}case"End":{P.preventDefault(),_();break}case"Enter":{P.preventDefault();let G=E();if(G){let se=new Event(Wm);G.dispatchEvent(se)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:N$},c),Ku(e,P=>m.createElement(s2.Provider,{value:S},m.createElement(r2.Provider,{value:M},P))))}),d$=m.forwardRef((e,t)=>{var n,r;let a=nr(),i=m.useRef(null),o=m.useContext(a2),l=Fl(),c=o2(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Pa(()=>{if(!d)return l.item(a,o==null?void 0:o.id)},[d]);let h=l2(a,i,[e.value,e.children,i],e.keywords),u=Ax(),f=Bs(k=>k.value&&k.value===h.current),p=Bs(k=>d||l.filter()===!1?!0:k.search?k.filtered.items.get(a)>0:!0);m.useEffect(()=>{let k=i.current;if(!(!k||e.disabled))return k.addEventListener(Wm,w),()=>k.removeEventListener(Wm,w)},[p,e.onSelect,e.disabled]);function w(){var k,S;v(),(S=(k=c.current).onSelect)==null||S.call(k,h.current)}function v(){u.setState("value",h.current,!0)}if(!p)return null;let{disabled:b,value:g,onSelect:y,forceMount:x,keywords:N,...j}=e;return m.createElement(dt.div,{ref:_a(i,t),...j,id:a,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!f,"data-disabled":!!b,"data-selected":!!f,onPointerMove:b||l.getDisablePointerSelection()?void 0:v,onClick:b?void 0:w},e.children)}),u$=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=nr(),l=m.useRef(null),c=m.useRef(null),d=nr(),h=Fl(),u=Bs(p=>a||h.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);Pa(()=>h.group(o),[]),l2(o,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:a}),[a]);return m.createElement(dt.div,{ref:_a(l,t),...i,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Ku(e,p=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},m.createElement(a2.Provider,{value:f},p))))}),h$=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=m.useRef(null),i=Bs(o=>!o.search);return!n&&!i?null:m.createElement(dt.div,{ref:_a(a,t),...r,"cmdk-separator":"",role:"separator"})}),f$=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=Ax(),o=Bs(d=>d.search),l=Bs(d=>d.selectedItemId),c=Fl();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(dt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:a?e.value:o,onChange:d=>{a||i.setState("search",d.target.value),n==null||n(d.target.value)}})}),m$=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=m.useRef(null),o=m.useRef(null),l=Bs(d=>d.selectedItemId),c=Fl();return m.useEffect(()=>{if(o.current&&i.current){let d=o.current,h=i.current,u,f=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let p=d.offsetHeight;h.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(d),()=>{cancelAnimationFrame(u),f.unobserve(d)}}},[]),m.createElement(dt.div,{ref:_a(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Ku(e,d=>m.createElement("div",{ref:_a(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),p$=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...l}=e;return m.createElement(s$,{open:n,onOpenChange:r},m.createElement(a$,{container:o},m.createElement(i$,{"cmdk-overlay":"",className:a}),m.createElement(o$,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(i2,{ref:t,...l}))))}),x$=m.forwardRef((e,t)=>Bs(n=>n.filtered.count===0)?m.createElement(dt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),g$=m.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return m.createElement(dt.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Ku(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),yo=Object.assign(i2,{List:m$,Item:d$,Input:f$,Group:u$,Separator:h$,Dialog:p$,Empty:x$,Loading:g$});function v$(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function w$(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function o2(e){let t=m.useRef(e);return Pa(()=>{t.current=e}),t}var Pa=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Za(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Bs(e){let t=Ax(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function l2(e,t,n,r=[]){let a=m.useRef(),i=Fl();return Pa(()=>{var o;let l=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():a.current}})(),c=r.map(d=>d.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(Qa,l),a.current=l}),a}var y$=()=>{let[e,t]=m.useState(),n=Za(()=>new Map);return Pa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function b$(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ku({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(b$(t),{ref:t.ref},n(t.props.children)):n(t)}var N$={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function j$({isOpen:e,onClose:t}){const n=_r(),[r,a]=m.useState(""),[i,o]=m.useState(null);m.useEffect(()=>{(async()=>{try{const p=await(await fetch("/api/plugins")).json();o(p)}catch{}})()},[]);const l=u=>i!=null&&i.plugins?i.plugins.some(f=>f.id===u):!1,h=[{id:"users",title:"Users",description:"Manage users and their accounts",icon:Ma,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:pr,action:()=>n("/organizations"),category:"Navigation",keywords:["org","company","team"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"sessions",title:"Sessions",description:"View active user sessions",icon:dv,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:bi,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:dv,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:Pm,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:zs,action:()=>n("/organizations"),category:"Actions",keywords:["add","new","org"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"invite-user",title:"Invite User",description:"Send invitation to join organization",icon:Yd,action:()=>n("/organizations"),category:"Actions",keywords:["invite","email","send"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"}].filter(u=>{var p;const f=r.toLowerCase();return u.title.toLowerCase().includes(f)||u.description.toLowerCase().includes(f)||((p=u.keywords)==null?void 0:p.some(w=>w.toLowerCase().includes(f)))}).reduce((u,f)=>(u[f.category]||(u[f.category]=[]),u[f.category].push(f),u),{});return m.useEffect(()=>{const u=f=>{(f.metaKey||f.ctrlKey)&&f.key==="k"&&f.preventDefault()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[]),m.useEffect(()=>{const u=f=>{f.key==="Escape"&&t()};if(e)return document.body.style.overflow="hidden",document.addEventListener("keydown",u),()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",u)}},[e,t]),e?s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center pt-[20vh] z-50 overflow-hidden",onClick:t,children:s.jsx("div",{className:"bg-black/90 overflow-hidden border border-white/10 rounded-none w-full max-w-2xl mx-4",onClick:u=>u.stopPropagation(),children:s.jsxs(yo,{className:"p-2",children:[s.jsxs("div",{className:"flex items-center border-b border-dashed border-white/10 px-3 pb-3",children:[s.jsx(Ea,{className:"w-4 h-4 text-gray-400 mr-3"}),s.jsx(yo.Input,{value:r,onValueChange:a,placeholder:"Search for actions, pages, or commands...",className:"flex-1 placeholder:text-xs bg-transparent text-white placeholder-gray-400 outline-none",autoFocus:!0}),s.jsx("kbd",{className:"hidden sm:inline-flex items-center px-2 py-1 text-xs text-gray-400 border border-dashed border-white/20 rounded-sm",children:"ESC"})]}),s.jsx(yo.List,{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(h).length===0?s.jsxs("div",{className:"text-center py-8 text-gray-400",children:[s.jsx(Ea,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),s.jsx("p",{children:"No results found"}),s.jsx("p",{className:"text-sm",children:"Try a different search term"})]}):Object.entries(h).map(([u,f])=>s.jsx("div",{className:"mb-4",children:s.jsx(yo.Group,{heading:u,className:"text-xs text-gray-400 font-medium mb-2 px-2",children:f.map(p=>{const w=p.icon,v=p.disabled;return s.jsxs(yo.Item,{value:p.id,disabled:v,onSelect:()=>{v||(p.action(),t())},className:`flex items-center space-x-3 px-0 py-2 rounded-none transition-colors relative ${v?"opacity-40 cursor-not-allowed blur-[0.5px]":"hover:bg-white/5 cursor-pointer"}`,children:[s.jsx(w,{className:"w-4 h-4 text-white"}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"text-white text-[13px] font-light flex items-center gap-2",children:[p.title,v&&s.jsx(nd,{className:"w-3 h-3 text-yellow-500"})]}),s.jsx("div",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:v?p.disabledMessage:p.description})]}),!v&&s.jsx(TP,{className:"w-4 h-4 text-gray-400"})]},p.id)})})},u))}),s.jsx("div",{className:"border-t border-dashed border-white/10 px-3 py-2 text-xs text-gray-400",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{children:["Press"," ",s.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"↑↓"})," ","to navigate"]}),s.jsxs("span",{children:["Press"," ",s.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"Enter"})," ","to select"]})]})})]})})}):null}const Yv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Xv=Xd,c2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Xv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(d=>{const h=n==null?void 0:n[d],u=i==null?void 0:i[d];if(h===null)return null;const f=Yv(h)||Yv(u);return a[d][f]}),l=n&&Object.entries(n).reduce((d,h)=>{let[u,f]=h;return f===void 0||(d[u]=f),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:u,className:f,...p}=h;return Object.entries(p).every(w=>{let[v,b]=w;return Array.isArray(b)?b.includes({...i,...l}[v]):{...i,...l}[v]===b})?[...d,u,f]:d},[]);return Xv(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Hm=c2("inline-flex items-center justify-center gap-2 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"}}),Y=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?SA:"button";return s.jsx(o,{className:De(Hm({variant:t,size:n,className:e})),ref:i,...a})});Y.displayName="Button";function k$({children:e}){const t=Gi(),{counts:n,loading:r}=Xu(),[a,i]=m.useState(!1),[o,l]=m.useState("v1.0.0");m.useEffect(()=>{const h=u=>{(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),i(!0))};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[]),m.useEffect(()=>{(async()=>{var u;try{const p=await(await fetch("/api/config")).json();(u=p.studio)!=null&&u.version&&l(`v${p.studio.version}`)}catch{}})()},[]);const c=h=>h>=1e3?`${(h/1e3).toFixed(1).replace(/\.0$/,"")}k`:h.toString(),d=[{name:"Dashboard",href:"/",icon:FP},{name:"Users",href:"/users",icon:Ma,badge:r?"...":c(n.users)},{name:"Organizations",href:"/organizations",icon:pr,badge:r?"...":c(n.organizations)},{name:"Database",href:"/database",icon:mt},{name:"Tools",href:"/tools",icon:BN},{name:"Settings",href:"/settings",icon:bi}];return s.jsxs("div",{className:"min-h-screen bg-black",children:[s.jsx("div",{className:"bg-black/70 border-b border-white/15",children:s.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[s.jsx("div",{className:"w-7 h-7 border border-dashed border-white/20 rounded-lg flex items-center justify-center",children:s.jsx("span",{className:"text-black font-bold text-md",children:"⚡"})}),s.jsx("div",{className:"mb-0",children:s.jsxs("h1",{className:"text-md inline-flex mb-0 items-start font-light font-mono uppercase text-white",children:["Better-Auth Studio",s.jsxs("sup",{className:"text-sm text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 lowercase font-mono text-xs",children:o}),s.jsx("span",{className:"ml-1",children:"]"})]})]})})]})}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx("input",{type:"text",placeholder:"Search...",onClick:()=>i(!0),className:"pl-10 pr-4 py-2 bg-black border rounded-none border-gray-600 text-white border-dashed border-white/20 focus:ring-2 focus:ring-white focus:border-transparent transition-colors placeholder-gray-400 cursor-pointer",readOnly:!0}),s.jsx("kbd",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-xs text-gray-400 border border-dashed border-white/10 rounded-sm px-1.5 py-0.5",children:"⌘ K"})]}),s.jsx("a",{href:"https://better-auth.com/docs",target:"_blank",rel:"noopener",children:s.jsx(Y,{variant:"ghost",className:"text-gray-300 bg-transparent hover:bg-transparent hover:bg-gray-900 border-dashed",children:"Docs"})}),s.jsx("a",{href:"https://better-auth.com/support",target:"_blank",rel:"noopener",children:s.jsx(Y,{variant:"ghost",className:"text-gray-300 bg-transparent hover:bg-transparent hover:bg-gray-900 border-dashed",children:"Support"})})]})]})}),s.jsx("div",{className:"bg-black/50 border-b border-white/10",children:s.jsx("div",{className:"px-6",children:s.jsx("nav",{className:"flex space-x-8",children:d.map(h=>{const u=t.pathname===h.href;return s.jsxs(qp,{to:h.href,className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[s.jsx(h.icon,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:[h.name,h.badge&&s.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[s.jsx("span",{className:"mr-0.5",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:h.badge}),s.jsx("span",{className:"ml-0.5",children:"]"})]})]})]},h.name)})})})}),s.jsx("div",{className:"flex-1 p-0",children:e}),s.jsx(j$,{isOpen:a,onClose:()=>i(!1)})]})}function Jd(e){"@babel/helpers - typeof";return Jd=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},Jd(e)}function Aa(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function en(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Pr(e){en(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Jd(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function S$(e,t){en(2,arguments);var n=Pr(e).getTime(),r=Aa(t);return new Date(n+r)}var C$={};function Qu(){return C$}function E$(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function M$(e){return en(1,arguments),e instanceof Date||Jd(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _$(e){if(en(1,arguments),!M$(e)&&typeof e!="number")return!1;var t=Pr(e);return!isNaN(Number(t))}function D$(e,t){en(2,arguments);var n=Aa(t);return S$(e,-n)}var T$=864e5;function P$(e){en(1,arguments);var t=Pr(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),a=n-r;return Math.floor(a/T$)+1}function eu(e){en(1,arguments);var t=1,n=Pr(e),r=n.getUTCDay(),a=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-a),n.setUTCHours(0,0,0,0),n}function d2(e){en(1,arguments);var t=Pr(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var a=eu(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=eu(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function A$(e){en(1,arguments);var t=d2(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=eu(n);return r}var O$=6048e5;function z$(e){en(1,arguments);var t=Pr(e),n=eu(t).getTime()-A$(t).getTime();return Math.round(n/O$)+1}function tu(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Qu(),u=Aa((n=(r=(a=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:h.weekStartsOn)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&n!==void 0?n:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Pr(e),p=f.getUTCDay(),w=(p<u?7:0)+p-u;return f.setUTCDate(f.getUTCDate()-w),f.setUTCHours(0,0,0,0),f}function u2(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Pr(e),u=h.getUTCFullYear(),f=Qu(),p=Aa((n=(r=(a=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&a!==void 0?a:f.firstWeekContainsDate)!==null&&r!==void 0?r:(c=f.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(u+1,0,p),w.setUTCHours(0,0,0,0);var v=tu(w,t),b=new Date(0);b.setUTCFullYear(u,0,p),b.setUTCHours(0,0,0,0);var g=tu(b,t);return h.getTime()>=v.getTime()?u+1:h.getTime()>=g.getTime()?u:u-1}function $$(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Qu(),u=Aa((n=(r=(a=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&a!==void 0?a:h.firstWeekContainsDate)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=u2(e,t),p=new Date(0);p.setUTCFullYear(f,0,u),p.setUTCHours(0,0,0,0);var w=tu(p,t);return w}var R$=6048e5;function I$(e,t){en(1,arguments);var n=Pr(e),r=tu(n,t).getTime()-$$(n,t).getTime();return Math.round(r/R$)+1}function Ye(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var fs={y:function(t,n){var r=t.getUTCFullYear(),a=r>0?r:1-r;return Ye(n==="yy"?a%100:a,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):Ye(r+1,2)},d:function(t,n){return Ye(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return Ye(t.getUTCHours()%12||12,n.length)},H:function(t,n){return Ye(t.getUTCHours(),n.length)},m:function(t,n){return Ye(t.getUTCMinutes(),n.length)},s:function(t,n){return Ye(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,a=t.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,r-3));return Ye(i,n.length)}},Ga={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},L$={G:function(t,n,r){var a=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var a=t.getUTCFullYear(),i=a>0?a:1-a;return r.ordinalNumber(i,{unit:"year"})}return fs.y(t,n)},Y:function(t,n,r,a){var i=u2(t,a),o=i>0?i:1-i;if(n==="YY"){var l=o%100;return Ye(l,2)}return n==="Yo"?r.ordinalNumber(o,{unit:"year"}):Ye(o,n.length)},R:function(t,n){var r=d2(t);return Ye(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return Ye(r,n.length)},Q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(a);case"QQ":return Ye(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(a);case"qq":return Ye(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,n,r){var a=t.getUTCMonth();switch(n){case"M":case"MM":return fs.M(t,n);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(t,n,r){var a=t.getUTCMonth();switch(n){case"L":return String(a+1);case"LL":return Ye(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(t,n,r,a){var i=I$(t,a);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):Ye(i,n.length)},I:function(t,n,r){var a=z$(t);return n==="Io"?r.ordinalNumber(a,{unit:"week"}):Ye(a,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):fs.d(t,n)},D:function(t,n,r){var a=P$(t);return n==="Do"?r.ordinalNumber(a,{unit:"dayOfYear"}):Ye(a,n.length)},E:function(t,n,r){var a=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});case"EEEE":default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return Ye(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return Ye(o,n.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var a=t.getUTCDay(),i=a===0?7:a;switch(n){case"i":return String(i);case"ii":return Ye(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});case"iiii":default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(t,n,r){var a=t.getUTCHours(),i=a/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var a=t.getUTCHours(),i;switch(a===12?i=Ga.noon:a===0?i=Ga.midnight:i=a/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var a=t.getUTCHours(),i;switch(a>=17?i=Ga.evening:a>=12?i=Ga.afternoon:a>=4?i=Ga.morning:i=Ga.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var a=t.getUTCHours()%12;return a===0&&(a=12),r.ordinalNumber(a,{unit:"hour"})}return fs.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):fs.H(t,n)},K:function(t,n,r){var a=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(a,{unit:"hour"}):Ye(a,n.length)},k:function(t,n,r){var a=t.getUTCHours();return a===0&&(a=24),n==="ko"?r.ordinalNumber(a,{unit:"hour"}):Ye(a,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):fs.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):fs.s(t,n)},S:function(t,n){return fs.S(t,n)},X:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Gv(o);case"XXXX":case"XX":return ta(o);case"XXXXX":case"XXX":default:return ta(o,":")}},x:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Gv(o);case"xxxx":case"xx":return ta(o);case"xxxxx":case"xxx":default:return ta(o,":")}},O:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+qv(o,":");case"OOOO":default:return"GMT"+ta(o,":")}},z:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+qv(o,":");case"zzzz":default:return"GMT"+ta(o,":")}},t:function(t,n,r,a){var i=a._originalDate||t,o=Math.floor(i.getTime()/1e3);return Ye(o,n.length)},T:function(t,n,r,a){var i=a._originalDate||t,o=i.getTime();return Ye(o,n.length)}};function qv(e,t){var n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;if(i===0)return n+String(a);var o=t;return n+String(a)+o+Ye(i,2)}function Gv(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Ye(Math.abs(e)/60,2)}return ta(e,t)}function ta(e,t){var n=t||"",r=e>0?"-":"+",a=Math.abs(e),i=Ye(Math.floor(a/60),2),o=Ye(a%60,2);return r+i+n+o}var Kv=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},h2=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},F$=function(t,n){var r=t.match(/(P+)(p+)?/)||[],a=r[1],i=r[2];if(!i)return Kv(t,n);var o;switch(a){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;case"PPPP":default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",Kv(a,n)).replace("{{time}}",h2(i,n))},U$={p:h2,P:F$},B$=["D","DD"],W$=["YY","YYYY"];function H$(e){return B$.indexOf(e)!==-1}function V$(e){return W$.indexOf(e)!==-1}function Qv(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Y$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},X$=function(t,n,r){var a,i=Y$[t];return typeof i=="string"?a=i:n===1?a=i.one:a=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a};function uf(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var q$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},G$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},K$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q$={date:uf({formats:q$,defaultWidth:"full"}),time:uf({formats:G$,defaultWidth:"full"}),dateTime:uf({formats:K$,defaultWidth:"full"})},Z$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},J$=function(t,n,r,a){return Z$[t]};function bo(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",a;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[c]||e.values[l]}var d=e.argumentCallback?e.argumentCallback(t):t;return a[d]}}var eR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nR={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"]},rR={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"]},sR={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"}},aR={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"}},iR=function(t,n){var r=Number(t),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},oR={ordinalNumber:iR,era:bo({values:eR,defaultWidth:"wide"}),quarter:bo({values:tR,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:bo({values:nR,defaultWidth:"wide"}),day:bo({values:rR,defaultWidth:"wide"}),dayPeriod:bo({values:sR,defaultWidth:"wide",formattingValues:aR,defaultFormattingWidth:"wide"})};function No(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?cR(l,function(u){return u.test(o)}):lR(l,function(u){return u.test(o)}),d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;var h=t.slice(o.length);return{value:d,rest:h}}}function lR(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function cR(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function dR(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var a=r[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var l=t.slice(a.length);return{value:o,rest:l}}}var uR=/^(\d+)(th|st|nd|rd)?/i,hR=/\d+/i,fR={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},mR={any:[/^b/i,/^(a|c)/i]},pR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xR={any:[/1/i,/2/i,/3/i,/4/i]},gR={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},vR={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]},wR={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},yR={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]},bR={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},NR={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}},jR={ordinalNumber:dR({matchPattern:uR,parsePattern:hR,valueCallback:function(t){return parseInt(t,10)}}),era:No({matchPatterns:fR,defaultMatchWidth:"wide",parsePatterns:mR,defaultParseWidth:"any"}),quarter:No({matchPatterns:pR,defaultMatchWidth:"wide",parsePatterns:xR,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:No({matchPatterns:gR,defaultMatchWidth:"wide",parsePatterns:vR,defaultParseWidth:"any"}),day:No({matchPatterns:wR,defaultMatchWidth:"wide",parsePatterns:yR,defaultParseWidth:"any"}),dayPeriod:No({matchPatterns:bR,defaultMatchWidth:"any",parsePatterns:NR,defaultParseWidth:"any"})},kR={code:"en-US",formatDistance:X$,formatLong:Q$,formatRelative:J$,localize:oR,match:jR,options:{weekStartsOn:0,firstWeekContainsDate:1}},SR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,CR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ER=/^'([^]*?)'?$/,MR=/''/g,_R=/[a-zA-Z]/;function An(e,t,n){var r,a,i,o,l,c,d,h,u,f,p,w,v,b;en(2,arguments);var g=String(t),y=Qu(),x=(r=(a=void 0)!==null&&a!==void 0?a:y.locale)!==null&&r!==void 0?r:kR,N=Aa((i=(o=(l=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&l!==void 0?l:y.firstWeekContainsDate)!==null&&o!==void 0?o:(d=y.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=Aa((u=(f=(p=(w=void 0)!==null&&w!==void 0?w:void 0)!==null&&p!==void 0?p:y.weekStartsOn)!==null&&f!==void 0?f:(v=y.locale)===null||v===void 0||(b=v.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&u!==void 0?u:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!x.localize)throw new RangeError("locale must contain localize property");if(!x.formatLong)throw new RangeError("locale must contain formatLong property");var k=Pr(e);if(!_$(k))throw new RangeError("Invalid time value");var S=E$(k),M=D$(k,S),A={firstWeekContainsDate:N,weekStartsOn:j,locale:x,_originalDate:k},I=g.match(CR).map(function(U){var $=U[0];if($==="p"||$==="P"){var L=U$[$];return L(U,x.formatLong)}return U}).join("").match(SR).map(function(U){if(U==="''")return"'";var $=U[0];if($==="'")return DR(U);var L=L$[$];if(L)return V$(U)&&Qv(U,t,String(e)),H$(U)&&Qv(U,t,String(e)),L(M,U,x.localize,A);if($.match(_R))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return U}).join("");return I}function DR(e){var t=e.match(ER);return t?t[1].replace(MR,"'"):e}function TR(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const hf={},Ao={};function la(e,t){try{const r=(hf[e]||(hf[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in Ao?Ao[r]:Zv(r,r.split(":"))}catch{if(e in Ao)return Ao[e];const n=e==null?void 0:e.match(PR);return n?Zv(e,n.slice(1)):NaN}}const PR=/([+-]\d\d):?(\d\d)?/;function Zv(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return Ao[e]=n*60+r>0?n*60+r+a:n*60-r-a}class yr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(la(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),f2(this),Vm(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new yr(...n,t):new yr(Date.now(),t)}withTimeZone(t){return new yr(+this,t)}getTimezoneOffset(){const t=-la(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Vm(this),+this}[Symbol.for("constructDateFrom")](t){return new yr(+new Date(t),this.timeZone)}}const Jv=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Jv.test(e))return;const t=e.replace(Jv,"$1UTC");yr.prototype[t]&&(e.startsWith("get")?yr.prototype[e]=function(){return this.internal[t]()}:(yr.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),AR(this),+this},yr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Vm(this),+this}))});function Vm(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-la(e.timeZone,e)*60))}function AR(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),f2(e)}function f2(e){const t=la(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),o=a-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=a-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const h=a>0?d.getSeconds():(d.getSeconds()-60)%60,u=Math.round(-(la(e.timeZone,e)*60))%60;(u||h)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+h));const f=la(e.timeZone,e),p=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-p,b=p!==n,g=v-c;if(b&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const y=la(e.timeZone,e),x=y>0?Math.floor(y):Math.ceil(y),N=p-x;N&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N))}}class Vt extends yr{static tz(t,...n){return n.length?new Vt(...n,t):new Vt(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${TR(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new Vt(+this,t)}[Symbol.for("constructDateFrom")](t){return new Vt(+new Date(t),this.timeZone)}}const m2=6048e5,OR=864e5,ew=Symbol.for("constructDateFrom");function St(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ew in e?e[ew](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ke(e,t){return St(t||e,e)}function p2(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(t)?St(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function x2(e,t,n){const r=Ke(e,n==null?void 0:n.in);if(isNaN(t))return St(e,NaN);if(!t)return r;const a=r.getDate(),i=St(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const o=i.getDate();return a>=o?i:(r.setFullYear(i.getFullYear(),i.getMonth(),a),r)}let zR={};function Ul(){return zR}function Wi(e,t){var l,c,d,h;const n=Ul(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,a=Ke(e,t==null?void 0:t.in),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function kl(e,t){return Wi(e,{...t,weekStartsOn:1})}function g2(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=St(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=kl(a),o=St(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const l=kl(o);return n.getTime()>=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function tw(e){const t=Ke(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 Ji(e,...t){const n=St.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Sl(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function v2(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t),i=Sl(r),o=Sl(a),l=+i-tw(i),c=+o-tw(o);return Math.round((l-c)/OR)}function $R(e,t){const n=g2(e,t),r=St(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),kl(r)}function RR(e,t,n){return p2(e,t*7,n)}function IR(e,t,n){return x2(e,t*12,n)}function LR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=St.bind(null,a));const i=Ke(a,r);(!n||n<i||isNaN(+i))&&(n=i)}),St(r,n||NaN)}function FR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=St.bind(null,a));const i=Ke(a,r);(!n||n>i||isNaN(+i))&&(n=i)}),St(r,n||NaN)}function UR(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return+Sl(r)==+Sl(a)}function w2(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function BR(e){return!(!w2(e)&&typeof e!="number"||isNaN(+Ke(e)))}function WR(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t),i=r.getFullYear()-a.getFullYear(),o=r.getMonth()-a.getMonth();return i*12+o}function HR(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function y2(e,t){const[n,r]=Ji(e,t.start,t.end);return{start:n,end:r}}function VR(e,t){const{start:n,end:r}=y2(t==null?void 0:t.in,e);let a=+n>+r;const i=a?+n:+r,o=a?r:n;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(St(n,o)),o.setMonth(o.getMonth()+l);return a?c.reverse():c}function YR(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function XR(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function b2(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function qR(e,t){const{start:n,end:r}=y2(t==null?void 0:t.in,e);let a=+n>+r;const i=a?+n:+r,o=a?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(St(n,o)),o.setFullYear(o.getFullYear()+l);return a?c.reverse():c}function N2(e,t){var l,c,d,h;const n=Ul(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,a=Ke(e,t==null?void 0:t.in),i=a.getDay(),o=(i<r?-7:0)+6-(i-r);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function GR(e,t){return N2(e,{...t,weekStartsOn:1})}const KR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},QR=(e,t,n)=>{let r;const a=KR[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ff(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const ZR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},JR={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},eI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tI={date:ff({formats:ZR,defaultWidth:"full"}),time:ff({formats:JR,defaultWidth:"full"}),dateTime:ff({formats:eI,defaultWidth:"full"})},nI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},rI=(e,t,n,r)=>nI[e];function jo(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const sI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},aI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},iI={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"]},oI={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"]},lI={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"}},cI={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"}},dI=(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"},uI={ordinalNumber:dI,era:jo({values:sI,defaultWidth:"wide"}),quarter:jo({values:aI,defaultWidth:"wide",argumentCallback:e=>e-1}),month:jo({values:iI,defaultWidth:"wide"}),day:jo({values:oI,defaultWidth:"wide"}),dayPeriod:jo({values:lI,defaultWidth:"wide",formattingValues:cI,defaultFormattingWidth:"wide"})};function ko(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?fI(l,u=>u.test(o)):hI(l,u=>u.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(o.length);return{value:d,rest:h}}}function hI(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function fI(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function mI(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}const pI=/^(\d+)(th|st|nd|rd)?/i,xI=/\d+/i,gI={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},vI={any:[/^b/i,/^(a|c)/i]},wI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},yI={any:[/1/i,/2/i,/3/i,/4/i]},bI={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},NI={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]},jI={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},kI={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]},SI={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},CI={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}},EI={ordinalNumber:mI({matchPattern:pI,parsePattern:xI,valueCallback:e=>parseInt(e,10)}),era:ko({matchPatterns:gI,defaultMatchWidth:"wide",parsePatterns:vI,defaultParseWidth:"any"}),quarter:ko({matchPatterns:wI,defaultMatchWidth:"wide",parsePatterns:yI,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ko({matchPatterns:bI,defaultMatchWidth:"wide",parsePatterns:NI,defaultParseWidth:"any"}),day:ko({matchPatterns:jI,defaultMatchWidth:"wide",parsePatterns:kI,defaultParseWidth:"any"}),dayPeriod:ko({matchPatterns:SI,defaultMatchWidth:"any",parsePatterns:CI,defaultParseWidth:"any"})},Ox={code:"en-US",formatDistance:QR,formatLong:tI,formatRelative:rI,localize:uI,match:EI,options:{weekStartsOn:0,firstWeekContainsDate:1}};function MI(e,t){const n=Ke(e,t==null?void 0:t.in);return v2(n,b2(n))+1}function j2(e,t){const n=Ke(e,t==null?void 0:t.in),r=+kl(n)-+$R(n);return Math.round(r/m2)+1}function k2(e,t){var h,u,f,p;const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=Ul(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??a.firstWeekContainsDate??((p=(f=a.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=St((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=Wi(o,t),c=St((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=Wi(c,t);return+n>=+l?r+1:+n>=+d?r:r-1}function _I(e,t){var l,c,d,h;const n=Ul(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,a=k2(e,t),i=St((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),Wi(i,t)}function S2(e,t){const n=Ke(e,t==null?void 0:t.in),r=+Wi(n,t)-+_I(n,t);return Math.round(r/m2)+1}function Xe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ms={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Xe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Xe(n+1,2)},d(e,t){return Xe(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 Xe(e.getHours()%12||12,t.length)},H(e,t){return Xe(e.getHours(),t.length)},m(e,t){return Xe(e.getMinutes(),t.length)},s(e,t){return Xe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Xe(a,t.length)}},Ka={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},nw={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(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return ms.y(e,t)},Y:function(e,t,n,r){const a=k2(e,r),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return Xe(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Xe(i,t.length)},R:function(e,t){const n=g2(e);return Xe(n,t.length)},u:function(e,t){const n=e.getFullYear();return Xe(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 Xe(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 Xe(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 ms.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 Xe(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 a=S2(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Xe(a,t.length)},I:function(e,t,n){const r=j2(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Xe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ms.d(e,t)},D:function(e,t,n){const r=MI(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Xe(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 a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Xe(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Xe(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Xe(a,t.length);case"io":return n.ordinalNumber(a,{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 a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Ka.noon:r===0?a=Ka.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Ka.evening:r>=12?a=Ka.afternoon:r>=4?a=Ka.morning:a=Ka.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{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 ms.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ms.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Xe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Xe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ms.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ms.s(e,t)},S:function(e,t){return ms.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return sw(r);case"XXXX":case"XX":return na(r);case"XXXXX":case"XXX":default:return na(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return sw(r);case"xxxx":case"xx":return na(r);case"xxxxx":case"xxx":default:return na(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rw(r,":");case"OOOO":default:return"GMT"+na(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rw(r,":");case"zzzz":default:return"GMT"+na(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Xe(r,t.length)},T:function(e,t,n){return Xe(+e,t.length)}};function rw(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+Xe(i,2)}function sw(e,t){return e%60===0?(e>0?"-":"+")+Xe(Math.abs(e)/60,2):na(e,t)}function na(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Xe(Math.trunc(r/60),2),i=Xe(r%60,2);return n+a+t+i}const aw=(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"})}},C2=(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"})}},DI=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return aw(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",aw(r,t)).replace("{{time}}",C2(a,t))},TI={p:C2,P:DI},PI=/^D+$/,AI=/^Y+$/,OI=["D","DD","YY","YYYY"];function zI(e){return PI.test(e)}function $I(e){return AI.test(e)}function RI(e,t,n){const r=II(e,t,n);if(console.warn(r),OI.includes(e))throw new RangeError(r)}function II(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 LI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,UI=/^'([^]*?)'?$/,BI=/''/g,WI=/[a-zA-Z]/;function HI(e,t,n){var h,u,f,p,w,v,b,g;const r=Ul(),a=(n==null?void 0:n.locale)??r.locale??Ox,i=(n==null?void 0:n.firstWeekContainsDate)??((u=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(w=n==null?void 0:n.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((g=(b=r.locale)==null?void 0:b.options)==null?void 0:g.weekStartsOn)??0,l=Ke(e,n==null?void 0:n.in);if(!BR(l))throw new RangeError("Invalid time value");let c=t.match(FI).map(y=>{const x=y[0];if(x==="p"||x==="P"){const N=TI[x];return N(y,a.formatLong)}return y}).join("").match(LI).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:VI(y)};if(nw[x])return{isToken:!0,value:y};if(x.match(WI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:y}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(y=>{if(!y.isToken)return y.value;const x=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&$I(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&zI(x))&&RI(x,t,String(e));const N=nw[x[0]];return N(l,x,a.localize,d)}).join("")}function VI(e){const t=e.match(UI);return t?t[1].replace(BI,"'"):e}function YI(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=n.getMonth(),i=St(n,0);return i.setFullYear(r,a+1,0),i.setHours(0,0,0,0),i.getDate()}function XI(e,t){return Ke(e,t==null?void 0:t.in).getMonth()}function qI(e,t){return Ke(e,t==null?void 0:t.in).getFullYear()}function GI(e,t){return+Ke(e)>+Ke(t)}function KI(e,t){return+Ke(e)<+Ke(t)}function QI(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function ZI(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()}function JI(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=r.getFullYear(),i=r.getDate(),o=St(e,0);o.setFullYear(a,t,15),o.setHours(0,0,0,0);const l=YI(o);return r.setMonth(t,Math.min(i,l)),r}function e8(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(+r)?St(e,NaN):(r.setFullYear(t),r)}const iw=5,t8=4;function n8(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),i=t.addDays(a,iw*7-1);return t.getMonth(e)===t.getMonth(i)?iw:t8}function E2(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function r8(e,t){const n=E2(e,t),r=n8(e,t);return t.addDays(n,r*7-1)}class jn{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Vt.tz(this.options.timeZone):new this.Date},this.newDate=(r,a,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(r,a,i):this.options.timeZone?new Vt(r,a,i,this.options.timeZone):new Date(r,a,i)},this.addDays=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(r,a):p2(r,a)},this.addMonths=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(r,a):x2(r,a)},this.addWeeks=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(r,a):RR(r,a)},this.addYears=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,a):IR(r,a)},this.differenceInCalendarDays=(r,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):v2(r,a)},this.differenceInCalendarMonths=(r,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):WR(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):VR(r)},this.eachYearOfInterval=r=>{var l;const a=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(r):qR(r),i=new Set(a.map(c=>this.getYear(c)));if(i.size===a.length)return a;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):r8(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):GR(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):HR(r)},this.endOfWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,a):N2(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):XR(r)},this.format=(r,a,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(r,a,this.options):HI(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.getISOWeek?this.overrides.getISOWeek(r):j2(r)},this.getMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):XI(r,this.options)},this.getYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):qI(r,this.options)},this.getWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):S2(r,this.options)},this.isAfter=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,a):GI(r,a)},this.isBefore=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,a):KI(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):w2(r)},this.isSameDay=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,a):UR(r,a)},this.isSameMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,a):QI(r,a)},this.isSameYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,a):ZI(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):LR(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):FR(r)},this.setMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,a):JI(r,a)},this.setYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,a):e8(r,a)},this.startOfBroadcastWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):E2(r,this)},this.startOfDay=r=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(r):Sl(r)},this.startOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(r):kl(r)},this.startOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(r):YR(r)},this.startOfWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):Wi(r,this.options)},this.startOfYear=r=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(r):b2(r)},this.options={locale:Ox,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&jn.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:a}=this.options,i=n==null?void 0:n.code;if(i&&jn.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}jn.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Ar=new jn;class M2{constructor(t,n,r=Ar){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class s8{constructor(t,n){this.date=t,this.weeks=n}}class a8{constructor(t,n){this.days=n,this.weekNumber=t}}function i8(e){return Q.createElement("button",{...e})}function o8(e){return Q.createElement("span",{...e})}function l8(e){const{size:t=24,orientation:n="left",className:r}=e;return Q.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Q.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Q.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Q.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Q.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function c8(e){const{day:t,modifiers:n,...r}=e;return Q.createElement("td",{...r})}function d8(e){const{day:t,modifiers:n,...r}=e,a=Q.useRef(null);return Q.useEffect(()=>{var i;n.focused&&((i=a.current)==null||i.focus())},[n.focused]),Q.createElement("button",{ref:a,...r})}var ke;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(ke||(ke={}));var ht;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(ht||(ht={}));var Jn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Jn||(Jn={}));var mn;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(mn||(mn={}));function u8(e){const{options:t,className:n,components:r,classNames:a,...i}=e,o=[a[ke.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return Q.createElement("span",{"data-disabled":i.disabled,className:a[ke.DropdownRoot]},Q.createElement(r.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:h})=>Q.createElement(r.Option,{key:c,value:c,disabled:h},d))),Q.createElement("span",{className:a[ke.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,Q.createElement(r.Chevron,{orientation:"down",size:18,className:a[ke.Chevron]})))}function h8(e){return Q.createElement("div",{...e})}function f8(e){return Q.createElement("div",{...e})}function m8(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement("div",{...r},e.children)}function p8(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement("div",{...r})}function x8(e){return Q.createElement("table",{...e})}function g8(e){return Q.createElement("div",{...e})}const _2=m.createContext(void 0);function Bl(){const e=m.useContext(_2);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function v8(e){const{components:t}=Bl();return Q.createElement(t.Dropdown,{...e})}function w8(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Bl(),h=m.useCallback(f=>{a&&(n==null||n(f))},[a,n]),u=m.useCallback(f=>{r&&(t==null||t(f))},[r,t]);return Q.createElement("nav",{...i},Q.createElement(o.PreviousMonthButton,{type:"button",className:l[ke.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:u},Q.createElement(o.Chevron,{disabled:r?void 0:!0,className:l[ke.Chevron],orientation:"left"})),Q.createElement(o.NextMonthButton,{type:"button",className:l[ke.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":d(a),onClick:h},Q.createElement(o.Chevron,{disabled:a?void 0:!0,orientation:"right",className:l[ke.Chevron]})))}function y8(e){const{components:t}=Bl();return Q.createElement(t.Button,{...e})}function b8(e){return Q.createElement("option",{...e})}function N8(e){const{components:t}=Bl();return Q.createElement(t.Button,{...e})}function j8(e){const{rootRef:t,...n}=e;return Q.createElement("div",{...n,ref:t})}function k8(e){return Q.createElement("select",{...e})}function S8(e){const{week:t,...n}=e;return Q.createElement("tr",{...n})}function C8(e){return Q.createElement("th",{...e})}function E8(e){return Q.createElement("thead",{"aria-hidden":!0},Q.createElement("tr",{...e}))}function M8(e){const{week:t,...n}=e;return Q.createElement("th",{...n})}function _8(e){return Q.createElement("th",{...e})}function D8(e){return Q.createElement("tbody",{...e})}function T8(e){const{components:t}=Bl();return Q.createElement(t.Dropdown,{...e})}const P8=Object.freeze(Object.defineProperty({__proto__:null,Button:i8,CaptionLabel:o8,Chevron:l8,Day:c8,DayButton:d8,Dropdown:u8,DropdownNav:h8,Footer:f8,Month:m8,MonthCaption:p8,MonthGrid:x8,Months:g8,MonthsDropdown:v8,Nav:w8,NextMonthButton:y8,Option:b8,PreviousMonthButton:N8,Root:j8,Select:k8,Week:S8,WeekNumber:M8,WeekNumberHeader:_8,Weekday:C8,Weekdays:E8,Weeks:D8,YearsDropdown:T8},Symbol.toStringTag,{value:"Module"}));function Wr(e,t,n=!1,r=Ar){let{from:a,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=r;return a&&i?(o(i,a)<0&&([a,i]=[i,a]),o(t,a)>=(n?1:0)&&o(i,t)>=(n?1:0)):!n&&i?l(i,t):!n&&a?l(a,t):!1}function D2(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function zx(e){return!!(e&&typeof e=="object"&&"from"in e)}function T2(e){return!!(e&&typeof e=="object"&&"after"in e)}function P2(e){return!!(e&&typeof e=="object"&&"before"in e)}function A2(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function O2(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Hr(e,t,n=Ar){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:i,isAfter:o}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return a(e,l);if(O2(l,n))return l.includes(e);if(zx(l))return Wr(l,e,!1,n);if(A2(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(D2(l)){const c=i(l.before,e),d=i(l.after,e),h=c>0,u=d<0;return o(l.before,l.after)?u&&h:h||u}return T2(l)?i(e,l.after)>0:P2(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function A8(e,t,n,r,a){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:h}=t,{isSameDay:u,isSameMonth:f,startOfMonth:p,isBefore:w,endOfMonth:v,isAfter:b}=a,g=n&&p(n),y=r&&v(r),x={[ht.focused]:[],[ht.outside]:[],[ht.disabled]:[],[ht.hidden]:[],[ht.today]:[]},N={};for(const j of e){const{date:k,displayMonth:S}=j,M=!!(S&&!f(k,S)),A=!!(g&&w(k,g)),I=!!(y&&b(k,y)),U=!!(i&&Hr(k,i,a)),$=!!(o&&Hr(k,o,a))||A||I||!d&&!c&&M||d&&c===!1&&M,L=u(k,h??a.today());M&&x.outside.push(j),U&&x.disabled.push(j),$&&x.hidden.push(j),L&&x.today.push(j),l&&Object.keys(l).forEach(E=>{const O=l==null?void 0:l[E];O&&Hr(k,O,a)&&(N[E]?N[E].push(j):N[E]=[j])})}return j=>{const k={[ht.focused]:!1,[ht.disabled]:!1,[ht.hidden]:!1,[ht.outside]:!1,[ht.today]:!1},S={};for(const M in x){const A=x[M];k[M]=A.some(I=>I===j)}for(const M in N)S[M]=N[M].some(A=>A===j);return{...k,...S}}}function O8(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[i])=>(n[i]?a.push(n[i]):t[ht[i]]?a.push(t[ht[i]]):t[Jn[i]]&&a.push(t[Jn[i]]),a),[t[ke.Day]])}function z8(e){return{...P8,...e}}function $8(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function $x(){const e={};for(const t in ke)e[ke[t]]=`rdp-${ke[t]}`;for(const t in ht)e[ht[t]]=`rdp-${ht[t]}`;for(const t in Jn)e[Jn[t]]=`rdp-${Jn[t]}`;for(const t in mn)e[mn[t]]=`rdp-${mn[t]}`;return e}function z2(e,t,n){return(n??new jn(t)).formatMonthYear(e)}const R8=z2;function I8(e,t,n){return(n??new jn(t)).format(e,"d")}function L8(e,t=Ar){return t.format(e,"LLLL")}function F8(e,t,n){return(n??new jn(t)).format(e,"cccccc")}function U8(e,t=Ar){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function B8(){return""}function $2(e,t=Ar){return t.format(e,"yyyy")}const W8=$2,H8=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:z2,formatDay:I8,formatMonthCaption:R8,formatMonthDropdown:L8,formatWeekNumber:U8,formatWeekNumberHeader:B8,formatWeekdayName:F8,formatYearCaption:W8,formatYearDropdown:$2},Symbol.toStringTag,{value:"Module"}));function V8(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...H8,...e}}function Y8(e,t,n,r,a){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=a;return c({start:o(e),end:l(e)}).map(f=>{const p=r.formatMonthDropdown(f,a),w=d(f),v=t&&f<i(t)||n&&f>i(n)||!1;return{value:w,label:p,disabled:v}})}function X8(e,t={},n={}){let r={...t==null?void 0:t[ke.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n==null?void 0:n[a]}}),r}function q8(e,t,n){const r=e.today(),a=t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let o=0;o<7;o++){const l=e.addDays(a,o);i.push(l)}return i}function G8(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=r,d=i(e),h=o(t),u=l({start:d,end:h});return a&&u.reverse(),u.map(f=>{const p=n.formatYearDropdown(f,r);return{value:c(f),label:p,disabled:!1}})}function R2(e,t,n,r){let a=(r??new jn(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const K8=R2;function I2(e,t,n){return(n??new jn(t)).formatMonthYear(e)}const Q8=I2;function Z8(e,t,n,r){let a=(r??new jn(n)).format(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a}function J8(e){return"Choose the Month"}function eL(){return""}function tL(e){return"Go to the Next Month"}function nL(e){return"Go to the Previous Month"}function rL(e,t,n){return(n??new jn(t)).format(e,"cccc")}function sL(e,t){return`Week ${e}`}function aL(e){return"Week Number"}function iL(e){return"Choose the Year"}const oL=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Q8,labelDay:K8,labelDayButton:R2,labelGrid:I2,labelGridcell:Z8,labelMonthDropdown:J8,labelNav:eL,labelNext:tL,labelPrevious:nL,labelWeekNumber:sL,labelWeekNumberHeader:aL,labelWeekday:rL,labelYearDropdown:iL},Symbol.toStringTag,{value:"Module"})),Wl=e=>e instanceof HTMLElement?e:null,mf=e=>[...e.querySelectorAll("[data-animated-month]")??[]],lL=e=>Wl(e.querySelector("[data-animated-month]")),pf=e=>Wl(e.querySelector("[data-animated-caption]")),xf=e=>Wl(e.querySelector("[data-animated-weeks]")),cL=e=>Wl(e.querySelector("[data-animated-nav]")),dL=e=>Wl(e.querySelector("[data-animated-weekdays]"));function uL(e,t,{classNames:n,months:r,focused:a,dateLib:i}){const o=m.useRef(null),l=m.useRef(r),c=m.useRef(!1);m.useLayoutEffect(()=>{const d=l.current;if(l.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const h=i.isSameMonth(r[0].date,d[0].date),u=i.isAfter(r[0].date,d[0].date),f=u?n[mn.caption_after_enter]:n[mn.caption_before_enter],p=u?n[mn.weeks_after_enter]:n[mn.weeks_before_enter],w=o.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(mf(v).forEach(x=>{if(!(x instanceof HTMLElement))return;const N=lL(x);N&&x.contains(N)&&x.removeChild(N);const j=pf(x);j&&j.classList.remove(f);const k=xf(x);k&&k.classList.remove(p)}),o.current=v):o.current=null,c.current||h||a)return;const b=w instanceof HTMLElement?mf(w):[],g=mf(e.current);if(g!=null&&g.every(y=>y instanceof HTMLElement)&&b&&b.every(y=>y instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const y=cL(e.current);y&&(y.style.zIndex="1"),g.forEach((x,N)=>{const j=b[N];if(!j)return;x.style.position="relative",x.style.overflow="hidden";const k=pf(x);k&&k.classList.add(f);const S=xf(x);S&&S.classList.add(p);const M=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),y&&(y.style.zIndex=""),k&&k.classList.remove(f),S&&S.classList.remove(p),x.style.position="",x.style.overflow="",x.contains(j)&&x.removeChild(j)};j.style.pointerEvents="none",j.style.position="absolute",j.style.overflow="hidden",j.setAttribute("aria-hidden","true");const A=dL(j);A&&(A.style.opacity="0");const I=pf(j);I&&(I.classList.add(u?n[mn.caption_before_exit]:n[mn.caption_after_exit]),I.addEventListener("animationend",M));const U=xf(j);U&&U.classList.add(u?n[mn.weeks_before_exit]:n[mn.weeks_after_exit]),x.insertBefore(j,x.firstChild)})}})}function hL(e,t,n,r){const a=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:h,differenceInCalendarMonths:u,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:w,endOfWeek:v,isAfter:b,startOfBroadcastWeek:g,startOfISOWeek:y,startOfWeek:x}=r,N=c?g(a,r):o?y(a):x(a),j=c?f(i):o?p(w(i)):v(w(i)),k=h(j,N),S=u(i,a)+1,M=[];for(let U=0;U<=k;U++){const $=d(N,U);if(t&&b($,t))break;M.push($)}const I=(c?35:42)*S;if(l&&M.length<I){const U=I-M.length;for(let $=0;$<U;$++){const L=d(M[M.length-1],1);M.push(L)}}return M}function fL(e){const t=[];return e.reduce((n,r)=>{const a=r.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function mL(e,t,n,r){const{numberOfMonths:a=1}=n,i=[];for(let o=0;o<a;o++){const l=r.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function ow(e,t,n,r){const{month:a,defaultMonth:i,today:o=r.today(),numberOfMonths:l=1}=e;let c=a||i||o;const{differenceInCalendarMonths:d,addMonths:h,startOfMonth:u}=r;if(n&&d(n,c)<l-1){const f=-1*(l-1);c=h(n,f)}return t&&d(c,t)<0&&(c=t),u(c)}function pL(e,t,n,r){const{addDays:a,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:h,startOfBroadcastWeek:u,startOfISOWeek:f,startOfWeek:p}=r,w=e.reduce((v,b)=>{const g=n.broadcastCalendar?u(b,r):n.ISOWeek?f(b):p(b),y=n.broadcastCalendar?i(b):n.ISOWeek?o(l(b)):c(l(b)),x=t.filter(S=>S>=g&&S<=y),N=n.broadcastCalendar?35:42;if(n.fixedWeeks&&x.length<N){const S=t.filter(M=>{const A=N-x.length;return M>y&&M<=a(y,A)});x.push(...S)}const j=x.reduce((S,M)=>{const A=n.ISOWeek?d(M):h(M),I=S.find($=>$.weekNumber===A),U=new M2(M,b,r);return I?I.days.push(U):S.push(new a8(A,[U])),S},[]),k=new s8(b,j);return v.push(k),v},[]);return n.reverseMonths?w.reverse():w}function xL(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:d,newDate:h,today:u}=t,{fromYear:f,toYear:p,fromMonth:w,toMonth:v}=e;!n&&w&&(n=w),!n&&f&&(n=t.newDate(f,0,1)),!r&&v&&(r=v),!r&&p&&(r=h(p,11,31));const b=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=o(n):f?n=h(f,0,1):!n&&b&&(n=a(c(e.today??u(),-100))),r?r=l(r):p?r=h(p,11,31):!r&&b&&(r=d(e.today??u())),[n&&i(n),r&&i(r)]}function gL(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i=1}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=r,d=a?i:1,h=o(e);if(!t)return l(h,d);if(!(c(t,e)<i))return l(h,d)}function vL(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=r,d=a?i??1:1,h=o(e);if(!t)return l(h,-d);if(!(c(h,t)<=0))return l(h,-d)}function wL(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Zu(e,t){const[n,r]=m.useState(e);return[t===void 0?n:t,r]}function yL(e,t){const[n,r]=xL(e,t),{startOfMonth:a,endOfMonth:i}=t,o=ow(e,n,r,t),[l,c]=Zu(o,e.month?o:void 0);m.useEffect(()=>{const k=ow(e,n,r,t);c(k)},[e.timeZone]);const d=mL(l,r,e,t),h=hL(d,e.endMonth?i(e.endMonth):void 0,e,t),u=pL(d,h,e,t),f=wL(u),p=fL(u),w=vL(l,n,e,t),v=gL(l,r,e,t),{disableNavigation:b,onMonthChange:g}=e,y=k=>f.some(S=>S.days.some(M=>M.isEqualTo(k))),x=k=>{if(b)return;let S=a(k);n&&S<a(n)&&(S=a(n)),r&&S>a(r)&&(S=a(r)),c(S),g==null||g(S)};return{months:u,weeks:f,days:p,navStart:n,navEnd:r,previousMonth:w,nextMonth:v,goToMonth:x,goToDay:k=>{y(k)||x(k.date)}}}var mr;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(mr||(mr={}));function lw(e){return!e[ht.disabled]&&!e[ht.hidden]&&!e[ht.outside]}function bL(e,t,n,r){let a,i=-1;for(const o of e){const l=t(o);lw(l)&&(l[ht.focused]&&i<mr.FocusedModifier?(a=o,i=mr.FocusedModifier):r!=null&&r.isEqualTo(o)&&i<mr.LastFocused?(a=o,i=mr.LastFocused):n(o.date)&&i<mr.Selected?(a=o,i=mr.Selected):l[ht.today]&&i<mr.Today&&(a=o,i=mr.Today))}return a||(a=e.find(o=>lw(t(o)))),a}function NL(e,t,n,r,a,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:h,addWeeks:u,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:w,endOfWeek:v,max:b,min:g,startOfBroadcastWeek:y,startOfISOWeek:x,startOfWeek:N}=o;let k={day:d,week:u,month:h,year:f,startOfWeek:S=>c?y(S,o):l?x(S):N(S),endOfWeek:S=>c?p(S):l?w(S):v(S)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=b([r,k]):t==="after"&&a&&(k=g([a,k])),k}function L2(e,t,n,r,a,i,o,l=0){if(l>365)return;const c=NL(e,t,n.date,r,a,i,o),d=!!(i.disabled&&Hr(c,i.disabled,o)),h=!!(i.hidden&&Hr(c,i.hidden,o)),u=c,f=new M2(c,u,o);return!d&&!h?f:L2(e,t,f,r,a,i,o,l+1)}function jL(e,t,n,r,a){const{autoFocus:i}=e,[o,l]=m.useState(),c=bL(t.days,n,r||(()=>!1),o),[d,h]=m.useState(i?c:void 0);return{isFocusTarget:v=>!!(c!=null&&c.isEqualTo(v)),setFocused:h,focused:d,blur:()=>{l(d),h(void 0)},moveFocus:(v,b)=>{if(!d)return;const g=L2(v,b,d,t.navStart,t.navEnd,e,a);g&&(e.disableNavigation&&!t.days.some(x=>x.isEqualTo(g))||(t.goToDay(g),h(g)))}}}function kL(e,t){const{selected:n,required:r,onSelect:a}=e,[i,o]=Zu(n,a?n:void 0),l=a?n:i,{isSameDay:c}=t,d=p=>(l==null?void 0:l.some(w=>c(w,p)))??!1,{min:h,max:u}=e;return{selected:l,select:(p,w,v)=>{let b=[...l??[]];if(d(p)){if((l==null?void 0:l.length)===h||r&&(l==null?void 0:l.length)===1)return;b=l==null?void 0:l.filter(g=>!c(g,p))}else(l==null?void 0:l.length)===u?b=[p]:b=[...b,p];return a||o(b),a==null||a(b,p,w,v),b},isSelected:d}}function SL(e,t,n=0,r=0,a=!1,i=Ar){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:d,isBefore:h}=i;let u;if(!o&&!l)u={from:e,to:n>0?void 0:e};else if(o&&!l)c(o,e)?n===0?u={from:o,to:e}:a?u={from:o,to:void 0}:u=void 0:h(e,o)?u={from:e,to:o}:u={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))a?u={from:o,to:l}:u=void 0;else if(c(o,e))u={from:o,to:n>0?void 0:e};else if(c(l,e))u={from:e,to:n>0?void 0:e};else if(h(e,o))u={from:e,to:l};else if(d(e,o))u={from:o,to:e};else if(d(e,l))u={from:o,to:e};else throw new Error("Invalid range");if(u!=null&&u.from&&(u!=null&&u.to)){const f=i.differenceInCalendarDays(u.to,u.from);r>0&&f>r?u={from:e,to:void 0}:n>1&&f<n&&(u={from:e,to:void 0})}return u}function CL(e,t,n=Ar){const r=Array.isArray(t)?t:[t];let a=e.from;const i=n.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function cw(e,t,n=Ar){return Wr(e,t.from,!1,n)||Wr(e,t.to,!1,n)||Wr(t,e.from,!1,n)||Wr(t,e.to,!1,n)}function EL(e,t,n=Ar){const r=Array.isArray(t)?t:[t];if(r.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?Wr(e,l,!1,n):O2(l,n)?l.some(c=>Wr(e,c,!1,n)):zx(l)?l.from&&l.to?cw(e,{from:l.from,to:l.to},n):!1:A2(l)?CL(e,l.dayOfWeek,n):D2(l)?n.isAfter(l.before,l.after)?cw(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Hr(e.from,l,n)||Hr(e.to,l,n):T2(l)||P2(l)?Hr(e.from,l,n)||Hr(e.to,l,n):!1))return!0;const o=r.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(o.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function ML(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:i,onSelect:o}=e,[l,c]=Zu(a,o?a:void 0),d=o?a:l;return{selected:d,select:(f,p,w)=>{const{min:v,max:b}=e,g=f?SL(f,d,v,b,i,t):void 0;return r&&n&&(g!=null&&g.from)&&g.to&&EL({from:g.from,to:g.to},n,t)&&(g.from=f,g.to=void 0),o||c(g),o==null||o(g,f,p,w),g},isSelected:f=>d&&Wr(d,f,!1,t)}}function _L(e,t){const{selected:n,required:r,onSelect:a}=e,[i,o]=Zu(n,a?n:void 0),l=a?n:i,{isSameDay:c}=t;return{selected:l,select:(u,f,p)=>{let w=u;return!r&&l&&l&&c(u,l)&&(w=void 0),a||o(w),a==null||a(w,u,f,p),w},isSelected:u=>l?c(l,u):!1}}function DL(e,t){const n=_L(e,t),r=kL(e,t),a=ML(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function TL(e){var Se;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new Vt(t.today,t.timeZone)),t.month&&(t.month=new Vt(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new Vt(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new Vt(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new Vt(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new Vt(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(Se=t.selected)==null?void 0:Se.map(ue=>new Vt(ue,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new Vt(t.selected.from,t.timeZone):void 0,to:t.selected.to?new Vt(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:i,locale:o,classNames:l}=m.useMemo(()=>{const ue={...Ox,...t.locale};return{dateLib:new jn({locale:ue,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:z8(t.components),formatters:V8(t.formatters),labels:{...oL,...t.labels},locale:ue,classNames:{...$x(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:d,navLayout:h,numberOfMonths:u=1,onDayBlur:f,onDayClick:p,onDayFocus:w,onDayKeyDown:v,onDayMouseEnter:b,onDayMouseLeave:g,onNextClick:y,onPrevClick:x,showWeekNumber:N,styles:j}=t,{formatCaption:k,formatDay:S,formatMonthDropdown:M,formatWeekNumber:A,formatWeekNumberHeader:I,formatWeekdayName:U,formatYearDropdown:$}=r,L=yL(t,i),{days:E,months:O,navStart:D,navEnd:T,previousMonth:C,nextMonth:_,goToMonth:z}=L,H=A8(E,t,D,T,i),{isSelected:P,select:B,selected:q}=DL(t,i)??{},{blur:G,focused:se,isFocusTarget:re,moveFocus:Z,setFocused:R}=jL(t,L,H,P??(()=>!1),i),{labelDayButton:ee,labelGridcell:J,labelGrid:F,labelMonthDropdown:K,labelNav:ne,labelPrevious:ce,labelNext:ge,labelWeekday:ve,labelWeekNumber:Ae,labelWeekNumberHeader:Te,labelYearDropdown:tt}=a,ut=m.useMemo(()=>q8(i,t.ISOWeek),[i,t.ISOWeek]),Le=d!==void 0||p!==void 0,Oe=m.useCallback(()=>{C&&(z(C),x==null||x(C))},[C,z,x]),Ge=m.useCallback(()=>{_&&(z(_),y==null||y(_))},[z,_,y]),Je=m.useCallback((ue,Pe)=>_e=>{_e.preventDefault(),_e.stopPropagation(),R(ue),B==null||B(ue.date,Pe,_e),p==null||p(ue.date,Pe,_e)},[B,p,R]),ot=m.useCallback((ue,Pe)=>_e=>{R(ue),w==null||w(ue.date,Pe,_e)},[w,R]),Ot=m.useCallback((ue,Pe)=>_e=>{G(),f==null||f(ue.date,Pe,_e)},[G,f]),zt=m.useCallback((ue,Pe)=>_e=>{const Fe={ArrowLeft:[_e.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[_e.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[_e.shiftKey?"year":"week","after"],ArrowUp:[_e.shiftKey?"year":"week","before"],PageUp:[_e.shiftKey?"year":"month","before"],PageDown:[_e.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Fe[_e.key]){_e.preventDefault(),_e.stopPropagation();const[bt,he]=Fe[_e.key];Z(bt,he)}v==null||v(ue.date,Pe,_e)},[Z,v,t.dir]),ae=m.useCallback((ue,Pe)=>_e=>{b==null||b(ue.date,Pe,_e)},[b]),me=m.useCallback((ue,Pe)=>_e=>{g==null||g(ue.date,Pe,_e)},[g]),ze=m.useCallback(ue=>Pe=>{const _e=Number(Pe.target.value),Fe=i.setMonth(i.startOfMonth(ue),_e);z(Fe)},[i,z]),X=m.useCallback(ue=>Pe=>{const _e=Number(Pe.target.value),Fe=i.setYear(i.startOfMonth(ue),_e);z(Fe)},[i,z]),{className:le,style:W}=m.useMemo(()=>({className:[l[ke.Root],t.className].filter(Boolean).join(" "),style:{...j==null?void 0:j[ke.Root],...t.style}}),[l,t.className,t.style,j]),te=$8(t),de=m.useRef(null);uL(de,!!t.animate,{classNames:l,months:O,focused:se,dateLib:i});const Ne={dayPickerProps:t,selected:q,select:B,isSelected:P,months:O,nextMonth:_,previousMonth:C,goToMonth:z,getModifiers:H,components:n,classNames:l,styles:j,labels:a,formatters:r};return Q.createElement(_2.Provider,{value:Ne},Q.createElement(n.Root,{rootRef:t.animate?de:void 0,className:le,style:W,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...te},Q.createElement(n.Months,{className:l[ke.Months],style:j==null?void 0:j[ke.Months]},!t.hideNavigation&&!h&&Q.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ke.Nav],style:j==null?void 0:j[ke.Nav],"aria-label":ne(),onPreviousClick:Oe,onNextClick:Ge,previousMonth:C,nextMonth:_}),O.map((ue,Pe)=>Q.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[ke.Month],style:j==null?void 0:j[ke.Month],key:Pe,displayIndex:Pe,calendarMonth:ue},h==="around"&&!t.hideNavigation&&Pe===0&&Q.createElement(n.PreviousMonthButton,{type:"button",className:l[ke.PreviousMonthButton],tabIndex:C?void 0:-1,"aria-disabled":C?void 0:!0,"aria-label":ce(C),onClick:Oe,"data-animated-button":t.animate?"true":void 0},Q.createElement(n.Chevron,{disabled:C?void 0:!0,className:l[ke.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Q.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[ke.MonthCaption],style:j==null?void 0:j[ke.MonthCaption],calendarMonth:ue,displayIndex:Pe},c!=null&&c.startsWith("dropdown")?Q.createElement(n.DropdownNav,{className:l[ke.Dropdowns],style:j==null?void 0:j[ke.Dropdowns]},(()=>{const _e=c==="dropdown"||c==="dropdown-months"?Q.createElement(n.MonthsDropdown,{key:"month",className:l[ke.MonthsDropdown],"aria-label":K(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:ze(ue.date),options:Y8(ue.date,D,T,r,i),style:j==null?void 0:j[ke.Dropdown],value:i.getMonth(ue.date)}):Q.createElement("span",{key:"month"},M(ue.date,i)),Fe=c==="dropdown"||c==="dropdown-years"?Q.createElement(n.YearsDropdown,{key:"year",className:l[ke.YearsDropdown],"aria-label":tt(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:X(ue.date),options:G8(D,T,r,i,!!t.reverseYears),style:j==null?void 0:j[ke.Dropdown],value:i.getYear(ue.date)}):Q.createElement("span",{key:"year"},$(ue.date,i));return i.getMonthYearOrder()==="year-first"?[Fe,_e]:[_e,Fe]})(),Q.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(ue.date,i.options,i))):Q.createElement(n.CaptionLabel,{className:l[ke.CaptionLabel],role:"status","aria-live":"polite"},k(ue.date,i.options,i))),h==="around"&&!t.hideNavigation&&Pe===u-1&&Q.createElement(n.NextMonthButton,{type:"button",className:l[ke.NextMonthButton],tabIndex:_?void 0:-1,"aria-disabled":_?void 0:!0,"aria-label":ge(_),onClick:Ge,"data-animated-button":t.animate?"true":void 0},Q.createElement(n.Chevron,{disabled:_?void 0:!0,className:l[ke.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Pe===u-1&&h==="after"&&!t.hideNavigation&&Q.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ke.Nav],style:j==null?void 0:j[ke.Nav],"aria-label":ne(),onPreviousClick:Oe,onNextClick:Ge,previousMonth:C,nextMonth:_}),Q.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":F(ue.date,i.options,i)||void 0,className:l[ke.MonthGrid],style:j==null?void 0:j[ke.MonthGrid]},!t.hideWeekdays&&Q.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[ke.Weekdays],style:j==null?void 0:j[ke.Weekdays]},N&&Q.createElement(n.WeekNumberHeader,{"aria-label":Te(i.options),className:l[ke.WeekNumberHeader],style:j==null?void 0:j[ke.WeekNumberHeader],scope:"col"},I()),ut.map(_e=>Q.createElement(n.Weekday,{"aria-label":ve(_e,i.options,i),className:l[ke.Weekday],key:String(_e),style:j==null?void 0:j[ke.Weekday],scope:"col"},U(_e,i.options,i)))),Q.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[ke.Weeks],style:j==null?void 0:j[ke.Weeks]},ue.weeks.map(_e=>Q.createElement(n.Week,{className:l[ke.Week],key:_e.weekNumber,style:j==null?void 0:j[ke.Week],week:_e},N&&Q.createElement(n.WeekNumber,{week:_e,style:j==null?void 0:j[ke.WeekNumber],"aria-label":Ae(_e.weekNumber,{locale:o}),className:l[ke.WeekNumber],scope:"row",role:"rowheader"},A(_e.weekNumber,i)),_e.days.map(Fe=>{const{date:bt}=Fe,he=H(Fe);if(he[ht.focused]=!he.hidden&&!!(se!=null&&se.isEqualTo(Fe)),he[Jn.selected]=(P==null?void 0:P(bt))||he.selected,zx(q)){const{from:En,to:Qe}=q;he[Jn.range_start]=!!(En&&Qe&&i.isSameDay(bt,En)),he[Jn.range_end]=!!(En&&Qe&&i.isSameDay(bt,Qe)),he[Jn.range_middle]=Wr(q,bt,!0,i)}const Ve=X8(he,j,t.modifiersStyles),vt=O8(he,l,t.modifiersClassNames),Nt=!Le&&!he.hidden?J(bt,he,i.options,i):void 0;return Q.createElement(n.Day,{key:`${i.format(bt,"yyyy-MM-dd")}_${i.format(Fe.displayMonth,"yyyy-MM")}`,day:Fe,modifiers:he,className:vt.join(" "),style:Ve,role:"gridcell","aria-selected":he.selected||void 0,"aria-label":Nt,"data-day":i.format(bt,"yyyy-MM-dd"),"data-month":Fe.outside?i.format(bt,"yyyy-MM"):void 0,"data-selected":he.selected||void 0,"data-disabled":he.disabled||void 0,"data-hidden":he.hidden||void 0,"data-outside":Fe.outside||void 0,"data-focused":he.focused||void 0,"data-today":he.today||void 0},!he.hidden&&Le?Q.createElement(n.DayButton,{className:l[ke.DayButton],style:j==null?void 0:j[ke.DayButton],type:"button",day:Fe,modifiers:he,disabled:he.disabled||void 0,tabIndex:re(Fe)?0:-1,"aria-label":ee(bt,he,i.options,i),onClick:Je(Fe,he),onBlur:Ot(Fe,he),onFocus:ot(Fe,he),onKeyDown:zt(Fe,he),onMouseEnter:ae(Fe,he),onMouseLeave:me(Fe,he)},S(bt,i.options,i)):!he.hidden&&S(Fe.date,i.options,i))})))))))),t.footer&&Q.createElement(n.Footer,{className:l[ke.Footer],style:j==null?void 0:j[ke.Footer],role:"status","aria-live":"polite"},t.footer)))}function On({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:o,...l}){const c=$x();return s.jsx(TL,{showOutsideDays:n,className:De("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:De("w-fit",c.root),months:De("relative flex flex-col gap-4 md:flex-row",c.months),month:De("flex w-full flex-col gap-4",c.month),nav:De("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:De(Hm({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:De(Hm({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:De("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:De("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:De("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:De("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:De("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:De("flex",c.weekdays),weekday:De("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:De("mt-2 flex w-full",c.week),week_number_header:De("w-[--cell-size] select-none",c.week_number_header),week_number:De("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:De("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:De("bg-accent rounded-l-md",c.range_start),range_middle:De("rounded-none",c.range_middle),range_end:De("bg-accent rounded-r-md",c.range_end),today:De("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:De("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:De("text-muted-foreground opacity-50",c.disabled),hidden:De("invisible",c.hidden),...t},components:{Root:({className:d,rootRef:h,...u})=>s.jsx("div",{"data-slot":"calendar",ref:h,className:De(d),...u}),Chevron:({className:d,orientation:h,...u})=>h==="left"?s.jsx(FN,{className:De("size-4",d),...u}):h==="right"?s.jsx(hx,{className:De("size-4",d),...u}):s.jsx(zu,{className:De("size-4",d),...u}),DayButton:PL,WeekNumber:({children:d,...h})=>s.jsx("td",{...h,children:s.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:d})}),...o},...l})}function PL({className:e,day:t,modifiers:n,...r}){const a=$x(),i=m.useRef(null);return m.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),s.jsx(Y,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:De("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",a.day,e),...r})}var Ju="Popover",[F2]=$u(Ju,[Wu]),Hl=Wu(),[AL,Xs]=F2(Ju),U2=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=Hl(t),c=m.useRef(null),[d,h]=m.useState(!1),[u,f]=Cx({prop:r,defaultProp:a??!1,onChange:i,caller:Ju});return s.jsx(wj,{...l,children:s.jsx(AL,{scope:t,contentId:nr(),triggerRef:c,open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};U2.displayName=Ju;var B2="PopoverAnchor",OL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(B2,n),i=Hl(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return m.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(kx,{...i,...r,ref:t})});OL.displayName=B2;var W2="PopoverTrigger",H2=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(W2,n),i=Hl(n),o=Cn(t,a.triggerRef),l=s.jsx(dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":G2(a.open),...r,ref:o,onClick:_t(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:s.jsx(kx,{asChild:!0,...i,children:l})});H2.displayName=W2;var Rx="PopoverPortal",[zL,$L]=F2(Rx,{forceMount:void 0}),V2=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Xs(Rx,t);return s.jsx(zL,{scope:t,forceMount:n,children:s.jsx(Ia,{present:n||i.open,children:s.jsx(Sx,{asChild:!0,container:a,children:r})})})};V2.displayName=Rx;var Hi="PopoverContent",Y2=m.forwardRef((e,t)=>{const n=$L(Hi,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Xs(Hi,e.__scopePopover);return s.jsx(Ia,{present:r||i.open,children:i.modal?s.jsx(IL,{...a,ref:t}):s.jsx(LL,{...a,ref:t})})});Y2.displayName=Hi;var RL=Ru("PopoverContent.RemoveScroll"),IL=m.forwardRef((e,t)=>{const n=Xs(Hi,e.__scopePopover),r=m.useRef(null),a=Cn(t,r),i=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return Wj(o)},[]),s.jsx(_x,{as:RL,allowPinchZoom:!0,children:s.jsx(X2,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_t(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_t(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:_t(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),LL=m.forwardRef((e,t)=>{const n=Xs(Hi,e.__scopePopover),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(X2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),X2=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,...u}=e,f=Xs(Hi,n),p=Hl(n);return Oj(),s.jsx(Mx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Iu,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:s.jsx(yj,{"data-state":G2(f.open),role:"dialog",id:f.contentId,...p,...u,ref:t,style:{...u.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)"}})})})}),q2="PopoverClose",FL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(q2,n);return s.jsx(dt.button,{type:"button",...r,ref:t,onClick:_t(e.onClick,()=>a.onOpenChange(!1))})});FL.displayName=q2;var UL="PopoverArrow",BL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Hl(n);return s.jsx(bj,{...a,...r,ref:t})});BL.displayName=UL;function G2(e){return e?"open":"closed"}var WL=U2,HL=H2,VL=V2,K2=Y2;const zn=WL,$n=HL,pn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},a)=>s.jsx(VL,{children:s.jsx(K2,{ref:a,align:t,sideOffset:n,className:De("z-50 w-auto p-0 rounded-lg border border-white/20 bg-black text-white shadow-lg 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",e),...r})}));pn.displayName=K2.displayName;const dw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M20 3H2v14h8v2H8v2h8v-2h-2v-2h8V3h-2zm-6 12H4V5h16v10h-6z",fill:"currentColor"})}),zc=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M7 8H5v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2V8h-2v2h-2v2h-2v2h-2v-2H9v-2H7V8z",fill:"currentColor"})}),YL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})}),Yn=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2h2v2h4v18H3V4h4V2h2v2h6V2zM9 6H5v2h14V6H9zm-4 4v10h14V10H5zm2 2h8v2H7v-2zm4 6v-2H7v2h4z",fill:"currentColor"})}),XL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M2 2h14v4h6v16H2V2zm18 6h-4v2h2v2h-2v2h2v2h-2v2h2v2h2V8zm-6-4H4v16h2v-2h6v2h2V4zM6 6h2v2H6V6zm6 0h-2v2h2V6zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2z",fill:"currentColor"})}),qL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z",fill:"currentColor"})}),ws=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z",fill:"currentColor"})}),GL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M3 3h18v18H3V3zm16 2H5v14h14V5zM7 12h2v5H7v-5zm10-5h-2v10h2V7zm-6 3h2v2h-2v-2zm2 4h-2v3h2v-3z",fill:"currentColor"})}),Ir=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M22 4H2v16h20V4zM4 18V6h16v12H4zM8 8H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8V8z",fill:"currentColor"})}),Q2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M6 2h8v2H6V2zM4 6V4h2v2H4zm0 8H2V6h2v8zm2 2H4v-2h2v2zm8 0v2H6v-2h8zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm0-8h2v8h-2V6zm0 0V4h-2v2h2z",fill:"currentColor"})}),$c=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h12v2H6v4h12v-4h2v6H4v-6z",fill:"currentColor"})}),Ze=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M11 0H5v2H3v6h2v2h6V8H5V2h6V0zm0 2h2v6h-2V2zM0 14h2v4h12v2H0v-6zm2 0h12v-2H2v2zm14 0h-2v6h2v-6zM15 0h4v2h-4V0zm4 8h-4v2h4V8zm0-6h2v6h-2V2zm5 12h-2v4h-4v2h6v-6zm-6-2h4v2h-4v-2z",fill:"currentColor"})}),Kt=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M5 5h2v2H5V5zm4 4H7V7h2v2zm2 2H9V9h2v2zm2 0h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm2-2v2h-2V9h2zm2-2v2h-2V7h2zm0 0V5h2v2h-2z",fill:"currentColor"})}),Z2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2h-2v2h2v2h-2v2h-2v2H9V8H7V6H5V4H3v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2V8h2V6h2V4h-2v2h-2v2h-2v2h-2V6h2V4h2V2zm-2 12h2v2h-2v-2zm-2-2h2v2h-2v-2zm-2-2h2v2H9v-2zm-2-2h2v2H7v-2zm8 6h2v2h-2v-2zm2-2h2v2h-2v-2zm2-2h2v2h-2v-2zm2-2h-2v-2h2v2z",fill:"currentColor"})}),Vr=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M2 4h20v4H2V4zm18 2v2H4V6h16zm0 6H2v4h18v-4zm-2 2v2H4v-2h14zM2 16h20v4H2v-4zm18 2v2H4v-2h16z",fill:"currentColor"})}),KL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 4c2.21 0 4 1.79 4 4s-1.79 4-4 4-4-1.79-4-4 1.79-4 4-4zm0 6c1.38 0 2.5-1.12 2.5-2.5S13.38 11.5 12 11.5 9.5 12.62 9.5 14 10.62 16.5 12 16.5z",fill:"currentColor"})}),uw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm10-4h-2v2h2v-2z",fill:"currentColor"})}),Vo=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm12-6h-2v2h2v2h2v-2h-2v-2z",fill:"currentColor"})}),gf=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-1.57.46-3.03 1.24-4.26L16.26 18.76C15.03 19.54 13.57 20 12 20zm6.76-3.74L7.74 5.24C8.97 4.46 10.43 4 12 4c4.41 0 8 3.59 8 8 0 1.57-.46 3.03-1.24 4.26z",fill:"currentColor"})}),ca=e=>s.jsx(Sr,{...e,className:"w-4 h-4"}),QL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M6 2h12v2H6V2zm0 2v16h12V4H6zm8 2H10v2h4V6zm-4 4h4v8h-4v-8z",fill:"currentColor"})}),ZL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M8 4h2v4h4V4h2v4h4v2h-4v4h4v2h-4v4h-2v-4H8v4H6v-4H2v-2h4V8H2V6h4V4zm2 6v4h4v-4h-4z",fill:"currentColor"})}),Ln=({className:e="",size:t=24})=>s.jsx(XL,{className:e,size:t}),hw=({className:e="",size:t=24})=>s.jsx(GL,{className:e,size:t}),Ym=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M4 2h12v2H4v12H2V2h2zm4 4h12v16H8V6zm2 2v12h8V8h-8z",fill:"currentColor"})}),J2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4H8v2H6v2h2v2h2v-2h2V8h-2V6zm6 0h-2v2h2V6zm2 0h2v2h-2V6zm-6 8h-2v-2h2v2zm-4 0H6v-2h2v2zm-4 0H2v-2h2v2zm8 4h-2v-2h2v2zm4 0h2v-2h-2v2zm-6 2h2v2h-2v-2zm4 0h2v2h-2v-2z",fill:"currentColor"})}),JL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4h6v2h-2v6h-2V8H8V6zm-4 8h12v2H4v-2zm0 4h12v2H4v-2z",fill:"currentColor"})}),od=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M10 2h4v2h6v2h-2v14H6V6H4V4h6V2zM8 6v14h8V6H8zm2 2h2v10h-2V8zm4 0h2v10h-2V8z",fill:"currentColor"})}),fw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M2 4h20v2H2V4zm0 4h18v2H2V8zm0 4h16v2H2v-2zm0 4h14v2H2v-2z",fill:"currentColor"})}),Ix=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-5l6-6-1.41-1.41L11 12.17l-2.59-2.58L7 10.59l4 4z",fill:"currentColor"})}),mw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 1h2v8h8v4h-2v-2h-8V5h-2V1zM8 7V5h2v2H8zM6 9V7h2v2H6zm-2 2V9h2v2H4zm10 8v2h-2v2h-2v-8H2v-4h2v2h8v6h2zm2-2v2h-2v-2h2zm2-2v2h-2v-2h2zm0 0h2v-2h-2v2z",fill:"currentColor"})}),$s=(e,t,n)=>{const r=document.createElement(e),[a,i]=Array.isArray(t)?[void 0,t]:[t,n];return a&&Object.assign(r,a),i==null||i.forEach(o=>r.appendChild(o)),r},eF=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},tF=e=>e.offsetWidth>0&&e.offsetHeight>0,nF=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function rF(e,t,{reverse:n=!1}={}){const r=e.length;for(let a=n?r-1:0;n?a>=0:a<r;n?a--:a++)t(e[a],a)}function sF(e,t,n,r){const a=t.formatToParts(e);n&&a.unshift({type:"prefix",value:n}),r&&a.push({type:"suffix",value:r});const i=[],o=[],l=[],c=[],d={},h=v=>`${v}:${d[v]=(d[v]??-1)+1}`;let u="",f=!1,p=!1;for(const v of a){u+=v.value;const b=v.type==="minusSign"||v.type==="plusSign"?"sign":v.type;b==="integer"?(f=!0,o.push(...v.value.split("").map(g=>({type:b,value:parseInt(g)})))):b==="group"?o.push({type:b,value:v.value}):b==="decimal"?(p=!0,l.push({type:b,value:v.value,key:h(b)})):b==="fraction"?l.push(...v.value.split("").map(g=>({type:b,value:parseInt(g),key:h(b),pos:-1-d[b]}))):(f||p?c:i).push({type:b,value:v.value,key:h(b)})}const w=[];for(let v=o.length-1;v>=0;v--){const b=o[v];w.unshift(b.type==="integer"?{...b,key:h(b.type),pos:d[b.type]}:{...b,key:h(b.type)})}return{pre:i,integer:w,fraction:l,post:c,valueAsString:u,value:typeof e=="string"?parseFloat(e):e}}const aF=String.raw,iF=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),oF=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),pw=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,nu="--_number-flow-d-opacity",Lx="--_number-flow-d-width",ru="--_number-flow-dx",Fx="--_number-flow-d",lF=(()=>{try{return CSS.registerProperty({name:nu,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:ru,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:Lx,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Fx,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),cF="var(--number-flow-char-height, 1em)",xs="var(--number-flow-mask-height, 0.25em)",xw=`calc(${xs} / 2)`,Xm="var(--number-flow-mask-width, 0.5em)",Qs=`calc(${Xm} / var(--scale-x))`,Rc="#000 0, transparent 71%",gw=aF`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${cF} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${Lx}) / var(--width));transform:translateX(var(${ru})) scaleX(var(--scale-x));margin:0 calc(-1 * ${Xm});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${Qs},#000 calc(100% - ${Qs}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${xs},#000 calc(100% - ${xs}),transparent 100% ),radial-gradient(at bottom right,${Rc}),radial-gradient(at bottom left,${Rc}),radial-gradient(at top left,${Rc}),radial-gradient(at top right,${Rc});-webkit-mask-size:100% calc(100% - ${xs} * 2),calc(100% - ${Qs} * 2) 100%,${Qs} ${xs},${Qs} ${xs},${Qs} ${xs},${Qs} ${xs};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${xw} ${Xm};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${ru})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${Fx})}.digit__num,.number .section::after{padding:${xw} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${nu}))}`,dF=HTMLElement,uF=oF&&iF&&lF;let Ic;class ek extends dF{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(r=>r.finish()))}set data(t){var n;if(t==null)return;const{pre:r,integer:a,fraction:i,post:o,value:l}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,l):this.trend,this.computedAnimated=uF&&this._animated&&(!this.respectMotionPreference||!(pw!=null&&pw.matches))&&tF(this),(n=this.plugins)==null||n.forEach(d=>{var h;return(h=d.onUpdate)==null?void 0:h.call(d,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(r),this._num.update({integer:a,fraction:i}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)Ic||(Ic=new CSSStyleSheet,Ic.replaceSync(gw)),this.shadowRoot.adoptedStyleSheets=[Ic];else{const c=document.createElement("style");c.textContent=gw,this.shadowRoot.appendChild(c)}this._pre=new ww(this,r,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new hF(this,a,i),this.shadowRoot.appendChild(this._num.el),this._post=new ww(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}ek.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};class hF{constructor(t,n,r,{className:a,...i}={}){this.flow=t,this._integer=new vw(t,n,{justify:"right",part:"integer"}),this._fraction=new vw(t,r,{justify:"left",part:"fraction"}),this._inner=$s("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=$s("span",{...i,part:"number",className:`number ${a??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,r=this.el.offsetWidth,a=this._prevWidth-r;this.el.style.setProperty("--width",String(r)),this.el.animate({[ru]:[`${n}px`,"0px"],[Lx]:[a,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class tk{constructor(t,n,{justify:r,className:a,...i},o){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=r;const l=n.map(c=>this.addChar(c).el);this.el=$s("span",{...i,className:`section section--justify-${r} ${a??""}`},o?o(l):l)}addChar(t,{startDigitsAtZero:n=!1,...r}={}){const a=t.type==="integer"||t.type==="fraction"?new rk(this,t.type,n?0:t.value,t.pos,{...r,onRemove:this.onCharRemove(t.key)}):new fF(this,t.type,t.value,{...r,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,a),a}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${eF(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,r=new Map,a=this.justify==="left",i=a?"prepend":"append";if(rF(t,o=>{let l;this.children.has(o.key)?(l=this.children.get(o.key),r.set(o,l),this.unpop(l),l.present=!0):(l=this.addChar(o,{startDigitsAtZero:!0,animateIn:!0}),n.set(o,l)),this.el[i](l.el)},{reverse:a}),this.flow.computedAnimated){const o=this.el.getBoundingClientRect();n.forEach(l=>{l.willUpdate(o)})}n.forEach((o,l)=>{o.update(l.value)}),r.forEach((o,l)=>{o.update(l.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(a=>a.didUpdate(t));const n=t[this.justify],r=this._prevOffset-n;r&&this.children.size&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class vw extends tk{update(t){const n=new Map;this.children.forEach((r,a)=>{t.find(i=>i.key===a)||n.set(a,r),this.unpop(r)}),this.addNewAndUpdateExisting(t),n.forEach(r=>{r instanceof rk&&r.update(0)}),this.pop(n)}}class ww extends tk{update(t){const n=new Map;this.children.forEach((r,a)=>{t.find(i=>i.key===a)||n.set(a,r)}),this.pop(n),this.addNewAndUpdateExisting(t)}}class qm{constructor(t,n,{onRemove:r,animateIn:a=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var i;this.el.remove(),(i=this._onRemove)==null||i.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&a&&this.el.animate({[nu]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=r}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[nu]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class nk extends qm{constructor(t,n,r,a){super(t.flow,r,a),this.section=t,this.value=n,this.el=r}}class rk extends nk{constructor(t,n,r,a,i){var o,l;const c=(((l=(o=t.flow.digits)==null?void 0:o[a])==null?void 0:l.max)??9)+1,d=Array.from({length:c}).map((u,f)=>{const p=$s("span",{className:"digit__num"},[document.createTextNode(String(f))]);return f!==r&&p.setAttribute("inert",""),p.style.setProperty("--n",String(f)),p}),h=$s("span",{part:`digit ${n}-digit`,className:"digit"},d);h.style.setProperty("--current",String(r)),h.style.setProperty("--length",String(c)),super(t,r,h,i),this.pos=a,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=d,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const r=n[this.section.justify]-t[this.section.justify],a=n.width/2;this._prevCenter=this.section.justify==="left"?r+a:r-a}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,r)=>r===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),r=n[this.section.justify]-t[this.section.justify],a=n.width/2,i=this.section.justify==="left"?r+a:r-a,o=this._prevCenter-i;o&&this.el.animate({transform:[`translateX(${o}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const l=this.getDelta();l&&(this.el.classList.add("is-spinning"),this.el.animate({[Fx]:[-l,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const a of this.flow.plugins){const i=(t=a.getDelta)==null?void 0:t.call(a,this.value,this._prevValue,this);if(i!=null)return i}const n=this.value-this._prevValue,r=this.flow.computedTrend||Math.sign(n);return r<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:r>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:n}}class fF extends nk{constructor(t,n,r,a){const i=$s("span",{className:"symbol__value",textContent:r});super(t,r,$s("span",{part:`symbol ${n}`,className:"symbol"},[i]),a),this.type=n,this._children=new Map,this._onChildRemove=o=>()=>{this._children.delete(o)},this._children.set(r,new qm(this.flow,i,{onRemove:this._onChildRemove(r)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const r=this._children.get(t);if(r)r.present=!0;else{const a=$s("span",{className:"symbol__value",textContent:t});this.el.appendChild(a),this._children.set(t,new qm(this.flow,a,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],r=this._prevOffset-n;r&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}var kw;const mF=parseInt((kw=m.version.match(/^(\d+)\./))==null?void 0:kw[1]),Ux=mF>=19,pF=["data","digits"];class Bx extends ek{attributeChangedCallback(t,n,r){this[t]=JSON.parse(r)}}Bx.observedAttributes=Ux?[]:pF;nF("number-flow-react",Bx);const vf={},yw=Ux?e=>e:JSON.stringify;function bw(e){const{transformTiming:t,spinTiming:n,opacityTiming:r,animated:a,respectMotionPreference:i,trend:o,plugins:l,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:r,animated:a,respectMotionPreference:i,trend:o,plugins:l},c]}class xF extends m.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=bw(this.props);Object.entries(n).forEach(([r,a])=>{this.el[r]=a??Bx.defaultProps[r]}),t!=null&&t.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t!=null&&t.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),Ux&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){var n;if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>{var r;return(r=this.props.group)==null?void 0:r.didUpdate()};if(!this.props.isolate)return(n=this.el)==null||n.willUpdate(),()=>{var r;return(r=this.el)==null?void 0:r.didUpdate()}}return null}componentDidUpdate(t,n,r){r==null||r()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:r,data:a,willChange:i,isolate:o,group:l,digits:c,onAnimationsStart:d,onAnimationsFinish:h,...u}]=bw(this.props);return m.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":i?"":void 0,class:r,...u,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:yw(c),data:yw(a)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const gF=m.forwardRef(function({value:t,locales:n,format:r,prefix:a,suffix:i,...o},l){m.useImperativeHandle(l,()=>c.current,[]);const c=m.useRef(),d=m.useContext(vF);d==null||d.useRegister(c);const h=m.useMemo(()=>n?JSON.stringify(n):"",[n]),u=m.useMemo(()=>r?JSON.stringify(r):"",[r]),f=m.useMemo(()=>{var w;const p=vf[w=`${h}:${u}`]??(vf[w]=new Intl.NumberFormat(n,r));return sF(t,p,a,i)},[t,h,u,a,i]);return m.createElement(xF,{...o,group:d,data:f,innerRef:c})}),vF=m.createContext(void 0),wF={notation:"compact",maximumFractionDigits:1};function br({value:e,loading:t=!1,className:n,prefix:r,suffix:a,format:i,trend:o,fallback:l="…"}){const c=m.useMemo(()=>{if(e==null)return 0;const u=Number(e);return Number.isFinite(u)?u:0},[e]);if(t)return s.jsxs("span",{className:Xd("inline-flex items-baseline",n),children:[r,l,a]});const d=gF,h=typeof o=="boolean"?o?1:0:o;return s.jsxs("span",{className:Xd("inline-flex items-baseline",n),children:[r,s.jsx(d,{value:c,format:i??wF,trend:h,className:"inline-flex"}),a]})}function Oa({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:r="",defaultCollapsed:a=!1}){const[i,o]=m.useState(a),l=m.useRef(null);m.useEffect(()=>{const u=l.current;!u||i||u.scrollTo({top:u.scrollHeight,behavior:"smooth"})},[i]);const c=u=>{switch(u.type){case"success":return s.jsx(Et,{className:"w-3 h-3 text-green-400"});case"error":return s.jsx(ra,{className:"w-3 h-3 text-red-400"});case"progress":return u.status==="running"?s.jsx(Sr,{className:"w-3 h-3 text-blue-400 animate-spin"}):u.status==="completed"?s.jsx(Et,{className:"w-3 h-3 text-green-400"}):u.status==="failed"?s.jsx(ra,{className:"w-3 h-3 text-red-400"}):s.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"});default:return s.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"})}},d=u=>{switch(u.type){case"success":return"text-green-400";case"error":return"text-red-400";case"progress":return u.status==="running"?"text-blue-400":u.status==="completed"?"text-green-400":u.status==="failed"?"text-red-400":"text-gray-400";default:return"text-gray-300"}},h=u=>u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+u.getMilliseconds().toString().padStart(3,"0");return s.jsxs("div",{className:`bg-black/90 border border-dashed border-white/20 rounded-none font-mono text-xs ${r}`,children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-dashed border-white/10",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(HP,{className:"w-3 h-3 text-green-400"}),s.jsx("span",{className:"text-green-400 font-medium text-xs",children:e})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[n&&s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse"}),s.jsx("span",{className:"text-green-400 text-xs",children:"RUNNING"})]}),s.jsxs("div",{className:"text-gray-400 text-xs",children:[t.length," / ",t.length]}),s.jsx("button",{onClick:()=>o(!i),className:"text-gray-400 hover:text-white transition-colors",children:i?s.jsx(zu,{className:"w-3 h-3"}):s.jsx(zP,{className:"w-3 h-3"})})]})]}),!i&&s.jsxs("div",{ref:l,className:"p-3 space-y-0.5 h-56 overflow-y-auto",children:[t.length===0?s.jsxs("div",{className:"text-gray-500 italic text-xs",children:[s.jsx("span",{className:"text-green-400",children:"$"})," Waiting for operations..."]}):t.map(u=>s.jsxs("div",{className:`flex items-start space-x-3 py-1 ${d(u)} text-xs`,children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(u.timestamp)}),s.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),s.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c(u)}),s.jsx("span",{className:"flex-1 min-w-0 break-words",children:u.message})]},u.id)),n&&s.jsxs("div",{className:"flex items-start space-x-3 py-1 text-green-400 text-xs",children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(new Date)}),s.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),s.jsx("div",{className:"w-3 h-3 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 flex items-center",children:s.jsx("span",{className:"animate-pulse",children:"█"})})]})]}),!i&&s.jsx("div",{className:"px-3 py-1.5 border-t border-dashed border-white/10 bg-black/50",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("span",{children:["Status: ",n?"Active":"Idle"]}),s.jsxs("span",{children:["Lines: ",t.length]})]}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full"}),s.jsx("span",{children:"Better Auth Studio"})]})]})})]})}const sk=document.createElement("style");sk.textContent=`
|
|
403
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},n$="DialogDescriptionWarning",r$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t2(n$).contentName}}.`;return m.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},s$=Vj,a$=qj,i$=Gj,o$=Kj,wo='[cmdk-group=""]',df='[cmdk-group-items=""]',l$='[cmdk-group-heading=""]',n2='[cmdk-item=""]',Vv=`${n2}:not([aria-disabled="true"])`,Wm="cmdk-item-select",Qa="data-value",c$=(e,t,n)=>Z6(e,t,n),r2=m.createContext(void 0),Fl=()=>m.useContext(r2),s2=m.createContext(void 0),Ax=()=>m.useContext(s2),a2=m.createContext(void 0),i2=m.forwardRef((e,t)=>{let n=Za(()=>{var P,B;return{search:"",value:(B=(P=e.value)!=null?P:e.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Za(()=>new Set),a=Za(()=>new Map),i=Za(()=>new Map),o=Za(()=>new Set),l=o2(e),{label:c,children:d,value:h,onValueChange:u,filter:f,shouldFilter:p,loop:w,disablePointerSelection:v=!1,vimBindings:b=!0,...g}=e,y=nr(),x=nr(),N=nr(),j=m.useRef(null),k=y$();Pa(()=>{if(h!==void 0){let P=h.trim();n.current.value=P,S.emit()}},[h]),Pa(()=>{k(6,L)},[]);let S=m.useMemo(()=>({subscribe:P=>(o.current.add(P),()=>o.current.delete(P)),snapshot:()=>n.current,setState:(P,B,q)=>{var G,se,re,Z;if(!Object.is(n.current[P],B)){if(n.current[P]=B,P==="search")$(),I(),k(1,U);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let R=document.getElementById(N);R?R.focus():(G=document.getElementById(y))==null||G.focus()}if(k(7,()=>{var R;n.current.selectedItemId=(R=E())==null?void 0:R.id,S.emit()}),q||k(5,L),((se=l.current)==null?void 0:se.value)!==void 0){let R=B??"";(Z=(re=l.current).onValueChange)==null||Z.call(re,R);return}}S.emit()}},emit:()=>{o.current.forEach(P=>P())}}),[]),M=m.useMemo(()=>({value:(P,B,q)=>{var G;B!==((G=i.current.get(P))==null?void 0:G.value)&&(i.current.set(P,{value:B,keywords:q}),n.current.filtered.items.set(P,A(B,q)),k(2,()=>{I(),S.emit()}))},item:(P,B)=>(r.current.add(P),B&&(a.current.has(B)?a.current.get(B).add(P):a.current.set(B,new Set([P]))),k(3,()=>{$(),I(),n.current.value||U(),S.emit()}),()=>{i.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let q=E();k(4,()=>{$(),(q==null?void 0:q.getAttribute("id"))===P&&U(),S.emit()})}),group:P=>(a.current.has(P)||a.current.set(P,new Set),()=>{i.current.delete(P),a.current.delete(P)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:N,labelId:x,listInnerRef:j}),[]);function A(P,B){var q,G;let se=(G=(q=l.current)==null?void 0:q.filter)!=null?G:c$;return P?se(P,n.current.search,B):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let P=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(G=>{let se=a.current.get(G),re=0;se.forEach(Z=>{let R=P.get(Z);re=Math.max(R,re)}),B.push([G,re])});let q=j.current;O().sort((G,se)=>{var re,Z;let R=G.getAttribute("id"),ee=se.getAttribute("id");return((re=P.get(ee))!=null?re:0)-((Z=P.get(R))!=null?Z:0)}).forEach(G=>{let se=G.closest(df);se?se.appendChild(G.parentElement===se?G:G.closest(`${df} > *`)):q.appendChild(G.parentElement===q?G:G.closest(`${df} > *`))}),B.sort((G,se)=>se[1]-G[1]).forEach(G=>{var se;let re=(se=j.current)==null?void 0:se.querySelector(`${wo}[${Qa}="${encodeURIComponent(G[0])}"]`);re==null||re.parentElement.appendChild(re)})}function U(){let P=O().find(q=>q.getAttribute("aria-disabled")!=="true"),B=P==null?void 0:P.getAttribute(Qa);S.setState("value",B||void 0)}function $(){var P,B,q,G;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let re of r.current){let Z=(B=(P=i.current.get(re))==null?void 0:P.value)!=null?B:"",R=(G=(q=i.current.get(re))==null?void 0:q.keywords)!=null?G:[],ee=A(Z,R);n.current.filtered.items.set(re,ee),ee>0&&se++}for(let[re,Z]of a.current)for(let R of Z)if(n.current.filtered.items.get(R)>0){n.current.filtered.groups.add(re);break}n.current.filtered.count=se}function L(){var P,B,q;let G=E();G&&(((P=G.parentElement)==null?void 0:P.firstChild)===G&&((q=(B=G.closest(wo))==null?void 0:B.querySelector(l$))==null||q.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function E(){var P;return(P=j.current)==null?void 0:P.querySelector(`${n2}[aria-selected="true"]`)}function O(){var P;return Array.from(((P=j.current)==null?void 0:P.querySelectorAll(Vv))||[])}function D(P){let B=O()[P];B&&S.setState("value",B.getAttribute(Qa))}function T(P){var B;let q=E(),G=O(),se=G.findIndex(Z=>Z===q),re=G[se+P];(B=l.current)!=null&&B.loop&&(re=se+P<0?G[G.length-1]:se+P===G.length?G[0]:G[se+P]),re&&S.setState("value",re.getAttribute(Qa))}function C(P){let B=E(),q=B==null?void 0:B.closest(wo),G;for(;q&&!G;)q=P>0?v$(q,wo):w$(q,wo),G=q==null?void 0:q.querySelector(Vv);G?S.setState("value",G.getAttribute(Qa)):T(P)}let _=()=>D(O().length-1),z=P=>{P.preventDefault(),P.metaKey?_():P.altKey?C(1):T(1)},H=P=>{P.preventDefault(),P.metaKey?D(0):P.altKey?C(-1):T(-1)};return m.createElement(dt.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:P=>{var B;(B=g.onKeyDown)==null||B.call(g,P);let q=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||q))switch(P.key){case"n":case"j":{b&&P.ctrlKey&&z(P);break}case"ArrowDown":{z(P);break}case"p":case"k":{b&&P.ctrlKey&&H(P);break}case"ArrowUp":{H(P);break}case"Home":{P.preventDefault(),D(0);break}case"End":{P.preventDefault(),_();break}case"Enter":{P.preventDefault();let G=E();if(G){let se=new Event(Wm);G.dispatchEvent(se)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:N$},c),Ku(e,P=>m.createElement(s2.Provider,{value:S},m.createElement(r2.Provider,{value:M},P))))}),d$=m.forwardRef((e,t)=>{var n,r;let a=nr(),i=m.useRef(null),o=m.useContext(a2),l=Fl(),c=o2(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Pa(()=>{if(!d)return l.item(a,o==null?void 0:o.id)},[d]);let h=l2(a,i,[e.value,e.children,i],e.keywords),u=Ax(),f=Bs(k=>k.value&&k.value===h.current),p=Bs(k=>d||l.filter()===!1?!0:k.search?k.filtered.items.get(a)>0:!0);m.useEffect(()=>{let k=i.current;if(!(!k||e.disabled))return k.addEventListener(Wm,w),()=>k.removeEventListener(Wm,w)},[p,e.onSelect,e.disabled]);function w(){var k,S;v(),(S=(k=c.current).onSelect)==null||S.call(k,h.current)}function v(){u.setState("value",h.current,!0)}if(!p)return null;let{disabled:b,value:g,onSelect:y,forceMount:x,keywords:N,...j}=e;return m.createElement(dt.div,{ref:_a(i,t),...j,id:a,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!f,"data-disabled":!!b,"data-selected":!!f,onPointerMove:b||l.getDisablePointerSelection()?void 0:v,onClick:b?void 0:w},e.children)}),u$=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=nr(),l=m.useRef(null),c=m.useRef(null),d=nr(),h=Fl(),u=Bs(p=>a||h.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);Pa(()=>h.group(o),[]),l2(o,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:a}),[a]);return m.createElement(dt.div,{ref:_a(l,t),...i,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Ku(e,p=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},m.createElement(a2.Provider,{value:f},p))))}),h$=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=m.useRef(null),i=Bs(o=>!o.search);return!n&&!i?null:m.createElement(dt.div,{ref:_a(a,t),...r,"cmdk-separator":"",role:"separator"})}),f$=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=Ax(),o=Bs(d=>d.search),l=Bs(d=>d.selectedItemId),c=Fl();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(dt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:a?e.value:o,onChange:d=>{a||i.setState("search",d.target.value),n==null||n(d.target.value)}})}),m$=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=m.useRef(null),o=m.useRef(null),l=Bs(d=>d.selectedItemId),c=Fl();return m.useEffect(()=>{if(o.current&&i.current){let d=o.current,h=i.current,u,f=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let p=d.offsetHeight;h.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(d),()=>{cancelAnimationFrame(u),f.unobserve(d)}}},[]),m.createElement(dt.div,{ref:_a(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Ku(e,d=>m.createElement("div",{ref:_a(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),p$=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...l}=e;return m.createElement(s$,{open:n,onOpenChange:r},m.createElement(a$,{container:o},m.createElement(i$,{"cmdk-overlay":"",className:a}),m.createElement(o$,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(i2,{ref:t,...l}))))}),x$=m.forwardRef((e,t)=>Bs(n=>n.filtered.count===0)?m.createElement(dt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),g$=m.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return m.createElement(dt.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Ku(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),yo=Object.assign(i2,{List:m$,Item:d$,Input:f$,Group:u$,Separator:h$,Dialog:p$,Empty:x$,Loading:g$});function v$(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function w$(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function o2(e){let t=m.useRef(e);return Pa(()=>{t.current=e}),t}var Pa=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Za(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Bs(e){let t=Ax(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function l2(e,t,n,r=[]){let a=m.useRef(),i=Fl();return Pa(()=>{var o;let l=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():a.current}})(),c=r.map(d=>d.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(Qa,l),a.current=l}),a}var y$=()=>{let[e,t]=m.useState(),n=Za(()=>new Map);return Pa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function b$(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ku({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(b$(t),{ref:t.ref},n(t.props.children)):n(t)}var N$={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function j$({isOpen:e,onClose:t}){const n=_r(),[r,a]=m.useState(""),[i,o]=m.useState(null);m.useEffect(()=>{(async()=>{try{const p=await(await fetch("/api/plugins")).json();o(p)}catch{}})()},[]);const l=u=>i!=null&&i.plugins?i.plugins.some(f=>f.id===u):!1,h=[{id:"users",title:"Users",description:"Manage users and their accounts",icon:Ma,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:pr,action:()=>n("/organizations"),category:"Navigation",keywords:["org","company","team"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"sessions",title:"Sessions",description:"View active user sessions",icon:dv,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:bi,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:dv,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:Pm,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:zs,action:()=>n("/organizations"),category:"Actions",keywords:["add","new","org"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"invite-user",title:"Invite User",description:"Send invitation to join organization",icon:Yd,action:()=>n("/organizations"),category:"Actions",keywords:["invite","email","send"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"}].filter(u=>{var p;const f=r.toLowerCase();return u.title.toLowerCase().includes(f)||u.description.toLowerCase().includes(f)||((p=u.keywords)==null?void 0:p.some(w=>w.toLowerCase().includes(f)))}).reduce((u,f)=>(u[f.category]||(u[f.category]=[]),u[f.category].push(f),u),{});return m.useEffect(()=>{const u=f=>{(f.metaKey||f.ctrlKey)&&f.key==="k"&&f.preventDefault()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[]),m.useEffect(()=>{const u=f=>{f.key==="Escape"&&t()};if(e)return document.body.style.overflow="hidden",document.addEventListener("keydown",u),()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",u)}},[e,t]),e?s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center pt-[20vh] z-50 overflow-hidden",onClick:t,children:s.jsx("div",{className:"bg-black/90 overflow-hidden border border-white/10 rounded-none w-full max-w-2xl mx-4",onClick:u=>u.stopPropagation(),children:s.jsxs(yo,{className:"p-2",children:[s.jsxs("div",{className:"flex items-center border-b border-dashed border-white/10 px-3 pb-3",children:[s.jsx(Ea,{className:"w-4 h-4 text-gray-400 mr-3"}),s.jsx(yo.Input,{value:r,onValueChange:a,placeholder:"Search for actions, pages, or commands...",className:"flex-1 placeholder:text-xs bg-transparent text-white placeholder-gray-400 outline-none",autoFocus:!0}),s.jsx("kbd",{className:"hidden sm:inline-flex items-center px-2 py-1 text-xs text-gray-400 border border-dashed border-white/20 rounded-sm",children:"ESC"})]}),s.jsx(yo.List,{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(h).length===0?s.jsxs("div",{className:"text-center py-8 text-gray-400",children:[s.jsx(Ea,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),s.jsx("p",{children:"No results found"}),s.jsx("p",{className:"text-sm",children:"Try a different search term"})]}):Object.entries(h).map(([u,f])=>s.jsx("div",{className:"mb-4",children:s.jsx(yo.Group,{heading:u,className:"text-xs text-gray-400 font-medium mb-2 px-2",children:f.map(p=>{const w=p.icon,v=p.disabled;return s.jsxs(yo.Item,{value:p.id,disabled:v,onSelect:()=>{v||(p.action(),t())},className:`flex items-center space-x-3 px-0 py-2 rounded-none transition-colors relative ${v?"opacity-40 cursor-not-allowed blur-[0.5px]":"hover:bg-white/5 cursor-pointer"}`,children:[s.jsx(w,{className:"w-4 h-4 text-white"}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"text-white text-[13px] font-light flex items-center gap-2",children:[p.title,v&&s.jsx(nd,{className:"w-3 h-3 text-yellow-500"})]}),s.jsx("div",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:v?p.disabledMessage:p.description})]}),!v&&s.jsx(TP,{className:"w-4 h-4 text-gray-400"})]},p.id)})})},u))}),s.jsx("div",{className:"border-t border-dashed border-white/10 px-3 py-2 text-xs text-gray-400",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{children:["Press"," ",s.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"↑↓"})," ","to navigate"]}),s.jsxs("span",{children:["Press"," ",s.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"Enter"})," ","to select"]})]})})]})})}):null}const Yv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Xv=Xd,c2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Xv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(d=>{const h=n==null?void 0:n[d],u=i==null?void 0:i[d];if(h===null)return null;const f=Yv(h)||Yv(u);return a[d][f]}),l=n&&Object.entries(n).reduce((d,h)=>{let[u,f]=h;return f===void 0||(d[u]=f),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:u,className:f,...p}=h;return Object.entries(p).every(w=>{let[v,b]=w;return Array.isArray(b)?b.includes({...i,...l}[v]):{...i,...l}[v]===b})?[...d,u,f]:d},[]);return Xv(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Hm=c2("inline-flex items-center justify-center gap-2 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"}}),Y=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?SA:"button";return s.jsx(o,{className:De(Hm({variant:t,size:n,className:e})),ref:i,...a})});Y.displayName="Button";function k$({children:e}){const t=Gi(),{counts:n,loading:r}=Xu(),[a,i]=m.useState(!1),[o,l]=m.useState("v1.0.0");m.useEffect(()=>{const h=u=>{(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),i(!0))};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[]),m.useEffect(()=>{(async()=>{var u;try{const p=await(await fetch("/api/config")).json();(u=p.studio)!=null&&u.version&&l(`v${p.studio.version}`)}catch{}})()},[]);const c=h=>h>=1e3?`${(h/1e3).toFixed(1).replace(/\.0$/,"")}k`:h.toString(),d=[{name:"Dashboard",href:"/",icon:FP},{name:"Users",href:"/users",icon:Ma,badge:r?"...":c(n.users)},{name:"Organizations",href:"/organizations",icon:pr,badge:r?"...":c(n.organizations)},{name:"Database",href:"/database",icon:mt},{name:"Tools",href:"/tools",icon:BN},{name:"Settings",href:"/settings",icon:bi}];return s.jsxs("div",{className:"min-h-screen bg-black",children:[s.jsx("div",{className:"bg-black/70 border-b border-white/15",children:s.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[s.jsx("div",{className:"w-7 h-7 border border-dashed border-white/20 rounded-lg flex items-center justify-center",children:s.jsx("span",{className:"text-black font-bold text-md",children:"⚡"})}),s.jsx("div",{className:"mb-0",children:s.jsxs("h1",{className:"text-md inline-flex mb-0 items-start font-light font-mono uppercase text-white",children:["Better-Auth Studio",s.jsxs("sup",{className:"text-sm text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 lowercase font-mono text-xs",children:o}),s.jsx("span",{className:"ml-1",children:"]"})]})]})})]})}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx("input",{type:"text",placeholder:"Search...",onClick:()=>i(!0),className:"pl-10 pr-4 py-2 bg-black border rounded-none border-gray-600 text-white border-dashed border-white/20 focus:ring-2 focus:ring-white focus:border-transparent transition-colors placeholder-gray-400 cursor-pointer",readOnly:!0}),s.jsx("kbd",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-xs text-gray-400 border border-dashed border-white/10 rounded-sm px-1.5 py-0.5",children:"⌘ K"})]}),s.jsx("a",{href:"https://better-auth.com/docs",target:"_blank",rel:"noopener",children:s.jsx(Y,{variant:"ghost",className:"text-gray-300 bg-transparent hover:bg-transparent hover:bg-gray-900 border-dashed",children:"Docs"})}),s.jsx("a",{href:"https://better-auth.com/support",target:"_blank",rel:"noopener",children:s.jsx(Y,{variant:"ghost",className:"text-gray-300 bg-transparent hover:bg-transparent hover:bg-gray-900 border-dashed",children:"Support"})})]})]})}),s.jsx("div",{className:"bg-black/50 border-b border-white/10",children:s.jsx("div",{className:"px-6",children:s.jsx("nav",{className:"flex space-x-8",children:d.map(h=>{const u=t.pathname===h.href;return s.jsxs(qp,{to:h.href,className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[s.jsx(h.icon,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:[h.name,h.badge&&s.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[s.jsx("span",{className:"mr-0.5",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:h.badge}),s.jsx("span",{className:"ml-0.5",children:"]"})]})]})]},h.name)})})})}),s.jsx("div",{className:"flex-1 p-0",children:e}),s.jsx(j$,{isOpen:a,onClose:()=>i(!1)})]})}function Jd(e){"@babel/helpers - typeof";return Jd=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},Jd(e)}function Aa(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function en(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Pr(e){en(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Jd(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function S$(e,t){en(2,arguments);var n=Pr(e).getTime(),r=Aa(t);return new Date(n+r)}var C$={};function Qu(){return C$}function E$(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function M$(e){return en(1,arguments),e instanceof Date||Jd(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _$(e){if(en(1,arguments),!M$(e)&&typeof e!="number")return!1;var t=Pr(e);return!isNaN(Number(t))}function D$(e,t){en(2,arguments);var n=Aa(t);return S$(e,-n)}var T$=864e5;function P$(e){en(1,arguments);var t=Pr(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),a=n-r;return Math.floor(a/T$)+1}function eu(e){en(1,arguments);var t=1,n=Pr(e),r=n.getUTCDay(),a=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-a),n.setUTCHours(0,0,0,0),n}function d2(e){en(1,arguments);var t=Pr(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var a=eu(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=eu(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function A$(e){en(1,arguments);var t=d2(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=eu(n);return r}var O$=6048e5;function z$(e){en(1,arguments);var t=Pr(e),n=eu(t).getTime()-A$(t).getTime();return Math.round(n/O$)+1}function tu(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Qu(),u=Aa((n=(r=(a=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:h.weekStartsOn)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&n!==void 0?n:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Pr(e),p=f.getUTCDay(),w=(p<u?7:0)+p-u;return f.setUTCDate(f.getUTCDate()-w),f.setUTCHours(0,0,0,0),f}function u2(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Pr(e),u=h.getUTCFullYear(),f=Qu(),p=Aa((n=(r=(a=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&a!==void 0?a:f.firstWeekContainsDate)!==null&&r!==void 0?r:(c=f.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(u+1,0,p),w.setUTCHours(0,0,0,0);var v=tu(w,t),b=new Date(0);b.setUTCFullYear(u,0,p),b.setUTCHours(0,0,0,0);var g=tu(b,t);return h.getTime()>=v.getTime()?u+1:h.getTime()>=g.getTime()?u:u-1}function $$(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Qu(),u=Aa((n=(r=(a=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&a!==void 0?a:h.firstWeekContainsDate)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=u2(e,t),p=new Date(0);p.setUTCFullYear(f,0,u),p.setUTCHours(0,0,0,0);var w=tu(p,t);return w}var R$=6048e5;function I$(e,t){en(1,arguments);var n=Pr(e),r=tu(n,t).getTime()-$$(n,t).getTime();return Math.round(r/R$)+1}function Ye(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var fs={y:function(t,n){var r=t.getUTCFullYear(),a=r>0?r:1-r;return Ye(n==="yy"?a%100:a,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):Ye(r+1,2)},d:function(t,n){return Ye(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return Ye(t.getUTCHours()%12||12,n.length)},H:function(t,n){return Ye(t.getUTCHours(),n.length)},m:function(t,n){return Ye(t.getUTCMinutes(),n.length)},s:function(t,n){return Ye(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,a=t.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,r-3));return Ye(i,n.length)}},Ga={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},L$={G:function(t,n,r){var a=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var a=t.getUTCFullYear(),i=a>0?a:1-a;return r.ordinalNumber(i,{unit:"year"})}return fs.y(t,n)},Y:function(t,n,r,a){var i=u2(t,a),o=i>0?i:1-i;if(n==="YY"){var l=o%100;return Ye(l,2)}return n==="Yo"?r.ordinalNumber(o,{unit:"year"}):Ye(o,n.length)},R:function(t,n){var r=d2(t);return Ye(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return Ye(r,n.length)},Q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(a);case"QQ":return Ye(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(a);case"qq":return Ye(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,n,r){var a=t.getUTCMonth();switch(n){case"M":case"MM":return fs.M(t,n);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(t,n,r){var a=t.getUTCMonth();switch(n){case"L":return String(a+1);case"LL":return Ye(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(t,n,r,a){var i=I$(t,a);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):Ye(i,n.length)},I:function(t,n,r){var a=z$(t);return n==="Io"?r.ordinalNumber(a,{unit:"week"}):Ye(a,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):fs.d(t,n)},D:function(t,n,r){var a=P$(t);return n==="Do"?r.ordinalNumber(a,{unit:"dayOfYear"}):Ye(a,n.length)},E:function(t,n,r){var a=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});case"EEEE":default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return Ye(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return Ye(o,n.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var a=t.getUTCDay(),i=a===0?7:a;switch(n){case"i":return String(i);case"ii":return Ye(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});case"iiii":default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(t,n,r){var a=t.getUTCHours(),i=a/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var a=t.getUTCHours(),i;switch(a===12?i=Ga.noon:a===0?i=Ga.midnight:i=a/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var a=t.getUTCHours(),i;switch(a>=17?i=Ga.evening:a>=12?i=Ga.afternoon:a>=4?i=Ga.morning:i=Ga.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var a=t.getUTCHours()%12;return a===0&&(a=12),r.ordinalNumber(a,{unit:"hour"})}return fs.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):fs.H(t,n)},K:function(t,n,r){var a=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(a,{unit:"hour"}):Ye(a,n.length)},k:function(t,n,r){var a=t.getUTCHours();return a===0&&(a=24),n==="ko"?r.ordinalNumber(a,{unit:"hour"}):Ye(a,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):fs.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):fs.s(t,n)},S:function(t,n){return fs.S(t,n)},X:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Gv(o);case"XXXX":case"XX":return ta(o);case"XXXXX":case"XXX":default:return ta(o,":")}},x:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Gv(o);case"xxxx":case"xx":return ta(o);case"xxxxx":case"xxx":default:return ta(o,":")}},O:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+qv(o,":");case"OOOO":default:return"GMT"+ta(o,":")}},z:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+qv(o,":");case"zzzz":default:return"GMT"+ta(o,":")}},t:function(t,n,r,a){var i=a._originalDate||t,o=Math.floor(i.getTime()/1e3);return Ye(o,n.length)},T:function(t,n,r,a){var i=a._originalDate||t,o=i.getTime();return Ye(o,n.length)}};function qv(e,t){var n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;if(i===0)return n+String(a);var o=t;return n+String(a)+o+Ye(i,2)}function Gv(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Ye(Math.abs(e)/60,2)}return ta(e,t)}function ta(e,t){var n=t||"",r=e>0?"-":"+",a=Math.abs(e),i=Ye(Math.floor(a/60),2),o=Ye(a%60,2);return r+i+n+o}var Kv=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},h2=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},F$=function(t,n){var r=t.match(/(P+)(p+)?/)||[],a=r[1],i=r[2];if(!i)return Kv(t,n);var o;switch(a){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;case"PPPP":default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",Kv(a,n)).replace("{{time}}",h2(i,n))},U$={p:h2,P:F$},B$=["D","DD"],W$=["YY","YYYY"];function H$(e){return B$.indexOf(e)!==-1}function V$(e){return W$.indexOf(e)!==-1}function Qv(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Y$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},X$=function(t,n,r){var a,i=Y$[t];return typeof i=="string"?a=i:n===1?a=i.one:a=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a};function uf(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var q$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},G$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},K$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q$={date:uf({formats:q$,defaultWidth:"full"}),time:uf({formats:G$,defaultWidth:"full"}),dateTime:uf({formats:K$,defaultWidth:"full"})},Z$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},J$=function(t,n,r,a){return Z$[t]};function bo(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",a;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[c]||e.values[l]}var d=e.argumentCallback?e.argumentCallback(t):t;return a[d]}}var eR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nR={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"]},rR={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"]},sR={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"}},aR={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"}},iR=function(t,n){var r=Number(t),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},oR={ordinalNumber:iR,era:bo({values:eR,defaultWidth:"wide"}),quarter:bo({values:tR,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:bo({values:nR,defaultWidth:"wide"}),day:bo({values:rR,defaultWidth:"wide"}),dayPeriod:bo({values:sR,defaultWidth:"wide",formattingValues:aR,defaultFormattingWidth:"wide"})};function No(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?cR(l,function(u){return u.test(o)}):lR(l,function(u){return u.test(o)}),d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;var h=t.slice(o.length);return{value:d,rest:h}}}function lR(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function cR(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function dR(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var a=r[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var l=t.slice(a.length);return{value:o,rest:l}}}var uR=/^(\d+)(th|st|nd|rd)?/i,hR=/\d+/i,fR={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},mR={any:[/^b/i,/^(a|c)/i]},pR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xR={any:[/1/i,/2/i,/3/i,/4/i]},gR={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},vR={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]},wR={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},yR={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]},bR={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},NR={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}},jR={ordinalNumber:dR({matchPattern:uR,parsePattern:hR,valueCallback:function(t){return parseInt(t,10)}}),era:No({matchPatterns:fR,defaultMatchWidth:"wide",parsePatterns:mR,defaultParseWidth:"any"}),quarter:No({matchPatterns:pR,defaultMatchWidth:"wide",parsePatterns:xR,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:No({matchPatterns:gR,defaultMatchWidth:"wide",parsePatterns:vR,defaultParseWidth:"any"}),day:No({matchPatterns:wR,defaultMatchWidth:"wide",parsePatterns:yR,defaultParseWidth:"any"}),dayPeriod:No({matchPatterns:bR,defaultMatchWidth:"any",parsePatterns:NR,defaultParseWidth:"any"})},kR={code:"en-US",formatDistance:X$,formatLong:Q$,formatRelative:J$,localize:oR,match:jR,options:{weekStartsOn:0,firstWeekContainsDate:1}},SR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,CR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ER=/^'([^]*?)'?$/,MR=/''/g,_R=/[a-zA-Z]/;function An(e,t,n){var r,a,i,o,l,c,d,h,u,f,p,w,v,b;en(2,arguments);var g=String(t),y=Qu(),x=(r=(a=void 0)!==null&&a!==void 0?a:y.locale)!==null&&r!==void 0?r:kR,N=Aa((i=(o=(l=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&l!==void 0?l:y.firstWeekContainsDate)!==null&&o!==void 0?o:(d=y.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=Aa((u=(f=(p=(w=void 0)!==null&&w!==void 0?w:void 0)!==null&&p!==void 0?p:y.weekStartsOn)!==null&&f!==void 0?f:(v=y.locale)===null||v===void 0||(b=v.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&u!==void 0?u:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!x.localize)throw new RangeError("locale must contain localize property");if(!x.formatLong)throw new RangeError("locale must contain formatLong property");var k=Pr(e);if(!_$(k))throw new RangeError("Invalid time value");var S=E$(k),M=D$(k,S),A={firstWeekContainsDate:N,weekStartsOn:j,locale:x,_originalDate:k},I=g.match(CR).map(function(U){var $=U[0];if($==="p"||$==="P"){var L=U$[$];return L(U,x.formatLong)}return U}).join("").match(SR).map(function(U){if(U==="''")return"'";var $=U[0];if($==="'")return DR(U);var L=L$[$];if(L)return V$(U)&&Qv(U,t,String(e)),H$(U)&&Qv(U,t,String(e)),L(M,U,x.localize,A);if($.match(_R))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return U}).join("");return I}function DR(e){var t=e.match(ER);return t?t[1].replace(MR,"'"):e}function TR(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const hf={},Ao={};function la(e,t){try{const r=(hf[e]||(hf[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in Ao?Ao[r]:Zv(r,r.split(":"))}catch{if(e in Ao)return Ao[e];const n=e==null?void 0:e.match(PR);return n?Zv(e,n.slice(1)):NaN}}const PR=/([+-]\d\d):?(\d\d)?/;function Zv(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return Ao[e]=n*60+r>0?n*60+r+a:n*60-r-a}class yr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(la(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),f2(this),Vm(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new yr(...n,t):new yr(Date.now(),t)}withTimeZone(t){return new yr(+this,t)}getTimezoneOffset(){const t=-la(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Vm(this),+this}[Symbol.for("constructDateFrom")](t){return new yr(+new Date(t),this.timeZone)}}const Jv=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Jv.test(e))return;const t=e.replace(Jv,"$1UTC");yr.prototype[t]&&(e.startsWith("get")?yr.prototype[e]=function(){return this.internal[t]()}:(yr.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),AR(this),+this},yr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Vm(this),+this}))});function Vm(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-la(e.timeZone,e)*60))}function AR(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),f2(e)}function f2(e){const t=la(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),o=a-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=a-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const h=a>0?d.getSeconds():(d.getSeconds()-60)%60,u=Math.round(-(la(e.timeZone,e)*60))%60;(u||h)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+h));const f=la(e.timeZone,e),p=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-p,b=p!==n,g=v-c;if(b&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const y=la(e.timeZone,e),x=y>0?Math.floor(y):Math.ceil(y),N=p-x;N&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N))}}class Vt extends yr{static tz(t,...n){return n.length?new Vt(...n,t):new Vt(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${TR(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new Vt(+this,t)}[Symbol.for("constructDateFrom")](t){return new Vt(+new Date(t),this.timeZone)}}const m2=6048e5,OR=864e5,ew=Symbol.for("constructDateFrom");function St(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ew in e?e[ew](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ke(e,t){return St(t||e,e)}function p2(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(t)?St(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function x2(e,t,n){const r=Ke(e,n==null?void 0:n.in);if(isNaN(t))return St(e,NaN);if(!t)return r;const a=r.getDate(),i=St(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const o=i.getDate();return a>=o?i:(r.setFullYear(i.getFullYear(),i.getMonth(),a),r)}let zR={};function Ul(){return zR}function Wi(e,t){var l,c,d,h;const n=Ul(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,a=Ke(e,t==null?void 0:t.in),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function kl(e,t){return Wi(e,{...t,weekStartsOn:1})}function g2(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=St(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=kl(a),o=St(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const l=kl(o);return n.getTime()>=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function tw(e){const t=Ke(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 Ji(e,...t){const n=St.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Sl(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function v2(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t),i=Sl(r),o=Sl(a),l=+i-tw(i),c=+o-tw(o);return Math.round((l-c)/OR)}function $R(e,t){const n=g2(e,t),r=St(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),kl(r)}function RR(e,t,n){return p2(e,t*7,n)}function IR(e,t,n){return x2(e,t*12,n)}function LR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=St.bind(null,a));const i=Ke(a,r);(!n||n<i||isNaN(+i))&&(n=i)}),St(r,n||NaN)}function FR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=St.bind(null,a));const i=Ke(a,r);(!n||n>i||isNaN(+i))&&(n=i)}),St(r,n||NaN)}function UR(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return+Sl(r)==+Sl(a)}function w2(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function BR(e){return!(!w2(e)&&typeof e!="number"||isNaN(+Ke(e)))}function WR(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t),i=r.getFullYear()-a.getFullYear(),o=r.getMonth()-a.getMonth();return i*12+o}function HR(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function y2(e,t){const[n,r]=Ji(e,t.start,t.end);return{start:n,end:r}}function VR(e,t){const{start:n,end:r}=y2(t==null?void 0:t.in,e);let a=+n>+r;const i=a?+n:+r,o=a?r:n;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(St(n,o)),o.setMonth(o.getMonth()+l);return a?c.reverse():c}function YR(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function XR(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function b2(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function qR(e,t){const{start:n,end:r}=y2(t==null?void 0:t.in,e);let a=+n>+r;const i=a?+n:+r,o=a?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(St(n,o)),o.setFullYear(o.getFullYear()+l);return a?c.reverse():c}function N2(e,t){var l,c,d,h;const n=Ul(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,a=Ke(e,t==null?void 0:t.in),i=a.getDay(),o=(i<r?-7:0)+6-(i-r);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function GR(e,t){return N2(e,{...t,weekStartsOn:1})}const KR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},QR=(e,t,n)=>{let r;const a=KR[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ff(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const ZR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},JR={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},eI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tI={date:ff({formats:ZR,defaultWidth:"full"}),time:ff({formats:JR,defaultWidth:"full"}),dateTime:ff({formats:eI,defaultWidth:"full"})},nI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},rI=(e,t,n,r)=>nI[e];function jo(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const sI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},aI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},iI={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"]},oI={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"]},lI={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"}},cI={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"}},dI=(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"},uI={ordinalNumber:dI,era:jo({values:sI,defaultWidth:"wide"}),quarter:jo({values:aI,defaultWidth:"wide",argumentCallback:e=>e-1}),month:jo({values:iI,defaultWidth:"wide"}),day:jo({values:oI,defaultWidth:"wide"}),dayPeriod:jo({values:lI,defaultWidth:"wide",formattingValues:cI,defaultFormattingWidth:"wide"})};function ko(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?fI(l,u=>u.test(o)):hI(l,u=>u.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(o.length);return{value:d,rest:h}}}function hI(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function fI(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function mI(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}const pI=/^(\d+)(th|st|nd|rd)?/i,xI=/\d+/i,gI={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},vI={any:[/^b/i,/^(a|c)/i]},wI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},yI={any:[/1/i,/2/i,/3/i,/4/i]},bI={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},NI={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]},jI={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},kI={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]},SI={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},CI={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}},EI={ordinalNumber:mI({matchPattern:pI,parsePattern:xI,valueCallback:e=>parseInt(e,10)}),era:ko({matchPatterns:gI,defaultMatchWidth:"wide",parsePatterns:vI,defaultParseWidth:"any"}),quarter:ko({matchPatterns:wI,defaultMatchWidth:"wide",parsePatterns:yI,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ko({matchPatterns:bI,defaultMatchWidth:"wide",parsePatterns:NI,defaultParseWidth:"any"}),day:ko({matchPatterns:jI,defaultMatchWidth:"wide",parsePatterns:kI,defaultParseWidth:"any"}),dayPeriod:ko({matchPatterns:SI,defaultMatchWidth:"any",parsePatterns:CI,defaultParseWidth:"any"})},Ox={code:"en-US",formatDistance:QR,formatLong:tI,formatRelative:rI,localize:uI,match:EI,options:{weekStartsOn:0,firstWeekContainsDate:1}};function MI(e,t){const n=Ke(e,t==null?void 0:t.in);return v2(n,b2(n))+1}function j2(e,t){const n=Ke(e,t==null?void 0:t.in),r=+kl(n)-+$R(n);return Math.round(r/m2)+1}function k2(e,t){var h,u,f,p;const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=Ul(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??a.firstWeekContainsDate??((p=(f=a.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=St((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=Wi(o,t),c=St((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=Wi(c,t);return+n>=+l?r+1:+n>=+d?r:r-1}function _I(e,t){var l,c,d,h;const n=Ul(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,a=k2(e,t),i=St((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),Wi(i,t)}function S2(e,t){const n=Ke(e,t==null?void 0:t.in),r=+Wi(n,t)-+_I(n,t);return Math.round(r/m2)+1}function Xe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ms={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Xe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Xe(n+1,2)},d(e,t){return Xe(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 Xe(e.getHours()%12||12,t.length)},H(e,t){return Xe(e.getHours(),t.length)},m(e,t){return Xe(e.getMinutes(),t.length)},s(e,t){return Xe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Xe(a,t.length)}},Ka={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},nw={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(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return ms.y(e,t)},Y:function(e,t,n,r){const a=k2(e,r),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return Xe(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Xe(i,t.length)},R:function(e,t){const n=g2(e);return Xe(n,t.length)},u:function(e,t){const n=e.getFullYear();return Xe(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 Xe(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 Xe(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 ms.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 Xe(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 a=S2(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Xe(a,t.length)},I:function(e,t,n){const r=j2(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Xe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ms.d(e,t)},D:function(e,t,n){const r=MI(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Xe(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 a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Xe(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Xe(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Xe(a,t.length);case"io":return n.ordinalNumber(a,{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 a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Ka.noon:r===0?a=Ka.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Ka.evening:r>=12?a=Ka.afternoon:r>=4?a=Ka.morning:a=Ka.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{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 ms.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ms.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Xe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Xe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ms.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ms.s(e,t)},S:function(e,t){return ms.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return sw(r);case"XXXX":case"XX":return na(r);case"XXXXX":case"XXX":default:return na(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return sw(r);case"xxxx":case"xx":return na(r);case"xxxxx":case"xxx":default:return na(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rw(r,":");case"OOOO":default:return"GMT"+na(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rw(r,":");case"zzzz":default:return"GMT"+na(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Xe(r,t.length)},T:function(e,t,n){return Xe(+e,t.length)}};function rw(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+Xe(i,2)}function sw(e,t){return e%60===0?(e>0?"-":"+")+Xe(Math.abs(e)/60,2):na(e,t)}function na(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Xe(Math.trunc(r/60),2),i=Xe(r%60,2);return n+a+t+i}const aw=(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"})}},C2=(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"})}},DI=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return aw(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",aw(r,t)).replace("{{time}}",C2(a,t))},TI={p:C2,P:DI},PI=/^D+$/,AI=/^Y+$/,OI=["D","DD","YY","YYYY"];function zI(e){return PI.test(e)}function $I(e){return AI.test(e)}function RI(e,t,n){const r=II(e,t,n);if(console.warn(r),OI.includes(e))throw new RangeError(r)}function II(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 LI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,UI=/^'([^]*?)'?$/,BI=/''/g,WI=/[a-zA-Z]/;function HI(e,t,n){var h,u,f,p,w,v,b,g;const r=Ul(),a=(n==null?void 0:n.locale)??r.locale??Ox,i=(n==null?void 0:n.firstWeekContainsDate)??((u=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(w=n==null?void 0:n.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((g=(b=r.locale)==null?void 0:b.options)==null?void 0:g.weekStartsOn)??0,l=Ke(e,n==null?void 0:n.in);if(!BR(l))throw new RangeError("Invalid time value");let c=t.match(FI).map(y=>{const x=y[0];if(x==="p"||x==="P"){const N=TI[x];return N(y,a.formatLong)}return y}).join("").match(LI).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:VI(y)};if(nw[x])return{isToken:!0,value:y};if(x.match(WI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:y}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(y=>{if(!y.isToken)return y.value;const x=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&$I(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&zI(x))&&RI(x,t,String(e));const N=nw[x[0]];return N(l,x,a.localize,d)}).join("")}function VI(e){const t=e.match(UI);return t?t[1].replace(BI,"'"):e}function YI(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=n.getMonth(),i=St(n,0);return i.setFullYear(r,a+1,0),i.setHours(0,0,0,0),i.getDate()}function XI(e,t){return Ke(e,t==null?void 0:t.in).getMonth()}function qI(e,t){return Ke(e,t==null?void 0:t.in).getFullYear()}function GI(e,t){return+Ke(e)>+Ke(t)}function KI(e,t){return+Ke(e)<+Ke(t)}function QI(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function ZI(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()}function JI(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=r.getFullYear(),i=r.getDate(),o=St(e,0);o.setFullYear(a,t,15),o.setHours(0,0,0,0);const l=YI(o);return r.setMonth(t,Math.min(i,l)),r}function e8(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(+r)?St(e,NaN):(r.setFullYear(t),r)}const iw=5,t8=4;function n8(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),i=t.addDays(a,iw*7-1);return t.getMonth(e)===t.getMonth(i)?iw:t8}function E2(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function r8(e,t){const n=E2(e,t),r=n8(e,t);return t.addDays(n,r*7-1)}class jn{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Vt.tz(this.options.timeZone):new this.Date},this.newDate=(r,a,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(r,a,i):this.options.timeZone?new Vt(r,a,i,this.options.timeZone):new Date(r,a,i)},this.addDays=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(r,a):p2(r,a)},this.addMonths=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(r,a):x2(r,a)},this.addWeeks=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(r,a):RR(r,a)},this.addYears=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,a):IR(r,a)},this.differenceInCalendarDays=(r,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):v2(r,a)},this.differenceInCalendarMonths=(r,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):WR(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):VR(r)},this.eachYearOfInterval=r=>{var l;const a=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(r):qR(r),i=new Set(a.map(c=>this.getYear(c)));if(i.size===a.length)return a;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):r8(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):GR(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):HR(r)},this.endOfWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,a):N2(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):XR(r)},this.format=(r,a,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(r,a,this.options):HI(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.getISOWeek?this.overrides.getISOWeek(r):j2(r)},this.getMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):XI(r,this.options)},this.getYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):qI(r,this.options)},this.getWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):S2(r,this.options)},this.isAfter=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,a):GI(r,a)},this.isBefore=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,a):KI(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):w2(r)},this.isSameDay=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,a):UR(r,a)},this.isSameMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,a):QI(r,a)},this.isSameYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,a):ZI(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):LR(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):FR(r)},this.setMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,a):JI(r,a)},this.setYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,a):e8(r,a)},this.startOfBroadcastWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):E2(r,this)},this.startOfDay=r=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(r):Sl(r)},this.startOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(r):kl(r)},this.startOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(r):YR(r)},this.startOfWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):Wi(r,this.options)},this.startOfYear=r=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(r):b2(r)},this.options={locale:Ox,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&jn.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:a}=this.options,i=n==null?void 0:n.code;if(i&&jn.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}jn.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Ar=new jn;class M2{constructor(t,n,r=Ar){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class s8{constructor(t,n){this.date=t,this.weeks=n}}class a8{constructor(t,n){this.days=n,this.weekNumber=t}}function i8(e){return Q.createElement("button",{...e})}function o8(e){return Q.createElement("span",{...e})}function l8(e){const{size:t=24,orientation:n="left",className:r}=e;return Q.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Q.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Q.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Q.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Q.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function c8(e){const{day:t,modifiers:n,...r}=e;return Q.createElement("td",{...r})}function d8(e){const{day:t,modifiers:n,...r}=e,a=Q.useRef(null);return Q.useEffect(()=>{var i;n.focused&&((i=a.current)==null||i.focus())},[n.focused]),Q.createElement("button",{ref:a,...r})}var ke;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(ke||(ke={}));var ht;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(ht||(ht={}));var Jn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Jn||(Jn={}));var mn;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(mn||(mn={}));function u8(e){const{options:t,className:n,components:r,classNames:a,...i}=e,o=[a[ke.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return Q.createElement("span",{"data-disabled":i.disabled,className:a[ke.DropdownRoot]},Q.createElement(r.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:h})=>Q.createElement(r.Option,{key:c,value:c,disabled:h},d))),Q.createElement("span",{className:a[ke.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,Q.createElement(r.Chevron,{orientation:"down",size:18,className:a[ke.Chevron]})))}function h8(e){return Q.createElement("div",{...e})}function f8(e){return Q.createElement("div",{...e})}function m8(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement("div",{...r},e.children)}function p8(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement("div",{...r})}function x8(e){return Q.createElement("table",{...e})}function g8(e){return Q.createElement("div",{...e})}const _2=m.createContext(void 0);function Bl(){const e=m.useContext(_2);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function v8(e){const{components:t}=Bl();return Q.createElement(t.Dropdown,{...e})}function w8(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Bl(),h=m.useCallback(f=>{a&&(n==null||n(f))},[a,n]),u=m.useCallback(f=>{r&&(t==null||t(f))},[r,t]);return Q.createElement("nav",{...i},Q.createElement(o.PreviousMonthButton,{type:"button",className:l[ke.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:u},Q.createElement(o.Chevron,{disabled:r?void 0:!0,className:l[ke.Chevron],orientation:"left"})),Q.createElement(o.NextMonthButton,{type:"button",className:l[ke.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":d(a),onClick:h},Q.createElement(o.Chevron,{disabled:a?void 0:!0,orientation:"right",className:l[ke.Chevron]})))}function y8(e){const{components:t}=Bl();return Q.createElement(t.Button,{...e})}function b8(e){return Q.createElement("option",{...e})}function N8(e){const{components:t}=Bl();return Q.createElement(t.Button,{...e})}function j8(e){const{rootRef:t,...n}=e;return Q.createElement("div",{...n,ref:t})}function k8(e){return Q.createElement("select",{...e})}function S8(e){const{week:t,...n}=e;return Q.createElement("tr",{...n})}function C8(e){return Q.createElement("th",{...e})}function E8(e){return Q.createElement("thead",{"aria-hidden":!0},Q.createElement("tr",{...e}))}function M8(e){const{week:t,...n}=e;return Q.createElement("th",{...n})}function _8(e){return Q.createElement("th",{...e})}function D8(e){return Q.createElement("tbody",{...e})}function T8(e){const{components:t}=Bl();return Q.createElement(t.Dropdown,{...e})}const P8=Object.freeze(Object.defineProperty({__proto__:null,Button:i8,CaptionLabel:o8,Chevron:l8,Day:c8,DayButton:d8,Dropdown:u8,DropdownNav:h8,Footer:f8,Month:m8,MonthCaption:p8,MonthGrid:x8,Months:g8,MonthsDropdown:v8,Nav:w8,NextMonthButton:y8,Option:b8,PreviousMonthButton:N8,Root:j8,Select:k8,Week:S8,WeekNumber:M8,WeekNumberHeader:_8,Weekday:C8,Weekdays:E8,Weeks:D8,YearsDropdown:T8},Symbol.toStringTag,{value:"Module"}));function Wr(e,t,n=!1,r=Ar){let{from:a,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=r;return a&&i?(o(i,a)<0&&([a,i]=[i,a]),o(t,a)>=(n?1:0)&&o(i,t)>=(n?1:0)):!n&&i?l(i,t):!n&&a?l(a,t):!1}function D2(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function zx(e){return!!(e&&typeof e=="object"&&"from"in e)}function T2(e){return!!(e&&typeof e=="object"&&"after"in e)}function P2(e){return!!(e&&typeof e=="object"&&"before"in e)}function A2(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function O2(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Hr(e,t,n=Ar){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:i,isAfter:o}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return a(e,l);if(O2(l,n))return l.includes(e);if(zx(l))return Wr(l,e,!1,n);if(A2(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(D2(l)){const c=i(l.before,e),d=i(l.after,e),h=c>0,u=d<0;return o(l.before,l.after)?u&&h:h||u}return T2(l)?i(e,l.after)>0:P2(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function A8(e,t,n,r,a){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:h}=t,{isSameDay:u,isSameMonth:f,startOfMonth:p,isBefore:w,endOfMonth:v,isAfter:b}=a,g=n&&p(n),y=r&&v(r),x={[ht.focused]:[],[ht.outside]:[],[ht.disabled]:[],[ht.hidden]:[],[ht.today]:[]},N={};for(const j of e){const{date:k,displayMonth:S}=j,M=!!(S&&!f(k,S)),A=!!(g&&w(k,g)),I=!!(y&&b(k,y)),U=!!(i&&Hr(k,i,a)),$=!!(o&&Hr(k,o,a))||A||I||!d&&!c&&M||d&&c===!1&&M,L=u(k,h??a.today());M&&x.outside.push(j),U&&x.disabled.push(j),$&&x.hidden.push(j),L&&x.today.push(j),l&&Object.keys(l).forEach(E=>{const O=l==null?void 0:l[E];O&&Hr(k,O,a)&&(N[E]?N[E].push(j):N[E]=[j])})}return j=>{const k={[ht.focused]:!1,[ht.disabled]:!1,[ht.hidden]:!1,[ht.outside]:!1,[ht.today]:!1},S={};for(const M in x){const A=x[M];k[M]=A.some(I=>I===j)}for(const M in N)S[M]=N[M].some(A=>A===j);return{...k,...S}}}function O8(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[i])=>(n[i]?a.push(n[i]):t[ht[i]]?a.push(t[ht[i]]):t[Jn[i]]&&a.push(t[Jn[i]]),a),[t[ke.Day]])}function z8(e){return{...P8,...e}}function $8(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function $x(){const e={};for(const t in ke)e[ke[t]]=`rdp-${ke[t]}`;for(const t in ht)e[ht[t]]=`rdp-${ht[t]}`;for(const t in Jn)e[Jn[t]]=`rdp-${Jn[t]}`;for(const t in mn)e[mn[t]]=`rdp-${mn[t]}`;return e}function z2(e,t,n){return(n??new jn(t)).formatMonthYear(e)}const R8=z2;function I8(e,t,n){return(n??new jn(t)).format(e,"d")}function L8(e,t=Ar){return t.format(e,"LLLL")}function F8(e,t,n){return(n??new jn(t)).format(e,"cccccc")}function U8(e,t=Ar){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function B8(){return""}function $2(e,t=Ar){return t.format(e,"yyyy")}const W8=$2,H8=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:z2,formatDay:I8,formatMonthCaption:R8,formatMonthDropdown:L8,formatWeekNumber:U8,formatWeekNumberHeader:B8,formatWeekdayName:F8,formatYearCaption:W8,formatYearDropdown:$2},Symbol.toStringTag,{value:"Module"}));function V8(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...H8,...e}}function Y8(e,t,n,r,a){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=a;return c({start:o(e),end:l(e)}).map(f=>{const p=r.formatMonthDropdown(f,a),w=d(f),v=t&&f<i(t)||n&&f>i(n)||!1;return{value:w,label:p,disabled:v}})}function X8(e,t={},n={}){let r={...t==null?void 0:t[ke.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n==null?void 0:n[a]}}),r}function q8(e,t,n){const r=e.today(),a=t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let o=0;o<7;o++){const l=e.addDays(a,o);i.push(l)}return i}function G8(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=r,d=i(e),h=o(t),u=l({start:d,end:h});return a&&u.reverse(),u.map(f=>{const p=n.formatYearDropdown(f,r);return{value:c(f),label:p,disabled:!1}})}function R2(e,t,n,r){let a=(r??new jn(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const K8=R2;function I2(e,t,n){return(n??new jn(t)).formatMonthYear(e)}const Q8=I2;function Z8(e,t,n,r){let a=(r??new jn(n)).format(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a}function J8(e){return"Choose the Month"}function eL(){return""}function tL(e){return"Go to the Next Month"}function nL(e){return"Go to the Previous Month"}function rL(e,t,n){return(n??new jn(t)).format(e,"cccc")}function sL(e,t){return`Week ${e}`}function aL(e){return"Week Number"}function iL(e){return"Choose the Year"}const oL=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Q8,labelDay:K8,labelDayButton:R2,labelGrid:I2,labelGridcell:Z8,labelMonthDropdown:J8,labelNav:eL,labelNext:tL,labelPrevious:nL,labelWeekNumber:sL,labelWeekNumberHeader:aL,labelWeekday:rL,labelYearDropdown:iL},Symbol.toStringTag,{value:"Module"})),Wl=e=>e instanceof HTMLElement?e:null,mf=e=>[...e.querySelectorAll("[data-animated-month]")??[]],lL=e=>Wl(e.querySelector("[data-animated-month]")),pf=e=>Wl(e.querySelector("[data-animated-caption]")),xf=e=>Wl(e.querySelector("[data-animated-weeks]")),cL=e=>Wl(e.querySelector("[data-animated-nav]")),dL=e=>Wl(e.querySelector("[data-animated-weekdays]"));function uL(e,t,{classNames:n,months:r,focused:a,dateLib:i}){const o=m.useRef(null),l=m.useRef(r),c=m.useRef(!1);m.useLayoutEffect(()=>{const d=l.current;if(l.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const h=i.isSameMonth(r[0].date,d[0].date),u=i.isAfter(r[0].date,d[0].date),f=u?n[mn.caption_after_enter]:n[mn.caption_before_enter],p=u?n[mn.weeks_after_enter]:n[mn.weeks_before_enter],w=o.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(mf(v).forEach(x=>{if(!(x instanceof HTMLElement))return;const N=lL(x);N&&x.contains(N)&&x.removeChild(N);const j=pf(x);j&&j.classList.remove(f);const k=xf(x);k&&k.classList.remove(p)}),o.current=v):o.current=null,c.current||h||a)return;const b=w instanceof HTMLElement?mf(w):[],g=mf(e.current);if(g!=null&&g.every(y=>y instanceof HTMLElement)&&b&&b.every(y=>y instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const y=cL(e.current);y&&(y.style.zIndex="1"),g.forEach((x,N)=>{const j=b[N];if(!j)return;x.style.position="relative",x.style.overflow="hidden";const k=pf(x);k&&k.classList.add(f);const S=xf(x);S&&S.classList.add(p);const M=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),y&&(y.style.zIndex=""),k&&k.classList.remove(f),S&&S.classList.remove(p),x.style.position="",x.style.overflow="",x.contains(j)&&x.removeChild(j)};j.style.pointerEvents="none",j.style.position="absolute",j.style.overflow="hidden",j.setAttribute("aria-hidden","true");const A=dL(j);A&&(A.style.opacity="0");const I=pf(j);I&&(I.classList.add(u?n[mn.caption_before_exit]:n[mn.caption_after_exit]),I.addEventListener("animationend",M));const U=xf(j);U&&U.classList.add(u?n[mn.weeks_before_exit]:n[mn.weeks_after_exit]),x.insertBefore(j,x.firstChild)})}})}function hL(e,t,n,r){const a=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:h,differenceInCalendarMonths:u,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:w,endOfWeek:v,isAfter:b,startOfBroadcastWeek:g,startOfISOWeek:y,startOfWeek:x}=r,N=c?g(a,r):o?y(a):x(a),j=c?f(i):o?p(w(i)):v(w(i)),k=h(j,N),S=u(i,a)+1,M=[];for(let U=0;U<=k;U++){const $=d(N,U);if(t&&b($,t))break;M.push($)}const I=(c?35:42)*S;if(l&&M.length<I){const U=I-M.length;for(let $=0;$<U;$++){const L=d(M[M.length-1],1);M.push(L)}}return M}function fL(e){const t=[];return e.reduce((n,r)=>{const a=r.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function mL(e,t,n,r){const{numberOfMonths:a=1}=n,i=[];for(let o=0;o<a;o++){const l=r.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function ow(e,t,n,r){const{month:a,defaultMonth:i,today:o=r.today(),numberOfMonths:l=1}=e;let c=a||i||o;const{differenceInCalendarMonths:d,addMonths:h,startOfMonth:u}=r;if(n&&d(n,c)<l-1){const f=-1*(l-1);c=h(n,f)}return t&&d(c,t)<0&&(c=t),u(c)}function pL(e,t,n,r){const{addDays:a,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:h,startOfBroadcastWeek:u,startOfISOWeek:f,startOfWeek:p}=r,w=e.reduce((v,b)=>{const g=n.broadcastCalendar?u(b,r):n.ISOWeek?f(b):p(b),y=n.broadcastCalendar?i(b):n.ISOWeek?o(l(b)):c(l(b)),x=t.filter(S=>S>=g&&S<=y),N=n.broadcastCalendar?35:42;if(n.fixedWeeks&&x.length<N){const S=t.filter(M=>{const A=N-x.length;return M>y&&M<=a(y,A)});x.push(...S)}const j=x.reduce((S,M)=>{const A=n.ISOWeek?d(M):h(M),I=S.find($=>$.weekNumber===A),U=new M2(M,b,r);return I?I.days.push(U):S.push(new a8(A,[U])),S},[]),k=new s8(b,j);return v.push(k),v},[]);return n.reverseMonths?w.reverse():w}function xL(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:d,newDate:h,today:u}=t,{fromYear:f,toYear:p,fromMonth:w,toMonth:v}=e;!n&&w&&(n=w),!n&&f&&(n=t.newDate(f,0,1)),!r&&v&&(r=v),!r&&p&&(r=h(p,11,31));const b=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=o(n):f?n=h(f,0,1):!n&&b&&(n=a(c(e.today??u(),-100))),r?r=l(r):p?r=h(p,11,31):!r&&b&&(r=d(e.today??u())),[n&&i(n),r&&i(r)]}function gL(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i=1}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=r,d=a?i:1,h=o(e);if(!t)return l(h,d);if(!(c(t,e)<i))return l(h,d)}function vL(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=r,d=a?i??1:1,h=o(e);if(!t)return l(h,-d);if(!(c(h,t)<=0))return l(h,-d)}function wL(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Zu(e,t){const[n,r]=m.useState(e);return[t===void 0?n:t,r]}function yL(e,t){const[n,r]=xL(e,t),{startOfMonth:a,endOfMonth:i}=t,o=ow(e,n,r,t),[l,c]=Zu(o,e.month?o:void 0);m.useEffect(()=>{const k=ow(e,n,r,t);c(k)},[e.timeZone]);const d=mL(l,r,e,t),h=hL(d,e.endMonth?i(e.endMonth):void 0,e,t),u=pL(d,h,e,t),f=wL(u),p=fL(u),w=vL(l,n,e,t),v=gL(l,r,e,t),{disableNavigation:b,onMonthChange:g}=e,y=k=>f.some(S=>S.days.some(M=>M.isEqualTo(k))),x=k=>{if(b)return;let S=a(k);n&&S<a(n)&&(S=a(n)),r&&S>a(r)&&(S=a(r)),c(S),g==null||g(S)};return{months:u,weeks:f,days:p,navStart:n,navEnd:r,previousMonth:w,nextMonth:v,goToMonth:x,goToDay:k=>{y(k)||x(k.date)}}}var mr;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(mr||(mr={}));function lw(e){return!e[ht.disabled]&&!e[ht.hidden]&&!e[ht.outside]}function bL(e,t,n,r){let a,i=-1;for(const o of e){const l=t(o);lw(l)&&(l[ht.focused]&&i<mr.FocusedModifier?(a=o,i=mr.FocusedModifier):r!=null&&r.isEqualTo(o)&&i<mr.LastFocused?(a=o,i=mr.LastFocused):n(o.date)&&i<mr.Selected?(a=o,i=mr.Selected):l[ht.today]&&i<mr.Today&&(a=o,i=mr.Today))}return a||(a=e.find(o=>lw(t(o)))),a}function NL(e,t,n,r,a,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:h,addWeeks:u,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:w,endOfWeek:v,max:b,min:g,startOfBroadcastWeek:y,startOfISOWeek:x,startOfWeek:N}=o;let k={day:d,week:u,month:h,year:f,startOfWeek:S=>c?y(S,o):l?x(S):N(S),endOfWeek:S=>c?p(S):l?w(S):v(S)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=b([r,k]):t==="after"&&a&&(k=g([a,k])),k}function L2(e,t,n,r,a,i,o,l=0){if(l>365)return;const c=NL(e,t,n.date,r,a,i,o),d=!!(i.disabled&&Hr(c,i.disabled,o)),h=!!(i.hidden&&Hr(c,i.hidden,o)),u=c,f=new M2(c,u,o);return!d&&!h?f:L2(e,t,f,r,a,i,o,l+1)}function jL(e,t,n,r,a){const{autoFocus:i}=e,[o,l]=m.useState(),c=bL(t.days,n,r||(()=>!1),o),[d,h]=m.useState(i?c:void 0);return{isFocusTarget:v=>!!(c!=null&&c.isEqualTo(v)),setFocused:h,focused:d,blur:()=>{l(d),h(void 0)},moveFocus:(v,b)=>{if(!d)return;const g=L2(v,b,d,t.navStart,t.navEnd,e,a);g&&(e.disableNavigation&&!t.days.some(x=>x.isEqualTo(g))||(t.goToDay(g),h(g)))}}}function kL(e,t){const{selected:n,required:r,onSelect:a}=e,[i,o]=Zu(n,a?n:void 0),l=a?n:i,{isSameDay:c}=t,d=p=>(l==null?void 0:l.some(w=>c(w,p)))??!1,{min:h,max:u}=e;return{selected:l,select:(p,w,v)=>{let b=[...l??[]];if(d(p)){if((l==null?void 0:l.length)===h||r&&(l==null?void 0:l.length)===1)return;b=l==null?void 0:l.filter(g=>!c(g,p))}else(l==null?void 0:l.length)===u?b=[p]:b=[...b,p];return a||o(b),a==null||a(b,p,w,v),b},isSelected:d}}function SL(e,t,n=0,r=0,a=!1,i=Ar){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:d,isBefore:h}=i;let u;if(!o&&!l)u={from:e,to:n>0?void 0:e};else if(o&&!l)c(o,e)?n===0?u={from:o,to:e}:a?u={from:o,to:void 0}:u=void 0:h(e,o)?u={from:e,to:o}:u={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))a?u={from:o,to:l}:u=void 0;else if(c(o,e))u={from:o,to:n>0?void 0:e};else if(c(l,e))u={from:e,to:n>0?void 0:e};else if(h(e,o))u={from:e,to:l};else if(d(e,o))u={from:o,to:e};else if(d(e,l))u={from:o,to:e};else throw new Error("Invalid range");if(u!=null&&u.from&&(u!=null&&u.to)){const f=i.differenceInCalendarDays(u.to,u.from);r>0&&f>r?u={from:e,to:void 0}:n>1&&f<n&&(u={from:e,to:void 0})}return u}function CL(e,t,n=Ar){const r=Array.isArray(t)?t:[t];let a=e.from;const i=n.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function cw(e,t,n=Ar){return Wr(e,t.from,!1,n)||Wr(e,t.to,!1,n)||Wr(t,e.from,!1,n)||Wr(t,e.to,!1,n)}function EL(e,t,n=Ar){const r=Array.isArray(t)?t:[t];if(r.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?Wr(e,l,!1,n):O2(l,n)?l.some(c=>Wr(e,c,!1,n)):zx(l)?l.from&&l.to?cw(e,{from:l.from,to:l.to},n):!1:A2(l)?CL(e,l.dayOfWeek,n):D2(l)?n.isAfter(l.before,l.after)?cw(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Hr(e.from,l,n)||Hr(e.to,l,n):T2(l)||P2(l)?Hr(e.from,l,n)||Hr(e.to,l,n):!1))return!0;const o=r.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(o.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function ML(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:i,onSelect:o}=e,[l,c]=Zu(a,o?a:void 0),d=o?a:l;return{selected:d,select:(f,p,w)=>{const{min:v,max:b}=e,g=f?SL(f,d,v,b,i,t):void 0;return r&&n&&(g!=null&&g.from)&&g.to&&EL({from:g.from,to:g.to},n,t)&&(g.from=f,g.to=void 0),o||c(g),o==null||o(g,f,p,w),g},isSelected:f=>d&&Wr(d,f,!1,t)}}function _L(e,t){const{selected:n,required:r,onSelect:a}=e,[i,o]=Zu(n,a?n:void 0),l=a?n:i,{isSameDay:c}=t;return{selected:l,select:(u,f,p)=>{let w=u;return!r&&l&&l&&c(u,l)&&(w=void 0),a||o(w),a==null||a(w,u,f,p),w},isSelected:u=>l?c(l,u):!1}}function DL(e,t){const n=_L(e,t),r=kL(e,t),a=ML(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function TL(e){var Se;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new Vt(t.today,t.timeZone)),t.month&&(t.month=new Vt(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new Vt(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new Vt(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new Vt(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new Vt(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(Se=t.selected)==null?void 0:Se.map(ue=>new Vt(ue,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new Vt(t.selected.from,t.timeZone):void 0,to:t.selected.to?new Vt(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:i,locale:o,classNames:l}=m.useMemo(()=>{const ue={...Ox,...t.locale};return{dateLib:new jn({locale:ue,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:z8(t.components),formatters:V8(t.formatters),labels:{...oL,...t.labels},locale:ue,classNames:{...$x(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:d,navLayout:h,numberOfMonths:u=1,onDayBlur:f,onDayClick:p,onDayFocus:w,onDayKeyDown:v,onDayMouseEnter:b,onDayMouseLeave:g,onNextClick:y,onPrevClick:x,showWeekNumber:N,styles:j}=t,{formatCaption:k,formatDay:S,formatMonthDropdown:M,formatWeekNumber:A,formatWeekNumberHeader:I,formatWeekdayName:U,formatYearDropdown:$}=r,L=yL(t,i),{days:E,months:O,navStart:D,navEnd:T,previousMonth:C,nextMonth:_,goToMonth:z}=L,H=A8(E,t,D,T,i),{isSelected:P,select:B,selected:q}=DL(t,i)??{},{blur:G,focused:se,isFocusTarget:re,moveFocus:Z,setFocused:R}=jL(t,L,H,P??(()=>!1),i),{labelDayButton:ee,labelGridcell:J,labelGrid:F,labelMonthDropdown:K,labelNav:ne,labelPrevious:ce,labelNext:ge,labelWeekday:ve,labelWeekNumber:Ae,labelWeekNumberHeader:Te,labelYearDropdown:tt}=a,ut=m.useMemo(()=>q8(i,t.ISOWeek),[i,t.ISOWeek]),Le=d!==void 0||p!==void 0,Oe=m.useCallback(()=>{C&&(z(C),x==null||x(C))},[C,z,x]),Ge=m.useCallback(()=>{_&&(z(_),y==null||y(_))},[z,_,y]),Je=m.useCallback((ue,Pe)=>_e=>{_e.preventDefault(),_e.stopPropagation(),R(ue),B==null||B(ue.date,Pe,_e),p==null||p(ue.date,Pe,_e)},[B,p,R]),ot=m.useCallback((ue,Pe)=>_e=>{R(ue),w==null||w(ue.date,Pe,_e)},[w,R]),Ot=m.useCallback((ue,Pe)=>_e=>{G(),f==null||f(ue.date,Pe,_e)},[G,f]),zt=m.useCallback((ue,Pe)=>_e=>{const Fe={ArrowLeft:[_e.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[_e.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[_e.shiftKey?"year":"week","after"],ArrowUp:[_e.shiftKey?"year":"week","before"],PageUp:[_e.shiftKey?"year":"month","before"],PageDown:[_e.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Fe[_e.key]){_e.preventDefault(),_e.stopPropagation();const[bt,he]=Fe[_e.key];Z(bt,he)}v==null||v(ue.date,Pe,_e)},[Z,v,t.dir]),ae=m.useCallback((ue,Pe)=>_e=>{b==null||b(ue.date,Pe,_e)},[b]),me=m.useCallback((ue,Pe)=>_e=>{g==null||g(ue.date,Pe,_e)},[g]),ze=m.useCallback(ue=>Pe=>{const _e=Number(Pe.target.value),Fe=i.setMonth(i.startOfMonth(ue),_e);z(Fe)},[i,z]),X=m.useCallback(ue=>Pe=>{const _e=Number(Pe.target.value),Fe=i.setYear(i.startOfMonth(ue),_e);z(Fe)},[i,z]),{className:le,style:W}=m.useMemo(()=>({className:[l[ke.Root],t.className].filter(Boolean).join(" "),style:{...j==null?void 0:j[ke.Root],...t.style}}),[l,t.className,t.style,j]),te=$8(t),de=m.useRef(null);uL(de,!!t.animate,{classNames:l,months:O,focused:se,dateLib:i});const Ne={dayPickerProps:t,selected:q,select:B,isSelected:P,months:O,nextMonth:_,previousMonth:C,goToMonth:z,getModifiers:H,components:n,classNames:l,styles:j,labels:a,formatters:r};return Q.createElement(_2.Provider,{value:Ne},Q.createElement(n.Root,{rootRef:t.animate?de:void 0,className:le,style:W,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...te},Q.createElement(n.Months,{className:l[ke.Months],style:j==null?void 0:j[ke.Months]},!t.hideNavigation&&!h&&Q.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ke.Nav],style:j==null?void 0:j[ke.Nav],"aria-label":ne(),onPreviousClick:Oe,onNextClick:Ge,previousMonth:C,nextMonth:_}),O.map((ue,Pe)=>Q.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[ke.Month],style:j==null?void 0:j[ke.Month],key:Pe,displayIndex:Pe,calendarMonth:ue},h==="around"&&!t.hideNavigation&&Pe===0&&Q.createElement(n.PreviousMonthButton,{type:"button",className:l[ke.PreviousMonthButton],tabIndex:C?void 0:-1,"aria-disabled":C?void 0:!0,"aria-label":ce(C),onClick:Oe,"data-animated-button":t.animate?"true":void 0},Q.createElement(n.Chevron,{disabled:C?void 0:!0,className:l[ke.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Q.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[ke.MonthCaption],style:j==null?void 0:j[ke.MonthCaption],calendarMonth:ue,displayIndex:Pe},c!=null&&c.startsWith("dropdown")?Q.createElement(n.DropdownNav,{className:l[ke.Dropdowns],style:j==null?void 0:j[ke.Dropdowns]},(()=>{const _e=c==="dropdown"||c==="dropdown-months"?Q.createElement(n.MonthsDropdown,{key:"month",className:l[ke.MonthsDropdown],"aria-label":K(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:ze(ue.date),options:Y8(ue.date,D,T,r,i),style:j==null?void 0:j[ke.Dropdown],value:i.getMonth(ue.date)}):Q.createElement("span",{key:"month"},M(ue.date,i)),Fe=c==="dropdown"||c==="dropdown-years"?Q.createElement(n.YearsDropdown,{key:"year",className:l[ke.YearsDropdown],"aria-label":tt(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:X(ue.date),options:G8(D,T,r,i,!!t.reverseYears),style:j==null?void 0:j[ke.Dropdown],value:i.getYear(ue.date)}):Q.createElement("span",{key:"year"},$(ue.date,i));return i.getMonthYearOrder()==="year-first"?[Fe,_e]:[_e,Fe]})(),Q.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(ue.date,i.options,i))):Q.createElement(n.CaptionLabel,{className:l[ke.CaptionLabel],role:"status","aria-live":"polite"},k(ue.date,i.options,i))),h==="around"&&!t.hideNavigation&&Pe===u-1&&Q.createElement(n.NextMonthButton,{type:"button",className:l[ke.NextMonthButton],tabIndex:_?void 0:-1,"aria-disabled":_?void 0:!0,"aria-label":ge(_),onClick:Ge,"data-animated-button":t.animate?"true":void 0},Q.createElement(n.Chevron,{disabled:_?void 0:!0,className:l[ke.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Pe===u-1&&h==="after"&&!t.hideNavigation&&Q.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ke.Nav],style:j==null?void 0:j[ke.Nav],"aria-label":ne(),onPreviousClick:Oe,onNextClick:Ge,previousMonth:C,nextMonth:_}),Q.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":F(ue.date,i.options,i)||void 0,className:l[ke.MonthGrid],style:j==null?void 0:j[ke.MonthGrid]},!t.hideWeekdays&&Q.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[ke.Weekdays],style:j==null?void 0:j[ke.Weekdays]},N&&Q.createElement(n.WeekNumberHeader,{"aria-label":Te(i.options),className:l[ke.WeekNumberHeader],style:j==null?void 0:j[ke.WeekNumberHeader],scope:"col"},I()),ut.map(_e=>Q.createElement(n.Weekday,{"aria-label":ve(_e,i.options,i),className:l[ke.Weekday],key:String(_e),style:j==null?void 0:j[ke.Weekday],scope:"col"},U(_e,i.options,i)))),Q.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[ke.Weeks],style:j==null?void 0:j[ke.Weeks]},ue.weeks.map(_e=>Q.createElement(n.Week,{className:l[ke.Week],key:_e.weekNumber,style:j==null?void 0:j[ke.Week],week:_e},N&&Q.createElement(n.WeekNumber,{week:_e,style:j==null?void 0:j[ke.WeekNumber],"aria-label":Ae(_e.weekNumber,{locale:o}),className:l[ke.WeekNumber],scope:"row",role:"rowheader"},A(_e.weekNumber,i)),_e.days.map(Fe=>{const{date:bt}=Fe,he=H(Fe);if(he[ht.focused]=!he.hidden&&!!(se!=null&&se.isEqualTo(Fe)),he[Jn.selected]=(P==null?void 0:P(bt))||he.selected,zx(q)){const{from:En,to:Qe}=q;he[Jn.range_start]=!!(En&&Qe&&i.isSameDay(bt,En)),he[Jn.range_end]=!!(En&&Qe&&i.isSameDay(bt,Qe)),he[Jn.range_middle]=Wr(q,bt,!0,i)}const Ve=X8(he,j,t.modifiersStyles),vt=O8(he,l,t.modifiersClassNames),Nt=!Le&&!he.hidden?J(bt,he,i.options,i):void 0;return Q.createElement(n.Day,{key:`${i.format(bt,"yyyy-MM-dd")}_${i.format(Fe.displayMonth,"yyyy-MM")}`,day:Fe,modifiers:he,className:vt.join(" "),style:Ve,role:"gridcell","aria-selected":he.selected||void 0,"aria-label":Nt,"data-day":i.format(bt,"yyyy-MM-dd"),"data-month":Fe.outside?i.format(bt,"yyyy-MM"):void 0,"data-selected":he.selected||void 0,"data-disabled":he.disabled||void 0,"data-hidden":he.hidden||void 0,"data-outside":Fe.outside||void 0,"data-focused":he.focused||void 0,"data-today":he.today||void 0},!he.hidden&&Le?Q.createElement(n.DayButton,{className:l[ke.DayButton],style:j==null?void 0:j[ke.DayButton],type:"button",day:Fe,modifiers:he,disabled:he.disabled||void 0,tabIndex:re(Fe)?0:-1,"aria-label":ee(bt,he,i.options,i),onClick:Je(Fe,he),onBlur:Ot(Fe,he),onFocus:ot(Fe,he),onKeyDown:zt(Fe,he),onMouseEnter:ae(Fe,he),onMouseLeave:me(Fe,he)},S(bt,i.options,i)):!he.hidden&&S(Fe.date,i.options,i))})))))))),t.footer&&Q.createElement(n.Footer,{className:l[ke.Footer],style:j==null?void 0:j[ke.Footer],role:"status","aria-live":"polite"},t.footer)))}function On({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:o,...l}){const c=$x();return s.jsx(TL,{showOutsideDays:n,className:De("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:De("w-fit",c.root),months:De("relative flex flex-col gap-4 md:flex-row",c.months),month:De("flex w-full flex-col gap-4",c.month),nav:De("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:De(Hm({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:De(Hm({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:De("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:De("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:De("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:De("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:De("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:De("flex",c.weekdays),weekday:De("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:De("mt-2 flex w-full",c.week),week_number_header:De("w-[--cell-size] select-none",c.week_number_header),week_number:De("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:De("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:De("bg-accent rounded-l-md",c.range_start),range_middle:De("rounded-none",c.range_middle),range_end:De("bg-accent rounded-r-md",c.range_end),today:De("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:De("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:De("text-muted-foreground opacity-50",c.disabled),hidden:De("invisible",c.hidden),...t},components:{Root:({className:d,rootRef:h,...u})=>s.jsx("div",{"data-slot":"calendar",ref:h,className:De(d),...u}),Chevron:({className:d,orientation:h,...u})=>h==="left"?s.jsx(FN,{className:De("size-4",d),...u}):h==="right"?s.jsx(hx,{className:De("size-4",d),...u}):s.jsx(zu,{className:De("size-4",d),...u}),DayButton:PL,WeekNumber:({children:d,...h})=>s.jsx("td",{...h,children:s.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:d})}),...o},...l})}function PL({className:e,day:t,modifiers:n,...r}){const a=$x(),i=m.useRef(null);return m.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),s.jsx(Y,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:De("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",a.day,e),...r})}var Ju="Popover",[F2]=$u(Ju,[Wu]),Hl=Wu(),[AL,Xs]=F2(Ju),U2=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=Hl(t),c=m.useRef(null),[d,h]=m.useState(!1),[u,f]=Cx({prop:r,defaultProp:a??!1,onChange:i,caller:Ju});return s.jsx(wj,{...l,children:s.jsx(AL,{scope:t,contentId:nr(),triggerRef:c,open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};U2.displayName=Ju;var B2="PopoverAnchor",OL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(B2,n),i=Hl(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return m.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(kx,{...i,...r,ref:t})});OL.displayName=B2;var W2="PopoverTrigger",H2=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(W2,n),i=Hl(n),o=Cn(t,a.triggerRef),l=s.jsx(dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":G2(a.open),...r,ref:o,onClick:_t(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:s.jsx(kx,{asChild:!0,...i,children:l})});H2.displayName=W2;var Rx="PopoverPortal",[zL,$L]=F2(Rx,{forceMount:void 0}),V2=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Xs(Rx,t);return s.jsx(zL,{scope:t,forceMount:n,children:s.jsx(Ia,{present:n||i.open,children:s.jsx(Sx,{asChild:!0,container:a,children:r})})})};V2.displayName=Rx;var Hi="PopoverContent",Y2=m.forwardRef((e,t)=>{const n=$L(Hi,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Xs(Hi,e.__scopePopover);return s.jsx(Ia,{present:r||i.open,children:i.modal?s.jsx(IL,{...a,ref:t}):s.jsx(LL,{...a,ref:t})})});Y2.displayName=Hi;var RL=Ru("PopoverContent.RemoveScroll"),IL=m.forwardRef((e,t)=>{const n=Xs(Hi,e.__scopePopover),r=m.useRef(null),a=Cn(t,r),i=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return Wj(o)},[]),s.jsx(_x,{as:RL,allowPinchZoom:!0,children:s.jsx(X2,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_t(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_t(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:_t(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),LL=m.forwardRef((e,t)=>{const n=Xs(Hi,e.__scopePopover),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(X2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),X2=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,...u}=e,f=Xs(Hi,n),p=Hl(n);return Oj(),s.jsx(Mx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Iu,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:s.jsx(yj,{"data-state":G2(f.open),role:"dialog",id:f.contentId,...p,...u,ref:t,style:{...u.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)"}})})})}),q2="PopoverClose",FL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(q2,n);return s.jsx(dt.button,{type:"button",...r,ref:t,onClick:_t(e.onClick,()=>a.onOpenChange(!1))})});FL.displayName=q2;var UL="PopoverArrow",BL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Hl(n);return s.jsx(bj,{...a,...r,ref:t})});BL.displayName=UL;function G2(e){return e?"open":"closed"}var WL=U2,HL=H2,VL=V2,K2=Y2;const zn=WL,$n=HL,pn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},a)=>s.jsx(VL,{children:s.jsx(K2,{ref:a,align:t,sideOffset:n,className:De("z-50 w-auto p-0 rounded-lg border border-white/20 bg-black text-white shadow-lg 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",e),...r})}));pn.displayName=K2.displayName;const dw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M20 3H2v14h8v2H8v2h8v-2h-2v-2h8V3h-2zm-6 12H4V5h16v10h-6z",fill:"currentColor"})}),zc=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M7 8H5v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2V8h-2v2h-2v2h-2v2h-2v-2H9v-2H7V8z",fill:"currentColor"})}),YL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})}),Yn=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2h2v2h4v18H3V4h4V2h2v2h6V2zM9 6H5v2h14V6H9zm-4 4v10h14V10H5zm2 2h8v2H7v-2zm4 6v-2H7v2h4z",fill:"currentColor"})}),XL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M2 2h14v4h6v16H2V2zm18 6h-4v2h2v2h-2v2h2v2h-2v2h2v2h2V8zm-6-4H4v16h2v-2h6v2h2V4zM6 6h2v2H6V6zm6 0h-2v2h2V6zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2z",fill:"currentColor"})}),qL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z",fill:"currentColor"})}),ws=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z",fill:"currentColor"})}),GL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M3 3h18v18H3V3zm16 2H5v14h14V5zM7 12h2v5H7v-5zm10-5h-2v10h2V7zm-6 3h2v2h-2v-2zm2 4h-2v3h2v-3z",fill:"currentColor"})}),Ir=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M22 4H2v16h20V4zM4 18V6h16v12H4zM8 8H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8V8z",fill:"currentColor"})}),Q2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M6 2h8v2H6V2zM4 6V4h2v2H4zm0 8H2V6h2v8zm2 2H4v-2h2v2zm8 0v2H6v-2h8zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm0-8h2v8h-2V6zm0 0V4h-2v2h2z",fill:"currentColor"})}),$c=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h12v2H6v4h12v-4h2v6H4v-6z",fill:"currentColor"})}),Ze=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M11 0H5v2H3v6h2v2h6V8H5V2h6V0zm0 2h2v6h-2V2zM0 14h2v4h12v2H0v-6zm2 0h12v-2H2v2zm14 0h-2v6h2v-6zM15 0h4v2h-4V0zm4 8h-4v2h4V8zm0-6h2v6h-2V2zm5 12h-2v4h-4v2h6v-6zm-6-2h4v2h-4v-2z",fill:"currentColor"})}),Kt=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M5 5h2v2H5V5zm4 4H7V7h2v2zm2 2H9V9h2v2zm2 0h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm2-2v2h-2V9h2zm2-2v2h-2V7h2zm0 0V5h2v2h-2z",fill:"currentColor"})}),Z2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2h-2v2h2v2h-2v2h-2v2H9V8H7V6H5V4H3v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2V8h2V6h2V4h-2v2h-2v2h-2v2h-2V6h2V4h2V2zm-2 12h2v2h-2v-2zm-2-2h2v2h-2v-2zm-2-2h2v2H9v-2zm-2-2h2v2H7v-2zm8 6h2v2h-2v-2zm2-2h2v2h-2v-2zm2-2h2v2h-2v-2zm2-2h-2v-2h2v2z",fill:"currentColor"})}),Vr=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M2 4h20v4H2V4zm18 2v2H4V6h16zm0 6H2v4h18v-4zm-2 2v2H4v-2h14zM2 16h20v4H2v-4zm18 2v2H4v-2h16z",fill:"currentColor"})}),KL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 4c2.21 0 4 1.79 4 4s-1.79 4-4 4-4-1.79-4-4 1.79-4 4-4zm0 6c1.38 0 2.5-1.12 2.5-2.5S13.38 11.5 12 11.5 9.5 12.62 9.5 14 10.62 16.5 12 16.5z",fill:"currentColor"})}),uw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm10-4h-2v2h2v-2z",fill:"currentColor"})}),Vo=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm12-6h-2v2h2v2h2v-2h-2v-2z",fill:"currentColor"})}),gf=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-1.57.46-3.03 1.24-4.26L16.26 18.76C15.03 19.54 13.57 20 12 20zm6.76-3.74L7.74 5.24C8.97 4.46 10.43 4 12 4c4.41 0 8 3.59 8 8 0 1.57-.46 3.03-1.24 4.26z",fill:"currentColor"})}),ca=e=>s.jsx(Sr,{...e,className:"w-4 h-4 animate-spin"}),QL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M6 2h12v2H6V2zm0 2v16h12V4H6zm8 2H10v2h4V6zm-4 4h4v8h-4v-8z",fill:"currentColor"})}),ZL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M8 4h2v4h4V4h2v4h4v2h-4v4h4v2h-4v4h-2v-4H8v4H6v-4H2v-2h4V8H2V6h4V4zm2 6v4h4v-4h-4z",fill:"currentColor"})}),Ln=({className:e="",size:t=24})=>s.jsx(XL,{className:e,size:t}),hw=({className:e="",size:t=24})=>s.jsx(GL,{className:e,size:t}),Ym=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M4 2h12v2H4v12H2V2h2zm4 4h12v16H8V6zm2 2v12h8V8h-8z",fill:"currentColor"})}),J2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4H8v2H6v2h2v2h2v-2h2V8h-2V6zm6 0h-2v2h2V6zm2 0h2v2h-2V6zm-6 8h-2v-2h2v2zm-4 0H6v-2h2v2zm-4 0H2v-2h2v2zm8 4h-2v-2h2v2zm4 0h2v-2h-2v2zm-6 2h2v2h-2v-2zm4 0h2v2h-2v-2z",fill:"currentColor"})}),JL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4h6v2h-2v6h-2V8H8V6zm-4 8h12v2H4v-2zm0 4h12v2H4v-2z",fill:"currentColor"})}),od=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M10 2h4v2h6v2h-2v14H6V6H4V4h6V2zM8 6v14h8V6H8zm2 2h2v10h-2V8zm4 0h2v10h-2V8z",fill:"currentColor"})}),fw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M2 4h20v2H2V4zm0 4h18v2H2V8zm0 4h16v2H2v-2zm0 4h14v2H2v-2z",fill:"currentColor"})}),Ix=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-5l6-6-1.41-1.41L11 12.17l-2.59-2.58L7 10.59l4 4z",fill:"currentColor"})}),mw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 1h2v8h8v4h-2v-2h-8V5h-2V1zM8 7V5h2v2H8zM6 9V7h2v2H6zm-2 2V9h2v2H4zm10 8v2h-2v2h-2v-8H2v-4h2v2h8v6h2zm2-2v2h-2v-2h2zm2-2v2h-2v-2h2zm0 0h2v-2h-2v2z",fill:"currentColor"})}),$s=(e,t,n)=>{const r=document.createElement(e),[a,i]=Array.isArray(t)?[void 0,t]:[t,n];return a&&Object.assign(r,a),i==null||i.forEach(o=>r.appendChild(o)),r},eF=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},tF=e=>e.offsetWidth>0&&e.offsetHeight>0,nF=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function rF(e,t,{reverse:n=!1}={}){const r=e.length;for(let a=n?r-1:0;n?a>=0:a<r;n?a--:a++)t(e[a],a)}function sF(e,t,n,r){const a=t.formatToParts(e);n&&a.unshift({type:"prefix",value:n}),r&&a.push({type:"suffix",value:r});const i=[],o=[],l=[],c=[],d={},h=v=>`${v}:${d[v]=(d[v]??-1)+1}`;let u="",f=!1,p=!1;for(const v of a){u+=v.value;const b=v.type==="minusSign"||v.type==="plusSign"?"sign":v.type;b==="integer"?(f=!0,o.push(...v.value.split("").map(g=>({type:b,value:parseInt(g)})))):b==="group"?o.push({type:b,value:v.value}):b==="decimal"?(p=!0,l.push({type:b,value:v.value,key:h(b)})):b==="fraction"?l.push(...v.value.split("").map(g=>({type:b,value:parseInt(g),key:h(b),pos:-1-d[b]}))):(f||p?c:i).push({type:b,value:v.value,key:h(b)})}const w=[];for(let v=o.length-1;v>=0;v--){const b=o[v];w.unshift(b.type==="integer"?{...b,key:h(b.type),pos:d[b.type]}:{...b,key:h(b.type)})}return{pre:i,integer:w,fraction:l,post:c,valueAsString:u,value:typeof e=="string"?parseFloat(e):e}}const aF=String.raw,iF=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),oF=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),pw=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,nu="--_number-flow-d-opacity",Lx="--_number-flow-d-width",ru="--_number-flow-dx",Fx="--_number-flow-d",lF=(()=>{try{return CSS.registerProperty({name:nu,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:ru,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:Lx,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Fx,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),cF="var(--number-flow-char-height, 1em)",xs="var(--number-flow-mask-height, 0.25em)",xw=`calc(${xs} / 2)`,Xm="var(--number-flow-mask-width, 0.5em)",Qs=`calc(${Xm} / var(--scale-x))`,Rc="#000 0, transparent 71%",gw=aF`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${cF} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${Lx}) / var(--width));transform:translateX(var(${ru})) scaleX(var(--scale-x));margin:0 calc(-1 * ${Xm});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${Qs},#000 calc(100% - ${Qs}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${xs},#000 calc(100% - ${xs}),transparent 100% ),radial-gradient(at bottom right,${Rc}),radial-gradient(at bottom left,${Rc}),radial-gradient(at top left,${Rc}),radial-gradient(at top right,${Rc});-webkit-mask-size:100% calc(100% - ${xs} * 2),calc(100% - ${Qs} * 2) 100%,${Qs} ${xs},${Qs} ${xs},${Qs} ${xs},${Qs} ${xs};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${xw} ${Xm};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${ru})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${Fx})}.digit__num,.number .section::after{padding:${xw} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${nu}))}`,dF=HTMLElement,uF=oF&&iF&&lF;let Ic;class ek extends dF{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(r=>r.finish()))}set data(t){var n;if(t==null)return;const{pre:r,integer:a,fraction:i,post:o,value:l}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,l):this.trend,this.computedAnimated=uF&&this._animated&&(!this.respectMotionPreference||!(pw!=null&&pw.matches))&&tF(this),(n=this.plugins)==null||n.forEach(d=>{var h;return(h=d.onUpdate)==null?void 0:h.call(d,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(r),this._num.update({integer:a,fraction:i}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)Ic||(Ic=new CSSStyleSheet,Ic.replaceSync(gw)),this.shadowRoot.adoptedStyleSheets=[Ic];else{const c=document.createElement("style");c.textContent=gw,this.shadowRoot.appendChild(c)}this._pre=new ww(this,r,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new hF(this,a,i),this.shadowRoot.appendChild(this._num.el),this._post=new ww(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}ek.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};class hF{constructor(t,n,r,{className:a,...i}={}){this.flow=t,this._integer=new vw(t,n,{justify:"right",part:"integer"}),this._fraction=new vw(t,r,{justify:"left",part:"fraction"}),this._inner=$s("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=$s("span",{...i,part:"number",className:`number ${a??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,r=this.el.offsetWidth,a=this._prevWidth-r;this.el.style.setProperty("--width",String(r)),this.el.animate({[ru]:[`${n}px`,"0px"],[Lx]:[a,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class tk{constructor(t,n,{justify:r,className:a,...i},o){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=r;const l=n.map(c=>this.addChar(c).el);this.el=$s("span",{...i,className:`section section--justify-${r} ${a??""}`},o?o(l):l)}addChar(t,{startDigitsAtZero:n=!1,...r}={}){const a=t.type==="integer"||t.type==="fraction"?new rk(this,t.type,n?0:t.value,t.pos,{...r,onRemove:this.onCharRemove(t.key)}):new fF(this,t.type,t.value,{...r,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,a),a}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${eF(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,r=new Map,a=this.justify==="left",i=a?"prepend":"append";if(rF(t,o=>{let l;this.children.has(o.key)?(l=this.children.get(o.key),r.set(o,l),this.unpop(l),l.present=!0):(l=this.addChar(o,{startDigitsAtZero:!0,animateIn:!0}),n.set(o,l)),this.el[i](l.el)},{reverse:a}),this.flow.computedAnimated){const o=this.el.getBoundingClientRect();n.forEach(l=>{l.willUpdate(o)})}n.forEach((o,l)=>{o.update(l.value)}),r.forEach((o,l)=>{o.update(l.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(a=>a.didUpdate(t));const n=t[this.justify],r=this._prevOffset-n;r&&this.children.size&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class vw extends tk{update(t){const n=new Map;this.children.forEach((r,a)=>{t.find(i=>i.key===a)||n.set(a,r),this.unpop(r)}),this.addNewAndUpdateExisting(t),n.forEach(r=>{r instanceof rk&&r.update(0)}),this.pop(n)}}class ww extends tk{update(t){const n=new Map;this.children.forEach((r,a)=>{t.find(i=>i.key===a)||n.set(a,r)}),this.pop(n),this.addNewAndUpdateExisting(t)}}class qm{constructor(t,n,{onRemove:r,animateIn:a=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var i;this.el.remove(),(i=this._onRemove)==null||i.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&a&&this.el.animate({[nu]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=r}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[nu]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class nk extends qm{constructor(t,n,r,a){super(t.flow,r,a),this.section=t,this.value=n,this.el=r}}class rk extends nk{constructor(t,n,r,a,i){var o,l;const c=(((l=(o=t.flow.digits)==null?void 0:o[a])==null?void 0:l.max)??9)+1,d=Array.from({length:c}).map((u,f)=>{const p=$s("span",{className:"digit__num"},[document.createTextNode(String(f))]);return f!==r&&p.setAttribute("inert",""),p.style.setProperty("--n",String(f)),p}),h=$s("span",{part:`digit ${n}-digit`,className:"digit"},d);h.style.setProperty("--current",String(r)),h.style.setProperty("--length",String(c)),super(t,r,h,i),this.pos=a,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=d,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const r=n[this.section.justify]-t[this.section.justify],a=n.width/2;this._prevCenter=this.section.justify==="left"?r+a:r-a}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,r)=>r===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),r=n[this.section.justify]-t[this.section.justify],a=n.width/2,i=this.section.justify==="left"?r+a:r-a,o=this._prevCenter-i;o&&this.el.animate({transform:[`translateX(${o}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const l=this.getDelta();l&&(this.el.classList.add("is-spinning"),this.el.animate({[Fx]:[-l,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const a of this.flow.plugins){const i=(t=a.getDelta)==null?void 0:t.call(a,this.value,this._prevValue,this);if(i!=null)return i}const n=this.value-this._prevValue,r=this.flow.computedTrend||Math.sign(n);return r<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:r>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:n}}class fF extends nk{constructor(t,n,r,a){const i=$s("span",{className:"symbol__value",textContent:r});super(t,r,$s("span",{part:`symbol ${n}`,className:"symbol"},[i]),a),this.type=n,this._children=new Map,this._onChildRemove=o=>()=>{this._children.delete(o)},this._children.set(r,new qm(this.flow,i,{onRemove:this._onChildRemove(r)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const r=this._children.get(t);if(r)r.present=!0;else{const a=$s("span",{className:"symbol__value",textContent:t});this.el.appendChild(a),this._children.set(t,new qm(this.flow,a,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],r=this._prevOffset-n;r&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}var kw;const mF=parseInt((kw=m.version.match(/^(\d+)\./))==null?void 0:kw[1]),Ux=mF>=19,pF=["data","digits"];class Bx extends ek{attributeChangedCallback(t,n,r){this[t]=JSON.parse(r)}}Bx.observedAttributes=Ux?[]:pF;nF("number-flow-react",Bx);const vf={},yw=Ux?e=>e:JSON.stringify;function bw(e){const{transformTiming:t,spinTiming:n,opacityTiming:r,animated:a,respectMotionPreference:i,trend:o,plugins:l,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:r,animated:a,respectMotionPreference:i,trend:o,plugins:l},c]}class xF extends m.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=bw(this.props);Object.entries(n).forEach(([r,a])=>{this.el[r]=a??Bx.defaultProps[r]}),t!=null&&t.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t!=null&&t.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),Ux&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){var n;if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>{var r;return(r=this.props.group)==null?void 0:r.didUpdate()};if(!this.props.isolate)return(n=this.el)==null||n.willUpdate(),()=>{var r;return(r=this.el)==null?void 0:r.didUpdate()}}return null}componentDidUpdate(t,n,r){r==null||r()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:r,data:a,willChange:i,isolate:o,group:l,digits:c,onAnimationsStart:d,onAnimationsFinish:h,...u}]=bw(this.props);return m.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":i?"":void 0,class:r,...u,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:yw(c),data:yw(a)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const gF=m.forwardRef(function({value:t,locales:n,format:r,prefix:a,suffix:i,...o},l){m.useImperativeHandle(l,()=>c.current,[]);const c=m.useRef(),d=m.useContext(vF);d==null||d.useRegister(c);const h=m.useMemo(()=>n?JSON.stringify(n):"",[n]),u=m.useMemo(()=>r?JSON.stringify(r):"",[r]),f=m.useMemo(()=>{var w;const p=vf[w=`${h}:${u}`]??(vf[w]=new Intl.NumberFormat(n,r));return sF(t,p,a,i)},[t,h,u,a,i]);return m.createElement(xF,{...o,group:d,data:f,innerRef:c})}),vF=m.createContext(void 0),wF={notation:"compact",maximumFractionDigits:1};function br({value:e,loading:t=!1,className:n,prefix:r,suffix:a,format:i,trend:o,fallback:l="…"}){const c=m.useMemo(()=>{if(e==null)return 0;const u=Number(e);return Number.isFinite(u)?u:0},[e]);if(t)return s.jsxs("span",{className:Xd("inline-flex items-baseline",n),children:[r,l,a]});const d=gF,h=typeof o=="boolean"?o?1:0:o;return s.jsxs("span",{className:Xd("inline-flex",n),children:[r,s.jsx(d,{value:c,format:i??wF,trend:h,className:"inline-flex"}),a]})}function Oa({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:r="",defaultCollapsed:a=!1}){const[i,o]=m.useState(a),l=m.useRef(null);m.useEffect(()=>{const u=l.current;!u||i||u.scrollTo({top:u.scrollHeight,behavior:"smooth"})},[i]);const c=u=>{switch(u.type){case"success":return s.jsx(Et,{className:"w-3 h-3 text-green-400"});case"error":return s.jsx(ra,{className:"w-3 h-3 text-red-400"});case"progress":return u.status==="running"?s.jsx(Sr,{className:"w-3 h-3 text-blue-400 animate-spin"}):u.status==="completed"?s.jsx(Et,{className:"w-3 h-3 text-green-400"}):u.status==="failed"?s.jsx(ra,{className:"w-3 h-3 text-red-400"}):s.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"});default:return s.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"})}},d=u=>{switch(u.type){case"success":return"text-green-400";case"error":return"text-red-400";case"progress":return u.status==="running"?"text-blue-400":u.status==="completed"?"text-green-400":u.status==="failed"?"text-red-400":"text-gray-400";default:return"text-gray-300"}},h=u=>u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+u.getMilliseconds().toString().padStart(3,"0");return s.jsxs("div",{className:`bg-black/90 border border-dashed border-white/20 rounded-none font-mono text-xs ${r}`,children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-dashed border-white/10",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(HP,{className:"w-3 h-3 text-green-400"}),s.jsx("span",{className:"text-green-400 font-medium text-xs",children:e})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[n&&s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse"}),s.jsx("span",{className:"text-green-400 text-xs",children:"RUNNING"})]}),s.jsxs("div",{className:"text-gray-400 text-xs",children:[t.length," / ",t.length]}),s.jsx("button",{onClick:()=>o(!i),className:"text-gray-400 hover:text-white transition-colors",children:i?s.jsx(zu,{className:"w-3 h-3"}):s.jsx(zP,{className:"w-3 h-3"})})]})]}),!i&&s.jsxs("div",{ref:l,className:"p-3 space-y-0.5 h-56 overflow-y-auto",children:[t.length===0?s.jsxs("div",{className:"text-gray-500 italic text-xs",children:[s.jsx("span",{className:"text-green-400",children:"$"})," Waiting for operations..."]}):t.map(u=>s.jsxs("div",{className:`flex items-start space-x-3 py-1 ${d(u)} text-xs`,children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(u.timestamp)}),s.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),s.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c(u)}),s.jsx("span",{className:"flex-1 min-w-0 break-words",children:u.message})]},u.id)),n&&s.jsxs("div",{className:"flex items-start space-x-3 py-1 text-green-400 text-xs",children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(new Date)}),s.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),s.jsx("div",{className:"w-3 h-3 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 flex items-center",children:s.jsx("span",{className:"animate-pulse",children:"█"})})]})]}),!i&&s.jsx("div",{className:"px-3 py-1.5 border-t border-dashed border-white/10 bg-black/50",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("span",{children:["Status: ",n?"Active":"Idle"]}),s.jsxs("span",{children:["Lines: ",t.length]})]}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full"}),s.jsx("span",{children:"Better Auth Studio"})]})]})})]})}const sk=document.createElement("style");sk.textContent=`
|
|
404
404
|
@keyframes fadeIn {
|
|
405
405
|
from {
|
|
406
406
|
opacity: 0;
|
|
@@ -417,7 +417,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
417
417
|
}
|
|
418
418
|
`;document.head.appendChild(sk);const Ie=m.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:`flex h-10 w-full border border-dashed border-white/20 bg-black/30 px-3 py-2 text-sm text-white placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,ref:r,...n}));Ie.displayName="Input";const He=m.forwardRef(({className:e,...t},n)=>s.jsx("label",{className:`text-sm font-light text-white ${e}`,ref:n,...t}));He.displayName="Label";function ak({currentPage:e,totalPages:t,onPageChange:n,totalItems:r,startIndex:a,endIndex:i}){const o=()=>{const d=[],h=[];for(let u=Math.max(2,e-2);u<=Math.min(t-1,e+2);u++)d.push(u);return e-2>2?h.push(1,"..."):h.push(1),h.push(...d),e+2<t-1?h.push("...",t):t>1&&h.push(t),h};if(t<=1)return null;const l=o();return s.jsxs("div",{className:"flex items-center justify-between mt-6",children:[s.jsxs("div",{className:"text-sm text-gray-400",children:["Showing ",a+1," to ",Math.min(i,r)," of ",r," items"]}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>n(e-1),disabled:e===1,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[s.jsx(FN,{className:"w-4 h-4"}),"Previous"]}),l.map((c,d)=>{if(c==="...")return s.jsx(Y,{variant:"outline",size:"sm",disabled:!0,className:"border border-dashed border-white/20 text-white rounded-none",children:s.jsx(UP,{className:"w-4 h-4"})},`dots-${d}`);const h=c,u=e===h;return s.jsx(Y,{variant:u?"default":"outline",size:"sm",onClick:()=>n(h),className:u?"bg-white text-black rounded-none":"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:h},h)}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>n(e+1),disabled:e===t,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:["Next",s.jsx(hx,{className:"w-4 h-4"})]})]})]})}const Vl=m.createContext({isOpen:!1,setIsOpen:()=>{}}),pa=m.forwardRef(({className:e,value:t,onValueChange:n,children:r,...a},i)=>{const[o,l]=m.useState(!1);return s.jsx(Vl.Provider,{value:{value:t,onValueChange:n,isOpen:o,setIsOpen:l},children:s.jsx("div",{ref:i,className:`relative ${e}`,...a,children:r})})});pa.displayName="Select";const xa=m.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:a,setIsOpen:i}=m.useContext(Vl);return s.jsxs("button",{ref:r,type:"button",className:`flex h-10 w-full items-center justify-between border bg-black/30 px-3 py-2 text-sm text-white focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,onClick:()=>i(!a),...n,children:[t,s.jsx(zu,{className:`h-4 w-4 text-gray-400 transition-transform ${a?"rotate-180":""}`})]})});xa.displayName="SelectTrigger";const Wx=m.forwardRef(({className:e,placeholder:t,...n},r)=>{const{value:a}=m.useContext(Vl);return s.jsx("span",{ref:r,className:`text-sm text-white ${e}`,...n,children:a||t})});Wx.displayName="SelectValue";const ga=m.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:a}=m.useContext(Vl);return a?s.jsx("div",{ref:r,className:`absolute top-full left-0 right-0 z-50 mt-1 border border-dashed border-white/20 bg-black/90 rounded-none shadow-lg ${e}`,...n,children:t}):null});ga.displayName="SelectContent";const sn=m.forwardRef(({className:e,children:t,value:n,...r},a)=>{const{onValueChange:i,setIsOpen:o}=m.useContext(Vl);return s.jsx("div",{ref:a,className:`px-3 py-2 text-sm text-white hover:bg-white/10 cursor-pointer ${e}`,onClick:()=>{i==null||i(n),o(!1)},...r,children:t})});sn.displayName="SelectItem";function ik(){const e=_r(),{counts:t,refetchCounts:n}=Xu(),[r,a]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(null),[d,h]=m.useState(""),[u,f]=m.useState("all"),[p,w]=m.useState([]),[v,b]=m.useState(1),[g]=m.useState(20),[y,x]=m.useState(!1),[N,j]=m.useState(!1),[k,S]=m.useState(!1),[M,A]=m.useState(!1),[I,U]=m.useState(!1),[$,L]=m.useState(!1),[E,O]=m.useState(null),[D,T]=m.useState([]),[C,_]=m.useState(!1),[z,H]=m.useState({name:"",slug:""}),[P,B]=m.useState({name:"",slug:""});m.useEffect(()=>{R()},[]);const q=ae=>ae.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),G=ae=>{const me=q(ae);H({name:ae,slug:me})},se=ae=>{H(me=>({...me,slug:q(ae)}))},re=ae=>{const me=q(ae);B({name:ae,slug:me})},Z=ae=>{B(me=>({...me,slug:q(ae)}))},R=async()=>{try{const me=await(await fetch("/api/plugins")).json(),ze=(me==null?void 0:me.plugins).find(X=>X.id==="organization");c({enabled:!!ze,availablePlugins:(me==null?void 0:me.plugins).map(X=>X.id),configPath:me.configPath,organizationPlugin:(me==null?void 0:me.plugins).find(X=>X.id==="organization")}),ze?await ee():o(!1)}catch(ae){console.error("Failed to check plugin status:",ae),c({enabled:!1,error:"Failed to check plugin status"}),o(!1)}},ee=async()=>{try{const me=await(await fetch("/api/organizations?limit=10000")).json();console.log({lenght:me.organizations.length}),a(me.organizations||[])}catch(ae){console.error("Failed to fetch organizations:",ae),V.error("Failed to fetch organizations")}finally{o(!1)}},J=async ae=>{T([]),_(!0),T([{id:"start",type:"info",message:`Starting organization seeding process for ${ae} organizations...`,timestamp:new Date}]);try{const ze=await(await fetch("/api/seed/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:ae})})).json();if(ze.success){const X=ze.results.map((W,te)=>W.success?{id:`org-${te}`,type:"progress",message:`Creating organization: ${W.organization.name} (${W.organization.slug})`,timestamp:new Date,status:"completed"}:{id:`org-${te}`,type:"error",message:`Failed to create organization ${te+1}: ${W.error}`,timestamp:new Date});T(W=>[...W,...X]);const le=ze.results.filter(W=>W.success).length;T(W=>[...W,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${le}/${ae} organizations successfully`,timestamp:new Date}]),await ee(),await n()}else T(X=>[...X,{id:"error",type:"error",message:`❌ Seeding failed: ${ze.error||"Unknown error"}`,timestamp:new Date}])}catch(me){T(ze=>[...ze,{id:"error",type:"error",message:`❌ Network error: ${me}`,timestamp:new Date}])}finally{_(!1)}},F=ae=>{O(ae),U(!0)},K=ae=>{O(ae),B({name:ae.name,slug:ae.slug}),S(!0)},ne=ae=>{O(ae),A(!0)},ce=async()=>{if(!z.name){V.error("Please fill in the organization name");return}const ae=V.loading("Creating organization...");try{const ze=await(await fetch("/api/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:z.name,slug:z.slug})})).json();ze.success?(await ee(),x(!1),H({name:"",slug:""}),V.success("Organization created successfully!",{id:ae})):V.error(`Error creating organization: ${ze.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error creating organization:",me),V.error("Error creating organization",{id:ae})}},ge=async()=>{if(!E){V.error("No organization selected");return}if(!P.name){V.error("Please fill in the organization name");return}const ae=V.loading("Updating organization...");try{const ze=await(await fetch(`/api/organizations/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,slug:P.slug})})).json();ze.success?(await ee(),S(!1),O(null),B({name:"",slug:""}),V.success("Organization updated successfully!",{id:ae})):V.error(`Error updating organization: ${ze.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error updating organization:",me),V.error("Error updating organization",{id:ae})}},ve=async()=>{if(!E){V.error("No organization selected");return}const ae=V.loading("Deleting organization...");try{const ze=await(await fetch(`/api/organizations/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ze.success?(await ee(),await n(),A(!1),O(null),V.success("Organization deleted successfully!",{id:ae})):V.error(`Error deleting organization: ${ze.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error deleting organization:",me),V.error("Error deleting organization",{id:ae})}},Ae=()=>{if(r.length===0){V.error("No organizations to export");return}const ae=["ID","Name","Slug","Created At","Updated At"],me=r.map(te=>[te.id,te.name||"",te.slug||"",new Date(te.createdAt).toLocaleString(),new Date(te.updatedAt).toLocaleString()]),ze=[ae.join(","),...me.map(te=>te.map(de=>`"${de}"`).join(","))].join(`
|
|
419
419
|
`),X=new Blob([ze],{type:"text/csv;charset=utf-8;"}),le=document.createElement("a"),W=URL.createObjectURL(X);le.setAttribute("href",W),le.setAttribute("download",`organizations-export-${new Date().toISOString().split("T")[0]}.csv`),le.style.visibility="hidden",document.body.appendChild(le),le.click(),document.body.removeChild(le),V.success(`Exported ${r.length} organizations to CSV`)},Te=ae=>{p.some(me=>me.type===ae)||w([...p,{type:ae}])},tt=ae=>{w(p.filter(me=>me.type!==ae))},ut=()=>{w([])},Le=(ae,me)=>{w(ze=>ze.map(X=>X.type===ae?{...X,dateRange:me}:X))},Oe=r.filter(ae=>{const me=ae.name.toLowerCase().includes(d.toLowerCase())||ae.slug.toLowerCase().includes(d.toLowerCase());if(p.length===0)return me;const ze=p.every(X=>{var le,W,te,de;switch(X.type){case"createdAt":{if(!((le=X.dateRange)!=null&&le.from)&&!((W=X.dateRange)!=null&&W.to))return!0;const Ne=new Date(ae.createdAt);return!((te=X.dateRange)!=null&&te.from&&X.dateRange.from>Ne||(de=X.dateRange)!=null&&de.to&&X.dateRange.to<Ne)}default:return!0}});return me&&ze}),Ge=Math.ceil(Oe.length/g),Je=(v-1)*g,ot=Je+g,Ot=Oe.slice(Je,ot),zt=ae=>{b(ae)};return i?s.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(Sr,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading organizations..."})]})}):l&&!l.enabled?s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl text-white font-light",children:"Organizations"}),s.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx(pr,{className:"w-12 h-12 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),s.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),s.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[s.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),s.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:s.jsxs("li",{children:["Import the plugin in your auth configuration file",l.configPath&&s.jsxs("span",{className:"text-gray-400",children:[" (",l.configPath,")"]}),":"]})}),s.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:s.jsxs("pre",{className:"text-sm text-gray-300",children:[s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"export const"})," ",s.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",s.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",s.jsx("br",{}),s.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",s.jsx("br",{}),s.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),s.jsx("br",{}),s.jsx("span",{className:"pl-10",children:"]"})," ",s.jsx("br",{}),"}",") ",s.jsx("br",{})]})}),s.jsx("div",{className:"mt-4",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),s.jsx("div",{className:"mt-2",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),l.availablePlugins&&l.availablePlugins.length>0&&s.jsx("div",{className:"mb-4",children:s.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",l.availablePlugins.join(", ")]})}),s.jsx(Y,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),s.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",s.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Organizations",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:s.jsx(br,{value:t.organizations??0,className:"text-white font-mono text-sm",prefix:s.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),s.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your organizations and teams"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:Ae,children:[s.jsx(UN,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>L(!0),children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>x(!0),children:[s.jsx(zs,{className:"w-4 h-4 mr-2"}),"Add Organization"]})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{placeholder:"Search organizations...",value:d,onChange:ae=>h(ae.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(pa,{value:"",onValueChange:Te,children:[s.jsx(xa,{className:"w-[180px]",children:s.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[s.jsx(zs,{className:"w-4 h-4"}),s.jsx("span",{children:"Add Filter"})]})}),s.jsx(ga,{children:!p.some(ae=>ae.type==="createdAt")&&s.jsx(sn,{value:"createdAt",children:"Created Date"})})]})}),p.length>0&&s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(Y,{onClick:ut,children:"Clear all"})})]}),p.length>0&&s.jsx("div",{className:"space-y-3",children:s.jsx("div",{className:"flex flex-wrap gap-3",children:p.map(ae=>{var me,ze,X,le;return s.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[s.jsx(fx,{className:"w-3 h-3 text-white"}),ae.type==="createdAt"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Created:"}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Hd,{className:"mr-1 h-3 w-3"}),(me=ae.dateRange)!=null&&me.from?An(ae.dateRange.from,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(ze=ae.dateRange)==null?void 0:ze.from,onSelect:W=>{var te;return Le("createdAt",{from:W,to:(te=ae.dateRange)==null?void 0:te.to})},initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Hd,{className:"mr-1 h-3 w-3"}),(X=ae.dateRange)!=null&&X.to?An(ae.dateRange.to,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(le=ae.dateRange)==null?void 0:le.to,onSelect:W=>{var te;return Le("createdAt",{from:(te=ae.dateRange)==null?void 0:te.from,to:W})},initialFocus:!0,disabled:W=>{var te;return(te=ae.dateRange)!=null&&te.from?W<ae.dateRange.from:!1},className:"rounded-none"})})]})]}),s.jsx("button",{onClick:()=>tt(ae.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:s.jsx(Pt,{className:"w-3 h-3 text-white"})})]},ae.type)})})})]}),s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Organization"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Slug"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:Oe.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:s.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(pr,{className:"w-8 h-8 text-white/50"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium text-lg",children:"No organizations found"}),s.jsx("p",{className:"text-gray-400 text-sm mt-1",children:d||u!=="all"?"Try adjusting your search or filter criteria":"Get started by creating your first organization"})]}),!d&&u==="all"&&s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{onClick:()=>x(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[s.jsx(zs,{className:"w-4 h-4 mr-2"}),"Create Organization"]}),s.jsxs(Y,{onClick:()=>L(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):Ot.map(ae=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>e(`/organizations/${ae.id}`),children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(pr,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:ae.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",ae.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:ae.slug}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:s.jsxs("div",{className:"flex flex-col",children:[new Date(ae.createdAt).toLocaleDateString(),s.jsx("p",{className:"text-xs",children:new Date(ae.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:me=>{me.stopPropagation(),F(ae)},children:s.jsx(Il,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:me=>{me.stopPropagation(),K(ae)},children:s.jsx(Ca,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:me=>{me.stopPropagation(),ne(ae)},children:s.jsx(mx,{className:"w-4 h-4"})})]})})]},ae.id))})]})}),s.jsx(ak,{currentPage:v,totalPages:Ge,onPageChange:zt,totalItems:Oe.length,startIndex:Je,endIndex:ot})]}),$&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[s.jsx("span",{className:"text-white/50 mr-2",children:"["}),s.jsx(pr,{className:"inline mr-2 w-3.5 h-3.5 text-white"}),s.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Organizations"}),s.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>L(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(He,{htmlFor:"organization-count",className:"text-sm text-gray-400 font-light",children:"Number of organizations"}),s.jsx(Ie,{id:"organization-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsx(Y,{onClick:()=>{var me;const ae=parseInt(((me=document.getElementById("organization-count"))==null?void 0:me.value)||"5",10);J(ae)},disabled:C,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:C?s.jsxs(s.Fragment,{children:[s.jsx(Sr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{className:"w-3 h-3 mr-2"}),"Seed Organizations"]})})]})}),D.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Organization Seeding Terminal",lines:D,isRunning:C,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),s.jsx("div",{className:"flex justify-end mt-6 pt-6",children:s.jsx(Y,{variant:"outline",onClick:()=>L(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create Organization"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"create-name",value:z.name,onChange:ae=>G(ae.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),s.jsx(Ie,{id:"create-slug",value:z.slug,onChange:ae=>se(ae.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>{x(!1),H({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),k&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(pr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.slug})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"edit-name",value:P.name,onChange:ae=>re(ae.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),s.jsx(Ie,{id:"edit-slug",value:P.slug,onChange:ae=>Z(ae.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>{S(!1),B({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ge,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),M&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Organization"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>A(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(pr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.slug})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this organization? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>A(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ve,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),I&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Organization Details"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>U(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(pr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.slug})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"ID:"}),s.jsx("span",{className:"text-white text-sm",children:E.id})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Created:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(E.createdAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Updated:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(E.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(Y,{onClick:()=>U(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function ok(){const e=_r(),{counts:t,refetchCounts:n}=Xu(),[r,a]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(""),[d,h]=m.useState([]),[u,f]=m.useState(1),[p]=m.useState(20),[w,v]=m.useState(!1),[b,g]=m.useState(!1),[y,x]=m.useState(!1),[N,j]=m.useState(!1),[k,S]=m.useState(!1),[M,A]=m.useState(!1),[I,U]=m.useState(!1),[$,L]=m.useState(!1),[E,O]=m.useState(null),[D,T]=m.useState(null),[C,_]=m.useState(""),[z,H]=m.useState(),[P,B]=m.useState(!1),[q,G]=m.useState([]),[se,re]=m.useState(!1),Z=m.useCallback(async()=>{try{const le=await(await fetch("/api/users?limit=10000")).json();a(le.users||[])}catch{}finally{o(!1)}},[]),R=m.useCallback(async()=>{try{const le=await(await fetch("/api/admin/status")).json();B(le.enabled)}catch{B(!1)}},[]);m.useEffect(()=>{Z(),R();const X=()=>{D&&T(null)};return document.addEventListener("click",X),()=>document.removeEventListener("click",X)},[D,R,Z]);const ee=async X=>{G([]),re(!0),G([{id:"start",type:"info",message:`Starting user seeding process for ${X} users...`,timestamp:new Date}]);try{const W=await(await fetch("/api/seed/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:X})})).json();if(W.success){const te=W.results.map((Ne,Se)=>Ne.success?{id:`user-${Se}`,type:"progress",message:`Creating user: ${Ne.user.name} (${Ne.user.email})`,timestamp:new Date,status:"completed"}:{id:`user-${Se}`,type:"error",message:`Failed to create user ${Se+1}: ${Ne.error}`,timestamp:new Date});G(Ne=>[...Ne,...te]);const de=W.results.filter(Ne=>Ne.success).length;G(Ne=>[...Ne,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${de}/${X} users successfully`,timestamp:new Date}]),await Z(),await n()}else G(te=>[...te,{id:"error",type:"error",message:`❌ Seeding failed: ${W.error||"Unknown error"}`,timestamp:new Date}])}catch(le){G(W=>[...W,{id:"error",type:"error",message:`❌ Network error: ${le}`,timestamp:new Date}])}finally{re(!1)}},J=X=>{O(X),j(!0)},F=X=>{O(X),g(!0)},K=X=>{O(X),x(!0)},ne=async()=>{var de,Ne,Se;const X=(de=document.getElementById("create-name"))==null?void 0:de.value,le=(Ne=document.getElementById("create-email"))==null?void 0:Ne.value,W=(Se=document.getElementById("create-password"))==null?void 0:Se.value;if(!X||!le||!W){V.error("Please fill in all fields");return}const te=V.loading("Creating user...");try{const Pe=await(await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:X,email:le,password:W})})).json();Pe.success?(await Z(),v(!1),document.getElementById("create-name").value="",document.getElementById("create-email").value="",document.getElementById("create-password").value="",V.success("User created successfully!",{id:te})):V.error(`Error creating user: ${Pe.error||"Unknown error"}`,{id:te})}catch{V.error("Error creating user",{id:te})}},ce=async()=>{var te,de;if(!E){V.error("No user selected");return}const X=(te=document.getElementById("edit-name"))==null?void 0:te.value,le=(de=document.getElementById("edit-email"))==null?void 0:de.value;if(!X||!le){V.error("Please fill in all fields");return}const W=V.loading("Updating user...");try{const Se=await(await fetch(`/api/users/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:X,email:le})})).json();Se.success?(await Z(),g(!1),O(null),V.success("User updated successfully!",{id:W})):V.error(`Error updating user: ${Se.error||"Unknown error"}`,{id:W})}catch{V.error("Error updating user",{id:W})}},ge=async()=>{if(!E){V.error("No user selected");return}const X=V.loading("Deleting user...");try{const W=await(await fetch(`/api/users/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();W.success?(await Z(),await n(),x(!1),O(null),V.success("User deleted successfully!",{id:X})):V.error(`Error deleting user: ${W.error||"Unknown error"}`,{id:X})}catch{V.error("Error deleting user",{id:X})}},ve=async()=>{if(!E)return;if(!P){V.error("Admin plugin is not enabled");return}const X=V.loading("Banning user...");try{const le=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:E.id,banReason:C||"No reason provided",banExpiresIn:z})}),W=await le.json();le.ok?(V.success("User banned successfully!",{id:X}),A(!1),_(""),H(void 0),O(null),T(null),Z()):V.error(`Error banning user: ${W.error||W.message||"Unknown error"}`,{id:X})}catch{V.error("Error banning user",{id:X})}},Ae=async()=>{if(!E)return;if(!P){V.error("Admin plugin is not enabled");return}const X=V.loading("Unbanning user...");try{const le=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:E.id})}),W=await le.json();le.ok?(V.success("User unbanned successfully!",{id:X}),U(!1),O(null),T(null),Z()):V.error(`Error unbanning user: ${W.error||W.message||"Unknown error"}`,{id:X})}catch{V.error("Error unbanning user",{id:X})}},Te=async()=>{var W;if(!E){V.error("No user selected");return}const X=(W=document.getElementById("update-password"))==null?void 0:W.value;if(!X){V.error("Please enter a new password");return}const le=V.loading("Updating password...");try{const te=await fetch(`/api/users/${E.id}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:X})}),de=await te.json();te.ok&&de.success?(V.success("Password updated successfully!",{id:le}),L(!1),O(null),document.getElementById("update-password").value=""):V.error(`Error updating password: ${de.error||"Unknown error"}`,{id:le})}catch{V.error("Error updating password",{id:le})}},tt=()=>{if(r.length===0){V.error("No users to export");return}const X=["ID","Name","Email","Email Verified","Created At","Updated At"],le=r.map(Se=>[Se.id,Se.name||"",Se.email||"",!!Se.emailVerified,new Date(Se.createdAt).toLocaleString(),new Date(Se.updatedAt).toLocaleString()]),W=[X.join(","),...le.map(Se=>Se.map(ue=>`"${ue}"`).join(","))].join(`
|
|
420
|
-
`),te=new Blob([W],{type:"text/csv;charset=utf-8;"}),de=document.createElement("a"),Ne=URL.createObjectURL(te);de.setAttribute("href",Ne),de.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),de.style.visibility="hidden",document.body.appendChild(de),de.click(),document.body.removeChild(de),V.success(`Exported ${r.length} users to CSV`)},ut=X=>{d.some(W=>W.type===X)||(h(W=>[...W,{type:X}]),f(1))},Le=X=>{h(le=>le.filter(W=>W.type!==X)),f(1)},Oe=(X,le)=>{h(W=>W.map(te=>te.type===X?{...te,value:le}:te))},Ge=(X,le)=>{h(W=>W.map(te=>te.type===X?{...te,dateRange:le}:te))},Je=r.filter(X=>{const le=X.name.toLowerCase().includes(l.toLowerCase())||X.email.toLowerCase().includes(l.toLowerCase());if(d.length===0)return le;const W=d.every(te=>{var de,Ne,Se,ue,Pe;switch(te.type){case"emailVerified":return te.value===void 0?!0:X.emailVerified===(te.value==="true");case"banned":return te.value===void 0?!0:X.banned===(te.value==="true");case"active":return X.banned!==!0;case"createdAt":{if(!((de=te.dateRange)!=null&&de.from)&&!((Ne=te.dateRange)!=null&&Ne.to))return!0;const _e=new Date(X.createdAt);return!((Se=te.dateRange)!=null&&Se.from&&te.dateRange.from>_e||(ue=te.dateRange)!=null&&ue.to&&te.dateRange.to<_e)}case"role":return te.value?(Pe=X.role)==null?void 0:Pe.toLowerCase().includes(te.value.toLowerCase()):!0;default:return!0}});return le&&W}),ot=r.filter(X=>X.banned).length,Ot=Math.ceil(Je.length/p),zt=(u-1)*p,ae=zt+p,me=Je.slice(zt,ae),ze=X=>{f(X)};return i?s.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(Sr,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading users..."})]})}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Users",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:s.jsx(br,{value:t.users??0,className:"text-white font-mono text-sm",prefix:s.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),s.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application users"}),s.jsx("div",{className:"flex items-center space-x-4 mt-2",children:ot>0&&s.jsxs("span",{className:"text-sm text-red-400 flex items-center space-x-1",children:[s.jsx(Cc,{className:"w-3 h-3"}),s.jsxs("span",{children:[ot," Banned"]})]})})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:tt,children:[s.jsx(UN,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>S(!0),children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>v(!0),children:[s.jsx(Pm,{className:"w-4 h-4 mr-2"}),"Add User"]})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{placeholder:"Search users...",value:l,onChange:X=>c(X.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(pa,{value:"",onValueChange:ut,children:[s.jsx(xa,{className:"w-[180px]",children:s.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[s.jsx(zs,{className:"w-4 h-4"}),s.jsx("span",{children:"Add Filter"})]})}),s.jsxs(ga,{children:[!d.some(X=>X.type==="emailVerified")&&s.jsx(sn,{value:"emailVerified",children:"Email Verified"}),!d.some(X=>X.type==="banned")&&s.jsx(sn,{value:"banned",children:"Banned Status"}),!d.some(X=>X.type==="createdAt")&&s.jsx(sn,{value:"createdAt",children:"Created Date"}),!d.some(X=>X.type==="role")&&s.jsx(sn,{value:"role",children:"Role"})]})]})}),d.length>0&&s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(Y,{onClick:()=>h([]),className:"",children:"Clear all"})})]}),d.length>0&&s.jsx("div",{className:"space-y-3",children:s.jsx("div",{className:"flex flex-wrap gap-3",children:d.map(X=>{var le,W,te,de;return s.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[s.jsx(fx,{className:"w-3 h-3 text-white"}),X.type==="emailVerified"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Email Verified:"}),s.jsxs(pa,{value:X.value||"",onValueChange:Ne=>Oe("emailVerified",Ne),children:[s.jsx(xa,{className:"h-7 w-24 text-xs",children:s.jsx("span",{children:X.value==="true"?"True":X.value==="false"?"False":"Select"})}),s.jsxs(ga,{children:[s.jsx(sn,{value:"true",children:"True"}),s.jsx(sn,{value:"false",children:"False"})]})]})]}),X.type==="banned"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Banned:"}),s.jsxs(pa,{value:X.value||"",onValueChange:Ne=>Oe("banned",Ne),children:[s.jsx(xa,{className:"h-7 w-24 text-xs",children:s.jsx("span",{children:X.value==="true"?"Yes":X.value==="false"?"No":"Select"})}),s.jsxs(ga,{children:[s.jsx(sn,{value:"true",children:"Yes"}),s.jsx(sn,{value:"false",children:"No"})]})]})]}),X.type==="createdAt"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Created:"}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Hd,{className:"mr-1 h-3 w-3"}),(le=X.dateRange)!=null&&le.from?An(X.dateRange.from,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(W=X.dateRange)==null?void 0:W.from,onSelect:Ne=>{var Se;return Ge("createdAt",{from:Ne,to:(Se=X.dateRange)==null?void 0:Se.to})},initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Hd,{className:"mr-1 h-3 w-3"}),(te=X.dateRange)!=null&&te.to?An(X.dateRange.to,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(de=X.dateRange)==null?void 0:de.to,onSelect:Ne=>{var Se;return Ge("createdAt",{from:(Se=X.dateRange)==null?void 0:Se.from,to:Ne})},initialFocus:!0,disabled:Ne=>{var Se;return(Se=X.dateRange)!=null&&Se.from?Ne<X.dateRange.from:!1},className:"rounded-none"})})]})]}),X.type==="role"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Role:"}),s.jsx(Ie,{type:"text",value:X.value||"",onChange:Ne=>Oe("role",Ne.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),s.jsx("button",{onClick:()=>Le(X.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:s.jsx(Pt,{className:"w-3 h-3 text-white"})})]},X.type)})})})]}),s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email Status"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:me.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:s.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(Ma,{className:"w-8 h-8 text-white/50"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium text-lg",children:"No users found"}),s.jsx("p",{className:"text-gray-400 text-sm mt-1",children:l||d.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!l&&d.length===0&&s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{onClick:()=>v(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[s.jsx(Pm,{className:"w-4 h-4 mr-2"}),"Create User"]}),s.jsxs(Y,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):me.map(X=>s.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${X.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${X.id}`),children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:X.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${X.id}`,alt:X.name,className:`w-10 h-10 rounded-none border border-dashed ${X.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),X.banned&&s.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:s.jsx(Cc,{className:"w-3 h-3 text-white"})})]}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"text-white font-light",children:X.name}),X.banned&&s.jsx("span",{className:"px-2 py-0.5 text-[10px] font-semibold bg-red-500/20 border border-red-500/50 text-red-400 rounded-sm uppercase tracking-wide",children:"Banned"})]}),s.jsx("div",{className:"text-sm text-gray-400 mt-0.5",children:X.email})]})]})}),s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[X.emailVerified?s.jsx(OP,{className:"w-4 h-4 text-green-400"}):s.jsx(Yd,{className:"w-4 h-4 text-yellow-400"}),s.jsx("span",{className:"text-sm text-gray-400",children:X.emailVerified?"Verified":"Not Verified"})]})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:s.jsxs("div",{className:"flex flex-col",children:[new Date(X.createdAt).toLocaleDateString(),s.jsx("p",{className:"text-xs",children:new Date(X.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"relative flex items-center justify-end",children:[s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:le=>{le.stopPropagation(),T(D===X.id?null:X.id)},children:s.jsx(BP,{className:"w-4 h-4"})}),D===X.id&&s.jsxs("div",{className:"absolute right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg z-50",onClick:le=>le.stopPropagation(),children:[s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),T(null),J(X)},children:[s.jsx(Il,{className:"w-4 h-4"}),s.jsx("span",{children:"View Details"})]}),s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),T(null),F(X)},children:[s.jsx(Ca,{className:"w-4 h-4"}),s.jsx("span",{children:"Edit User"})]}),s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),T(null),O(X),L(!0)},children:[s.jsx(Mn,{className:"w-4 h-4"}),s.jsx("span",{children:"Update Password"})]}),P&&(X.banned?s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),O(X),U(!0),T(null)},children:[s.jsx(Cc,{className:"w-4 h-4"}),s.jsx("span",{children:"Unban User"})]}):s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),O(X),A(!0),T(null)},children:[s.jsx(Cc,{className:"w-4 h-4"}),s.jsx("span",{children:"Ban User"})]})),s.jsx("div",{className:"border-t border-white/10 my-1"}),s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),T(null),K(X)},children:[s.jsx(mx,{className:"w-4 h-4"}),s.jsx("span",{children:"Delete User"})]})]})]})})]},X.id))})]})}),s.jsx(ak,{currentPage:u,totalPages:Ot,onPageChange:ze,totalItems:Je.length,startIndex:zt,endIndex:ae})]}),k&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[s.jsx("span",{className:"text-white/50 mr-2",children:"["}),s.jsx(Ma,{className:"inline mr-2 w-3 h-3 text-white"}),s.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed User"}),s.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center space-x-2"}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(He,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),s.jsx(Ie,{id:"user-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsx(Y,{onClick:()=>{var le;const X=parseInt(((le=document.getElementById("user-count"))==null?void 0:le.value)||"5",10);ee(X)},disabled:se,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:se?s.jsxs(s.Fragment,{children:[s.jsx(Sr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),q.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"User Seeding Terminal",lines:q,isRunning:se,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),s.jsx("div",{className:"flex justify-end mt-6 pt-6",children:s.jsx(Y,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),w&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-white/10 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"create-name",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),s.jsx(Ie,{id:"create-email",type:"email",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),s.jsx(Ie,{id:"create-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ne,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),b&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"edit-name",defaultValue:E.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),s.jsx(Ie,{id:"edit-email",type:"email",defaultValue:E.email,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),y&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ge,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),N&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"User Details"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"ID:"}),s.jsx("span",{className:"text-white text-sm",children:E.id})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Email Verified:"}),s.jsx("span",{className:"text-white text-sm",children:E.emailVerified?"Yes":"No"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Created:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(E.createdAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Updated:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(E.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(Y,{onClick:()=>j(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),M&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),s.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",s.jsx("strong",{children:E.name})," from accessing the system."]}),s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),s.jsx(Ie,{id:"banReason",value:C,onChange:X=>_(X.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),s.jsx(Ie,{id:"banExpires",type:"number",value:z||"",onChange:X=>H(X.target.value?Number(X.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>{A(!1),_(""),H(void 0),O(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ve,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),I&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-dashed border-green-400/50 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),s.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",s.jsx("strong",{children:E.name}),"? This will restore their access to the system."]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>{U(!1),O(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:Ae,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),$&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>{L(!1),O(null),document.getElementById("update-password").value=""},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"update-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),s.jsx(Ie,{id:"update-password",type:"password",placeholder:"Enter new password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>{L(!1),O(null),document.getElementById("update-password").value=""},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:Te,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Password"})]})]})})]})}const So=[{id:"signups",label:"Signups",analyticsKey:"newUsers",barClass:"bg-white/25 border border-white/10",dotClass:"bg-white/25"},{id:"logins",label:"Logins",analyticsKey:"activeUsers",barClass:"bg-white/20 border border-white/10",dotClass:"bg-white/20"},{id:"organizations",label:"Organizations",analyticsKey:"organizations",barClass:"bg-white/15 border border-white/10",dotClass:"bg-white/15"},{id:"teams",label:"Teams",analyticsKey:"teams",barClass:"bg-white/10 border border-white/10",dotClass:"bg-white/10"},{id:"sessions",label:"Sessions",analyticsKey:"sessions",barClass:"bg-white/5 border border-white/10",dotClass:"bg-white/5"}];function yF(){const[e]=m.useState("overview"),[t,n]=m.useState(!1),[r,a]=m.useState(0),[i,o]=m.useState(0),[l,c]=m.useState("1D"),[d,h]=m.useState("1D"),[u,f]=m.useState(null),[p,w]=m.useState(!1),[v,b]=m.useState("Daily"),[g,y]=m.useState("Daily"),[x,N]=m.useState("Daily"),[j,k]=m.useState("Daily"),[S,M]=m.useState(!1),[A,I]=m.useState(!1),[U,$]=m.useState(!1),[L,E]=m.useState(!1),[O,D]=m.useState(null),[T,C]=m.useState(null),[_,z]=m.useState(null),[H,P]=m.useState(null),[B,q]=m.useState(null),[G,se]=m.useState(void 0),[re,Z]=m.useState(void 0),[R,ee]=m.useState(void 0),[J,F]=m.useState(void 0),[K,ne]=m.useState(void 0),[ce,ge]=m.useState(void 0),[ve,Ae]=m.useState(void 0),[Te,tt]=m.useState(void 0),[ut,Le]=m.useState([]),[Oe,Ge]=m.useState([]),[Je,ot]=m.useState(0),[Ot,zt]=m.useState([]),[ae,me]=m.useState([]),[ze,X]=m.useState(0),[le,W]=m.useState(0),[te,de]=m.useState(0),[Ne,Se]=m.useState(0),[ue,Pe]=m.useState(0),[_e,Fe]=m.useState(!1),[bt,he]=m.useState(!1),[Ve,vt]=m.useState({signups:[],logins:[],organizations:[],teams:[],sessions:[]}),[Nt,En]=m.useState([]),[Qe,$t]=m.useState(!1),[lr,qt]=m.useState(0),[Rt,La]=m.useState(0),[hn,Yl]=m.useState(0),[eo,to]=m.useState(0),[eh,th]=m.useState(0),[qs,no]=m.useState([]),[Xl,Fa]=m.useState(0),[Ua,Ba]=m.useState(0),{counts:rs,loading:Or}=Xu(),ss=_r(),Gs=["Daily","Weekly","Monthly","Yearly","Custom"],ql={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"},nh=m.useMemo(()=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}),[]),as=fe=>fe==null?"...":nh.format(Number(fe)),is=fe=>fe==null?"...":Number(fe).toLocaleString(),ro=m.useMemo(()=>So.reduce((fe,xe)=>(fe[xe.id]=(Ve[xe.id]||[]).reduce((pe,ie)=>pe+ie,0),fe),{}),[Ve]),rh=m.useMemo(()=>Object.values(ro).reduce((fe,xe)=>fe+xe,0),[ro]),sh=(fe,xe)=>{const pe=fe.currentTarget.getBoundingClientRect();P(xe),q({x:pe.left+pe.width/2,y:pe.top})},ih=(()=>{const fe=[];return O!=null&&O.isOutdated?fe.push({id:"version-check",title:`Update Better-Auth to v${O.latest}`,severity:"high",date:new Date().toISOString().split("T")[0],description:"Your current version is outdated. Update to the latest version to get the latest security fixes, features, and improvements. Run: `npm install better-auth@latest`",affectedComponents:["All Components"],status:"pending",cve:""}):O&&fe.push({id:"version-check",title:"Better-Auth is Up to date",severity:"low",date:new Date().toISOString().split("T")[0],description:"You are running the latest version of better-auth. Great job keeping your dependencies up to date!",affectedComponents:["All Components"],status:"applied",cve:""}),fe.push(),fe})(),nt=m.useCallback(async(fe,xe,pe,ie)=>{try{const be=new URLSearchParams({type:fe,period:xe});return pe&&be.append("from",pe.toISOString()),ie&&be.append("to",ie.toISOString()),await(await fetch(`/api/analytics?${be.toString()}`)).json()}catch{return null}},[]);m.useEffect(()=>{(async()=>{try{const pe=await(await fetch("/api/users/all")).json();pe!=null&&pe.success&&pe.users&&no(pe.users)}catch{no([])}})()},[]),m.useEffect(()=>{(async()=>{try{const pe=await(await fetch("/api/stats")).json();pe&&(a(pe.activeUsers||0),o(pe.totalUsers||0))}catch{a(0),o(0)}})()},[]),m.useEffect(()=>{(async()=>{const xe=await nt("users",l,G,re);xe&&(Le(xe.data||[]),Ge(xe.labels||[]),ot(xe.percentageChange||0))})()},[l,G,re,nt]),m.useEffect(()=>{if(qs.length===0){Fa(0),Ba(0);return}const fe=new Date;let xe,pe=fe,ie,be;if(g==="Custom"){if(!R||!J){Fa(0),Ba(0);return}xe=new Date(R),pe=new Date(J),pe.setHours(23,59,59,999);const Ut=pe.getTime()-xe.getTime();be=new Date(xe.getTime()-1),ie=new Date(be.getTime()-Ut)}else switch(g){case"Daily":xe=new Date(fe),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(be.getTime()-24*60*60*1e3);break;case"Weekly":xe=new Date(fe),xe.setDate(fe.getDate()-fe.getDay()),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(be.getTime()-7*24*60*60*1e3);break;case"Monthly":xe=new Date(fe.getFullYear(),fe.getMonth(),1),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(fe.getFullYear(),fe.getMonth()-1,1),ie.setHours(0,0,0,0);break;case"Yearly":xe=new Date(fe.getFullYear(),0,1),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(fe.getFullYear()-1,0,1),ie.setHours(0,0,0,0);break;default:Fa(0),Ba(0);return}const Ce=qs.filter(Ut=>{if(!Ut.createdAt)return!1;const os=new Date(Ut.createdAt);return os>=xe&&os<=pe}),je=qs.filter(Ut=>{if(!Ut.createdAt)return!1;const os=new Date(Ut.createdAt);return os>=ie&&os<=be}),we=Ce.length,Ue=je.length;let tn=0;Ue>0?tn=(we-Ue)/Ue*100:we>0&&(tn=100),Fa(we),Ba(tn)},[qs,g,R,J]),m.useEffect(()=>{(async()=>{if(!(d==="Custom"&&(!R||!J))){$t(!0);try{const[xe,pe,ie,be,Ce]=await Promise.all([nt("newUsers",d,R,J),nt("activeUsers",d,R,J),nt("organizations",d,R,J),nt("teams",d,R,J),nt("sessions",d,R,J)]);xe&&(zt(xe.data||[]),me(xe.labels||[])),vt({signups:(xe==null?void 0:xe.data)||[],logins:(pe==null?void 0:pe.data)||[],organizations:(ie==null?void 0:ie.data)||[],teams:(be==null?void 0:be.data)||[],sessions:(Ce==null?void 0:Ce.data)||[]}),En((xe==null?void 0:xe.labels)||(pe==null?void 0:pe.labels)||(ie==null?void 0:ie.labels)||(be==null?void 0:be.labels)||(Ce==null?void 0:Ce.labels)||[])}finally{$t(!1)}}})()},[d,R,J,nt]),m.useEffect(()=>{(async()=>{const xe=await nt("activeUsers","1D");xe&&X(xe.percentageChange||0)})()},[nt]),m.useEffect(()=>{},[rs.organizations,rs.teams,Or]),m.useEffect(()=>{(async()=>{const xe=ql[x]||"1D",pe=xe==="Custom";if(!(pe&&(!K||!ce))){Fe(!0);try{const ie=await nt("organizations",xe,pe?K:void 0,pe?ce:void 0);ie&&(Se(ie.total||0),W(ie.percentageChange||0))}catch{Se(0),W(0)}finally{Fe(!1)}}})()},[x,K,ce,nt]),m.useEffect(()=>{(async()=>{const xe=ql[j]||"1D",pe=xe==="Custom";if(!(pe&&(!ve||!Te))){he(!0);try{const ie=await nt("teams",xe,pe?ve:void 0,pe?Te:void 0);ie&&(Pe(ie.total||0),de(ie.percentageChange||0))}catch{Pe(0),de(0)}finally{he(!1)}}})()},[j,ve,Te,nt]),m.useEffect(()=>{(async()=>{const xe=await nt("users","1D");xe&&qt(xe.percentageChange||0);const pe=await nt("organizations","1D");pe&&La(pe.percentageChange||0);const ie=await nt("activeUsers","1D");ie&&Yl(ie.percentageChange||0);const[be,Ce,je,we,Ue]=await Promise.all([nt("newUsers","1D"),nt("activeUsers","1D"),nt("organizations","1D"),nt("teams","1D"),nt("sessions","1D")]),Ut=[(be==null?void 0:be.total)||0,(Ce==null?void 0:Ce.total)||0,(je==null?void 0:je.total)||0,(we==null?void 0:we.total)||0,(Ue==null?void 0:Ue.total)||0].reduce((Ks,ch)=>Ks+ch,0);th(Ut);const ao=[(be==null?void 0:be.previousTotal)||0,(Ce==null?void 0:Ce.previousTotal)||0,(je==null?void 0:je.previousTotal)||0,(we==null?void 0:we.previousTotal)||0,(Ue==null?void 0:Ue.previousTotal)||0].reduce((Ks,ch)=>Ks+ch,0);if(ao>0){const Ks=(Ut-ao)/ao*100;to(Ks)}else Ut>0?to(100):to(0)})()},[nt]),m.useEffect(()=>{(async()=>{try{const pe=await(await fetch("/api/version-check")).json();pe&&D({current:pe.current||"1.0.0",latest:pe.latest||"1.0.0",isOutdated:pe.isOutdated||!1})}catch{try{const be=(await(await fetch("/api/package-info")).json()).betterAuthVersion||"1.0.0",Ce="1.5.0";D({current:be,latest:Ce,isOutdated:be!==Ce})}catch{D({current:"1.0.0",latest:"1.5.0",isOutdated:!0})}}})()},[]);const Gl=fe=>{switch(fe){case"critical":return"bg-white/10 text-white border-white/20";case"high":return"bg-white/10 text-white border-white/20";case"medium":return"bg-white/10 text-gray-300 border-white/20";case"low":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},Kl=fe=>{switch(fe){case"applied":return"bg-white/10 text-white border-white/20";case"scheduled":return"bg-white/10 text-gray-300 border-white/20";case"pending":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},oh=fe=>{f(fe),w(!0)},so=()=>{w(!1),setTimeout(()=>f(null),300)},Ql=(fe,xe="users")=>{const pe=xe==="users"?Oe:ae,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(pe&&pe.length>0&&pe.length===be)return fe==="1D"?pe.filter((je,we)=>we%4===0).map(je=>{const we=parseInt(je.replace("h",""),10);return we===0?"12am":we<12?`${we}am`:we===12?"12pm":`${we-12}pm`}):fe==="1W"?pe.map(je=>je.length>3?je.substring(0,3):je):fe==="1M"?pe.map(je=>{const we=je.split(" ");return we.length>=2?we[1]:je}):fe==="1Y"||fe==="3M"||fe==="6M"?pe.map(je=>je.length>3?je.substring(0,3):je):pe.map(je=>je.length>3?je.substring(0,3):je);const Ce=new Date;switch(fe){case"1D":return["12am","4am","8am","12pm","4pm","8pm"];case"1W":return Array.from({length:7},(je,we)=>new Date(Ce.getTime()-(6-we)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"short"}));case"1M":return Array.from({length:30},(je,we)=>new Date(Ce.getTime()-(29-we)*24*60*60*1e3).getDate().toString());case"3M":return Array.from({length:3},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(2-we),1).toLocaleDateString("en-US",{month:"short"}));case"6M":return Array.from({length:6},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(5-we),1).toLocaleDateString("en-US",{month:"short"}));case"1Y":return Array.from({length:12},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(11-we),1).toLocaleDateString("en-US",{month:"short"}));case"ALL":return Array.from({length:7},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(6-we),1).toLocaleDateString("en-US",{month:"short"}));default:return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},lh=(fe,xe="users")=>{const pe=xe==="users"?Oe:ae,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(pe&&pe.length>0&&pe.length===be)return fe==="1D"?pe.map(je=>{const we=parseInt(je.replace("h",""),10);return we===0?"12am":we<12?`${we}am`:we===12?"12pm":`${we-12}pm`}):fe==="1Y"||fe==="3M"||fe==="6M"?pe.map(je=>{const we=["January","February","March","April","May","June","July","August","September","October","November","December"],tn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(je);return tn!==-1?we[tn]:je}):pe;const Ce=new Date;switch(fe){case"1D":return Array.from({length:24},(je,we)=>{const Ue=new Date;return Ue.setHours(we,0,0,0),Ue.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0})});case"1W":return Array.from({length:7},(je,we)=>new Date(Ce.getTime()-(6-we)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"long"}));case"1M":return Array.from({length:30},(je,we)=>{const Ue=new Date(Ce.getTime()-(29-we)*24*60*60*1e3),tn=Ue.toLocaleDateString("en-US",{month:"short"}),Ut=Ue.getDate();return`${tn} ${Ut}`});case"3M":return Array.from({length:3},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(2-we),1).toLocaleDateString("en-US",{month:"long"}));case"6M":return Array.from({length:6},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(5-we),1).toLocaleDateString("en-US",{month:"long"}));case"1Y":return Array.from({length:12},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(11-we),1).toLocaleDateString("en-US",{month:"long"}));case"ALL":return Array.from({length:7},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(6-we),1).toLocaleDateString("en-US",{month:"long"}));default:return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},Wa=(fe,xe="users")=>{const pe=xe==="users"?ut:Ot,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(!pe||pe.length===0)return Array(be).fill(0);const Ce=[...pe];for(;Ce.length<be;)Ce.push(0);const je=Ce.slice(0,be),we=Math.max(...je,1);return je.map(Ue=>Ue/we*100)},Zl=()=>{const fe=Nt.length>0?Nt:Ql(d,"users"),xe=fe.map((ie,be)=>So.reduce((Ce,je)=>{var we;return Ce+(((we=Ve[je.id])==null?void 0:we[be])??0)},0)),pe=Math.max(...xe,1);return s.jsxs("div",{className:"space-y-6 min-h-screen h-full mt-5 flex-1 overflow-y-hidden overflow-x-hidden px-0",children:[s.jsx("div",{className:"px-6 overflow-hidden",children:s.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-white/5 border border-white/10 rounded-none overflow-x-auto relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:s.jsx(Ze,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Users"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Or?"...":as(rs.users)}),s.jsxs("div",{className:`flex items-center gap-1 ${lr>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${lr<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(lr).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:s.jsx(Ln,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Organizations"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Or?"...":as(rs.organizations)}),s.jsxs("div",{className:`flex items-center gap-1 ${Rt>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${Rt<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Rt).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:s.jsx(mw,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Sessions"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Or?"...":as(rs.sessions)}),s.jsxs("div",{className:`flex items-center gap-1 ${hn>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${hn<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(hn).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:s.jsx(hw,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Activity Hits"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Or?"...":as(eh??0)}),s.jsxs("div",{className:`flex items-center gap-1 ${eo>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${eo<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(eo).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:s.jsx(Ze,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"New Users"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Or?"...":as(i??0)}),s.jsxs("div",{className:"flex items-center gap-1 text-green-500",children:[s.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsx("span",{className:"text-sm font-medium",children:"18%"})]})]})]})]})}),s.jsxs("div",{className:"px-6 pb-10 space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"TOTAL USER"}),s.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","6M","1Y"].map(ie=>s.jsx("button",{onClick:()=>c(ie),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${l===ie?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:ie},ie))})]}),s.jsxs("div",{className:"flex justify-between items-end mb-6",children:[s.jsx("p",{className:"text-4xl text-white font-light",children:Or?"...":as(rs.users)}),s.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[s.jsx("svg",{className:`w-3 h-3 ${Je>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${Je>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Je).toFixed(1),"%"]})]})]}),s.jsxs("div",{className:"space-y-2 relative",children:[s.jsxs("div",{className:"h-32 relative",children:[s.jsx("svg",{className:"w-full h-full absolute inset-0",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:s.jsx("defs",{children:s.jsxs("linearGradient",{id:"usersBarGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[s.jsx("stop",{offset:"0%",style:{stopColor:"rgba(255, 255, 255, 0.3)",stopOpacity:1}}),s.jsx("stop",{offset:"100%",style:{stopColor:"rgba(255, 255, 255, 0.05)",stopOpacity:1}})]})})}),s.jsx("div",{className:"h-32 flex items-end justify-between space-x-1 relative z-10",children:Wa(l,"users").map((ie,be)=>{const Ce=T===be;return s.jsx("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group",style:{height:`${ie}%`,background:"url(#usersBarGradient)"},onMouseEnter:je=>{const we=je.currentTarget.getBoundingClientRect(),Ue=we.left+we.width/2,tn=we.top,Ut=150,os=60,ao=Math.max(Ut/2,Math.min(window.innerWidth-Ut/2,Ue)),Ks=Math.max(os+10,Math.min(window.innerHeight-10,tn));C(be),z({x:ao,y:Ks})},onMouseLeave:()=>{C(null),z(null)},children:s.jsx("div",{className:"w-full h-full",style:{background:"linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05))",opacity:Ce?1:.8}})},be)})}),T!==null&&_&&s.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${_.x}px`,top:`${_.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:s.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg whitespace-nowrap",children:[s.jsx("div",{className:"text-xs text-gray-400 mb-1 font-mono uppercase",children:lh(l,"users")[T]}),s.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[ut[T]!==void 0?ut[T].toLocaleString():"0"," ",s.jsx("span",{className:"font-mono text-xs text-gray-400",children:"users"})]})]})})]}),s.jsx("div",{className:`flex justify-between ${l==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:Ql(l,"users").map((ie,be)=>s.jsx("span",{className:"flex-1 text-center truncate",children:ie},be))})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"Activity Hits"}),s.jsx("p",{className:"text-4xl text-white font-light mt-1",children:Qe?"...":is(rh)}),s.jsx("p",{className:"text-xs text-gray-400",children:"Tracked events in selected period"})]}),s.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","1M","3M","6M","1Y","ALL"].map(ie=>s.jsx("button",{onClick:()=>h(ie),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${d===ie?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:ie},ie))})]}),s.jsxs("div",{className:"space-y-2 relative",children:[s.jsx("div",{className:"h-40 flex items-end gap-1",children:fe.map((ie,be)=>{const Ce=xe[be]||0;return s.jsx("div",{className:"flex-1 flex flex-col justify-end gap-[1px] h-full cursor-pointer",onMouseEnter:je=>sh(je,be),onMouseLeave:()=>{P(null),q(null)},children:So.map(je=>{var tn;const we=((tn=Ve[je.id])==null?void 0:tn[be])??0,Ue=Ce===0||pe===0?0:Math.max(we/pe*100,we>0?4:0);return s.jsx("div",{className:`w-full ${je.barClass}`,style:{height:`${Ue}%`}},`${je.id}-${be}`)})},`${ie}-${be}`)})}),Qe&&s.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center text-xs uppercase text-gray-400 pointer-events-none",children:"Loading activity..."}),H!==null&&B&&s.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${B.x}px`,top:`${B.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:s.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg min-w-[180px]",children:[s.jsx("div",{className:"text-xs text-gray-400 mb-2 font-mono uppercase",children:fe[H]||`Bucket ${H+1}`}),s.jsx("div",{className:"space-y-1",children:So.map(ie=>{var be;return s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[s.jsx("span",{className:`w-2 h-2 rounded-sm ${ie.dotClass}`}),ie.label]}),s.jsx("span",{className:"text-white font-medium",children:((be=Ve[ie.id])==null?void 0:be[H])??0})]},ie.id)})})]})}),s.jsx("div",{className:`flex justify-between ${d==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:fe.map((ie,be)=>s.jsx("span",{className:"flex-1 text-center truncate",children:ie},be))}),s.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3 mt-4 pt-4 border-t border-white/10",children:So.map(ie=>s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`w-2 h-2 rounded-sm ${ie.dotClass}`}),ie.label]}),s.jsx("span",{className:"text-white font-medium",children:Qe?"...":is(ro[ie.id]||0)})]},ie.id))})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>M(!S),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:v})]}),S&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{b(ie),M(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ie},ie))})]}),v==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),G?An(G,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:G,onSelect:se,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),re?An(re,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:re,onSelect:Z,initialFocus:!0,disabled:ie=>G?ie<G:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Active Users"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Users with active session in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:is(r)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 border-white/5 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${ze>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${ze>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ze).toFixed(1),"%"]})]})})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>I(!A),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:g})]}),A&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{y(ie),I(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ie},ie))})]}),g==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),R?An(R,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:R,onSelect:ee,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),J?An(J,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:J,onSelect:F,initialFocus:!0,disabled:ie=>R?ie<R:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"New Users"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Newly registered Users in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:is(Xl)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${Ua>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",style:Ua<0?{transform:"rotate(180deg)"}:{},children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${Ua>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Ua).toFixed(1),"%"]})]})})]})]})]}),s.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>$(!U),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:x})]}),U&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{N(ie),$(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ie},ie))})]}),x==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),K?An(K,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:K,onSelect:ne,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),ce?An(ce,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:ce,onSelect:ge,initialFocus:!0,disabled:ie=>K?ie<K:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Organizations"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total organizations in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:_e?"...":is(Ne)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${le>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${le>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(le).toFixed(1),"%"]})]})})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>E(!L),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:j})]}),L&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{k(ie),E(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ie},ie))})]}),j==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),ve?An(ve,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:ve,onSelect:Ae,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),Te?An(Te,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:Te,onSelect:tt,initialFocus:!0,disabled:ie=>ve?ie<ve:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Teams"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total teams in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:bt?"...":is(ue)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${te>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${te>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(te).toFixed(1),"%"]})]})})]})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pt-4 overflow-hidden relative rounded-none flex flex-col",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Mn,{className:"w-4 h-4 text-white/60"}),s.jsx("h4",{className:"text-xs text-gray-400 uppercase font-mono font-light",children:"Security Insights"})]})}),s.jsx("hr",{className:"-mx-10 -mt-1 border-white/10"}),s.jsx("div",{className:"space-y-3 overflow-y-auto custom-scrollbar max-h-[400px]",children:ih.map((ie,be)=>s.jsx("div",{onClick:()=>oh(ie),className:"group py-2 border-b border-white/5 cursor-pointer transition-all duration-200 hover:border-white/20",style:{animation:`slideIn 0.3s ease-out ${be*.1}s both`},children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:s.jsx("span",{className:"text-sm text-white/90 font-light truncate group-hover:text-white transition-colors",children:ie.title})}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm uppercase font-mono ${Gl(ie.severity)}`,children:ie.severity}),s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm capitalize font-mono ${Kl(ie.status)}`,children:ie.status})]})]}),s.jsx(PP,{className:"w-3.5 h-3.5 text-gray-500 group-hover:text-white transition-all flex-shrink-0 mt-0.5"})]})},ie.id))})]})]})]})]})};return s.jsxs("div",{className:"h-screen bg-black text-white overflow-hidden flex flex-col",style:{overflowX:"hidden"},children:[s.jsx("div",{className:"flex-1 overflow-hidden",children:e==="overview"?Zl():e==="users"?s.jsx(ok,{}):e==="organizations"?s.jsx(ik,{}):Zl()}),t&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-3xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mw,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-lg text-white font-light",children:"Quick Actions"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("button",{onClick:()=>{n(!1),ss("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Ze,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View All Users"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Manage user accounts"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/organizations")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Ln,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View Organizations"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Manage organizations"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/sessions")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(hw,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View Sessions"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Monitor active sessions"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/database")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Vr,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Database Schema"}),s.jsx("p",{className:"text-sm text-gray-400",children:"View schema visualizer"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/settings")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(J2,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Settings"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Configure system"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Q2,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Search Users"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Find specific users"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]})]}),s.jsx("div",{className:"mt-6 pt-6 border-t border-dashed border-white/10",children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[s.jsx("span",{children:"Tip: Press Ctrl+K or Cmd+K for command palette"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:"Close"})]})})]})}),p&&u&&s.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",style:{animation:"fadeIn 0.3s ease-out"},onClick:so,children:s.jsxs("div",{className:"bg-black border border-white/20 rounded-none max-w-2xl w-full max-h-[80vh] overflow-y-auto",style:{animation:"slideUp 0.3s ease-out"},onClick:fe=>fe.stopPropagation(),children:[s.jsx("div",{className:"sticky top-0 bg-black border-b border-white/10 p-6 z-10",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx(Mn,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-xl text-white font-light",children:u.title})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs("span",{className:`text-xs px-2 py-1 border rounded-none uppercase font-medium ${Gl(u.severity)}`,children:[u.severity," Severity"]}),s.jsx("span",{className:`text-xs px-2 py-1 border rounded-none capitalize ${Kl(u.status)}`,children:u.status}),u.cve&&s.jsx("span",{className:"text-xs text-gray-400 font-mono bg-white/5 px-2 py-1 border border-white/10 rounded-none",children:u.cve})]})]}),s.jsx("button",{onClick:so,className:"p-2 hover:bg-white/10 transition-colors rounded-none",children:s.jsx(Kt,{className:"w-5 h-5 text-gray-400 hover:text-white"})})]})}),s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Release Date"}),s.jsx("p",{className:"text-white",children:new Date(u.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Description"}),u.description.includes("npm install")?s.jsxs("div",{children:[s.jsx("p",{className:"text-white leading-relaxed mb-3",children:u.description.split("Run:")[0]}),s.jsx("div",{className:"relative group",children:s.jsx("div",{className:"bg-black border border-white/20 rounded-none p-3 font-mono text-sm",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("code",{children:[s.jsx("span",{className:"text-green-400",children:"$"})," ",s.jsx("span",{className:"text-cyan-400",children:"npm"})," ",s.jsx("span",{className:"text-yellow-400",children:"install"})," ",s.jsx("span",{className:"text-white",children:"better-auth@latest"})]}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText("npm install better-auth@latest"),V.success("Command copied to clipboard")},className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-white/10 rounded",title:"Copy command",children:s.jsx(Ym,{className:"w-4 h-4 text-gray-400 hover:text-white"})})]})})})]}):s.jsx("p",{className:"text-white leading-relaxed",children:u.description})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-3",children:"Affected Components"}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:u.affectedComponents.map((fe,xe)=>s.jsxs("div",{className:"flex items-center gap-2 p-3 bg-white/5 border border-white/10 rounded-none",style:{animation:`slideIn 0.3s ease-out ${xe*.1}s both`},children:[s.jsx("div",{className:"w-2 h-2 bg-white rounded-none flex-shrink-0"}),s.jsx("span",{className:"text-sm text-white",children:fe})]},xe))})]}),s.jsx("div",{className:"p-4 bg-white/5 border border-white/10 rounded-none",children:s.jsxs("div",{className:"flex items-start gap-3",children:[u.status==="applied"&&s.jsxs(s.Fragment,{children:[s.jsx(Ix,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Patch Applied"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This security patch has been successfully applied to your system."})]})]}),u.status==="scheduled"&&s.jsxs(s.Fragment,{children:[s.jsx(Z2,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Scheduled"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This patch is scheduled for deployment in the next maintenance window."})]})]}),u.status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(JL,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Action Required"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This patch is pending review and requires manual approval before deployment."})]})]})]})}),s.jsx("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-white/10",children:s.jsx(Y,{variant:"ghost",onClick:so,className:"text-gray-400 hover:text-white rounded-none",children:"Close"})})]})]})}),s.jsx("style",{children:`
|
|
420
|
+
`),te=new Blob([W],{type:"text/csv;charset=utf-8;"}),de=document.createElement("a"),Ne=URL.createObjectURL(te);de.setAttribute("href",Ne),de.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),de.style.visibility="hidden",document.body.appendChild(de),de.click(),document.body.removeChild(de),V.success(`Exported ${r.length} users to CSV`)},ut=X=>{d.some(W=>W.type===X)||(h(W=>[...W,{type:X}]),f(1))},Le=X=>{h(le=>le.filter(W=>W.type!==X)),f(1)},Oe=(X,le)=>{h(W=>W.map(te=>te.type===X?{...te,value:le}:te))},Ge=(X,le)=>{h(W=>W.map(te=>te.type===X?{...te,dateRange:le}:te))},Je=r.filter(X=>{const le=X.name.toLowerCase().includes(l.toLowerCase())||X.email.toLowerCase().includes(l.toLowerCase());if(d.length===0)return le;const W=d.every(te=>{var de,Ne,Se,ue,Pe;switch(te.type){case"emailVerified":return te.value===void 0?!0:X.emailVerified===(te.value==="true");case"banned":return te.value===void 0?!0:X.banned===(te.value==="true");case"active":return X.banned!==!0;case"createdAt":{if(!((de=te.dateRange)!=null&&de.from)&&!((Ne=te.dateRange)!=null&&Ne.to))return!0;const _e=new Date(X.createdAt);return!((Se=te.dateRange)!=null&&Se.from&&te.dateRange.from>_e||(ue=te.dateRange)!=null&&ue.to&&te.dateRange.to<_e)}case"role":return te.value?(Pe=X.role)==null?void 0:Pe.toLowerCase().includes(te.value.toLowerCase()):!0;default:return!0}});return le&&W}),ot=r.filter(X=>X.banned).length,Ot=Math.ceil(Je.length/p),zt=(u-1)*p,ae=zt+p,me=Je.slice(zt,ae),ze=X=>{f(X)};return i?s.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(Sr,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading users..."})]})}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Users",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:s.jsx(br,{value:t.users??0,className:"text-white font-mono text-sm",prefix:s.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),s.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application users"}),s.jsx("div",{className:"flex items-center space-x-4 mt-2",children:ot>0&&s.jsxs("span",{className:"text-sm text-red-400 flex items-center space-x-1",children:[s.jsx(Cc,{className:"w-3 h-3"}),s.jsxs("span",{children:[ot," Banned"]})]})})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:tt,children:[s.jsx(UN,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>S(!0),children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>v(!0),children:[s.jsx(Pm,{className:"w-4 h-4 mr-2"}),"Add User"]})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{placeholder:"Search users...",value:l,onChange:X=>c(X.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(pa,{value:"",onValueChange:ut,children:[s.jsx(xa,{className:"w-[180px]",children:s.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[s.jsx(zs,{className:"w-4 h-4"}),s.jsx("span",{children:"Add Filter"})]})}),s.jsxs(ga,{children:[!d.some(X=>X.type==="emailVerified")&&s.jsx(sn,{value:"emailVerified",children:"Email Verified"}),!d.some(X=>X.type==="banned")&&s.jsx(sn,{value:"banned",children:"Banned Status"}),!d.some(X=>X.type==="createdAt")&&s.jsx(sn,{value:"createdAt",children:"Created Date"}),!d.some(X=>X.type==="role")&&s.jsx(sn,{value:"role",children:"Role"})]})]})}),d.length>0&&s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(Y,{onClick:()=>h([]),className:"",children:"Clear all"})})]}),d.length>0&&s.jsx("div",{className:"space-y-3",children:s.jsx("div",{className:"flex flex-wrap gap-3",children:d.map(X=>{var le,W,te,de;return s.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[s.jsx(fx,{className:"w-3 h-3 text-white"}),X.type==="emailVerified"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Email Verified:"}),s.jsxs(pa,{value:X.value||"",onValueChange:Ne=>Oe("emailVerified",Ne),children:[s.jsx(xa,{className:"h-7 w-24 text-xs",children:s.jsx("span",{children:X.value==="true"?"True":X.value==="false"?"False":"Select"})}),s.jsxs(ga,{children:[s.jsx(sn,{value:"true",children:"True"}),s.jsx(sn,{value:"false",children:"False"})]})]})]}),X.type==="banned"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Banned:"}),s.jsxs(pa,{value:X.value||"",onValueChange:Ne=>Oe("banned",Ne),children:[s.jsx(xa,{className:"h-7 w-24 text-xs",children:s.jsx("span",{children:X.value==="true"?"Yes":X.value==="false"?"No":"Select"})}),s.jsxs(ga,{children:[s.jsx(sn,{value:"true",children:"Yes"}),s.jsx(sn,{value:"false",children:"No"})]})]})]}),X.type==="createdAt"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Created:"}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Hd,{className:"mr-1 h-3 w-3"}),(le=X.dateRange)!=null&&le.from?An(X.dateRange.from,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(W=X.dateRange)==null?void 0:W.from,onSelect:Ne=>{var Se;return Ge("createdAt",{from:Ne,to:(Se=X.dateRange)==null?void 0:Se.to})},initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Hd,{className:"mr-1 h-3 w-3"}),(te=X.dateRange)!=null&&te.to?An(X.dateRange.to,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(de=X.dateRange)==null?void 0:de.to,onSelect:Ne=>{var Se;return Ge("createdAt",{from:(Se=X.dateRange)==null?void 0:Se.from,to:Ne})},initialFocus:!0,disabled:Ne=>{var Se;return(Se=X.dateRange)!=null&&Se.from?Ne<X.dateRange.from:!1},className:"rounded-none"})})]})]}),X.type==="role"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Role:"}),s.jsx(Ie,{type:"text",value:X.value||"",onChange:Ne=>Oe("role",Ne.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),s.jsx("button",{onClick:()=>Le(X.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:s.jsx(Pt,{className:"w-3 h-3 text-white"})})]},X.type)})})})]}),s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email Status"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:me.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:s.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(Ma,{className:"w-8 h-8 text-white/50"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium text-lg",children:"No users found"}),s.jsx("p",{className:"text-gray-400 text-sm mt-1",children:l||d.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!l&&d.length===0&&s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{onClick:()=>v(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[s.jsx(Pm,{className:"w-4 h-4 mr-2"}),"Create User"]}),s.jsxs(Y,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):me.map(X=>s.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${X.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${X.id}`),children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:X.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${X.id}`,alt:X.name,className:`w-10 h-10 rounded-none border border-dashed ${X.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),X.banned&&s.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:s.jsx(Cc,{className:"w-3 h-3 text-white"})})]}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"text-white font-light",children:X.name}),X.banned&&s.jsx("span",{className:"px-2 py-0.5 text-[10px] font-semibold bg-red-500/20 border border-red-500/50 text-red-400 rounded-sm uppercase tracking-wide",children:"Banned"})]}),s.jsx("div",{className:"text-sm text-gray-400 mt-0.5",children:X.email})]})]})}),s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[X.emailVerified?s.jsx(OP,{className:"w-4 h-4 text-green-400"}):s.jsx(Yd,{className:"w-4 h-4 text-yellow-400"}),s.jsx("span",{className:"text-sm text-gray-400",children:X.emailVerified?"Verified":"Not Verified"})]})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:s.jsxs("div",{className:"flex flex-col",children:[new Date(X.createdAt).toLocaleDateString(),s.jsx("p",{className:"text-xs",children:new Date(X.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"relative flex items-center justify-end",children:[s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:le=>{le.stopPropagation(),T(D===X.id?null:X.id)},children:s.jsx(BP,{className:"w-4 h-4"})}),D===X.id&&s.jsxs("div",{className:"absolute right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg z-50",onClick:le=>le.stopPropagation(),children:[s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),T(null),J(X)},children:[s.jsx(Il,{className:"w-4 h-4"}),s.jsx("span",{children:"View"})]}),s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),T(null),F(X)},children:[s.jsx(Ca,{className:"w-4 h-4"}),s.jsx("span",{children:"Edit User"})]}),s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),T(null),O(X),L(!0)},children:[s.jsx(Mn,{className:"w-4 h-4"}),s.jsx("span",{children:"Update Password"})]}),P&&(X.banned?s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),O(X),U(!0),T(null)},children:[s.jsx(Cc,{className:"w-4 h-4"}),s.jsx("span",{children:"Unban User"})]}):s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),O(X),A(!0),T(null)},children:[s.jsx(Cc,{className:"w-4 h-4"}),s.jsx("span",{children:"Ban User"})]})),s.jsx("div",{className:"border-t border-white/10 my-1"}),s.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:le=>{le.stopPropagation(),T(null),K(X)},children:[s.jsx(mx,{className:"w-4 h-4"}),s.jsx("span",{children:"Delete User"})]})]})]})})]},X.id))})]})}),s.jsx(ak,{currentPage:u,totalPages:Ot,onPageChange:ze,totalItems:Je.length,startIndex:zt,endIndex:ae})]}),k&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[s.jsx("span",{className:"text-white/50 mr-2",children:"["}),s.jsx(Ma,{className:"inline mr-2 w-3 h-3 text-white"}),s.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed User"}),s.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center space-x-2"}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(He,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),s.jsx(Ie,{id:"user-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsx(Y,{onClick:()=>{var le;const X=parseInt(((le=document.getElementById("user-count"))==null?void 0:le.value)||"5",10);ee(X)},disabled:se,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:se?s.jsxs(s.Fragment,{children:[s.jsx(Sr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),q.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"User Seeding Terminal",lines:q,isRunning:se,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),s.jsx("div",{className:"flex justify-end mt-6 pt-6",children:s.jsx(Y,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),w&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-white/10 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"create-name",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),s.jsx(Ie,{id:"create-email",type:"email",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),s.jsx(Ie,{id:"create-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ne,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),b&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"edit-name",defaultValue:E.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),s.jsx(Ie,{id:"edit-email",type:"email",defaultValue:E.email,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),y&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ge,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),N&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"User Details"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"ID:"}),s.jsx("span",{className:"text-white text-sm",children:E.id})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Email Verified:"}),s.jsx("span",{className:"text-white text-sm",children:E.emailVerified?"Yes":"No"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Created:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(E.createdAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Updated:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(E.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(Y,{onClick:()=>j(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),M&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),s.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",s.jsx("strong",{children:E.name})," from accessing the system."]}),s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),s.jsx(Ie,{id:"banReason",value:C,onChange:X=>_(X.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),s.jsx(Ie,{id:"banExpires",type:"number",value:z||"",onChange:X=>H(X.target.value?Number(X.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>{A(!1),_(""),H(void 0),O(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ve,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),I&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-dashed border-green-400/50 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),s.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",s.jsx("strong",{children:E.name}),"? This will restore their access to the system."]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>{U(!1),O(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:Ae,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),$&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>{L(!1),O(null),document.getElementById("update-password").value=""},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"update-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),s.jsx(Ie,{id:"update-password",type:"password",placeholder:"Enter new password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>{L(!1),O(null),document.getElementById("update-password").value=""},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:Te,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Password"})]})]})})]})}const So=[{id:"signups",label:"Signups",analyticsKey:"newUsers",barClass:"bg-white/25 border border-white/10",dotClass:"bg-white/25"},{id:"logins",label:"Logins",analyticsKey:"activeUsers",barClass:"bg-white/20 border border-white/10",dotClass:"bg-white/20"},{id:"organizations",label:"Organizations",analyticsKey:"organizations",barClass:"bg-white/15 border border-white/10",dotClass:"bg-white/15"},{id:"teams",label:"Teams",analyticsKey:"teams",barClass:"bg-white/10 border border-white/10",dotClass:"bg-white/10"},{id:"sessions",label:"Sessions",analyticsKey:"sessions",barClass:"bg-white/5 border border-white/10",dotClass:"bg-white/5"}];function yF(){const[e]=m.useState("overview"),[t,n]=m.useState(!1),[r,a]=m.useState(0),[i,o]=m.useState(0),[l,c]=m.useState("1D"),[d,h]=m.useState("1D"),[u,f]=m.useState(null),[p,w]=m.useState(!1),[v,b]=m.useState("Daily"),[g,y]=m.useState("Daily"),[x,N]=m.useState("Daily"),[j,k]=m.useState("Daily"),[S,M]=m.useState(!1),[A,I]=m.useState(!1),[U,$]=m.useState(!1),[L,E]=m.useState(!1),[O,D]=m.useState(null),[T,C]=m.useState(null),[_,z]=m.useState(null),[H,P]=m.useState(null),[B,q]=m.useState(null),[G,se]=m.useState(void 0),[re,Z]=m.useState(void 0),[R,ee]=m.useState(void 0),[J,F]=m.useState(void 0),[K,ne]=m.useState(void 0),[ce,ge]=m.useState(void 0),[ve,Ae]=m.useState(void 0),[Te,tt]=m.useState(void 0),[ut,Le]=m.useState([]),[Oe,Ge]=m.useState([]),[Je,ot]=m.useState(0),[Ot,zt]=m.useState([]),[ae,me]=m.useState([]),[ze,X]=m.useState(0),[le,W]=m.useState(0),[te,de]=m.useState(0),[Ne,Se]=m.useState(0),[ue,Pe]=m.useState(0),[_e,Fe]=m.useState(!1),[bt,he]=m.useState(!1),[Ve,vt]=m.useState({signups:[],logins:[],organizations:[],teams:[],sessions:[]}),[Nt,En]=m.useState([]),[Qe,$t]=m.useState(!1),[lr,qt]=m.useState(0),[Rt,La]=m.useState(0),[hn,Yl]=m.useState(0),[eo,to]=m.useState(0),[eh,th]=m.useState(0),[qs,no]=m.useState([]),[Xl,Fa]=m.useState(0),[Ua,Ba]=m.useState(0),{counts:rs,loading:Or}=Xu(),ss=_r(),Gs=["Daily","Weekly","Monthly","Yearly","Custom"],ql={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"},nh=m.useMemo(()=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}),[]),as=fe=>fe==null?"...":nh.format(Number(fe)),is=fe=>fe==null?"...":Number(fe).toLocaleString(),ro=m.useMemo(()=>So.reduce((fe,xe)=>(fe[xe.id]=(Ve[xe.id]||[]).reduce((pe,ie)=>pe+ie,0),fe),{}),[Ve]),rh=m.useMemo(()=>Object.values(ro).reduce((fe,xe)=>fe+xe,0),[ro]),sh=(fe,xe)=>{const pe=fe.currentTarget.getBoundingClientRect();P(xe),q({x:pe.left+pe.width/2,y:pe.top})},ih=(()=>{const fe=[];return O!=null&&O.isOutdated?fe.push({id:"version-check",title:`Update Better-Auth to v${O.latest}`,severity:"high",date:new Date().toISOString().split("T")[0],description:"Your current version is outdated. Update to the latest version to get the latest security fixes, features, and improvements. Run: `npm install better-auth@latest`",affectedComponents:["All Components"],status:"pending",cve:""}):O&&fe.push({id:"version-check",title:"Better-Auth is Up to date",severity:"low",date:new Date().toISOString().split("T")[0],description:"You are running the latest version of better-auth. Great job keeping your dependencies up to date!",affectedComponents:["All Components"],status:"applied",cve:""}),fe.push(),fe})(),nt=m.useCallback(async(fe,xe,pe,ie)=>{try{const be=new URLSearchParams({type:fe,period:xe});return pe&&be.append("from",pe.toISOString()),ie&&be.append("to",ie.toISOString()),await(await fetch(`/api/analytics?${be.toString()}`)).json()}catch{return null}},[]);m.useEffect(()=>{(async()=>{try{const pe=await(await fetch("/api/users/all")).json();pe!=null&&pe.success&&pe.users&&no(pe.users)}catch{no([])}})()},[]),m.useEffect(()=>{(async()=>{try{const pe=await(await fetch("/api/stats")).json();pe&&(a(pe.activeUsers||0),o(pe.totalUsers||0))}catch{a(0),o(0)}})()},[]),m.useEffect(()=>{(async()=>{const xe=await nt("users",l,G,re);xe&&(Le(xe.data||[]),Ge(xe.labels||[]),ot(xe.percentageChange||0))})()},[l,G,re,nt]),m.useEffect(()=>{if(qs.length===0){Fa(0),Ba(0);return}const fe=new Date;let xe,pe=fe,ie,be;if(g==="Custom"){if(!R||!J){Fa(0),Ba(0);return}xe=new Date(R),pe=new Date(J),pe.setHours(23,59,59,999);const Ut=pe.getTime()-xe.getTime();be=new Date(xe.getTime()-1),ie=new Date(be.getTime()-Ut)}else switch(g){case"Daily":xe=new Date(fe),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(be.getTime()-24*60*60*1e3);break;case"Weekly":xe=new Date(fe),xe.setDate(fe.getDate()-fe.getDay()),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(be.getTime()-7*24*60*60*1e3);break;case"Monthly":xe=new Date(fe.getFullYear(),fe.getMonth(),1),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(fe.getFullYear(),fe.getMonth()-1,1),ie.setHours(0,0,0,0);break;case"Yearly":xe=new Date(fe.getFullYear(),0,1),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(fe.getFullYear()-1,0,1),ie.setHours(0,0,0,0);break;default:Fa(0),Ba(0);return}const Ce=qs.filter(Ut=>{if(!Ut.createdAt)return!1;const os=new Date(Ut.createdAt);return os>=xe&&os<=pe}),je=qs.filter(Ut=>{if(!Ut.createdAt)return!1;const os=new Date(Ut.createdAt);return os>=ie&&os<=be}),we=Ce.length,Ue=je.length;let tn=0;Ue>0?tn=(we-Ue)/Ue*100:we>0&&(tn=100),Fa(we),Ba(tn)},[qs,g,R,J]),m.useEffect(()=>{(async()=>{if(!(d==="Custom"&&(!R||!J))){$t(!0);try{const[xe,pe,ie,be,Ce]=await Promise.all([nt("newUsers",d,R,J),nt("activeUsers",d,R,J),nt("organizations",d,R,J),nt("teams",d,R,J),nt("sessions",d,R,J)]);xe&&(zt(xe.data||[]),me(xe.labels||[])),vt({signups:(xe==null?void 0:xe.data)||[],logins:(pe==null?void 0:pe.data)||[],organizations:(ie==null?void 0:ie.data)||[],teams:(be==null?void 0:be.data)||[],sessions:(Ce==null?void 0:Ce.data)||[]}),En((xe==null?void 0:xe.labels)||(pe==null?void 0:pe.labels)||(ie==null?void 0:ie.labels)||(be==null?void 0:be.labels)||(Ce==null?void 0:Ce.labels)||[])}finally{$t(!1)}}})()},[d,R,J,nt]),m.useEffect(()=>{(async()=>{const xe=await nt("activeUsers","1D");xe&&X(xe.percentageChange||0)})()},[nt]),m.useEffect(()=>{},[rs.organizations,rs.teams,Or]),m.useEffect(()=>{(async()=>{const xe=ql[x]||"1D",pe=xe==="Custom";if(!(pe&&(!K||!ce))){Fe(!0);try{const ie=await nt("organizations",xe,pe?K:void 0,pe?ce:void 0);ie&&(Se(ie.total||0),W(ie.percentageChange||0))}catch{Se(0),W(0)}finally{Fe(!1)}}})()},[x,K,ce,nt]),m.useEffect(()=>{(async()=>{const xe=ql[j]||"1D",pe=xe==="Custom";if(!(pe&&(!ve||!Te))){he(!0);try{const ie=await nt("teams",xe,pe?ve:void 0,pe?Te:void 0);ie&&(Pe(ie.total||0),de(ie.percentageChange||0))}catch{Pe(0),de(0)}finally{he(!1)}}})()},[j,ve,Te,nt]),m.useEffect(()=>{(async()=>{const xe=await nt("users","1D");xe&&qt(xe.percentageChange||0);const pe=await nt("organizations","1D");pe&&La(pe.percentageChange||0);const ie=await nt("activeUsers","1D");ie&&Yl(ie.percentageChange||0);const[be,Ce,je,we,Ue]=await Promise.all([nt("newUsers","1D"),nt("activeUsers","1D"),nt("organizations","1D"),nt("teams","1D"),nt("sessions","1D")]),Ut=[(be==null?void 0:be.total)||0,(Ce==null?void 0:Ce.total)||0,(je==null?void 0:je.total)||0,(we==null?void 0:we.total)||0,(Ue==null?void 0:Ue.total)||0].reduce((Ks,ch)=>Ks+ch,0);th(Ut);const ao=[(be==null?void 0:be.previousTotal)||0,(Ce==null?void 0:Ce.previousTotal)||0,(je==null?void 0:je.previousTotal)||0,(we==null?void 0:we.previousTotal)||0,(Ue==null?void 0:Ue.previousTotal)||0].reduce((Ks,ch)=>Ks+ch,0);if(ao>0){const Ks=(Ut-ao)/ao*100;to(Ks)}else Ut>0?to(100):to(0)})()},[nt]),m.useEffect(()=>{(async()=>{try{const pe=await(await fetch("/api/version-check")).json();pe&&D({current:pe.current||"1.0.0",latest:pe.latest||"1.0.0",isOutdated:pe.isOutdated||!1})}catch{try{const be=(await(await fetch("/api/package-info")).json()).betterAuthVersion||"1.0.0",Ce="1.5.0";D({current:be,latest:Ce,isOutdated:be!==Ce})}catch{D({current:"1.0.0",latest:"1.5.0",isOutdated:!0})}}})()},[]);const Gl=fe=>{switch(fe){case"critical":return"bg-white/10 text-white border-white/20";case"high":return"bg-white/10 text-white border-white/20";case"medium":return"bg-white/10 text-gray-300 border-white/20";case"low":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},Kl=fe=>{switch(fe){case"applied":return"bg-white/10 text-white border-white/20";case"scheduled":return"bg-white/10 text-gray-300 border-white/20";case"pending":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},oh=fe=>{f(fe),w(!0)},so=()=>{w(!1),setTimeout(()=>f(null),300)},Ql=(fe,xe="users")=>{const pe=xe==="users"?Oe:ae,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(pe&&pe.length>0&&pe.length===be)return fe==="1D"?pe.filter((je,we)=>we%4===0).map(je=>{const we=parseInt(je.replace("h",""),10);return we===0?"12am":we<12?`${we}am`:we===12?"12pm":`${we-12}pm`}):fe==="1W"?pe.map(je=>je.length>3?je.substring(0,3):je):fe==="1M"?pe.map(je=>{const we=je.split(" ");return we.length>=2?we[1]:je}):fe==="1Y"||fe==="3M"||fe==="6M"?pe.map(je=>je.length>3?je.substring(0,3):je):pe.map(je=>je.length>3?je.substring(0,3):je);const Ce=new Date;switch(fe){case"1D":return["12am","4am","8am","12pm","4pm","8pm"];case"1W":return Array.from({length:7},(je,we)=>new Date(Ce.getTime()-(6-we)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"short"}));case"1M":return Array.from({length:30},(je,we)=>new Date(Ce.getTime()-(29-we)*24*60*60*1e3).getDate().toString());case"3M":return Array.from({length:3},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(2-we),1).toLocaleDateString("en-US",{month:"short"}));case"6M":return Array.from({length:6},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(5-we),1).toLocaleDateString("en-US",{month:"short"}));case"1Y":return Array.from({length:12},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(11-we),1).toLocaleDateString("en-US",{month:"short"}));case"ALL":return Array.from({length:7},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(6-we),1).toLocaleDateString("en-US",{month:"short"}));default:return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},lh=(fe,xe="users")=>{const pe=xe==="users"?Oe:ae,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(pe&&pe.length>0&&pe.length===be)return fe==="1D"?pe.map(je=>{const we=parseInt(je.replace("h",""),10);return we===0?"12am":we<12?`${we}am`:we===12?"12pm":`${we-12}pm`}):fe==="1Y"||fe==="3M"||fe==="6M"?pe.map(je=>{const we=["January","February","March","April","May","June","July","August","September","October","November","December"],tn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(je);return tn!==-1?we[tn]:je}):pe;const Ce=new Date;switch(fe){case"1D":return Array.from({length:24},(je,we)=>{const Ue=new Date;return Ue.setHours(we,0,0,0),Ue.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0})});case"1W":return Array.from({length:7},(je,we)=>new Date(Ce.getTime()-(6-we)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"long"}));case"1M":return Array.from({length:30},(je,we)=>{const Ue=new Date(Ce.getTime()-(29-we)*24*60*60*1e3),tn=Ue.toLocaleDateString("en-US",{month:"short"}),Ut=Ue.getDate();return`${tn} ${Ut}`});case"3M":return Array.from({length:3},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(2-we),1).toLocaleDateString("en-US",{month:"long"}));case"6M":return Array.from({length:6},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(5-we),1).toLocaleDateString("en-US",{month:"long"}));case"1Y":return Array.from({length:12},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(11-we),1).toLocaleDateString("en-US",{month:"long"}));case"ALL":return Array.from({length:7},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(6-we),1).toLocaleDateString("en-US",{month:"long"}));default:return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},Wa=(fe,xe="users")=>{const pe=xe==="users"?ut:Ot,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(!pe||pe.length===0)return Array(be).fill(0);const Ce=[...pe];for(;Ce.length<be;)Ce.push(0);const je=Ce.slice(0,be),we=Math.max(...je,1);return je.map(Ue=>Ue/we*100)},Zl=()=>{const fe=Nt.length>0?Nt:Ql(d,"users"),xe=fe.map((ie,be)=>So.reduce((Ce,je)=>{var we;return Ce+(((we=Ve[je.id])==null?void 0:we[be])??0)},0)),pe=Math.max(...xe,1);return s.jsxs("div",{className:"space-y-6 min-h-screen h-full mt-5 flex-1 overflow-y-hidden overflow-x-hidden px-0",children:[s.jsx("div",{className:"px-6 overflow-hidden",children:s.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-white/5 border border-white/10 rounded-none overflow-x-auto relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:s.jsx(Ze,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Users"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Or?"...":as(rs.users)}),s.jsxs("div",{className:`flex items-center gap-1 ${lr>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${lr<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(lr).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:s.jsx(Ln,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Organizations"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Or?"...":as(rs.organizations)}),s.jsxs("div",{className:`flex items-center gap-1 ${Rt>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${Rt<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Rt).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:s.jsx(mw,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Sessions"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Or?"...":as(rs.sessions)}),s.jsxs("div",{className:`flex items-center gap-1 ${hn>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${hn<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(hn).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:s.jsx(hw,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Activity Hits"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Or?"...":as(eh??0)}),s.jsxs("div",{className:`flex items-center gap-1 ${eo>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${eo<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(eo).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:s.jsx(Ze,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"New Users"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Or?"...":as(i??0)}),s.jsxs("div",{className:"flex items-center gap-1 text-green-500",children:[s.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsx("span",{className:"text-sm font-medium",children:"18%"})]})]})]})]})}),s.jsxs("div",{className:"px-6 pb-10 space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"TOTAL USER"}),s.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","6M","1Y"].map(ie=>s.jsx("button",{onClick:()=>c(ie),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${l===ie?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:ie},ie))})]}),s.jsxs("div",{className:"flex justify-between items-end mb-6",children:[s.jsx("p",{className:"text-4xl text-white font-light",children:Or?"...":as(rs.users)}),s.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[s.jsx("svg",{className:`w-3 h-3 ${Je>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${Je>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Je).toFixed(1),"%"]})]})]}),s.jsxs("div",{className:"space-y-2 relative",children:[s.jsxs("div",{className:"h-32 relative",children:[s.jsx("svg",{className:"w-full h-full absolute inset-0",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:s.jsx("defs",{children:s.jsxs("linearGradient",{id:"usersBarGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[s.jsx("stop",{offset:"0%",style:{stopColor:"rgba(255, 255, 255, 0.3)",stopOpacity:1}}),s.jsx("stop",{offset:"100%",style:{stopColor:"rgba(255, 255, 255, 0.05)",stopOpacity:1}})]})})}),s.jsx("div",{className:"h-32 flex items-end justify-between space-x-1 relative z-10",children:Wa(l,"users").map((ie,be)=>{const Ce=T===be;return s.jsx("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group",style:{height:`${ie}%`,background:"url(#usersBarGradient)"},onMouseEnter:je=>{const we=je.currentTarget.getBoundingClientRect(),Ue=we.left+we.width/2,tn=we.top,Ut=150,os=60,ao=Math.max(Ut/2,Math.min(window.innerWidth-Ut/2,Ue)),Ks=Math.max(os+10,Math.min(window.innerHeight-10,tn));C(be),z({x:ao,y:Ks})},onMouseLeave:()=>{C(null),z(null)},children:s.jsx("div",{className:"w-full h-full",style:{background:"linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05))",opacity:Ce?1:.8}})},be)})}),T!==null&&_&&s.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${_.x}px`,top:`${_.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:s.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg whitespace-nowrap",children:[s.jsx("div",{className:"text-xs text-gray-400 mb-1 font-mono uppercase",children:lh(l,"users")[T]}),s.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[ut[T]!==void 0?ut[T].toLocaleString():"0"," ",s.jsx("span",{className:"font-mono text-xs text-gray-400",children:"users"})]})]})})]}),s.jsx("div",{className:`flex justify-between ${l==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:Ql(l,"users").map((ie,be)=>s.jsx("span",{className:"flex-1 text-center truncate",children:ie},be))})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"Activity Hits"}),s.jsx("p",{className:"text-4xl text-white font-light mt-1",children:Qe?"...":is(rh)}),s.jsx("p",{className:"text-xs text-gray-400",children:"Tracked events in selected period"})]}),s.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","1M","3M","6M","1Y","ALL"].map(ie=>s.jsx("button",{onClick:()=>h(ie),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${d===ie?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:ie},ie))})]}),s.jsxs("div",{className:"space-y-2 relative",children:[s.jsx("div",{className:"h-40 flex items-end gap-1",children:fe.map((ie,be)=>{const Ce=xe[be]||0;return s.jsx("div",{className:"flex-1 flex flex-col justify-end gap-[1px] h-full cursor-pointer",onMouseEnter:je=>sh(je,be),onMouseLeave:()=>{P(null),q(null)},children:So.map(je=>{var tn;const we=((tn=Ve[je.id])==null?void 0:tn[be])??0,Ue=Ce===0||pe===0?0:Math.max(we/pe*100,we>0?4:0);return s.jsx("div",{className:`w-full ${je.barClass}`,style:{height:`${Ue}%`}},`${je.id}-${be}`)})},`${ie}-${be}`)})}),Qe&&s.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center text-xs uppercase text-gray-400 pointer-events-none",children:"Loading activity..."}),H!==null&&B&&s.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${B.x}px`,top:`${B.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:s.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg min-w-[180px]",children:[s.jsx("div",{className:"text-xs text-gray-400 mb-2 font-mono uppercase",children:fe[H]||`Bucket ${H+1}`}),s.jsx("div",{className:"space-y-1",children:So.map(ie=>{var be;return s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[s.jsx("span",{className:`w-2 h-2 rounded-sm ${ie.dotClass}`}),ie.label]}),s.jsx("span",{className:"text-white font-medium",children:((be=Ve[ie.id])==null?void 0:be[H])??0})]},ie.id)})})]})}),s.jsx("div",{className:`flex justify-between ${d==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:fe.map((ie,be)=>s.jsx("span",{className:"flex-1 text-center truncate",children:ie},be))}),s.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3 mt-4 pt-4 border-t border-white/10",children:So.map(ie=>s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`w-2 h-2 rounded-sm ${ie.dotClass}`}),ie.label]}),s.jsx("span",{className:"text-white font-medium",children:Qe?"...":is(ro[ie.id]||0)})]},ie.id))})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>M(!S),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:v})]}),S&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{b(ie),M(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ie},ie))})]}),v==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),G?An(G,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:G,onSelect:se,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),re?An(re,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:re,onSelect:Z,initialFocus:!0,disabled:ie=>G?ie<G:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Active Users"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Users with active session in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:is(r)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 border-white/5 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${ze>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${ze>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ze).toFixed(1),"%"]})]})})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>I(!A),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:g})]}),A&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{y(ie),I(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ie},ie))})]}),g==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),R?An(R,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:R,onSelect:ee,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),J?An(J,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:J,onSelect:F,initialFocus:!0,disabled:ie=>R?ie<R:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"New Users"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Newly registered Users in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:is(Xl)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${Ua>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",style:Ua<0?{transform:"rotate(180deg)"}:{},children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${Ua>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Ua).toFixed(1),"%"]})]})})]})]})]}),s.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>$(!U),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:x})]}),U&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{N(ie),$(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ie},ie))})]}),x==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),K?An(K,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:K,onSelect:ne,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),ce?An(ce,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:ce,onSelect:ge,initialFocus:!0,disabled:ie=>K?ie<K:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Organizations"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total organizations in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:_e?"...":is(Ne)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${le>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${le>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(le).toFixed(1),"%"]})]})})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>E(!L),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:j})]}),L&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{k(ie),E(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ie},ie))})]}),j==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),ve?An(ve,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:ve,onSelect:Ae,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),Te?An(Te,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:Te,onSelect:tt,initialFocus:!0,disabled:ie=>ve?ie<ve:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Teams"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total teams in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:bt?"...":is(ue)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${te>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${te>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(te).toFixed(1),"%"]})]})})]})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pt-4 overflow-hidden relative rounded-none flex flex-col",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Mn,{className:"w-4 h-4 text-white/60"}),s.jsx("h4",{className:"text-xs text-gray-400 uppercase font-mono font-light",children:"Security Insights"})]})}),s.jsx("hr",{className:"-mx-10 -mt-1 border-white/10"}),s.jsx("div",{className:"space-y-3 overflow-y-auto custom-scrollbar max-h-[400px]",children:ih.map((ie,be)=>s.jsx("div",{onClick:()=>oh(ie),className:"group py-2 border-b border-white/5 cursor-pointer transition-all duration-200 hover:border-white/20",style:{animation:`slideIn 0.3s ease-out ${be*.1}s both`},children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:s.jsx("span",{className:"text-sm text-white/90 font-light truncate group-hover:text-white transition-colors",children:ie.title})}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm uppercase font-mono ${Gl(ie.severity)}`,children:ie.severity}),s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm capitalize font-mono ${Kl(ie.status)}`,children:ie.status})]})]}),s.jsx(PP,{className:"w-3.5 h-3.5 text-gray-500 group-hover:text-white transition-all flex-shrink-0 mt-0.5"})]})},ie.id))})]})]})]})]})};return s.jsxs("div",{className:"h-screen bg-black text-white overflow-hidden flex flex-col",style:{overflowX:"hidden"},children:[s.jsx("div",{className:"flex-1 overflow-hidden",children:e==="overview"?Zl():e==="users"?s.jsx(ok,{}):e==="organizations"?s.jsx(ik,{}):Zl()}),t&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-3xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mw,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-lg text-white font-light",children:"Quick Actions"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("button",{onClick:()=>{n(!1),ss("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Ze,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View All Users"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Manage user accounts"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/organizations")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Ln,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View Organizations"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Manage organizations"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/sessions")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(hw,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View Sessions"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Monitor active sessions"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/database")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Vr,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Database Schema"}),s.jsx("p",{className:"text-sm text-gray-400",children:"View schema visualizer"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/settings")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(J2,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Settings"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Configure system"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Q2,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Search Users"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Find specific users"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]})]}),s.jsx("div",{className:"mt-6 pt-6 border-t border-dashed border-white/10",children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[s.jsx("span",{children:"Tip: Press Ctrl+K or Cmd+K for command palette"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:"Close"})]})})]})}),p&&u&&s.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",style:{animation:"fadeIn 0.3s ease-out"},onClick:so,children:s.jsxs("div",{className:"bg-black border border-white/20 rounded-none max-w-2xl w-full max-h-[80vh] overflow-y-auto",style:{animation:"slideUp 0.3s ease-out"},onClick:fe=>fe.stopPropagation(),children:[s.jsx("div",{className:"sticky top-0 bg-black border-b border-white/10 p-6 z-10",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx(Mn,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-xl text-white font-light",children:u.title})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs("span",{className:`text-xs px-2 py-1 border rounded-none uppercase font-medium ${Gl(u.severity)}`,children:[u.severity," Severity"]}),s.jsx("span",{className:`text-xs px-2 py-1 border rounded-none capitalize ${Kl(u.status)}`,children:u.status}),u.cve&&s.jsx("span",{className:"text-xs text-gray-400 font-mono bg-white/5 px-2 py-1 border border-white/10 rounded-none",children:u.cve})]})]}),s.jsx("button",{onClick:so,className:"p-2 hover:bg-white/10 transition-colors rounded-none",children:s.jsx(Kt,{className:"w-5 h-5 text-gray-400 hover:text-white"})})]})}),s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Release Date"}),s.jsx("p",{className:"text-white",children:new Date(u.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Description"}),u.description.includes("npm install")?s.jsxs("div",{children:[s.jsx("p",{className:"text-white leading-relaxed mb-3",children:u.description.split("Run:")[0]}),s.jsx("div",{className:"relative group",children:s.jsx("div",{className:"bg-black border border-white/20 rounded-none p-3 font-mono text-sm",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("code",{children:[s.jsx("span",{className:"text-green-400",children:"$"})," ",s.jsx("span",{className:"text-cyan-400",children:"npm"})," ",s.jsx("span",{className:"text-yellow-400",children:"install"})," ",s.jsx("span",{className:"text-white",children:"better-auth@latest"})]}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText("npm install better-auth@latest"),V.success("Command copied to clipboard")},className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-white/10 rounded",title:"Copy command",children:s.jsx(Ym,{className:"w-4 h-4 text-gray-400 hover:text-white"})})]})})})]}):s.jsx("p",{className:"text-white leading-relaxed",children:u.description})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-3",children:"Affected Components"}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:u.affectedComponents.map((fe,xe)=>s.jsxs("div",{className:"flex items-center gap-2 p-3 bg-white/5 border border-white/10 rounded-none",style:{animation:`slideIn 0.3s ease-out ${xe*.1}s both`},children:[s.jsx("div",{className:"w-2 h-2 bg-white rounded-none flex-shrink-0"}),s.jsx("span",{className:"text-sm text-white",children:fe})]},xe))})]}),s.jsx("div",{className:"p-4 bg-white/5 border border-white/10 rounded-none",children:s.jsxs("div",{className:"flex items-start gap-3",children:[u.status==="applied"&&s.jsxs(s.Fragment,{children:[s.jsx(Ix,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Patch Applied"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This security patch has been successfully applied to your system."})]})]}),u.status==="scheduled"&&s.jsxs(s.Fragment,{children:[s.jsx(Z2,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Scheduled"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This patch is scheduled for deployment in the next maintenance window."})]})]}),u.status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(JL,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Action Required"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This patch is pending review and requires manual approval before deployment."})]})]})]})}),s.jsx("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-white/10",children:s.jsx(Y,{variant:"ghost",onClick:so,className:"text-gray-400 hover:text-white rounded-none",children:"Close"})})]})]})}),s.jsx("style",{children:`
|
|
421
421
|
@keyframes fadeIn {
|
|
422
422
|
from {
|
|
423
423
|
opacity: 0;
|