1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,80436,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={formatUrl:function(){return l},formatWithValidation:function(){return u},urlObjectKeys:function(){return o}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=e.r(44066)._(e.r(21630)),i=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,a=e.protocol||"",n=e.pathname||"",l=e.hash||"",o=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),o&&"object"==typeof o&&(o=String(s.urlQueryToSearchParams(o)));let d=e.search||o&&`?${o}`||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||i.test(a))&&!1!==u?(u="//"+(u||""),n&&"/"!==n[0]&&(n="/"+n)):u||(u=""),l&&"#"!==l[0]&&(l="#"+l),d&&"?"!==d[0]&&(d="?"+d),n=n.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${a}${u}${n}${d}${l}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return l(e)}},86032,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return n}});let a=e.r(73576);function n(e,t){let r=(0,a.useRef)(null),n=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=r.current;e&&(r.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(r.current=s(e,a)),t&&(n.current=s(t,a))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},97151,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return s}});let a=e.r(69131),n=e.r(42783);function s(e){if(!(0,a.isAbsoluteUrl)(e))return!0;try{let t=(0,a.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,n.hasBasePath)(r.pathname)}catch(e){return!1}}},50232,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},55367,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return g},useLinkStatus:function(){return v}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=e.r(44066),i=e.r(76350),l=s._(e.r(73576)),o=e.r(80436),u=e.r(76968),d=e.r(86032),c=e.r(69131),h=e.r(36948);e.r(72489);let p=e.r(66215),f=e.r(82393),m=e.r(97151),x=e.r(96478);function g(t){var r,a;let n,s,g,[v,b]=(0,l.useOptimistic)(f.IDLE_LINK_STATUS),y=(0,l.useRef)(null),{href:M,as:S,children:k,prefetch:w=null,passHref:I,replace:C,shallow:A,scroll:N,onClick:D,onMouseEnter:z,onTouchStart:P,legacyBehavior:E=!1,onNavigate:L,transitionTypes:T,ref:R,unstable_dynamicOnHover:O,..._}=t;n=k,E&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let F=l.default.useContext(u.AppRouterContext),B=!1!==w,U=!1!==w?null===(a=w)||"auto"===a?x.FetchStrategy.PPR:x.FetchStrategy.Full:x.FetchStrategy.PPR,K="string"==typeof(r=S||M)?r:(0,o.formatUrl)(r);if(E){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});s=l.default.Children.only(n)}let $=E?s&&"object"==typeof s&&s.ref:R,G=l.default.useCallback(e=>(null!==F&&(y.current=(0,f.mountLinkInstance)(e,K,F,U,B,b)),()=>{y.current&&((0,f.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,f.unmountPrefetchableInstance)(e)}),[B,K,F,U,b]),q={ref:(0,d.useMergedRef)(G,$),onClick(t){E||"function"!=typeof D||D(t),E&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!F||t.defaultPrevented||function(t,r,a,n,s,i,o){if("u">typeof window){let u,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;
1if(!(0,m.isLocalURL)(r)){n&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:c}=e.r(25435);l.default.startTransition(()=>{c(r,n?"replace":"push",!1===s?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,a.current,o)})}}(t,K,y,C,N,L,T)},onMouseEnter(e){E||"function"!=typeof z||z(e),E&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),F&&B&&(0,f.onNavigationIntent)(e.currentTarget,!0===O)},onTouchStart:function(e){E||"function"!=typeof P||P(e),E&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),F&&B&&(0,f.onNavigationIntent)(e.currentTarget,!0===O)}};return(0,c.isAbsoluteUrl)(K)?q.href=K:E&&!I&&("a"!==s.type||"href"in s.props)||(q.href=(0,h.addBasePath)(K)),g=E?l.default.cloneElement(s,q):(0,i.jsx)("a",{..._,...q,children:n}),(0,i.jsx)(j.Provider,{value:v,children:g})}e.r(50232);let j=(0,l.createContext)(f.IDLE_LINK_STATUS),v=()=>(0,l.useContext)(j);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},44215,e=>{"use strict";e.s(["CURRENT_USER",0,{name:"shadcn",email:"[email protected]",avatar:"https://unavatar.io/x/shadcn",initials:"CN"}])},56889,e=>{"use strict";let t=(0,e.i(16735).default)("library-big",[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]]);e.s(["LibraryBigIcon",0,t],56889)},63270,e=>{"use strict";var t=e.i(76350),r=e.i(73576),a=e.i(99300),n=e.i(93956),s=e.i(89422),i=e.i(81004),l=e.i(20763),o=Object.defineProperty,u=(e,t)=>o(e,"name",{value:t,configurable:!0}),d="Avatar",[c,h]=(0,n.createContextScope)(d),p=[0,()=>void 0],[f,m]=c(d),x=r.forwardRef(u(function(e,a){let{__scopeAvatar:n,...s}=e,[i,o]=r.useState("idle"),[u,d]=y();return(0,t.jsx)(f,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:o,imageCount:u,setImageCount:d,children:(0,t.jsx)(l.Primitive.span,{...s,ref:a})})},"Avatar")),g=r.forwardRef(u(function(e,a){let{__scopeAvatar:n,src:o,onLoadingStatusChange:u,...d}=e,c=m("AvatarImage",n);M(c.setImageCount);let h=v(o,{referrerPolicy:d.referrerPolicy,crossOrigin:d.crossOrigin,loadingStatus:c.imageLoadingStatus,setLoadingStatus:c.setImageLoadingStatus}),p=(0,s.useCallbackRef)(e=>{u?.(e)}),f=r.useRef(h);return(0,i.useLayoutEffect)(()=>{let e=f.current;f.current=h,h!==e&&p(h)},[h,p]),"loaded"===h?(0,t.jsx)(l.Primitive.img,{...d,ref:a,src:o}):null},"AvatarImage")),j=r.forwardRef(u(function(e,a){let{__scopeAvatar:n,delayMs:s,...i}=e,o=m("AvatarFallback",n),[u,d]=r.useState(void 0===s);return r.useEffect(()=>{if(void 0!==s){let e=window.setTimeout(()=>d(!0),s);return()=>window.clearTimeout(e)}},[s]),u&&"loaded"!==o.imageLoadingStatus?(0,t.jsx)(l.Primitive.span,{...i,ref:a}):null},"AvatarFallback"));function v(e,{loadingStatus:t,setLoadingStatus:r,referrerPolicy:a,crossOrigin:n}){return(0,i.useLayoutEffect)(()=>{if(!e)return void r("error");let t=new window.Image,s=u(e=>{r(b(e.currentTarget))},"handleLoad"),i=u(()=>r("error"),"handleError");return t.addEventListener("load",s),t.addEventListener("error",i),a&&(t.referrerPolicy=a),t.crossOrigin=n??null,t.src=e,r(b(t)),()=>{t.removeEventListener("load",s),t.removeEventListener("error",i),r("idle")}},[e,n,a,r]),t}function b(e){return e.complete?e.naturalWidth>0?"loaded":"error":"loading"}function y(){let e=p;if(a.IS_DEVELOPMENT){let[t]=e=r.useState(0),a=r.useRef(!1);r.useEffect(()=>{t>1&&!a.current&&(a.current=!0,console.warn("Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior."))},[t])}return e}function M(e){a.IS_DEVELOPMENT&&r.useEffect(()=>(e(e=>e+1),()=>{e(e=>e-1)}),[e])}u(v,"useImageLoadingStatus"),u(b,"getImageLoadingStatus"),u(y,"useImageCount"),u(M,"useUpdateImageCount"),e.s(["Avatar",0,x,"AvatarFallback",0,j,"AvatarImage",0,g,"Fallback",0,j,"Image",0,g,"Root",0,x,"createAvatarScope",0,h],41101);var S=e.i(41101),S=S,k=e.i(47163);e.s(["Avatar",0,function({className:e,size:r="default",...a}){return(0,t.jsx)(S.Root,{"data-slot":"avatar","data-size":r,className:(0,k.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...a})},"AvatarBadge",0,function({className:e,...r}){return(0,t.jsx)("span",{"data-slot":"avatar-badge",className:(0,k.cn)("absolute right-0 bottom-0 z-10
1inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none","group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden","group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2","group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",e),...r})},"AvatarFallback",0,function({className:e,...r}){return(0,t.jsx)(S.Fallback,{"data-slot":"avatar-fallback",className:(0,k.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})},"AvatarGroup",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"avatar-group",className:(0,k.cn)("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",e),...r})},"AvatarGroupCount",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"avatar-group-count",className:(0,k.cn)("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",e),...r})},"AvatarImage",0,function({className:e,...r}){return(0,t.jsx)(S.Image,{"data-slot":"avatar-image",className:(0,k.cn)("aspect-square size-full rounded-full object-cover",e),...r})}],63270)},60313,e=>{"use strict";var t=e.i(76350),r=e.i(55367),a=e.i(12612),n=e.i(16735);let s=(0,n.default)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);var i=e.i(43764);let l=(0,n.default)("gallery-vertical-end",[["path",{d:"M7 2h10",key:"nczekb"}],["path",{d:"M5 6h14",key:"u2x4p"}],["rect",{width:"18",height:"12",x:"3",y:"10",rx:"2",key:"l0tzu3"}]]);var o=e.i(56889),u=e.i(60970);let d=(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 c=e.i(73576),h=e.i(97683),p=e.i(87003),f=e.i(91771);let m=(0,n.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),x=(0,n.default)("pin-off",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]),g=(0,n.default)("share",[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]]);var j=e.i(86194),v=e.i(63415),b=e.i(11522),y=e.i(71428),M=e.i(8482),S=e.i(54946),k=e.i(85460),w=e.i(73363);let I=["w-4/5","w-3/5","w-3/4","w-1/2","w-2/3"];function C({activeThreadId:e}){let{isMobile:r}=(0,b.useSidebar)(),{threads:a,isLoading:n,renameThread:s,setThreadPinned:i}=(0,k.useThreads)(),[l,o]=c.useState(null),[u,d]=c.useState(!1),[h,p]=c.useState(null),[f,m]=c.useState(!1),[x,g]=c.useState(null),[j,v]=c.useState(!1);if(n)return(0,t.jsx)(b.SidebarGroup,{className:"group-data-[collapsible=icon]:hidden",children:(0,t.jsx)(b.SidebarMenu,{children:I.map((e,r)=>(0,t.jsx)(b.SidebarMenuItem,{children:(0,t.jsx)("div",{className:"flex h-8 items-center gap-2 rounded-md px-2",children:(0,t.jsx)(y.Skeleton,{className:`h-4 ${e}`})})},r))})});let N=a.filter(e=>e.pinned),D=a.filter(e=>!e.pinned).reduce((e,t)=>(e[t.group]=e[t.group]??[],e[t.group].push(t),e),{}),z=[...N.length>0?[["Pinned",N]]:[],...Object.entries(D)];return(0,t.jsxs)(t.Fragment,{children:[z.map(([a,n])=>(0,t.jsxs)(b.SidebarGroup,{className:"group-data-[collapsible=icon]:hidden",children:[(0,t.jsx)(b.SidebarGroupLabel,{children:a}),(0,t.jsx)(b.SidebarMenu,{children:n.map(a=>(0,t.jsx)(A,{thread:a,isActive:a.id===e,menuSide:r?"bottom":"right",menuAlign:r?"end":"start",onRename:e=>s(a.id,e),onTogglePin:()=>i(a.id,!a.pinned),onAddToProject:()=>{g(a.id),v(!0)},onShare:()=>{o(a.id),d(!0)},onDelete:()=>{p(a),m(!0)}},a.id))})]},a)),l?(0,t.jsx)(S.ShareDialog,{threadId:l,open:u,onOpenChange:d},l):null,x?(0,t.jsx)(w.AddToProjectDialog,{threadId:x,open:j,onOpenChange:v}):null,h?(0,t.jsx)(M.DeleteThreadDialog,{threadId:h.id,title:h.title,activeThreadI
1d:e,open:f,onOpenChange:m}):null]})}function A({thread:e,isActive:a,menuSide:n,menuAlign:s,onRename:i,onTogglePin:l,onAddToProject:o,onShare:u,onDelete:d}){let[y,M]=c.useState(!1),S=c.useRef(null),k=c.useRef(null),w=c.useRef(!1);function I(t){let r=t.trim();r&&r!==e.title&&i(r),M(!1)}return c.useEffect(()=>{if(y){S.current?.focus(),S.current?.select();return}w.current&&(w.current=!1,k.current?.focus())},[y]),(0,t.jsxs)(b.SidebarMenuItem,{children:[y?(0,t.jsx)(b.SidebarMenuButton,{asChild:!0,isActive:a,children:(0,t.jsx)("div",{children:(0,t.jsx)("input",{ref:S,defaultValue:e.title,"aria-label":`Rename ${e.title}`,className:"-mx-1 w-full min-w-0 rounded-sm bg-transparent px-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onKeyDown:function(e){if("Enter"===e.key&&!e.nativeEvent.isComposing){e.preventDefault(),w.current=!0,I(e.currentTarget.value);return}"Escape"===e.key&&(e.stopPropagation(),w.current=!0,M(!1))},onBlur:e=>I(e.currentTarget.value)})})}):(0,t.jsx)(b.SidebarMenuButton,{asChild:!0,isActive:a,tooltip:e.title,children:(0,t.jsx)(r.default,{ref:k,href:`/chat/${e.id}`,children:(0,t.jsx)("span",{className:"truncate",children:e.title})})}),(0,t.jsxs)(v.DropdownMenu,{children:[(0,t.jsx)(v.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(b.SidebarMenuAction,{showOnHover:!0,className:"aria-expanded:bg-muted",children:[(0,t.jsx)(p.MoreHorizontalIcon,{}),(0,t.jsxs)("span",{className:"sr-only",children:["More options for ",e.title]})]})}),(0,t.jsxs)(v.DropdownMenuContent,{className:"w-48",side:n,align:s,onCloseAutoFocus:e=>{y&&(e.preventDefault(),S.current?.focus())},children:[(0,t.jsxs)(v.DropdownMenuGroup,{children:[(0,t.jsx)(v.DropdownMenuItem,{onClick:l,children:e.pinned?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x,{}),"Unpin"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{}),"Pin"]})}),(0,t.jsxs)(v.DropdownMenuItem,{onClick:()=>M(!0),children:[(0,t.jsx)(f.PencilIcon,{}),"Rename"]}),(0,t.jsxs)(v.DropdownMenuItem,{onClick:o,children:[(0,t.jsx)(h.FolderPlusIcon,{}),e.projectId?"Move to project":"Add to project"]}),(0,t.jsxs)(v.DropdownMenuItem,{onClick:u,children:[(0,t.jsx)(g,{}),"Share"]})]}),(0,t.jsx)(v.DropdownMenuSeparator,{}),(0,t.jsxs)(v.DropdownMenuItem,{variant:"destructive",onClick:d,children:[(0,t.jsx)(j.Trash2Icon,{}),"Delete"]})]})]})]})}let N=(0,n.default)("badge-check",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),D=(0,n.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),z=(0,n.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),P=(0,n.default)("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),E=(0,n.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]),L=(0,n.default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}
1],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var T=e.i(63270);function R({user:e}){return(0,t.jsx)(b.SidebarMenu,{children:(0,t.jsx)(b.SidebarMenuItem,{children:(0,t.jsxs)(v.DropdownMenu,{children:[(0,t.jsx)(v.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(b.SidebarMenuButton,{size:"lg",className:"aria-expanded:bg-sidebar-accent",children:[(0,t.jsxs)(T.Avatar,{children:[(0,t.jsx)(T.AvatarImage,{src:e.avatar,alt:e.name}),(0,t.jsx)(T.AvatarFallback,{children:e.initials})]}),(0,t.jsxs)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,t.jsx)("span",{className:"truncate text-xs",children:e.email})]}),(0,t.jsx)(z,{className:"ml-auto size-4"})]})}),(0,t.jsxs)(v.DropdownMenuContent,{className:"min-w-56",side:"bottom",align:"start",children:[(0,t.jsx)(v.DropdownMenuGroup,{children:(0,t.jsx)(v.DropdownMenuLabel,{className:"p-0 font-normal text-foreground",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[(0,t.jsxs)(T.Avatar,{children:[(0,t.jsx)(T.AvatarImage,{src:e.avatar,alt:e.name}),(0,t.jsx)(T.AvatarFallback,{children:e.initials})]}),(0,t.jsxs)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,t.jsx)("span",{className:"truncate text-xs",children:e.email})]})]})})}),(0,t.jsx)(v.DropdownMenuSeparator,{}),(0,t.jsx)(v.DropdownMenuGroup,{children:(0,t.jsxs)(v.DropdownMenuItem,{children:[(0,t.jsx)(L,{}),"Upgrade to Pro"]})}),(0,t.jsx)(v.DropdownMenuSeparator,{}),(0,t.jsxs)(v.DropdownMenuGroup,{children:[(0,t.jsxs)(v.DropdownMenuItem,{children:[(0,t.jsx)(N,{}),"Account"]}),(0,t.jsxs)(v.DropdownMenuItem,{children:[(0,t.jsx)(P,{}),"Billing"]}),(0,t.jsxs)(v.DropdownMenuItem,{children:[(0,t.jsx)(D,{}),"Notifications"]})]}),(0,t.jsx)(v.DropdownMenuSeparator,{}),(0,t.jsxs)(v.DropdownMenuItem,{children:[(0,t.jsx)(E,{}),"Log out"]})]})]})})})}var O=e.i(76937),_=e.i(53751);let F=[{label:"Projects",icon:i.FolderIcon,href:"/projects"},{label:"Library",icon:o.LibraryBigIcon,href:"/library"}];function B(){let[e,r]=c.useState(!1),{threads:n}=(0,k.useThreads)(),s=(0,a.useRouter)();function i(e){r(!1),s.push(e)}return c.useEffect(()=>{function e(e){"k"!==e.key.toLowerCase()||(e.metaKey||e.ctrlKey)&&(e.preventDefault(),r(e=>!e))}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.SidebarMenuItem,{children:(0,t.jsxs)(b.SidebarMenuButton,{onClick:()=>r(!0),children:[(0,t.jsx)(O.SearchIcon,{}),(0,t.jsx)("span",{children:"Search"})]})}),(0,t.jsx)(_.CommandDialog,{open:e,onOpenChange:r,title:"Search",description:"Search chats or jump to a section.",children:(0,t.jsxs)(_.Command,{children:[(0,t.jsx)(_.CommandInput,{placeholder:"Search chats..."}),(0,t.jsxs)(_.CommandList,{children:[(0,t.jsx)(_.CommandEmpty,{children:"No chats found."}),(0,t.jsx)(_.CommandGroup,{heading:"Chats",children:n.map(e=>(0,t.jsxs)(_.CommandItem,{value:`${e.title} ${e.group}`,onSelect:()=>i(`/chat/${e.id}`),children:[(0,t.jsx)("span",{className:"flex-1 truncate",children:e.title}),(0,t.jsx)(_.CommandShortcut,{className:"tracking-normal",children:e.group})]},e.id))}),(0,t.jsxs)(_.CommandGroup,{heading:"Actions",children:[(0,t.jsxs)(_.CommandItem,{value:"New chat",onSelect:()=>i("/chat"),children:[(0,t.jsx)(u.PlusIcon,{}),"New chat"]}),F.map(e=>(0,t.jsxs)(_.CommandItem,{value:e.label,onSelect:()=>i(e.href),children:[(0,t.jsx)(e.icon,{}),e.label]},e.label))]})]})]})})]})}function U({teams:e}){let[r,a]=c.useState(e[0]);return(c.useEffect(()=>{function t(t){if(!t.metaKey&&!t.ctrlKey||t.altKey||t.shiftKey)return;let r=Number(t.code.match(/^Digit([1-9])$/)?.[1]);!r||r>Math.min(e.length,9)||(t.preventDefault(),a(e[r-1]))}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]),r)?(0,t.jsx)(b.SidebarMenu,{children:(0,t.jsx)(b.SidebarMenuItem,{children:(0,t.jsxs)(v.DropdownMenu,{children:[(0,t.jsx)(v.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(b.SidebarMenuButton,{size:"lg",className:"aria-expanded:bg-sidebar-accent",children:[(0,t.jsx)("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground",children:(0,t.jsx)(r.logo,{className:"size-4"})}),(0,t.jsxs)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:r.name}),(0,t.jsx)("span",{className:"truncate text-xs",children:r.plan})]}),(0,t.jsx)(z,{className:"ml-auto"})]})}),(0,t.jsxs)(v.DropdownMenuContent,{className:"min-w-56",side:"bottom",align:"start",children:[(0,t.jsxs)(v.DropdownMenuGroup,{children:[(0,t.jsx)(v.DropdownMenuLabel,{children:"Worksp
1aces"}),e.map((e,r)=>(0,t.jsxs)(v.DropdownMenuItem,{onClick:()=>a(e),children:[(0,t.jsx)("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg border",children:(0,t.jsx)(e.logo,{className:"size-4"})}),e.name,r<9?(0,t.jsxs)(v.DropdownMenuShortcut,{children:["â",r+1]}):null]},e.name))]}),(0,t.jsx)(v.DropdownMenuSeparator,{}),(0,t.jsx)(v.DropdownMenuGroup,{children:(0,t.jsxs)(v.DropdownMenuItem,{children:[(0,t.jsx)("div",{className:"flex aspect-square size-8 items-center justify-center",children:(0,t.jsx)(u.PlusIcon,{className:"size-4"})}),"Add workspace"]})})]})]})})}):null}var K=e.i(44215);let $=[{name:"Acme Inc.",plan:"Enterprise",logo:l},{name:"Acme Labs",plan:"Pro",logo:s},{name:"Personal",plan:"Free",logo:d}],G=[{label:"Projects",icon:i.FolderIcon,href:"/projects"},{label:"Library",icon:o.LibraryBigIcon,href:"/library"}];e.s(["AppSidebar",0,function({...e}){let n=(0,a.usePathname)(),s=n.startsWith("/chat/")?n.slice(6):null;return(0,t.jsxs)(b.Sidebar,{collapsible:"icon",...e,children:[(0,t.jsxs)(b.SidebarHeader,{children:[(0,t.jsx)(U,{teams:$}),(0,t.jsxs)(b.SidebarMenu,{children:[(0,t.jsx)(b.SidebarMenuItem,{children:(0,t.jsx)(b.SidebarMenuButton,{tooltip:"New chat",asChild:!0,children:(0,t.jsxs)(r.default,{href:"/chat",children:[(0,t.jsx)(u.PlusIcon,{}),(0,t.jsx)("span",{children:"New chat"})]})})}),(0,t.jsx)(B,{}),G.map(e=>(0,t.jsx)(b.SidebarMenuItem,{children:(0,t.jsx)(b.SidebarMenuButton,{tooltip:e.label,isActive:n.startsWith(e.href),asChild:!0,children:(0,t.jsxs)(r.default,{href:e.href,children:[(0,t.jsx)(e.icon,{}),(0,t.jsx)("span",{children:e.label})]})})},e.label))]})]}),(0,t.jsx)(b.SidebarContent,{children:(0,t.jsx)(C,{activeThreadId:s})}),(0,t.jsx)(b.SidebarFooter,{children:(0,t.jsx)(R,{user:K.CURRENT_USER})}),(0,t.jsx)(b.SidebarRail,{})]})}],60313)}]);
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.