1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,37252,e=>{"use strict";var t=e.i(96243),a=e.i(93221),r=e.i(47450),n=e.i(10965);let s=(0,n.default)("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);var o=e.i(75170);let i=(0,n.default)("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);var l=e.i(85553),d=e.i(94237);let c=(0,n.default)("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);var u=e.i(15843),p=e.i(16593);function m({className:e,type:a,...r}){return(0,t.jsx)("input",{type:a,"data-slot":"input",className:(0,u.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var x=e.i(49630),f="horizontal",h=["horizontal","vertical"],v=a.forwardRef((e,a)=>{var r;let{decorative:n,orientation:s=f,...o}=e,i=(r=s,h.includes(r))?s:f;return(0,t.jsx)(x.Primitive.div,{"data-orientation":i,...n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"},...o,ref:a})});function g({className:e,orientation:a="horizontal",decorative:r=!0,...n}){return(0,t.jsx)(v,{"data-slot":"separator",decorative:r,orientation:a,className:(0,u.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}v.displayName="Separator";var b=e.i(78896),j=e.i(44739),w=e.i(64363),y=e.i(3040),N=e.i(33439),C=e.i(38341),k=e.i(34411),S=e.i(37741),_=e.i(97073),E=e.i(61876),R=e.i(8114),P=e.i(73772),D="Dialog",[T,M]=(0,w.createContextScope)(D),[I,L]=T(D),z=e=>{let{__scopeDialog:r,children:n,open:s,defaultOpen:o,onOpenChange:i,modal:l=!0}=e,d=a.useRef(null),c=a.useRef(null),[u=!1,p]=(0,N.useControllableState)({prop:s,defaultProp:o,onChange:i});return(0,t.jsx)(I,{scope:r,triggerRef:d,contentRef:c,contentId:(0,y.useId)(),titleId:(0,y.useId)(),descriptionId:(0,y.useId)(),open:u,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:n})};z.displayName=D;var O="DialogTrigger";a.forwardRef((e,a)=>{let{__scopeDialog:r,...n}=e,s=L(O,r),o=(0,j.useComposedRefs)(a,s.triggerRef);return(0,t.jsx)(x.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ea(s.open),...n,ref:o,onClick:(0,b.composeEventHandlers)(e.onClick,s.onOpenToggle)})}).displayName=O;var H="DialogPortal",[A,F]=T(H,{forceMount:void 0}),B=e=>{let{__scopeDialog:r,forceMount:n,children:s,container:o}=e,i=L(H,r);return(0,t.jsx)(A,{scope:r,forceMount:n,children:a.Children.map(s,e=>(0,t.jsx)(_.Presence,{present:n||i.open,children:(0,t.jsx)(S.Portal,{asChild:!0,container:o,children:e})}))})};B.displayName=H;var V="DialogOverlay",U=a.forwardRef((e,a)=>{let r=F(V,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=L(V,e.__scopeDialog);return o.modal?(0,t.jsx)(_.Presence,{present:n||o.open,children:(0,t.jsx)(K,{...s,ref:a})}):null});U.displayName=V;var K=a.forwardRef((e,a)=>{let{__scopeDialog:r,...n}=e,s=L(V,r);return(0,t.jsx)(R.RemoveScroll,{as:l.Slot,allowPinchZoom:!0,shards:[s.contentRef],children:(0,t.jsx)(x.Primitive.div,{"data-state":ea(s.open),...n,ref:a,style:{pointerEvents:"auto",...n.style}})})}),W="DialogContent",$=a.forwardRef((e,a)=>{let r=F(W,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=L(W,e.__scopeDialog);return(0,t.jsx)(_.Presence,{present:n||o.open,children:o.modal?(0,t.jsx)(q,{...s,ref:a}):(0,t.jsx)(G,{...s,ref:a})})});$.displayName=W;var q=a.forwardRef((e,r)=>{let n=L(W,e.__scopeDialog),s=a.useRef(null),o=(0,j.useComposedRefs)(r,n.contentRef,s);return a.useEffect(()=>{let e=s.current;if(e)return(0,P.hideOthers)(e)},[]),(0,t.jsx)(Y,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,b.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:(0,b.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,a=0===t.button&&!0===t.ctrlKey;(2===t.button||a)&&e.preventDefault()}),onFocusOutside:(0,b.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),G=a.forwardRef((e,r)=>{let n=L(W,e.__scopeDialog),s=a.useRef(!1),o=a.useRef(!1);return(0,t.jsx)(Y,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||n.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),Y=a.forwardRef((e,r)=>{let{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,...l}=e,d=L(W,n),c=a.useRef(null),u=(0,j.useComposedRefs)(r,c);return(0,E.useFocusGuards)(),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:i,children:(0,t.jsx)(C.Dism
1issableLayer,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":ea(d.open),...l,ref:u,onDismiss:()=>d.onOpenChange(!1)})}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eo,{titleId:d.titleId}),(0,t.jsx)(ei,{contentRef:c,descriptionId:d.descriptionId})]})]})}),X="DialogTitle",Z=a.forwardRef((e,a)=>{let{__scopeDialog:r,...n}=e,s=L(X,r);return(0,t.jsx)(x.Primitive.h2,{id:s.titleId,...n,ref:a})});Z.displayName=X;var J="DialogDescription",Q=a.forwardRef((e,a)=>{let{__scopeDialog:r,...n}=e,s=L(J,r);return(0,t.jsx)(x.Primitive.p,{id:s.descriptionId,...n,ref:a})});Q.displayName=J;var ee="DialogClose",et=a.forwardRef((e,a)=>{let{__scopeDialog:r,...n}=e,s=L(ee,r);return(0,t.jsx)(x.Primitive.button,{type:"button",...n,ref:a,onClick:(0,b.composeEventHandlers)(e.onClick,()=>s.onOpenChange(!1))})});function ea(e){return e?"open":"closed"}et.displayName=ee;var er="DialogTitleWarning",[en,es]=(0,w.createContext)(er,{contentName:W,titleName:X,docsSlug:"dialog"}),eo=({titleId:e})=>{let t=es(er),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 2 3If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 4 5For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ei=({contentRef:e,descriptionId:t})=>{let r=es("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return a.useEffect(()=>{let a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},el=e.i(34853),el=el;function ed({...e}){return(0,t.jsx)(z,{"data-slot":"sheet",...e})}function ec({...e}){return(0,t.jsx)(B,{"data-slot":"sheet-portal",...e})}function eu({className:e,...a}){return(0,t.jsx)(U,{"data-slot":"sheet-overlay",className:(0,u.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...a})}function ep({className:e,children:a,side:r="right",...n}){return(0,t.jsxs)(ec,{children:[(0,t.jsx)(eu,{}),(0,t.jsxs)($,{"data-slot":"sheet-content",className:(0,u.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===r&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","left"===r&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","top"===r&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b","bottom"===r&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...n,children:[a,(0,t.jsxs)(et,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,t.jsx)(el.default,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function em({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,u.cn)("flex flex-col gap-1.5 p-4",e),...a})}function ex({className:e,...a}){return(0,t.jsx)(Z,{"data-slot":"sheet-title",className:(0,u.cn)("text-foreground font-semibold",e),...a})}function ef({className:e,...a}){return(0,t.jsx)(Q,{"data-slot":"sheet-description",className:(0,u.cn)("text-muted-foreground text-sm",e),...a})}var eh=e.i(39456),ev=a.forwardRef((e,a)=>(0,t.jsx)(x.Primitive.span,{...e,ref:a,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ev.displayName="VisuallyHidden";var[eg,eb]=(0,w.createContextScope)("Tooltip",[eh.createPopperScope]),ej=(0,eh.createPopperScope)(),ew="TooltipProvider",ey="tooltip.open",[eN,eC]=eg(ew),ek=e=>{let{__scopeTooltip:r,delayDuration:n=700,skipDelayDuration:s=300,disableHoverableContent:o=!1,children:i}
5=e,[l,d]=a.useState(!0),c=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,t.jsx)(eN,{scope:r,isOpenDelayed:l,delayDuration:n,onOpen:a.useCallback(()=>{window.clearTimeout(u.current),d(!1)},[]),onClose:a.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>d(!0),s)},[s]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(e=>{c.current=e},[]),disableHoverableContent:o,children:i})};ek.displayName=ew;var eS="Tooltip",[e_,eE]=eg(eS),eR=e=>{let{__scopeTooltip:r,children:n,open:s,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:d}=e,c=eC(eS,e.__scopeTooltip),u=ej(r),[p,m]=a.useState(null),x=(0,y.useId)(),f=a.useRef(0),h=l??c.disableHoverableContent,v=d??c.delayDuration,g=a.useRef(!1),[b=!1,j]=(0,N.useControllableState)({prop:s,defaultProp:o,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(ey))):c.onClose(),i?.(e)}}),w=a.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),C=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,j(!0)},[j]),k=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,j(!1)},[j]),S=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,j(!0),f.current=0},v)},[v,j]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),(0,t.jsx)(eh.Root,{...u,children:(0,t.jsx)(e_,{scope:r,contentId:x,open:b,stateAttribute:w,trigger:p,onTriggerChange:m,onTriggerEnter:a.useCallback(()=>{c.isOpenDelayed?S():C()},[c.isOpenDelayed,S,C]),onTriggerLeave:a.useCallback(()=>{h?k():(window.clearTimeout(f.current),f.current=0)},[k,h]),onOpen:C,onClose:k,disableHoverableContent:h,children:n})})};eR.displayName=eS;var eP="TooltipTrigger",eD=a.forwardRef((e,r)=>{let{__scopeTooltip:n,...s}=e,o=eE(eP,n),i=eC(eP,n),l=ej(n),d=a.useRef(null),c=(0,j.useComposedRefs)(r,d,o.onTriggerChange),u=a.useRef(!1),p=a.useRef(!1),m=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),(0,t.jsx)(eh.Anchor,{asChild:!0,...l,children:(0,t.jsx)(x.Primitive.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...s,ref:c,onPointerMove:(0,b.composeEventHandlers)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(p.current||i.isPointerInTransitRef.current||(o.onTriggerEnter(),p.current=!0))}),onPointerLeave:(0,b.composeEventHandlers)(e.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:(0,b.composeEventHandlers)(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:(0,b.composeEventHandlers)(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:(0,b.composeEventHandlers)(e.onBlur,o.onClose),onClick:(0,b.composeEventHandlers)(e.onClick,o.onClose)})})});eD.displayName=eP;var eT="TooltipPortal",[eM,eI]=eg(eT,{forceMount:void 0}),eL=e=>{let{__scopeTooltip:a,forceMount:r,children:n,container:s}=e,o=eE(eT,a);return(0,t.jsx)(eM,{scope:a,forceMount:r,children:(0,t.jsx)(_.Presence,{present:r||o.open,children:(0,t.jsx)(S.Portal,{asChild:!0,container:s,children:n})})})};eL.displayName=eT;var ez="TooltipContent",eO=a.forwardRef((e,a)=>{let r=eI(ez,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=eE(ez,e.__scopeTooltip);return(0,t.jsx)(_.Presence,{present:n||i.open,children:i.disableHoverableContent?(0,t.jsx)(eB,{side:s,...o,ref:a}):(0,t.jsx)(eH,{side:s,...o,ref:a})})}),eH=a.forwardRef((e,r)=>{let n=eE(ez,e.__scopeTooltip),s=eC(ez,e.__scopeTooltip),o=a.useRef(null),i=(0,j.useComposedRefs)(r,o),[l,d]=a.useState(null),{trigger:c,onClose:u}=n,p=o.current,{onPointerInTransitChange:m}=s,x=a.useCallback(()=>{d(null),m(!1)},[m]),f=a.useCallback((e,t)=>{let a,r=e.currentTarget,n={x:e.clientX,y:e.clientY},s=function(e,t){let a=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),n=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(a,r,n,s)){case s:return"left";case n:return"right";case a:return"top";case r:return"bottom";default:throw Error("unreachable")}}(n,r.getBoundingClientRect());d(((a=[...function(e,t,a=5){let r=[];switch(t){case"top":r.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":r.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":r.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":r.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a})}return r}(n,s),...function(e){let{top:t,right:a,bottom:r,left:n}=e;return[{x:n,y:t},{x:a,y:t},{x:a,y:r},{x:n,y:r}]}(t.getBoundingClientRect())].slice()).sort((e,t)=>
5e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let a=0;a<e.length;a++){let r=e[a];for(;t.length>=2;){let e=t[t.length-1],a=t[t.length-2];if((e.x-a.x)*(r.y-a.y)>=(e.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();let a=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;a.length>=2;){let e=a[a.length-1],t=a[a.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))a.pop();else break}a.push(r)}return(a.pop(),1===t.length&&1===a.length&&t[0].x===a[0].x&&t[0].y===a[0].y)?t:t.concat(a)}(a))),m(!0)},[m]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(c&&p){let e=e=>f(e,p),t=e=>f(e,c);return c.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[c,p,f,x]),a.useEffect(()=>{if(l){let e=e=>{let t=e.target,a={x:e.clientX,y:e.clientY},r=c?.contains(t)||p?.contains(t),n=!function(e,t){let{x:a,y:r}=e,n=!1;for(let e=0,s=t.length-1;e<t.length;s=e++){let o=t[e].x,i=t[e].y,l=t[s].x,d=t[s].y;i>r!=d>r&&a<(l-o)*(r-i)/(d-i)+o&&(n=!n)}return n}(a,l);r?x():n&&(x(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,p,l,u,x]),(0,t.jsx)(eB,{...e,ref:i})}),[eA,eF]=eg(eS,{isInside:!1}),eB=a.forwardRef((e,r)=>{let{__scopeTooltip:n,children:s,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:d,...c}=e,u=eE(ez,n),p=ej(n),{onClose:m}=u;return a.useEffect(()=>(document.addEventListener(ey,m),()=>document.removeEventListener(ey,m)),[m]),a.useEffect(()=>{if(u.trigger){let e=e=>{let t=e.target;t?.contains(u.trigger)&&m()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,m]),(0,t.jsx)(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:(0,t.jsxs)(eh.Content,{"data-state":u.stateAttribute,...p,...c,ref:r,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,t.jsx)(l.Slottable,{children:s}),(0,t.jsx)(eA,{scope:n,isInside:!0,children:(0,t.jsx)(ev,{id:u.contentId,role:"tooltip",children:o||s})})]})})});eO.displayName=ez;var eV="TooltipArrow",eU=a.forwardRef((e,a)=>{let{__scopeTooltip:r,...n}=e,s=ej(r);return eF(eV,r).isInside?null:(0,t.jsx)(eh.Arrow,{...s,...n,ref:a})});function eK({delayDuration:e=0,...a}){return(0,t.jsx)(ek,{"data-slot":"tooltip-provider",delayDuration:e,...a})}function eW({...e}){return(0,t.jsx)(eK,{children:(0,t.jsx)(eR,{"data-slot":"tooltip",...e})})}function e$({...e}){return(0,t.jsx)(eD,{"data-slot":"tooltip-trigger",...e})}function eq({className:e,sideOffset:a=0,children:r,...n}){return(0,t.jsx)(eL,{children:(0,t.jsxs)(eO,{"data-slot":"tooltip-content",sideOffset:a,className:(0,u.cn)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[r,(0,t.jsx)(eU,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}eU.displayName=eV;let eG=a.createContext(null);function eY(){let e=a.useContext(eG);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}function eX({defaultOpen:e=!0,open:r,onOpenChange:n,className:s,style:o,children:i,...l}){let d=function(){let[e,t]=a.useState(void 0);return a.useEffect(()=>{let e=window.matchMedia("(max-width: 767px)"),a=()=>{t(window.innerWidth<768)};return e.addEventListener("change",a),t(window.innerWidth<768),()=>e.removeEventListener("change",a)},[]),!!e}
5(),[c,p]=a.useState(!1),[m,x]=a.useState(e),f=r??m,h=a.useCallback(e=>{let t="function"==typeof e?e(f):e;n?n(t):x(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,f]),v=a.useCallback(()=>d?p(e=>!e):h(e=>!e),[d,h,p]);a.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v]);let g=f?"expanded":"collapsed",b=a.useMemo(()=>({state:g,open:f,setOpen:h,isMobile:d,openMobile:c,setOpenMobile:p,toggleSidebar:v}),[g,f,h,d,c,p,v]);return(0,t.jsx)(eG.Provider,{value:b,children:(0,t.jsx)(eK,{delayDuration:0,children:(0,t.jsx)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...o},className:(0,u.cn)("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...l,children:i})})})}function eZ({side:e="left",variant:a="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){let{isMobile:i,state:l,openMobile:d,setOpenMobile:c}=eY();return"none"===r?(0,t.jsx)("div",{"data-slot":"sidebar",className:(0,u.cn)("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:s}):i?(0,t.jsx)(ed,{open:d,onOpenChange:c,...o,children:(0,t.jsxs)(ep,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:e,children:[(0,t.jsxs)(em,{className:"sr-only",children:[(0,t.jsx)(ex,{children:"Sidebar"}),(0,t.jsx)(ef,{children:"Displays the mobile sidebar."})]}),(0,t.jsx)("div",{className:"flex h-full w-full flex-col",children:s})]})}):(0,t.jsxs)("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":"collapsed"===l?r:"","data-variant":a,"data-side":e,"data-slot":"sidebar",children:[(0,t.jsx)("div",{"data-slot":"sidebar-gap",className:(0,u.cn)("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===a||"inset"===a?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),(0,t.jsx)("div",{"data-slot":"sidebar-container",className:(0,u.cn)("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex","left"===e?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===a||"inset"===a?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:(0,t.jsx)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function eJ({className:e,onClick:a,...r}){let{toggleSidebar:n}=eY();return(0,t.jsxs)(p.Button,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:(0,u.cn)("size-7",e),onClick:e=>{a?.(e),n()},...r,children:[(0,t.jsx)(c,{}),(0,t.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function eQ({className:e,...a}){return(0,t.jsx)("main",{"data-slot":"sidebar-inset",className:(0,u.cn)("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...a})}function e0({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:(0,u.cn)("flex flex-col gap-2 p-2",e),...a})}function e1({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:(0,u.cn)("flex flex-col gap-2 p-2",e),...a})}function e2({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:(0,u.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...a})}function e4({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:(0,u.cn)("relative flex w-full min-w-0 flex-col p-2",e),...a})}function e3({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:(0,u.cn)("w-full text-sm",e),...a})}function e5({className:e,...a}){return(0,t.jsx)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:(0,u.cn)("flex w-full min-w-0 flex-col gap-1",e),...a})}function e6({className:e,...a}){return(0,t.jsx)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:(0,u.cn)("group/menu-item relative",e),...a})}let e7=(0,d.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function e8({asChild:e=!1,isActive:a=!1,variant:r="default",size:n="default",tooltip:s,className:o,...i}){let d=e?l.Slot:"button",{isMobile:c,state:p}=eY(),m=(0,t.jsx)(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":a,className:(0,u.cn)(e7({variant:r,size:n}),o),...i});return s?("string"==typeof s&&(s={children:s}),(0,t.jsxs)(eW,{children:[(0,t.jsx)(e$,{asChild:!0,children:m}),(0,t.jsx)(eq,{side:"right",align:"center",hidden:"collapsed"!==p||c,...s})]})):m}function e9({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,t.jsx)("table",{"data-slot":"table",className:(0,u.cn)("w-full caption-bottom text-sm",e),...a})})}function te({className:e,...a}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,u.cn)("[&_tr]:border-b",e),...a})}function tt({className:e,...a}){return(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,u.cn)("[&_tr:last-child]:border-0",e),...a})}function ta({className:e,...a}){return(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,u.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...a})}function tr({className:e,...a}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,u.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}function tn({className:e,...a}){return(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,u.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}let ts=(0,d.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function to({className:e,variant:a,asChild:r=!1,...n}){let s=r?l.Slot:"span";return(0,t.jsx)(s,{"data-slot":"badge",className:(0,u.cn)(ts({variant:a}),e),...n})}var ti=e.i(35059);function tl(e,[t,a]){return Math.min(a,Math.max(t,e))}var td=e.i(80172),tc=e.i(82270),tu=e.i(67645),tp=e.i(74180),tm=[" ","Enter","ArrowUp","ArrowDown"],tx=[" ","Enter"],tf="Select",[th,tv,tg]=(0,td.createCollection)(tf),[tb,tj]=(0,w.createContextScope)(tf,[tg,eh.createPopperScope]),tw=(0,eh.createPopperScope)(),[ty,tN]=tb(tf),[tC,tk]=tb(tf),tS=e=>{let{__scopeSelect:r,children:n,open:s,defaultOpen:o,onOpenChange:i,value:l,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:m,disabled:x,required:f,form:h}=e,v=tw(r),[g,b]=a.useState(null),[j,w]=a.useState(null),[C,k]=a.useState(!1),S=(0,tc.useDirection)(u),[_=!1,E]=(0,N.useControllableState)({prop:s,defaultProp:o,onChange:i}),[R,P]=(0,N.useControllableState)({prop:l,defaultProp:d,onChange:c}
5),D=a.useRef(null),T=!g||h||!!g.closest("form"),[M,I]=a.useState(new Set),L=Array.from(M).map(e=>e.props.value).join(";");return(0,t.jsx)(eh.Root,{...v,children:(0,t.jsxs)(ty,{required:f,scope:r,trigger:g,onTriggerChange:b,valueNode:j,onValueNodeChange:w,valueNodeHasChildren:C,onValueNodeHasChildrenChange:k,contentId:(0,y.useId)(),value:R,onValueChange:P,open:_,onOpenChange:E,dir:S,triggerPointerDownPosRef:D,disabled:x,children:[(0,t.jsx)(th.Provider,{scope:r,children:(0,t.jsx)(tC,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{I(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{I(t=>{let a=new Set(t);return a.delete(e),a})},[]),children:n})}),T?(0,t.jsxs)(t9,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:m,value:R,onChange:e=>P(e.target.value),disabled:x,form:h,children:[void 0===R?(0,t.jsx)("option",{value:""}):null,Array.from(M)]},L):null]})})};tS.displayName=tf;var t_="SelectTrigger",tE=a.forwardRef((e,r)=>{let{__scopeSelect:n,disabled:s=!1,...o}=e,i=tw(n),l=tN(t_,n),d=l.disabled||s,c=(0,j.useComposedRefs)(r,l.onTriggerChange),u=tv(n),p=a.useRef("touch"),[m,f,h]=ae(e=>{let t=u().filter(e=>!e.disabled),a=t.find(e=>e.value===l.value),r=at(t,e,a);void 0!==r&&l.onValueChange(r.value)}),v=e=>{d||(l.onOpenChange(!0),h()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(eh.Anchor,{asChild:!0,...i,children:(0,t.jsx)(x.Primitive.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":t8(l.value)?"":void 0,...o,ref:c,onClick:(0,b.composeEventHandlers)(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:(0,b.composeEventHandlers)(o.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:(0,b.composeEventHandlers)(o.onKeyDown,e=>{let t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),(!t||" "!==e.key)&&tm.includes(e.key)&&(v(),e.preventDefault())})})})});tE.displayName=t_;var tR="SelectValue",tP=a.forwardRef((e,a)=>{let{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...l}=e,d=tN(tR,r),{onValueNodeHasChildrenChange:c}=d,u=void 0!==o,p=(0,j.useComposedRefs)(a,d.onValueNodeChange);return(0,tp.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(x.Primitive.span,{...l,ref:p,style:{pointerEvents:"none"},children:t8(d.value)?(0,t.jsx)(t.Fragment,{children:i}):o})});tP.displayName=tR;var tD=a.forwardRef((e,a)=>{let{__scopeSelect:r,children:n,...s}=e;return(0,t.jsx)(x.Primitive.span,{"aria-hidden":!0,...s,ref:a,children:n||"â¼"})});tD.displayName="SelectIcon";var tT=e=>(0,t.jsx)(S.Portal,{asChild:!0,...e});tT.displayName="SelectPortal";var tM="SelectContent",tI=a.forwardRef((e,r)=>{let n=tN(tM,e.__scopeSelect),[s,o]=a.useState();return((0,tp.useLayoutEffect)(()=>{o(new DocumentFragment)},[]),n.open)?(0,t.jsx)(tO,{...e,ref:r}):s?ti.createPortal((0,t.jsx)(tL,{scope:e.__scopeSelect,children:(0,t.jsx)(th.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),s):null});tI.displayName=tM;var[tL,tz]=tb(tM),tO=a.forwardRef((e,r)=>{let{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:d,side:c,sideOffset:u,align:p,alignOffset:m,arrowPadding:x,collisionBoundary:f,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:w,...y}=e,N=tN(tM,n),[S,_]=a.useState(null),[D,T]=a.useState(null),M=(0,j.useComposedRefs)(r,e=>_(e)),[I,L]=a.useState(null),[z,O]=a.useState(null),H=tv(n),[A,F]=a.useState(!1),B=a.useRef(!1);a.useEffect(()=>{if(S)return(0,P.hideOthers)(S)},[S]),(0,E.useFocusGuards)();let V=a.useCallback(e=>{let[t,...a]=H().map(e=>e.ref.current),[r]=a.slice(-1),n=document.activeElement;for(let a of e)if(a===n||(a?.scrollIntoView({block:"nearest"}),a===t&&D&&(D.scrollTop=0),a===r&&D&&(D.scrollTop=D.scrollHeight),a?.focus(),document.activeElement!==n))return}
5,[H,D]),U=a.useCallback(()=>V([I,S]),[V,I,S]);a.useEffect(()=>{A&&U()},[A,U]);let{onOpenChange:K,triggerPointerDownPosRef:W}=N;a.useEffect(()=>{if(S){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},a=a=>{e.x<=10&&e.y<=10?a.preventDefault():S.contains(a.target)||K(!1),document.removeEventListener("pointermove",t),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",a,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",a,{capture:!0})}}},[S,K,W]),a.useEffect(()=>{let e=()=>K(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[K]);let[$,q]=ae(e=>{let t=H().filter(e=>!e.disabled),a=t.find(e=>e.ref.current===document.activeElement),r=at(t,e,a);r&&setTimeout(()=>r.ref.current.focus())}),G=a.useCallback((e,t,a)=>{let r=!B.current&&!a;(void 0!==N.value&&N.value===t||r)&&(L(e),r&&(B.current=!0))},[N.value]),Y=a.useCallback(()=>S?.focus(),[S]),X=a.useCallback((e,t,a)=>{let r=!B.current&&!a;(void 0!==N.value&&N.value===t||r)&&O(e)},[N.value]),Z="popper"===s?tA:tH,J=Z===tA?{side:c,sideOffset:u,align:p,alignOffset:m,arrowPadding:x,collisionBoundary:f,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:w}:{};return(0,t.jsx)(tL,{scope:n,content:S,viewport:D,onViewportChange:T,itemRefCallback:G,selectedItem:I,onItemLeave:Y,itemTextRefCallback:X,focusSelectedItem:U,selectedItemText:z,position:s,isPositioned:A,searchRef:$,children:(0,t.jsx)(R.RemoveScroll,{as:l.Slot,allowPinchZoom:!0,children:(0,t.jsx)(k.FocusScope,{asChild:!0,trapped:N.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,b.composeEventHandlers)(o,e=>{N.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:(0,t.jsx)(Z,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:e=>e.preventDefault(),...y,...J,onPlaced:()=>F(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:(0,b.composeEventHandlers)(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||q(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=H().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let a=e.target,r=t.indexOf(a);t=t.slice(r+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});tO.displayName="SelectContentImpl";var tH=a.forwardRef((e,r)=>{let{__scopeSelect:n,onPlaced:s,...o}=e,i=tN(tM,n),l=tz(tM,n),[d,c]=a.useState(null),[u,p]=a.useState(null),m=(0,j.useComposedRefs)(r,e=>p(e)),f=tv(n),h=a.useRef(!1),v=a.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:w,focusSelectedItem:y}=l,N=a.useCallback(()=>{if(i.trigger&&i.valueNode&&d&&u&&g&&b&&w){let e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),a=i.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==i.dir){let n=r.left-t.left,s=a.left-n,o=e.left-s,i=e.width+o,l=Math.max(i,t.width),c=tl(s,[10,Math.max(10,window.innerWidth-10-l)]);d.style.minWidth=i+"px",d.style.left=c+"px"}else{let n=t.right-r.right,s=window.innerWidth-a.right-n,o=window.innerWidth-e.right-s,i=e.width+o,l=Math.max(i,t.width),c=tl(s,[10,Math.max(10,window.innerWidth-10-l)]);d.style.minWidth=i+"px",d.style.right=c+"px"}let n=f(),o=window.innerHeight-20,l=g.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),m=parseInt(c.paddingTop,10),x=parseInt(c.borderBottomWidth,10),v=p+m+l+parseInt(c.paddingBottom,10)+x,j=Math.min(5*b.offsetHeight,v),y=window.getComputedStyle(g),N=parseInt(y.paddingTop,10),C=parseInt(y.paddingBottom,10),k=e.top+e.height/2-10,S=b.offsetHeight/2,_=p+m+(b.offsetTop+S);if(_<=k){let e=n.length>0&&b===n[n.length-1].ref.current;d.style.bottom="0px";let t=Math.max(o-k,S+(e?C:0)+(u.clientHeight-g.offsetTop-g.offsetHeight)+x);d.style.height=_+t+"px"}else{let e=n.length>0&&b===n[0].ref.current;d.style.top="0px";let t=Math.max(k,p+g.offsetTop+(e?N:0)+S);d.style.height=t+(v-_)+"px",g.scrollTop=_-k+g.offsetTop}d.style.margin="10px 0",d.style.minHeight=j+"px",d.style.maxHeight=o+"px",s?.(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,d,u,g,b,w,i.dir,s]);(0,tp.useLayoutEffect)(()=>N(),[N]);let[C,k]=a.useState();(0,tp.useLayoutEffect)(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);let S=a.useCallback(e=>{e&&!0===v.current&&(N(),y?.(),v.current=!1)},[N,y]);return(0,t.jsx)(tF,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:h,onScrollButtonChange:S,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:(0,t.jsx)(x.Primitive.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});tH.displayName="SelectItemAlignedPosition";var tA=a.forwardRef((e,a)=>{let{__scopeSelect:r,align:n="start",collisionPadding:s=10,...o}=e,i=tw(r);return(0,t.jsx)(eh.Content,{...i,...o,ref:a,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});tA.displayName="SelectPopperPosition";var[tF,tB]=tb(tM,{}),tV="SelectViewport",tU=a.forwardRef((e,r)=>{let{__scopeSelect:n,nonce:s,...o}=e,i=tz(tV,n),l=tB(tV,n),d=(0,j.useComposedRefs)(r,i.onViewportChange),c=a.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),(0,t.jsx)(th.Slot,{scope:n,children:(0,t.jsx)(x.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:(0,b.composeEventHandlers)(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:a,shouldExpandOnScrollRef:r}=l;if(r?.current&&a){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,n=Math.max(parseFloat(a.style.minHeight),parseFloat(a.style.height));if(n<r){let s=n+e,o=Math.min(r,s),i=s-o;a.style.height=o+"px","0px"===a.style.bottom&&(t.scrollTop=i>0?i:0,a.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});tU.displayName=tV;var tK="SelectGroup",[tW,t$]=tb(tK);a.forwardRef((e,a)=>{let{__scopeSelect:r,...n}=e,s=(0,y.useId)();return(0,t.jsx)(tW,{scope:r,id:s,children:(0,t.jsx)(x.Primitive.div,{role:"group","aria-labelledby":s,...n,ref:a})})}).displayName=tK;var tq="SelectLabel";a.forwardRef((e,a)=>{let{__scopeSelect:r,...n}=e,s=t$(tq,r);return(0,t.jsx)(x.Primitive.div,{id:s.id,...n,ref:a})}).displayName=tq;var tG="SelectItem",[tY,tX]=tb(tG),tZ=a.forwardRef((e,r)=>{let{__scopeSelect:n,value:s,disabled:o=!1,textValue:i,...l}=e,d=tN(tG,n),c=tz(tG,n),u=d.value===s,[p,m]=a.useState(i??""),[f,h]=a.use
5State(!1),v=(0,j.useComposedRefs)(r,e=>c.itemRefCallback?.(e,s,o)),g=(0,y.useId)(),w=a.useRef("touch"),N=()=>{o||(d.onValueChange(s),d.onOpenChange(!1))};if(""===s)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(tY,{scope:n,value:s,disabled:o,textId:g,isSelected:u,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(th.ItemSlot,{scope:n,value:s,disabled:o,textValue:p,children:(0,t.jsx)(x.Primitive.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...l,ref:v,onFocus:(0,b.composeEventHandlers)(l.onFocus,()=>h(!0)),onBlur:(0,b.composeEventHandlers)(l.onBlur,()=>h(!1)),onClick:(0,b.composeEventHandlers)(l.onClick,()=>{"mouse"!==w.current&&N()}),onPointerUp:(0,b.composeEventHandlers)(l.onPointerUp,()=>{"mouse"===w.current&&N()}),onPointerDown:(0,b.composeEventHandlers)(l.onPointerDown,e=>{w.current=e.pointerType}),onPointerMove:(0,b.composeEventHandlers)(l.onPointerMove,e=>{w.current=e.pointerType,o?c.onItemLeave?.():"mouse"===w.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,b.composeEventHandlers)(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,b.composeEventHandlers)(l.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(tx.includes(e.key)&&N()," "===e.key&&e.preventDefault())})})})})});tZ.displayName=tG;var tJ="SelectItemText",tQ=a.forwardRef((e,r)=>{let{__scopeSelect:n,className:s,style:o,...i}=e,l=tN(tJ,n),d=tz(tJ,n),c=tX(tJ,n),u=tk(tJ,n),[p,m]=a.useState(null),f=(0,j.useComposedRefs)(r,e=>m(e),c.onItemTextChange,e=>d.itemTextRefCallback?.(e,c.value,c.disabled)),h=p?.textContent,v=a.useMemo(()=>(0,t.jsx)("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=u;return(0,tp.useLayoutEffect)(()=>(g(v),()=>b(v)),[g,b,v]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Primitive.span,{id:c.textId,...i,ref:f}),c.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ti.createPortal(i.children,l.valueNode):null]})});tQ.displayName=tJ;var t0="SelectItemIndicator",t1=a.forwardRef((e,a)=>{let{__scopeSelect:r,...n}=e;return tX(t0,r).isSelected?(0,t.jsx)(x.Primitive.span,{"aria-hidden":!0,...n,ref:a}):null});t1.displayName=t0;var t2="SelectScrollUpButton",t4=a.forwardRef((e,r)=>{let n=tz(t2,e.__scopeSelect),s=tB(t2,e.__scopeSelect),[o,i]=a.useState(!1),l=(0,j.useComposedRefs)(r,s.onScrollButtonChange);return(0,tp.useLayoutEffect)(()=>{if(n.viewport&&n.isPositioned){let e=function(){i(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?(0,t.jsx)(t6,{...e,ref:l,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});t4.displayName=t2;var t3="SelectScrollDownButton",t5=a.forwardRef((e,r)=>{let n=tz(t3,e.__scopeSelect),s=tB(t3,e.__scopeSelect),[o,i]=a.useState(!1),l=(0,j.useComposedRefs)(r,s.onScrollButtonChange);return(0,tp.useLayoutEffect)(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;i(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?(0,t.jsx)(t6,{...e,ref:l,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});t5.displayName=t3;var t6=a.forwardRef((e,r)=>{let{__scopeSelect:n,onAutoScroll:s,...o}=e,i=tz("SelectScrollButton",n),l=a.useRef(null),d=tv(n),c=a.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return a.useEffect(()=>()=>c(),[c]),(0,tp.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(x.Primitive.div,{"aria-hidden":!0,...o,ref:r,style:{flexShrink:0,...o.style},onPointerDown:(0,b.composeEventHandlers)(o.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(s,50))}),onPointerMove:(0,b.composeEventHandlers)(o.onPointerMove,()=>{i.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(s,50))}),onPointerLeave:(0,b.composeEventHandlers)(o.onPointerLeave,()=>{c()})})});a.forwardRef((e,a)=>{let{__scopeSelect:r,...n}=e;return(0,t.jsx)(x.Primitive.div,{"aria-hidden":!0,...n,ref:a})}).displayName="SelectSeparator";var t7="SelectArrow";function t8(e){return""===e||void 0===e}a.forwardRef((e,a)=>{let{__scopeSelect:r,...n}=e,s=tw(r),o=tN(t7,r),i=tz(t7,r);return o.open&&"popper"===i.position?(0,t.jsx)(eh.Arrow,{...s,...n,ref:a}):null}).displayName=t7;var t9=a.forwardRef((e,r)=>{let n,{value:s,...o}=e,i=a.useRef(null),l=(0,j.useComposedRefs)(r,i),d=(n=a.useRef({value:s,previous:s}),a.useMemo(()=>(n.current.value!==s&&(n.current.previous=n.current.value,n.current.value=s),n.current.previous),[s]));return a.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(d!==s&&t){let a=new Event("change",{bubbles:!0});t.call(e,s),e.dispatchEvent(a)}},[d,s]),(0,t.jsx)(ev,{asChild:!0,children:(0,t.jsx)("select",{...o,ref:l,defaultValue:s})})});function ae(e){let t=(0,tu.useCallbackRef)(e),r=a.useRef(""),n=a.useRef(0),s=a.useCallback(e=>{let a=r.current+e;t(a),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(a)},[t]),o=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function at(e,t,a){var r,n;let s=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=a?e.indexOf(a):-1,i=(r=e,n=Math.max(o,0),r.map((e,t)=>r[(n+t)%r.length]));1===s.length&&(i=i.filter(e=>e!==a));let l=i.find(e=>e.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==a?l:void 0}t9.displayName="BubbleSelect";var aa=e.i(49894),ar=e.i(43028);let an=(0,n.default)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function as({...e}){return(0,t.jsx)(tS,{"data-slot":"select",...e})}function ao({...e}){return(0,t.jsx)(tP,{"data-slot":"select-value",...e})}function ai({className:e,size:a="default",children:r,...n}){return(0,t.jsxs)(tE,{"data-slot":"select-trigger","data-size":a,className:(0,u.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[r,(0,t.jsx)(tD,{asChild:!0,children:(0,t.jsx)(ar.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function al({className:e,children:a,position:r="popper",...n}){return(0,t.jsx)(tT,{children:(0,t.jsxs)(tI,{"data-slot":"select-content",className:(0,u.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
5de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[(0,t.jsx)(ac,{}),(0,t.jsx)(tU,{className:(0,u.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,t.jsx)(au,{})]})})}function ad({className:e,children:a,...r}){return(0,t.jsxs)(tZ,{"data-slot":"select-item",className:(0,u.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[(0,t.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,t.jsx)(t1,{children:(0,t.jsx)(aa.CheckIcon,{className:"size-4"})})}),(0,t.jsx)(tQ,{children:a})]})}function ac({className:e,...a}){return(0,t.jsx)(t4,{"data-slot":"select-scroll-up-button",className:(0,u.cn)("flex cursor-default items-center justify-center py-1",e),...a,children:(0,t.jsx)(an,{className:"size-4"})})}function au({className:e,...a}){return(0,t.jsx)(t5,{"data-slot":"select-scroll-down-button",className:(0,u.cn)("flex cursor-default items-center justify-center py-1",e),...a,children:(0,t.jsx)(ar.ChevronDownIcon,{className:"size-4"})})}var ap=e.i(39607);let am=(0,n.default)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),ax=(0,n.default)("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),af=(0,n.default)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),ah=(0,n.default)("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),av=(0,n.default)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),ag=(0,n.default)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),ab=(0,n.default)("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]),aj=(0,n.default)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);function aw({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,u.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function ay({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,u.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function aN({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,u.cn)("leading-none font-semibold",e),...a})}function aC({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,u.cn)("text-muted-foreground text-sm",e),...a})}function ak({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,u.cn)("px-6",e),...a})}function aS({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"empty",className:(0,u.cn)("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",e),...a})}function a_({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"empty-header",className:(0,u.cn)("flex max-w-sm flex-col items-center gap-2 text-center",e),...a})}let aE=(0,d.cva)("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function aR({className:e,variant:a="default",...r}){return(0,t.jsx)("div",{"data-slot":"empty-icon","data-variant":a,className:(0,u.cn)(aE({variant:a,className:e})),...r})}function aP({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"empty-title",className:(0,u.cn)("text-lg font-medium tracking-tight",e),...a})}function aD({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"empty-description",className:(0,u.cn)("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...a})}e.i(68182);var aT=e.i(29759);async function aM(e=1e3){let t=(0,aT.createClient)(),{data:{user:a},error:r}=await t.auth.getUser();if(r||!a)return console.log("[Vocabulary] ç¨æ·æªç»å½"),[];let{data:n,error:s}=await t.from("saved_words").select("*").order("saved_at",{ascending:!1}).limit(e);
5if(s)throw console.error("[Vocabulary] è·ååè¯å表失败:",s),Error(`è·ååè¯å表失败: ${s.message}`);let o=(n||[]).map(e=>({...e,definitions:"string"==typeof e.definitions?JSON.parse(e.definitions):e.definitions,examples:"string"==typeof e.examples?JSON.parse(e.examples):e.examples,tags:"string"==typeof e.tags?JSON.parse(e.tags):e.tags}));return console.log("[Vocabulary] ð æ°æ®ç¤ºä¾:",o[0]),o}async function aI(e){let t=(0,aT.createClient)(),{data:{user:a},error:r}=await t.auth.getUser();if(r||!a)throw Error("请å
ç»å½");let{error:n}=await t.from("saved_words").delete().eq("id",e);if(n)throw console.error("[Vocabulary] å é¤åè¯å¤±è´¥:",n),Error(`å é¤åè¯å¤±è´¥: ${n.message}`);console.log("[Vocabulary] â
å 餿å:",e)}let aL=(0,n.default)("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);function az({columns:e,onColumnsChange:a}){let n=(0,r.useTranslations)("Dashboard"),s={basic:n("columns.basicInfo"),video:n("columns.videoInfo"),context:n("columns.contextInfo"),learning:n("columns.learningInfo")},o=e.reduce((e,t)=>(e[t.category]||(e[t.category]=[]),e[t.category].push(t),e),{});return(0,t.jsxs)(ap.DropdownMenu,{children:[(0,t.jsx)(ap.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(p.Button,{variant:"outline",children:[(0,t.jsx)(aL,{className:"mr-2 h-4 w-4"}),n("customizeColumns")]})}),(0,t.jsxs)(ap.DropdownMenuContent,{align:"end",className:"w-56",children:[(0,t.jsx)(ap.DropdownMenuLabel,{children:n("columns.showColumns")}),(0,t.jsx)(ap.DropdownMenuSeparator,{}),Object.entries(o).map(([r,n])=>(0,t.jsxs)("div",{children:[(0,t.jsx)(ap.DropdownMenuLabel,{className:"text-xs text-muted-foreground",children:s[r]}),n.map(r=>(0,t.jsx)(ap.DropdownMenuCheckboxItem,{checked:r.visible,onCheckedChange:()=>{var t;return t=r.id,void a(e.map(e=>e.id===t?{...e,visible:!e.visible}:e))},children:r.label},r.id)),(0,t.jsx)(ap.DropdownMenuSeparator,{})]},r))]})]})}var el=el;function aO({...e}){return(0,t.jsx)(z,{"data-slot":"dialog",...e})}function aH({...e}){return(0,t.jsx)(B,{"data-slot":"dialog-portal",...e})}function aA({className:e,...a}){return(0,t.jsx)(U,{"data-slot":"dialog-overlay",className:(0,u.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...a})}function aF({className:e,children:a,showCloseButton:r=!0,...n}){return(0,t.jsxs)(aH,{"data-slot":"dialog-portal",children:[(0,t.jsx)(aA,{}),(0,t.jsxs)($,{"data-slot":"dialog-content",className:(0,u.cn)("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n,children:[a,r&&(0,t.jsxs)(et,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,t.jsx)(el.default,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function aB({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"dialog-header",className:(0,u.cn)("flex flex-col gap-2 text-center sm:text-left",e),...a})}function aV({className:e,...a}){return(0,t.jsx)(Z,{"data-slot":"dialog-title",className:(0,u.cn)("text-lg leading-none font-semibold",e),...a})}function aU({className:e,...a}){return(0,t.jsx)(Q,{"data-slot":"dialog-description",className:(0,u.cn)("text-muted-foreground text-sm",e),...a})}let aK=(0,n.default)("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),aW=(0,n.default)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);function a$({word:e,open:a,onOpenChange:n}){let s=(0,r.useTranslations)("Dashboard");return e?(0,t.jsx)(aO,{open:a,onOpenChange:n,children:(0,t.jsxs)(aF,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[(0,t.jsxs)(aB,{children:[(0,t.jsx)(aV,{className:"text-3xl font-bold",children:e.word}),(0,t.jsx)(aU,{children:e.translation})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[(e.phonetic_uk||e.phonetic_us)&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold mb-2",children:s("details.pronunciation")}),(0,t.jsxs)("div",{className:"space-y-2",children:[e.phonetic_uk&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(to,{variant:"outline",children:"UK"}),(0,t.jsxs)("span",{className:"text-sm",children:["/",e.phonetic_uk,"/"]}),e.audio_url_uk&&(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",onClick:()=>{new Audio(e.audio_url_uk).play()},children:(0,t.jsx)(aK,{className:"h-3 w-3"})})]}),e.phonetic_us&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(to,{variant:"outline",children:"US"}),(0,t.jsxs)("span",{className:"text-sm",children:["/",e.phonetic_us,"/"]}),e.audio_url_us&&(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",onClick:()=>{new Audio(e.audio_url_us).play()},children:(0,t.jsx)(aK,{className:"h-3 w-3"})})]})]})]}),(0,t.jsx)(g,{}),e.definitions&&e.definitions.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold mb-2",children:s("details.definitions")}),(0,t.jsx)("ul",{className:"space-y-3",children:e.definitions.map((e,a)=>{let r=e.meaning.split(/[;ï¼]/).map(e=>e.trim()).filter(e=>e.length>0);return(0,t.jsxs)("li",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(to,{variant:"secondary",className:"shrink-0",children:e.part_of_speech}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[r.length," 个éä¹"]})]}),(0,t.jsx)("div",{className:"ml-0 space-y-1.5",children:r.map((e,a)=>(0,t.jsxs)("div",{className:"flex items-start gap-2 text-sm pl-2 border-l-2 border-muted",children:[(0,t.jsxs)("span",{className:"text-muted-foreground shrink-0 font-mono text-xs mt-0.5",children:[a+1,"."]}
5),(0,t.jsx)("span",{className:"flex-1",children:e})]},a))})]},a)})})]}),e.examples&&e.examples.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold mb-2",children:s("details.examples")}),(0,t.jsx)("ul",{className:"space-y-3",children:e.examples.map((e,a)=>(0,t.jsxs)("li",{className:"space-y-1 p-3 bg-muted rounded-lg",children:[(0,t.jsx)("p",{className:"text-sm",children:e.english}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.chinese}),e.source&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["â ",e.source]})]},a))})]})]}),e.video_id&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold mb-2",children:s("details.videoSource")}),(0,t.jsxs)("div",{className:"space-y-2 p-3 bg-muted rounded-lg",children:[e.video_title&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(ab,{className:"h-4 w-4 mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium truncate",children:e.video_title}),e.channel_name&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.channel_name})]})]}),null!==e.timestamp_seconds&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(aW,{className:"h-3 w-3"}),(0,t.jsx)("span",{children:(e=>{if(!e)return"";let t=Math.floor(e/60);return`${t}:${(e%60).toString().padStart(2,"0")}`})(e.timestamp_seconds)})]}),e.video_url&&(0,t.jsxs)(p.Button,{variant:"outline",size:"sm",className:"w-full",onClick:()=>{if(e.video_url&&e.timestamp_seconds){let t=`${e.video_url}${e.video_url.includes("?")?"&":"?"}t=${e.timestamp_seconds}`;window.open(t,"_blank")}else e.video_url&&window.open(e.video_url,"_blank")},children:[(0,t.jsx)(aj,{className:"h-3 w-3 mr-2"}),s("actions.jumpToVideo")]})]})]})]}),e.context_sentence&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold mb-2",children:s("details.context")}),(0,t.jsx)("div",{className:"p-3 bg-muted rounded-lg",children:(0,t.jsxs)("p",{className:"text-sm italic",children:["â",e.context_sentence,"â"]})})]})]}),(0,t.jsx)(g,{}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold mb-2",children:s("details.learning")}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"ä¿åæ¶é´"}),(0,t.jsx)("p",{children:new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC"}).format(new Date(e.saved_at))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"å¤ä¹ 次æ°"}),(0,t.jsxs)("p",{children:[e.review_count," 次"]})]})]})]})]})]})}):null}function aq(){let e=(0,r.useTranslations)("Dashboard"),[n,o]=(0,a.useState)([]),[i,l]=(0,a.useState)([]),[d,c]=(0,a.useState)(""),[u,x]=(0,a.useState)("all"),[f,h]=(0,a.useState)("all"),[v,g]=(0,a.useState)(1),[b,j]=(0,a.useState)(10),[w,y]=(0,a.useState)(!0),[N,C]=(0,a.useState)(null),[k,S]=(0,a.useState)(null),[_,E]=(0,a.useState)(!1),[R,P]=(0,a.useState)([{id:"word",label:e("table.word"),visible:!0,category:"basic"},{id:"translation",label:e("table.translation"),visible:!0,category:"basic"},{id:"phonetic",label:e("table.phonetic"),visible:!0,category:"basic"},{id:"definitions",label:e("table.definitions"),visible:!1,category:"basic"},{id:"status",label:e("table.status"),visible:!0,category:"basic"},{id:"contextSentence",label:e("table.contextSentence"),visible:!0,category:"context"},{id:"videoTitle",label:e("table.videoTitle"),visible:!0,category:"video"},{id:"channelName",label:e("table.channelName"),visible:!1,category:"video"},{id:"timestamp",label:e("table.timestamp"),visible:!0,category:"video"},{id:"reviewCount",label:e("table.reviewCount"),visible:!0,category:"learning"},{id:"savedAt",label:e("table.savedAt"),visible:!0,category:"basic"}]);(0,a.useEffect)(()=>{(async()=>{try{y(!0),C(null);let e=await aM(1e3),t=e.map(e=>({...e,status:"learning"}));o(t),l(t),console.log("[Dashboard] â
æåå è½½",e.length,"个åè¯")}catch(e){console.error("[Dashboard] å è½½åè¯å¤±è´¥:",e),C(e instanceof Error?e.message:"å 载失败"),o([]),l([])}finally{y(!1)}})()},[]),(0,a.useEffect)(()=>{let e=n;d&&(e=e.filter(e=>e.word.toLowerCase().includes(d.toLowerCase())||e.translation?.toLowerCase().includes(d.toLowerCase())||e.context_sentence?.toLowerCase().includes(d.toLowerCase()))),"all"!==u&&(e=e.filter(e=>e.status===u)),"all"!==f&&(e=e.filter(e=>e.video_id===f)),l(e),g(1)},[d,u,f,n]);let D=Math.ceil(i.length/b),T=(v-1)*b,M=T+b,I=i.slice(T,M),L=Array.from(new Set(n.filter(e=>e.video_id).map(e=>e.video_id))),z=async t=>{if(confirm(e("actions.delete")+"?"))try{await aI(t),o(e=>e.filter(e=>e.id!==t)),l(e=>e.filter(e=>e.id!==t)),console.log("[Dashboard] â
å 餿å")}catch(e){console.error("[Dashboard] å é¤å¤±è´¥:",e),alert("å é¤å¤±è´¥: "+(e instanceof Error?e.message:"æªç¥é误"))}},O=e=>{if(e.video_url&&e.timestamp_seconds){let t=`${e.video_url}${e.video_url.includes("?")?"&":"?"}t=${e.timestamp_seconds}`;window.open(t,"_blank")}else e.video_url&&window.open(e.video_url,"_blank")};if(w)return(0,t.jsx)(aw,{children:(0,t.jsx)(ak,{className:"p-8",children:(0,t.jsx)("div",{className:"flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-muted-foreground",children:"å è½½ä¸..."})})})});if(N)return(0,t.jsx)(aw,{children:(0,t.jsx)(ak,{className:"p-8",children:(0,t.jsx)(aS,{className:"py-12",children:(0,t.jsxs)(a_,{children:[(0,t.jsx)(aR,{variant:"icon",children:(0,t.jsx)(s,{})}),(0,t.jsx)(aP,{children:"å 载失败"}),(0,t.jsx)(aD,{children:N}),(0,t.jsx)(p.Button,{onClick:()=>window.location.reload(),className:"mt-4",children:"éè¯"})]})})})});if(0===n.length)return(0,t.jsx)(aw,{children:(0,t.jsx)(ak,{className:"p-8",children:(0,t.jsx)(aS,{className:"py-12",children:(0,t.jsxs)(a_,{children:[(0,t.jsx)(aR,{variant:"icon",children:(0,t.jsx)(s,{})}),(0,t.jsx)(aP,{children:e("noWords")}),(0,t.jsx)(aD,{children:e("noWordsDescription")})]})})})});let H=R.filter(e=>e.visible);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(aw,{children:(0,t.jsx)(ak,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-4 flex-wrap",children:[(0,t.jsxs)("div",{className:"relative flex-1 min-w-[200px]",children:[(0,t.jsx)(am,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(m,{placeholder:e("search"),value:d,onChange:e=>c(e.target.value),className:"pl-9"})]}),(0,t.jsxs)(as,{value:u,onValueChange:x,children:[(0,t.jsxs)(ai,{className:"w-[150px]",children:[(0,t.jsx)(ax,{className:"mr-2 h-4 w-4"}),(0,t.jsx)(ao,{placeholder:e("filterLabel")})]}),(0,t.jsxs)(al,{children:[(0,t.jsx)(ad,{value:"all",children:e("filters.all")}),(0,t.jsx)(ad,{value:"learning",children:e("status.learning")}),(0,t.jsx)(ad,{value:"mastered",children:e("status.mastered")}),(0,t.jsx)(ad,{value:"reviewing",children:e("status.reviewing")})]})]}),L.length>0&&(0,t.jsxs)(as,{value:f,onValueChange:h,children:[(0,t.jsxs)(ai,{className:"w-[150px]",children:[(0,t.jsx)(ab,{className:"mr-2 h-4 w-4"}),(0,t.jsx)(ao,{placeholder:"è§é¢"})]}),(0,t.jsxs)(al,{children:[(0,t.jsx)(ad,{value:"all",children:"ææè§é¢"}),L.slice(0,10).map(e=>{let a=n.find(t=>t.video_id===e);return(0,t.jsx)(ad,{value:e,children:a?.video_title?.substring(0,30)||e},e)})]})]}),(0,t.jsx)(az,{columns:R,onColumnsChange:P}),(0,t.jsxs)(p.Button,{variant:"outline",onClick:()=>{console.log("Exporting words...")},children:[(0,t.jsx)(af,{className:"mr-2 h-4 w-4"}),e("export")]})]})})}),(0,t.jsx)(aw,{children:(0,t.jsx)(ak,{className:"p-0",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(e9,{children:[(0,t.jsx)(te,{children:(0,t.jsxs)(ta,{children:[H.map(e=>(0,t.jsx)(tr,{children:e.label},e.id)),(0,t.jsx)(tr,{className:"w-[80px]"})]})}),(0,t.jsx)(tt,{children:I.map(a=>(0,t.jsxs)(ta,{className:"cursor-pointer hover:bg-muted/50",children:[H.map(r=>{var n;let s;return(0,t.jsxs)(tn,{children:["word"===r.id&&(0,t.jsx)("span",{className:"font-medium",children:a.word}),"translation"===r.id&&(a.translation||"-"),"phonetic"===r.id&&(0,t.jsxs)("div",{className:"text-sm text-muted-foreground min-w-[120px]",children:[a.phonetic_uk&&(0,t.jsxs)("div",{children:["UK: /",a.phonetic_uk,"/"]}),a.phonetic_us&&(0,t.jsxs)("div",{children:["US: /",a.phonetic_us,"/"]})]}),"definitions"===r.id&&(0,t.jsx)("div",{className:"max-w-xl space-y-2",children:a.definitions&&a.definitions.length>0?a.definitions.slice(0,2).map((e,a)=>{let r=e.meaning.split(/[;ï¼]/).map(e=>e.trim()).filter(e=>e.length>0).slice(0,4);return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(to,{variant:"secondary",className:"h-5 text-xs",children:e.part_of_speech}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.map((e,a)=>(0,t.jsxs)("div",{className:"group relative inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md border bg-background text-xs max-w-[200px] cursor-help",children:[(0,t.jsx)("span",{className:"text-muted-foreground shrink-0",children:"â¢"}),(0,t.jsx)("span",{className:"truncate",children:e}),(0,t.jsx)("div",{className:"pointer-events-none absolute bottom-full left-1/2 -translate-x-1/2 mb-2 hidden group-hover:block z-50",children:(0,t.jsxs)("div",{className:"bg-foreground text-background text-xs rounded-md px-3 py-2 max-w-xs whitespace-normal shadow-lg animate-in fade-in-0 zoom-in-95 duration-200",children:[e,(0,t.jsx)("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-1 border-4 border-transparent border-t-foreground"})]})})]},a))})]},a)}):"-"}),"status"===r.id&&(n=a.status||"learning",s=({learning:{label:e("status.learning"),variant:"secondary"},mastered:{label:e("status.mastered"),variant:"default"},reviewing:{label:e("status.reviewing"),variant:"outline"}})[n],(0,t.jsx)(to,{variant:s.variant,children:s.label}
5)),"contextSentence"===r.id&&(0,t.jsx)("div",{className:"max-w-xs truncate text-sm text-muted-foreground italic",children:a.context_sentence||"-"}),"videoTitle"===r.id&&(0,t.jsx)("div",{className:"max-w-xs",children:a.video_title?(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(ab,{className:"h-4 w-4 mt-0.5 shrink-0 text-red-500"}),(0,t.jsx)("span",{className:"text-sm truncate",children:a.video_title})]}):"-"}),"channelName"===r.id&&(a.channel_name||"-"),"timestamp"===r.id&&(0,t.jsx)("div",{className:"text-sm",children:a.timestamp_seconds?(0,t.jsxs)(p.Button,{variant:"ghost",size:"sm",onClick:()=>O(a),className:"h-auto p-1",children:[(0,t.jsx)(aj,{className:"h-3 w-3 mr-1"}),(e=>{if(!e)return"-";let t=Math.floor(e/60);return`${t}:${(e%60).toString().padStart(2,"0")}`})(a.timestamp_seconds)]}):"-"}),"reviewCount"===r.id&&(0,t.jsx)("div",{className:"text-center",children:a.review_count}),"savedAt"===r.id&&(0,t.jsx)("div",{className:"text-sm text-muted-foreground whitespace-nowrap",children:new Date(a.saved_at).toLocaleDateString("zh-CN",{month:"2-digit",day:"2-digit"})})]},r.id)}),(0,t.jsx)(tn,{children:(0,t.jsxs)(ap.DropdownMenu,{children:[(0,t.jsx)(ap.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(p.Button,{variant:"ghost",size:"icon",children:(0,t.jsx)(ah,{className:"h-4 w-4"})})}),(0,t.jsxs)(ap.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(ap.DropdownMenuItem,{onClick:()=>{S(a),E(!0)},children:[(0,t.jsx)(ag,{className:"mr-2 h-4 w-4"}),e("actions.viewDetails")]}),a.video_url&&(0,t.jsxs)(ap.DropdownMenuItem,{onClick:()=>O(a),children:[(0,t.jsx)(aj,{className:"mr-2 h-4 w-4"}),e("actions.jumpToVideo")]}),(0,t.jsxs)(ap.DropdownMenuItem,{className:"text-destructive",onClick:()=>z(a.id),children:[(0,t.jsx)(av,{className:"mr-2 h-4 w-4"}),e("actions.delete")]})]})]})})]},a.id))})]})})})}),i.length>0&&(0,t.jsx)(aw,{children:(0,t.jsx)(ak,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"text-sm text-muted-foreground",children:["æ¾ç¤º ",T+1," - ",Math.min(M,i.length)," æ¡ï¼å
±"," ",i.length," æ¡"]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm",children:e("pagination.rowsPerPage")}),(0,t.jsxs)(as,{value:b.toString(),onValueChange:e=>{j(Number(e)),g(1)},children:[(0,t.jsx)(ai,{className:"w-[80px]",children:(0,t.jsx)(ao,{})}),(0,t.jsxs)(al,{children:[(0,t.jsx)(ad,{value:"10",children:"10"}),(0,t.jsx)(ad,{value:"20",children:"20"}),(0,t.jsx)(ad,{value:"50",children:"50"}),(0,t.jsx)(ad,{value:"100",children:"100"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(p.Button,{variant:"outline",size:"sm",onClick:()=>g(e=>Math.max(1,e-1)),disabled:1===v,children:"ä¸ä¸é¡µ"}),(0,t.jsxs)("span",{className:"text-sm",children:["第 ",v," 页ï¼å
± ",D," 页"]}),(0,t.jsx)(p.Button,{variant:"outline",size:"sm",onClick:()=>g(e=>Math.min(D,e+1)),disabled:v===D,children:"ä¸ä¸é¡µ"})]})]})]})})})]}),(0,t.jsx)(a$,{word:k,open:_,onOpenChange:E})]})}function aG({children:e}){let[r,n]=(0,a.useState)(null),[s,o]=(0,a.useState)(!0),[i,l]=(0,a.useState)(""),[d,c]=(0,a.useState)(""),[u,x]=(0,a.useState)(!1),[f,h]=(0,a.useState)("");(0,a.useEffect)(()=>{v()},[]);let v=async()=>{try{let e=(0,aT.createClient)(),{data:{user:t}}=await e.auth.getUser();n(t)}catch(e){console.error("Auth check error:",e)}finally{o(!1)}},g=async e=>{e.preventDefault(),h("");try{let e=(0,aT.createClient)();if(u){let{data:t,error:a}=await e.auth.signUp({email:i,password:d});if(a)throw a;t.user&&(n(t.user),alert("注åæåï¼"))}else{let{data:t,error:a}=await e.auth.signInWithPassword({email:i,password:d});if(a)throw a;t.user&&n(t.user)}}catch(e){console.error("Auth error:",e),h(e.message||"ç»å½å¤±è´¥")}};return s?(0,t.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,t.jsx)("div",{className:"text-muted-foreground",children:"å è½½ä¸..."})}):r?(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"border-b",children:(0,t.jsx)("div",{className:"container mx-auto flex h-12 items-center justify-end px-4",children:(0,t.jsx)("div",{className:"flex items-center gap-4 text-sm",children:(0,t.jsx)("span",{className:"text-muted-foreground",children:r.email})})})}),e]}):(0,t.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-muted/30",children:(0,t.jsxs)(aw,{className:"w-full max-w-md",children:[(0,t.jsxs)(ay,{children:[(0,t.jsx)(aN,{children:u?"注å":"ç»å½"}),(0,t.jsx)(aC,{children:u?"å建ä¸ä¸ªæ°è´¦æ·æ¥ç®¡çä½ çåè¯":"ç»å½ä»¥æ¥çä½ ä¿åçåè¯"})]}),(0,t.jsx)(ak,{children:(0,t.jsxs)("form",{onSubmit:g,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:"é®ç®±"}),(0,t.jsx)(m,{type:"email",placeholder:"[email protected]",value:i,onChange:e=>l(e.target.value),required:!0})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:"å¯ç "}),(0,t.jsx)(m,{type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:d,onChange:e=>c(e.target.value),required:!0,minLength:6})]}),f&&(0,t.jsx)("div",{className:"text-sm text-destructive",children:f}),(0,t.jsx)(p.Button,{type:"submit",className:"w-full",children:u?"注å":"ç»å½"}),(0,t.jsx)("div",{className:"text-center text-sm",children:(0,t.jsx)("button",{type:"button",onClick:()=>{x(!u),h("")},className:"text-primary hover:underline",children:u?"å·²æè´¦æ·ï¼ç»å½":"没æè´¦æ·ï¼æ³¨å"})})]})})]})})}var aY=e.i(45041),aX=e.i(26587);let aZ=(0,n.default)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),aJ=(0,n.default)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var aQ="Popover",[a0,a1]=(0,w.createContextScope)(aQ,[eh.createPopperScope]),a2=(0,eh.createPopperScope)(),[a4,a3]=a0(aQ),a5=e=>{let{__scopePopover:r,children:n,open:s,defaultOpen:o,onOpenChange:i,modal:l=!1}
5=e,d=a2(r),c=a.useRef(null),[u,p]=a.useState(!1),[m=!1,x]=(0,N.useControllableState)({prop:s,defaultProp:o,onChange:i});return(0,t.jsx)(eh.Root,{...d,children:(0,t.jsx)(a4,{scope:r,contentId:(0,y.useId)(),triggerRef:c,open:m,onOpenChange:x,onOpenToggle:a.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>p(!0),[]),onCustomAnchorRemove:a.useCallback(()=>p(!1),[]),modal:l,children:n})})};a5.displayName=aQ;var a6="PopoverAnchor",a7=a.forwardRef((e,r)=>{let{__scopePopover:n,...s}=e,o=a3(a6,n),i=a2(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=o;return a.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(eh.Anchor,{...i,...s,ref:r})});a7.displayName=a6;var a8="PopoverTrigger",a9=a.forwardRef((e,a)=>{let{__scopePopover:r,...n}=e,s=a3(a8,r),o=a2(r),i=(0,j.useComposedRefs)(a,s.triggerRef),l=(0,t.jsx)(x.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":rc(s.open),...n,ref:i,onClick:(0,b.composeEventHandlers)(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:(0,t.jsx)(eh.Anchor,{asChild:!0,...o,children:l})});a9.displayName=a8;var re="PopoverPortal",[rt,ra]=a0(re,{forceMount:void 0}),rr=e=>{let{__scopePopover:a,forceMount:r,children:n,container:s}=e,o=a3(re,a);return(0,t.jsx)(rt,{scope:a,forceMount:r,children:(0,t.jsx)(_.Presence,{present:r||o.open,children:(0,t.jsx)(S.Portal,{asChild:!0,container:s,children:n})})})};rr.displayName=re;var rn="PopoverContent",rs=a.forwardRef((e,a)=>{let r=ra(rn,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=a3(rn,e.__scopePopover);return(0,t.jsx)(_.Presence,{present:n||o.open,children:o.modal?(0,t.jsx)(ro,{...s,ref:a}):(0,t.jsx)(ri,{...s,ref:a})})});rs.displayName=rn;var ro=a.forwardRef((e,r)=>{let n=a3(rn,e.__scopePopover),s=a.useRef(null),o=(0,j.useComposedRefs)(r,s),i=a.useRef(!1);return a.useEffect(()=>{let e=s.current;if(e)return(0,P.hideOthers)(e)},[]),(0,t.jsx)(R.RemoveScroll,{as:l.Slot,allowPinchZoom:!0,children:(0,t.jsx)(rl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,b.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,b.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,a=0===t.button&&!0===t.ctrlKey;i.current=2===t.button||a},{checkForDefaultPrevented:!1}),onFocusOutside:(0,b.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),ri=a.forwardRef((e,r)=>{let n=a3(rn,e.__scopePopover),s=a.useRef(!1),o=a.useRef(!1);return(0,t.jsx)(rl,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||n.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),rl=a.forwardRef((e,a)=>{let{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:u,...p}=e,m=a3(rn,r),x=a2(r);return(0,E.useFocusGuards)(),(0,t.jsx)(k.FocusScope,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:(0,t.jsx)(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:(0,t.jsx)(eh.Content,{"data-state":rc(m.open),role:"dialog",id:m.contentId,...x,...p,ref:a,style:{...p.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)"}})})})}),rd="PopoverClose";function rc(e){return e?"open":"closed"}function ru({...e}){return(0,t.jsx)(a5,{"data-slot":"popover",...e})}function rp({...e}){return(0,t.jsx)(a9,{"data-slot":"popover-trigger",...e})}function rm({className:e,align:a="center",sideOffset:r=4,...n}){return(0,t.jsx)(rr,{children:(0,t.jsx)(rs,{"data-slot":"popover-content",align:a,sideOffset:r,className:(0,u.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
5de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}function rx({...e}){return(0,t.jsx)(a7,{"data-slot":"popover-anchor",...e})}function rf(){let[e,n]=(0,a.useState)(null),s=(0,aX.useRouter)(),o=(0,r.useTranslations)("Dashboard");(0,a.useEffect)(()=>{(async()=>{try{let e=(0,aT.createClient)(),{data:t}=await e.auth.getUser();n(t.user??null)}catch(e){console.error("[Dashboard] getUser error",e)}})()},[]);let i=(0,a.useMemo)(()=>{let t=(e?.user_metadata?.name||e?.user_metadata?.full_name||"").trim();if(t)return t.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("")||"U";let a=(e?.email??"User").split("@")[0].split(/[._-]+/).filter(Boolean);return(a[0]?.[0]??"U")+(a[1]?.[0]??"").toUpperCase()},[e]),l=(0,a.useMemo)(()=>(e?.user_metadata?.name||e?.user_metadata?.full_name)??e?.email??"User",[e]),d=(0,a.useCallback)(async()=>{try{let e=(0,aT.createClient)();await e.auth.signOut()}catch(e){console.error("[Dashboard] signOut error",e)}finally{s.refresh()}},[s]);return(0,t.jsxs)(ru,{children:[(0,t.jsx)(rx,{}),(0,t.jsx)(rp,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md p-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","aria-label":l,children:[(0,t.jsx)("div",{className:"bg-violet-500 text-white flex h-8 w-8 items-center justify-center rounded-md text-xs font-bold",children:i||"U"}),(0,t.jsxs)("div",{className:"min-w-0 group-data-[collapsible=icon]:hidden",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium",children:l}),e?.email&&(0,t.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:e.email})]})]})}),(0,t.jsx)(rm,{side:"right",align:"start",className:"p-0",children:(0,t.jsxs)("div",{className:"w-72",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsx)("div",{className:"bg-violet-500 text-white flex h-10 w-10 items-center justify-center rounded-md text-sm font-bold",children:i||"U"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("div",{className:"truncate font-medium",children:l})}),e?.email&&(0,t.jsx)("div",{className:"truncate text-sm text-muted-foreground",children:e.email})]})]}),(0,t.jsx)("div",{className:"border-t"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2 px-4 py-3 text-sm hover:bg-muted/40","aria-label":o("account"),children:[(0,t.jsx)(aJ,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:o("account")})]}),(0,t.jsxs)("button",{type:"button",onClick:d,className:"flex w-full items-center gap-2 px-4 py-3 text-sm text-destructive hover:bg-destructive/10","aria-label":o("logout"),children:[(0,t.jsx)(aZ,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"flex-1 text-left font-medium",children:o("logout")})]})]})]})})]})}function rh(){let e=(0,r.useTranslations)("Dashboard"),[n,l]=(0,a.useState)("notebook"),d=[{id:"notebook",title:e("sidebar.notebook"),icon:s},{id:"bookReader",title:e("sidebar.bookReader"),icon:o.BookMarked,disabled:!0},{id:"training",title:e("sidebar.training"),icon:i,disabled:!0}];return(0,t.jsx)(aG,{children:(0,t.jsx)(eX,{defaultOpen:!0,children:(0,t.jsxs)("div",{className:"flex min-h-screen w-full",children:[(0,t.jsxs)(eZ,{collapsible:"icon",className:"border-r",children:[(0,t.jsx)(e0,{className:"border-b p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(aY.default,{src:"/logo.svg",alt:"StreamLanguage Logo",width:32,height:32,className:"w-8 h-8"}),(0,t.jsx)("span",{className:"text-xl font-bold group-data-[collapsible=icon]:hidden",children:"StreamLanguage"})]})}),(0,t.jsx)(e2,{children:(0,t.jsx)(e4,{children:(0,t.jsx)(e3,{children:(0,t.jsx)(e5,{children:d.map(e=>(0,t.jsx)(e6,{children:(0,t.jsxs)(e8,{isActive:n===e.id,onClick:()=>!e.disabled&&l(e.id),disabled:e.disabled,className:e.disabled?"opacity-50 cursor-not-allowed":"",children:[(0,t.jsx)(e.icon,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:e.title})]})},e.id))})})})}),(0,t.jsx)(e1,{className:"mt-auto border-t",children:(0,t.jsx)(rf,{})})]}),(0,t.jsxs)(eQ,{className:"flex-1",children:[(0,t.jsxs)("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[(0,t.jsx)(eJ,{className:"-ml-1"}),(0,t.jsx)(g,{orientation:"vertical",className:"mr-2 h-4"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold",children:e("title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")})]})]}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4",children:["notebook"===n&&(0,t.jsx)(aq,{}),"bookReader"===n&&(0,t.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:"Coming soon..."}),"training"===n&&(0,t.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:"Coming soon..."})]})]})]})})})}a.forwardRef((e,a)=>{let{__scopePopover:r,...n}=e,s=a3(rd,r);return(0,t.jsx)(x.Primitive.button,{type:"button",...n,ref:a,onClick:(0,b.composeEventHandlers)(e.onClick,()=>s.onOpenChange(!1))})}).displayName=rd,a.forwardRef((e,a)=>{let{__scopePopover:r,...n}=e,s=a2(r);return(0,t.jsx)(eh.Arrow,{...s,...n,ref:a})}).displayName="PopoverArrow",e.s(["default",()=>rh],37252)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.