teodor-new-chat-ui 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -0
- package/dist/components/chat/ChatApp.d.ts +8 -0
- package/dist/components/chat/ChatInterface.d.ts +9 -0
- package/dist/components/chat/ChatProvider.d.ts +59 -0
- package/dist/components/chat/MessageComponent.d.ts +9 -0
- package/dist/components/chat/ThreadManager.d.ts +7 -0
- package/dist/components/chat/index.d.ts +6 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert.d.ts +8 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/avatar.d.ts +6 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/breadcrumb.d.ts +19 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/carousel.d.ts +18 -0
- package/dist/components/ui/chart.d.ts +62 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/command.d.ts +82 -0
- package/dist/components/ui/context-menu.d.ts +27 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/drawer.d.ts +22 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/input-otp.d.ts +34 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/menubar.d.ts +28 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/pagination.d.ts +28 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/resizable.d.ts +23 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +25 -0
- package/dist/components/ui/sidebar.d.ts +66 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/toast.d.ts +15 -0
- package/dist/components/ui/toaster.d.ts +1 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/use-toast.d.ts +2 -0
- package/dist/favicon.ico +0 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-toast.d.ts +44 -0
- package/dist/index.esm.js +3812 -0
- package/dist/index.umd.js +8 -0
- package/dist/lib/index.d.ts +30 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/placeholder.svg +1 -0
- package/dist/robots.txt +14 -0
- package/package.json +118 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(function(L,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react/jsx-runtime"),require("react"),require("lucide-react"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("clsx"),require("tailwind-merge"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","lucide-react","@radix-ui/react-slot","class-variance-authority","clsx","tailwind-merge","react-dom"],c):(L=typeof globalThis<"u"?globalThis:L||self,c(L.NewChatUI={},L.jsxRuntime,L.React,L.LucideReact,L.reactSlot,L.classVarianceAuthority,L.clsx,L.tailwindMerge,L.ReactDOM))})(this,function(L,c,_,B,Ye,vt,Qr,en,tn){"use strict";function wt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const u=wt(_),bt=wt(tn),yt=_.createContext(null),rn="http://localhost:8000/api/chat";function Xe({children:e,apiBaseUrl:t=rn,enableUrlSync:r=!1}){const[n,o]=_.useState({currentThreadId:null,messages:[],isLoading:!1,isLoadingHistory:!1,error:null,interrupt:null,threads:[],loadingThreads:!1,availableBranches:[],currentBranch:null}),s=_.useCallback(()=>r?new URLSearchParams(window.location.search).get("thread"):null,[r]),i=_.useCallback(b=>{if(!r)return;const w=new URL(window.location.href);b?w.searchParams.set("thread",b):w.searchParams.delete("thread"),window.history.pushState({},"",w.toString())},[r]);_.useEffect(()=>{if(r){const b=s();b&&o(w=>({...w,currentThreadId:b}))}},[r,s]),_.useEffect(()=>{if(!r)return;const b=()=>{const w=s();o(m=>({...m,currentThreadId:w}))};return window.addEventListener("popstate",b),()=>window.removeEventListener("popstate",b)},[r,s]);const a=_.useCallback(async()=>{o(b=>({...b,loadingThreads:!0}));try{const b=await fetch(`${t}/threads`);if(!b.ok)throw new Error("Failed to load threads");const w=await b.json();o(m=>({...m,threads:w,loadingThreads:!1}))}catch(b){o(w=>({...w,loadingThreads:!1,error:b instanceof Error?b.message:"Failed to load threads"}))}},[t]),l=b=>b.map(w=>({id:w.id,role:w.role==="human"?"human":w.role==="ai"?"ai":"tool",content:w.content,timestamp:w.timestamp,name:w.name,tool_call_id:w.tool_call_id,args:w.args,branch_id:w.branch_id,sequence_number:w.sequence_number})),d=_.useCallback(async b=>{o(w=>({...w,isLoadingHistory:!0}));try{const w=await fetch(`${t}/history/${b}`);if(!w.ok)throw new Error("Failed to load history");const m=await w.json(),A=l(m);o(k=>({...k,messages:A,isLoadingHistory:!1}))}catch(w){o(m=>({...m,isLoadingHistory:!1,error:w instanceof Error?w.message:"Failed to load history"}))}},[t]),f=_.useCallback(async b=>{try{const w=await fetch(`${t}/threads/${b}/branches`);if(!w.ok)return;const m=await w.json();o(A=>({...A,availableBranches:m.branches||[],currentBranch:m.current_branch}))}catch(w){console.warn("Failed to load branches:",w)}},[t]),h=_.useCallback(b=>{o(w=>({...w,currentThreadId:b,messages:[],availableBranches:[],currentBranch:null,error:null})),i(b),b&&Promise.all([d(b),f(b)]).catch(w=>{console.error("Failed to load thread data:",w)})},[i,d,f]),p=_.useCallback(async()=>{try{const b=await fetch(`${t}/threads`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!b.ok)throw new Error("Failed to create thread");const m=(await b.json()).thread_id;return await a(),m}catch(b){throw o(w=>({...w,error:b instanceof Error?b.message:"Failed to create thread"})),b}},[t]),g=_.useCallback(async b=>{console.log("deleteThread called with threadId:",b),console.log("apiBaseUrl:",t);try{const w=`${t}/threads/${b}`;console.log("Making DELETE request to:",w);const m=await fetch(w,{method:"DELETE"});if(console.log("Delete response status:",m.status),console.log("Delete response ok:",m.ok),!m.ok){const A=await m.text();throw console.log("Delete error response:",A),new Error(`Failed to delete thread: ${m.status} ${A}`)}console.log("Thread deleted successfully"),n.currentThreadId===b&&(console.log("Clearing current thread as it was deleted"),h(null)),console.log("Reloading threads list"),await a()}catch(w){console.error("Error deleting thread:",w),o(m=>({...m,error:w instanceof Error?w.message:"Failed to delete thread"}))}},[t,n.currentThreadId,h,a]),v=_.useCallback(async(b,w)=>{try{if(!(await fetch(`${t}/threads/${b}/title`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:w})})).ok)throw new Error("Failed to update thread title");await a()}catch(m){o(A=>({...A,error:m instanceof Error?m.message:"Failed to update thread title"}))}},[t,a]),y=_.useCallback(async b=>{if(!n.currentThreadId)return;const w={id:`temp-${Date.now()}`,role:"human",content:b,timestamp:new Date().toISOString()};o(m=>({...m,messages:[...m.messages,w],isLoading:!0,error:null}));try{const m=await fetch(`${t}/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({thread_id:n.currentThreadId,messages:[...n.messages,{role:"human",content:b}],operation:"continue"})});if(!m.ok){const A=await m.text();throw new Error(`HTTP ${m.status}: ${A}`)}await x(m),await d(n.currentThreadId)}catch(m){o(A=>({...A,messages:A.messages.filter(k=>k.id!==w.id),isLoading:!1,error:m instanceof Error?m.message:"Failed to send message"}))}},[t,n.currentThreadId,n.messages,d]),x=async b=>{var k;const w=(k=b.body)==null?void 0:k.getReader();if(!w){o(I=>({...I,isLoading:!1}));return}const m=new TextDecoder;let A="";try{for(;;){const{done:I,value:F}=await w.read();if(I)break;A+=m.decode(F,{stream:!0});const W=A.split(`
|
|
2
|
+
`);A=W.pop()||"";for(const $ of W)if($.trim()&&$.startsWith("data: "))try{const M=JSON.parse($.slice(6));M.type==="text"?o(D=>{const z=[...D.messages],Y=z[z.length-1];return Y&&Y.role==="ai"?Y.content+=M.text:z.push({id:`ai-${Date.now()}`,role:"ai",content:M.text,timestamp:new Date().toISOString()}),{...D,messages:z}}):M.type==="tool_call"&&o(D=>({...D,messages:[...D.messages,{id:`tool-${Date.now()}`,role:"tool",content:M.result||"",name:M.name||"unknown_function",tool_call_id:M.id,args:M.args,timestamp:new Date().toISOString()}]}))}catch(M){console.warn("Failed to parse streaming data:",$,M)}}}catch(I){console.error("Streaming error:",I)}finally{o(I=>({...I,isLoading:!1}))}};_.useEffect(()=>{a()},[a]);const S=_.useCallback(async(b,w)=>{if(!(!n.currentThreadId||!b.id)){o(m=>({...m,isLoading:!0,error:null}));try{const m=w?"edit_and_regenerate":"regenerate",A=await fetch(`${t}/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({thread_id:n.currentThreadId,messages:n.messages,operation:m,from_message_id:b.id,edited_content:w,create_branch:!0})});if(!A.ok){const k=await A.text();throw new Error(`HTTP ${A.status}: ${k}`)}await x(A),await Promise.all([d(n.currentThreadId),f(n.currentThreadId)])}catch(m){o(A=>({...A,isLoading:!1,error:m instanceof Error?m.message:"Failed to regenerate message"}))}}},[t,n.currentThreadId,n.messages,d,f]),E=_.useCallback(async(b,w,m=!1)=>{if(!(!n.currentThreadId||!b.id)){if(m){await S(b,w);return}o(A=>({...A,messages:A.messages.map(k=>k.id===b.id?{...k,content:w}:k)}))}},[n.currentThreadId,S]),N=_.useCallback(async b=>{if(n.currentThreadId)try{if(!(await fetch(`${t}/threads/${n.currentThreadId}/branch`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch_id:b})})).ok)throw new Error("Failed to switch branch");o(m=>({...m,currentBranch:b})),await d(n.currentThreadId)}catch(w){o(m=>({...m,error:w instanceof Error?w.message:"Failed to switch branch"}))}},[t,n.currentThreadId,d]),C=_.useCallback(()=>{o(b=>({...b,isLoading:!1}))},[]),T=_.useCallback(()=>{o(b=>({...b,error:null}))},[]),O=_.useCallback(async()=>{await a(),n.currentThreadId&&await Promise.all([d(n.currentThreadId),f(n.currentThreadId)])},[a,d,f,n.currentThreadId]),P={...n,selectThread:h,createThread:p,deleteThread:g,updateThreadTitle:v,sendMessage:y,editMessage:E,regenerateFromMessage:S,stop:C,switchBranch:N,clearError:T,refresh:O};return c.jsx(yt.Provider,{value:P,children:e})}function Te(){const e=_.useContext(yt);if(!e)throw new Error("useChat must be used within a ChatProvider");return e}function V(...e){return en.twMerge(Qr.clsx(e))}const nn=vt.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),R=u.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?Ye.Slot:"button";return c.jsx(i,{className:V(nn({variant:t,size:r,className:e})),ref:s,...o})});R.displayName="Button";const Ee=u.forwardRef(({className:e,...t},r)=>c.jsx("textarea",{className:V("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Ee.displayName="Textarea";function Ue({message:e,onRegenerate:t,onEditMessage:r,showRegenerate:n=!1}){const[o,s]=_.useState(!1),[i,a]=_.useState(!1),[l,d]=_.useState(typeof e.content=="string"?e.content:JSON.stringify(e.content)),f=()=>{t&&t(e)},h=()=>{const x=typeof e.content=="string"?e.content:JSON.stringify(e.content);l.trim()&&l!==x&&r&&r(e,l.trim(),!0),a(!1)},p=()=>{const x=typeof e.content=="string"?e.content:JSON.stringify(e.content);d(x),a(!1)},g=()=>{switch(e.role){case"human":return c.jsx(B.User,{size:20,className:"text-blue-600"});case"ai":return c.jsx(B.Bot,{size:20,className:"text-green-600"});case"tool":return c.jsx(B.Wrench,{size:20,className:"text-orange-600"});default:return c.jsx(B.Bot,{size:20,className:"text-gray-600"})}},v=()=>{switch(e.role){case"human":return"You";case"ai":return"Assistant";case"tool":return e.name||"Tool";default:return"Message"}},y=()=>typeof e.content=="string"?e.content:e.role==="tool"&&e.args?JSON.stringify(e.args,null,2):JSON.stringify(e.content,null,2);return console.log("Rendering message:",e),e.role==="human"?c.jsxs("div",{className:"flex gap-3 justify-end mb-4",children:[c.jsxs("div",{className:"max-w-[80%] rounded-lg p-4 relative group",style:{backgroundColor:"#2563eb",color:"white",border:"2px solid #1d4ed8",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},children:[r&&e.id&&c.jsx("div",{className:"absolute -top-1 -right-1 flex space-x-1 opacity-0 group-hover:opacity-100 transition-opacity",children:i?c.jsxs(c.Fragment,{children:[c.jsx(R,{size:"sm",variant:"ghost",onClick:h,className:"h-6 w-6 p-0 bg-white/10 hover:bg-white/20",title:"Save changes and regenerate",children:c.jsx(B.Check,{className:"h-3 w-3"})}),c.jsx(R,{size:"sm",variant:"ghost",onClick:p,className:"h-6 w-6 p-0 bg-white/10 hover:bg-white/20",title:"Cancel editing",children:c.jsx(B.X,{className:"h-3 w-3"})})]}):c.jsx(R,{size:"sm",variant:"ghost",onClick:()=>a(!0),className:"h-6 w-6 p-0 bg-white/10 hover:bg-white/20",title:"Edit message and regenerate AI response",children:c.jsx(B.Edit2,{className:"h-3 w-3"})})}),c.jsx("div",{className:"whitespace-pre-wrap",style:{color:"white"},children:i?c.jsx(Ee,{value:l,onChange:x=>d(x.target.value),className:"w-full min-h-[60px] bg-white/10 border-white/20 text-white placeholder-white/70",placeholder:"Edit your message...",autoFocus:!0}):c.jsx("span",{style:{color:"white"},children:e.content||"[No content]"})}),e.timestamp&&!i&&c.jsx("div",{className:"text-xs opacity-70 mt-2",style:{color:"white"},children:new Date(e.timestamp).toLocaleTimeString()})]}),c.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center",children:g()})]}):c.jsxs("div",{className:"flex gap-3 justify-start mb-4",children:[c.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-gray-100 flex items-center justify-center",children:g()}),c.jsxs("div",{className:`
|
|
3
|
+
max-w-[80%] rounded-lg p-3 relative group
|
|
4
|
+
${e.role==="tool"?"bg-orange-50 border border-orange-200":"bg-gray-100 text-gray-900"}
|
|
5
|
+
`,children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"font-medium text-sm",children:v()}),e.role==="tool"&&c.jsxs(R,{variant:"ghost",size:"sm",onClick:()=>s(!o),className:"h-6 px-2 text-xs",children:[o?c.jsx(B.ChevronDown,{size:12}):c.jsx(B.ChevronRight,{size:12}),o?"Hide":"Show"," Content"]})]}),n&&t&&c.jsxs(R,{variant:"ghost",size:"sm",onClick:f,className:"h-6 px-2 text-xs",children:[c.jsx(B.RotateCcw,{size:12,className:"mr-1"}),"Regenerate"]})]}),(e.role!=="tool"||o)&&c.jsx("div",{className:`whitespace-pre-wrap ${e.role==="tool"?"font-mono text-sm":""}`,children:y()}),e.timestamp&&c.jsx("div",{className:"text-xs opacity-70 mt-2",children:new Date(e.timestamp).toLocaleTimeString()})]})]})}function ve({className:e="",placeholder:t="Type your message...",autoFocus:r=!0,showBranches:n=!0,maxHeight:o="600px"}){const{currentThreadId:s,messages:i,isLoading:a,isLoadingHistory:l,error:d,availableBranches:f,currentBranch:h,sendMessage:p,stop:g,switchBranch:v,regenerateFromMessage:y,editMessage:x,clearError:S}=Te(),[E,N]=_.useState(""),C=_.useRef(null),T=_.useRef(null);_.useEffect(()=>{var m;(m=C.current)==null||m.scrollIntoView({behavior:"smooth"})},[i]),_.useEffect(()=>{r&&T.current&&T.current.focus()},[r,s]);const O=async m=>{if(m.preventDefault(),!E.trim()||a||!s)return;const A=E.trim();N(""),await p(A)},P=m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),O(m))},b=async m=>{await y(m)},w=async(m,A,k=!1)=>{await x(m,A,k)};return s?c.jsxs("div",{className:`flex flex-col h-full ${e}`,children:[d&&c.jsx("div",{className:"bg-red-50 border-l-4 border-red-400 p-4 mb-4",children:c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("div",{className:"text-red-700 text-sm",children:d}),c.jsx(R,{variant:"ghost",size:"sm",onClick:S,className:"text-red-600 hover:text-red-700",children:"×"})]})}),n&&f.length>1&&c.jsxs("div",{className:"border-b p-3 bg-gray-50",children:[c.jsx("div",{className:"text-sm font-medium mb-2",children:"Branches:"}),c.jsx("div",{className:"flex gap-2 flex-wrap",children:f.map(m=>c.jsxs(R,{size:"sm",variant:h===m.branch_id?"default":"outline",onClick:()=>v(m.branch_id),className:"text-xs",children:[m.preview,c.jsxs("span",{className:"ml-1 text-gray-500",children:["(",m.message_count,")"]})]},m.branch_id))})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-4",style:{maxHeight:o},children:[l?c.jsxs("div",{className:"flex items-center justify-center py-8",children:[c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),c.jsx("span",{className:"ml-2 text-gray-600",children:"Loading conversation..."})]}):i.length===0?c.jsxs("div",{className:"text-center text-gray-500 py-8",children:[c.jsx("div",{className:"text-lg font-medium mb-2",children:"Start a conversation"}),c.jsx("div",{className:"text-sm",children:"Type a message below to begin"})]}):c.jsx("div",{className:"space-y-4",children:i.map((m,A)=>c.jsxs("div",{children:[c.jsx(Ue,{message:m,onRegenerate:b,onEditMessage:w,showRegenerate:m.role==="ai"||m.role==="human"}),m.role==="human"&&m.branch_id&&c.jsxs("div",{className:"text-xs text-gray-500 ml-12 mt-1",children:["Branch: ",m.branch_id.slice(0,8),"..."]})]},m.id||A))}),c.jsx("div",{ref:C})]}),c.jsx("div",{className:"border-t p-4 bg-white",children:c.jsxs("form",{onSubmit:O,className:"flex gap-3",children:[c.jsx("div",{className:"flex-1",children:c.jsx(Ee,{ref:T,value:E,onChange:m=>N(m.target.value),onKeyDown:P,placeholder:t,className:"resize-none min-h-[44px] max-h-32",disabled:a})}),c.jsx("div",{className:"flex flex-col gap-2",children:a?c.jsx(R,{type:"button",onClick:g,size:"icon",variant:"outline",className:"shrink-0",children:c.jsx(B.Square,{size:16})}):c.jsx(R,{type:"submit",disabled:!E.trim()||!s,size:"icon",className:"shrink-0",children:c.jsx(B.Send,{size:16})})})]})})]}):c.jsx("div",{className:`flex items-center justify-center h-full ${e}`,children:c.jsxs("div",{className:"text-center text-gray-500",children:[c.jsx("div",{className:"text-lg font-medium mb-2",children:"No thread selected"}),c.jsx("div",{className:"text-sm",children:"Select a thread or create a new one to start chatting"})]})})}function we({className:e="",showCreateButton:t=!0,onThreadSelect:r}){const{currentThreadId:n,threads:o,loadingThreads:s,selectThread:i,createThread:a,deleteThread:l,updateThreadTitle:d}=Te();console.log("ThreadManager rendered, deleteThread available:",typeof l);const[f,h]=_.useState(null),[p,g]=_.useState(""),v=async C=>{await i(C),r==null||r(C)},y=async()=>{const C=await a();await v(C)},x=async(C,T)=>{console.log("handleDeleteThread called with threadId:",T),C.stopPropagation();const O=confirm("Are you sure you want to delete this thread?");if(console.log("User confirmed deletion:",O),O){console.log("Calling deleteThread from ChatProvider...");try{await l(T),console.log("deleteThread completed successfully")}catch(P){console.error("Error in handleDeleteThread:",P)}}},S=(C,T)=>{C.stopPropagation(),h(T.id),g(T.title||`Thread ${T.id.slice(0,8)}`)},E=async C=>{await d(C,p),h(null)},N=()=>{h(null),g("")};return s?c.jsx("div",{className:`p-4 ${e}`,children:c.jsx("div",{className:"animate-pulse space-y-2",children:[...Array(3)].map((C,T)=>c.jsx("div",{className:"h-10 bg-gray-200 rounded"},T))})}):c.jsxs("div",{className:`p-4 ${e}`,children:[t&&c.jsxs(R,{onClick:y,className:"w-full mb-4 flex items-center gap-2",variant:"outline",children:[c.jsx(B.Plus,{size:16}),"New Thread"]}),c.jsxs("div",{className:"space-y-2",children:[o.map(C=>c.jsx("div",{className:`
|
|
6
|
+
group p-3 rounded-lg cursor-pointer transition-colors
|
|
7
|
+
${n===C.id?"bg-blue-100 border-blue-300 border":"bg-gray-50 hover:bg-gray-100 border border-transparent"}
|
|
8
|
+
`,onClick:()=>v(C.id),children:c.jsx("div",{className:"flex items-center justify-between",children:f===C.id?c.jsxs("div",{className:"flex-1 flex gap-2",children:[c.jsx("input",{value:p,onChange:T=>g(T.target.value),onKeyDown:T=>{T.key==="Enter"&&E(C.id),T.key==="Escape"&&N()},className:"flex-1 px-2 py-1 text-sm border rounded",autoFocus:!0}),c.jsx(R,{size:"sm",onClick:T=>{T.stopPropagation(),E(C.id)},children:"Save"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"font-medium text-sm truncate",children:C.title||`Thread ${C.id.slice(0,8)}`}),c.jsx("div",{className:"text-xs text-gray-500",children:new Date(C.updated_at).toLocaleDateString()})]}),c.jsxs("div",{className:"flex gap-1 opacity-100 transition-opacity",children:[c.jsx(R,{size:"sm",variant:"ghost",onClick:T=>S(T,C),className:"p-1 h-auto",children:c.jsx(B.Edit3,{size:12})}),c.jsx(R,{size:"sm",variant:"ghost",onClick:T=>{console.log("Delete button clicked!"),x(T,C.id)},className:"p-1 h-auto text-red-600 hover:text-red-700",style:{backgroundColor:"rgba(255, 0, 0, 0.1)"},children:c.jsx(B.Trash2,{size:12})})]})]})})},C.id)),o.length===0&&c.jsx("div",{className:"text-center text-gray-500 py-8",children:"No threads yet. Create your first thread to get started!"})]})]})}function xt({apiBaseUrl:e,enableUrlSync:t=!0,layout:r="sidebar",className:n=""}){return c.jsx(Xe,{apiBaseUrl:e,enableUrlSync:t,children:c.jsxs("div",{className:`h-full ${n}`,children:[r==="sidebar"&&c.jsx(on,{}),r==="tabs"&&c.jsx(sn,{}),r==="split"&&c.jsx(an,{})]})})}function on(){return c.jsxs("div",{className:"flex h-full",children:[c.jsx("div",{className:"w-80 border-r bg-gray-50",children:c.jsx(we,{})}),c.jsx("div",{className:"flex-1",children:c.jsx(ve,{})})]})}function sn(){const[e,t]=_.useState("chat");return c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsx("div",{className:"border-b",children:c.jsxs("div",{className:"flex",children:[c.jsx("button",{onClick:()=>t("chat"),className:`px-4 py-2 font-medium ${e==="chat"?"border-b-2 border-blue-500 text-blue-600":"text-gray-500 hover:text-gray-700"}`,children:"Chat"}),c.jsx("button",{onClick:()=>t("threads"),className:`px-4 py-2 font-medium ${e==="threads"?"border-b-2 border-blue-500 text-blue-600":"text-gray-500 hover:text-gray-700"}`,children:"Threads"})]})}),c.jsxs("div",{className:"flex-1",children:[e==="chat"&&c.jsx(ve,{}),e==="threads"&&c.jsx(we,{onThreadSelect:()=>t("chat")})]})]})}function an(){return c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsx("div",{className:"h-1/3 border-b",children:c.jsx(we,{})}),c.jsx("div",{className:"flex-1",children:c.jsx(ve,{})})]})}const Ct=u.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:V("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ct.displayName="Card";const St=u.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:V("flex flex-col space-y-1.5 p-6",e),...t}));St.displayName="CardHeader";const Tt=u.forwardRef(({className:e,...t},r)=>c.jsx("h3",{ref:r,className:V("text-2xl font-semibold leading-none tracking-tight",e),...t}));Tt.displayName="CardTitle";const Et=u.forwardRef(({className:e,...t},r)=>c.jsx("p",{ref:r,className:V("text-sm text-muted-foreground",e),...t}));Et.displayName="CardDescription";const Pt=u.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:V("p-6 pt-0",e),...t}));Pt.displayName="CardContent";const Nt=u.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:V("flex items-center p-6 pt-0",e),...t}));Nt.displayName="CardFooter";const At=u.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:V("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));At.displayName="Input";var ln=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],j=ln.reduce((e,t)=>{const r=Ye.createSlot(`Primitive.${t}`),n=u.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function cn(e,t){e&&bt.flushSync(()=>e.dispatchEvent(t))}var dn="Label",Ot=u.forwardRef((e,t)=>c.jsx(j.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Ot.displayName=dn;var Dt=Ot;const fn=vt.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Lt=u.forwardRef(({className:e,...t},r)=>c.jsx(Dt,{ref:r,className:V(fn(),e),...t}));Lt.displayName=Dt.displayName;var un="Separator",_t="horizontal",hn=["horizontal","vertical"],kt=u.forwardRef((e,t)=>{const{decorative:r,orientation:n=_t,...o}=e,s=pn(n)?n:_t,a=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(j.div,{"data-orientation":s,...a,...o,ref:t})});kt.displayName=un;function pn(e){return hn.includes(e)}var Mt=kt;const It=u.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},o)=>c.jsx(Mt,{ref:o,decorative:r,orientation:t,className:V("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));It.displayName=Mt.displayName;function $t(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gn(...e){return t=>{let r=!1;const n=e.map(o=>{const s=$t(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():$t(e[o],null)}}}}function X(...e){return u.useCallback(gn(...e),e)}var ie=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{};function mn(e,t){return u.useReducer((r,n)=>t[r][n]??r,e)}var de=e=>{const{present:t,children:r}=e,n=vn(t),o=typeof r=="function"?r({present:n.isPresent}):u.Children.only(r),s=X(n.ref,wn(o));return typeof r=="function"||n.isPresent?u.cloneElement(o,{ref:s}):null};de.displayName="Presence";function vn(e){const[t,r]=u.useState(),n=u.useRef(null),o=u.useRef(e),s=u.useRef("none"),i=e?"mounted":"unmounted",[a,l]=mn(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=Pe(n.current);s.current=a==="mounted"?d:"none"},[a]),ie(()=>{const d=n.current,f=o.current;if(f!==e){const p=s.current,g=Pe(d);e?l("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(f&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ie(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=g=>{const y=Pe(n.current).includes(g.animationName);if(g.target===t&&y&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},p=g=>{g.target===t&&(s.current=Pe(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:u.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Pe(e){return(e==null?void 0:e.animationName)||"none"}function wn(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function qe(e,t=[]){let r=[];function n(s,i){const a=u.createContext(i),l=r.length;r=[...r,i];const d=h=>{var S;const{scope:p,children:g,...v}=h,y=((S=p==null?void 0:p[e])==null?void 0:S[l])||a,x=u.useMemo(()=>v,Object.values(v));return c.jsx(y.Provider,{value:x,children:g})};d.displayName=s+"Provider";function f(h,p){var y;const g=((y=p==null?void 0:p[e])==null?void 0:y[l])||a,v=u.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[d,f]}const o=()=>{const s=r.map(i=>u.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return u.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,bn(o,...t)]}function bn(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:l,scopeName:d})=>{const h=l(s)[`__scope${d}`];return{...a,...h}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function G(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var yn=u.createContext(void 0);function xn(e){const t=u.useContext(yn);return e||t||"ltr"}function Cn(e,[t,r]){return Math.min(r,Math.max(t,e))}function H(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Sn(e,t){return u.useReducer((r,n)=>t[r][n]??r,e)}var Je="ScrollArea",[Ft,ri]=qe(Je),[Tn,J]=Ft(Je),zt=u.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,l]=u.useState(null),[d,f]=u.useState(null),[h,p]=u.useState(null),[g,v]=u.useState(null),[y,x]=u.useState(null),[S,E]=u.useState(0),[N,C]=u.useState(0),[T,O]=u.useState(!1),[P,b]=u.useState(!1),w=X(t,A=>l(A)),m=xn(o);return c.jsx(Tn,{scope:r,type:n,dir:m,scrollHideDelay:s,scrollArea:a,viewport:d,onViewportChange:f,content:h,onContentChange:p,scrollbarX:g,onScrollbarXChange:v,scrollbarXEnabled:T,onScrollbarXEnabledChange:O,scrollbarY:y,onScrollbarYChange:x,scrollbarYEnabled:P,onScrollbarYEnabledChange:b,onCornerWidthChange:E,onCornerHeightChange:C,children:c.jsx(j.div,{dir:m,...i,ref:w,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});zt.displayName=Je;var Ht="ScrollAreaViewport",Wt=u.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...s}=e,i=J(Ht,r),a=u.useRef(null),l=X(t,a,i.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(j.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Wt.displayName=Ht;var Q="ScrollAreaScrollbar",Ge=u.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=J(Q,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return u.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?c.jsx(En,{...n,ref:t,forceMount:r}):o.type==="scroll"?c.jsx(Pn,{...n,ref:t,forceMount:r}):o.type==="auto"?c.jsx(Bt,{...n,ref:t,forceMount:r}):o.type==="always"?c.jsx(Ke,{...n,ref:t}):null});Ge.displayName=Q;var En=u.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=J(Q,e.__scopeScrollArea),[s,i]=u.useState(!1);return u.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const d=()=>{window.clearTimeout(l),i(!0)},f=()=>{l=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",f)}}},[o.scrollArea,o.scrollHideDelay]),c.jsx(de,{present:r||s,children:c.jsx(Bt,{"data-state":s?"visible":"hidden",...n,ref:t})})}),Pn=u.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=J(Q,e.__scopeScrollArea),s=e.orientation==="horizontal",i=De(()=>l("SCROLL_END"),100),[a,l]=Sn("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return u.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,o.scrollHideDelay,l]),u.useEffect(()=>{const d=o.viewport,f=s?"scrollLeft":"scrollTop";if(d){let h=d[f];const p=()=>{const g=d[f];h!==g&&(l("SCROLL"),i()),h=g};return d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[o.viewport,s,l,i]),c.jsx(de,{present:r||a!=="hidden",children:c.jsx(Ke,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:H(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:H(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Bt=u.forwardRef((e,t)=>{const r=J(Q,e.__scopeScrollArea),{forceMount:n,...o}=e,[s,i]=u.useState(!1),a=e.orientation==="horizontal",l=De(()=>{if(r.viewport){const d=r.viewport.offsetWidth<r.viewport.scrollWidth,f=r.viewport.offsetHeight<r.viewport.scrollHeight;i(a?d:f)}},10);return fe(r.viewport,l),fe(r.content,l),c.jsx(de,{present:n||s,children:c.jsx(Ke,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Ke=u.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=J(Q,e.__scopeScrollArea),s=u.useRef(null),i=u.useRef(0),[a,l]=u.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Xt(a.viewport,a.content),f={...n,sizes:a,onSizesChange:l,hasThumb:d>0&&d<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function h(p,g){return _n(p,i.current,a,g)}return r==="horizontal"?c.jsx(Nn,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollLeft,g=Ut(p,a,o.dir);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=h(p,o.dir))}}):r==="vertical"?c.jsx(An,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollTop,g=Ut(p,a);s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=h(p))}}):null}),Nn=u.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,s=J(Q,e.__scopeScrollArea),[i,a]=u.useState(),l=u.useRef(null),d=X(t,l,s.onScrollbarXChange);return u.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(Rt,{"data-orientation":"horizontal",...o,ref:d,sizes:r,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Oe(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(s.viewport){const p=s.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),Jt(p,h)&&f.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&n({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ae(i.paddingLeft),paddingEnd:Ae(i.paddingRight)}})}})}),An=u.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,s=J(Q,e.__scopeScrollArea),[i,a]=u.useState(),l=u.useRef(null),d=X(t,l,s.onScrollbarYChange);return u.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(Rt,{"data-orientation":"vertical",...o,ref:d,sizes:r,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Oe(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(s.viewport){const p=s.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),Jt(p,h)&&f.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&n({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ae(i.paddingTop),paddingEnd:Ae(i.paddingBottom)}})}})}),[On,Vt]=Ft(Q),Rt=u.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:d,onWheelScroll:f,onResize:h,...p}=e,g=J(Q,r),[v,y]=u.useState(null),x=X(t,w=>y(w)),S=u.useRef(null),E=u.useRef(""),N=g.viewport,C=n.content-n.viewport,T=G(f),O=G(l),P=De(h,10);function b(w){if(S.current){const m=w.clientX-S.current.left,A=w.clientY-S.current.top;d({x:m,y:A})}}return u.useEffect(()=>{const w=m=>{const A=m.target;(v==null?void 0:v.contains(A))&&T(m,C)};return document.addEventListener("wheel",w,{passive:!1}),()=>document.removeEventListener("wheel",w,{passive:!1})},[N,v,C,T]),u.useEffect(O,[n,O]),fe(v,P),fe(g.content,P),c.jsx(On,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:G(s),onThumbPointerUp:G(i),onThumbPositionChange:O,onThumbPointerDown:G(a),children:c.jsx(j.div,{...p,ref:x,style:{position:"absolute",...p.style},onPointerDown:H(e.onPointerDown,w=>{w.button===0&&(w.target.setPointerCapture(w.pointerId),S.current=v.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),b(w))}),onPointerMove:H(e.onPointerMove,b),onPointerUp:H(e.onPointerUp,w=>{const m=w.target;m.hasPointerCapture(w.pointerId)&&m.releasePointerCapture(w.pointerId),document.body.style.webkitUserSelect=E.current,g.viewport&&(g.viewport.style.scrollBehavior=""),S.current=null})})})}),Ne="ScrollAreaThumb",jt=u.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Vt(Ne,e.__scopeScrollArea);return c.jsx(de,{present:r||o.hasThumb,children:c.jsx(Dn,{ref:t,...n})})}),Dn=u.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,s=J(Ne,r),i=Vt(Ne,r),{onThumbPositionChange:a}=i,l=X(t,h=>i.onThumbChange(h)),d=u.useRef(void 0),f=De(()=>{d.current&&(d.current(),d.current=void 0)},100);return u.useEffect(()=>{const h=s.viewport;if(h){const p=()=>{if(f(),!d.current){const g=kn(h,a);d.current=g,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[s.viewport,f,a]),c.jsx(j.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:H(e.onPointerDownCapture,h=>{const g=h.target.getBoundingClientRect(),v=h.clientX-g.left,y=h.clientY-g.top;i.onThumbPointerDown({x:v,y})}),onPointerUp:H(e.onPointerUp,i.onThumbPointerUp)})});jt.displayName=Ne;var Ze="ScrollAreaCorner",Yt=u.forwardRef((e,t)=>{const r=J(Ze,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?c.jsx(Ln,{...e,ref:t}):null});Yt.displayName=Ze;var Ln=u.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=J(Ze,r),[s,i]=u.useState(0),[a,l]=u.useState(0),d=!!(s&&a);return fe(o.scrollbarX,()=>{var h;const f=((h=o.scrollbarX)==null?void 0:h.offsetHeight)||0;o.onCornerHeightChange(f),l(f)}),fe(o.scrollbarY,()=>{var h;const f=((h=o.scrollbarY)==null?void 0:h.offsetWidth)||0;o.onCornerWidthChange(f),i(f)}),d?c.jsx(j.div,{...n,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ae(e){return e?parseInt(e,10):0}function Xt(e,t){const r=e/t;return isNaN(r)?0:r}function Oe(e){const t=Xt(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function _n(e,t,r,n="ltr"){const o=Oe(r),s=o/2,i=t||s,a=o-i,l=r.scrollbar.paddingStart+i,d=r.scrollbar.size-r.scrollbar.paddingEnd-a,f=r.content-r.viewport,h=n==="ltr"?[0,f]:[f*-1,0];return qt([l,d],h)(e)}function Ut(e,t,r="ltr"){const n=Oe(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-n,l=r==="ltr"?[0,i]:[i*-1,0],d=Cn(e,l);return qt([0,i],[0,a])(d)}function qt(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Jt(e,t){return e>0&&e<t}var kn=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=r.left!==s.left,a=r.top!==s.top;(i||a)&&t(),r=s,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function De(e,t){const r=G(e),n=u.useRef(0);return u.useEffect(()=>()=>window.clearTimeout(n.current),[]),u.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function fe(e,t){const r=G(t);ie(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var Gt=zt,Mn=Wt,In=Yt;const Kt=u.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Gt,{ref:n,className:V("relative overflow-hidden",e),...r,children:[c.jsx(Mn,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(Zt,{}),c.jsx(In,{})]}));Kt.displayName=Gt.displayName;const Zt=u.forwardRef(({className:e,orientation:t="vertical",...r},n)=>c.jsx(Ge,{ref:n,orientation:t,className:V("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:c.jsx(jt,{className:"relative flex-1 rounded-full bg-border"})}));Zt.displayName=Ge.displayName;function $n(e,t=globalThis==null?void 0:globalThis.document){const r=G(e);u.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Fn="DismissableLayer",Qe="dismissableLayer.update",zn="dismissableLayer.pointerDownOutside",Hn="dismissableLayer.focusOutside",Qt,er=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tr=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,d=u.useContext(er),[f,h]=u.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=u.useState({}),v=X(t,P=>h(P)),y=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=y.indexOf(x),E=f?y.indexOf(f):-1,N=d.layersWithOutsidePointerEventsDisabled.size>0,C=E>=S,T=Vn(P=>{const b=P.target,w=[...d.branches].some(m=>m.contains(b));!C||w||(o==null||o(P),i==null||i(P),P.defaultPrevented||a==null||a())},p),O=Rn(P=>{const b=P.target;[...d.branches].some(m=>m.contains(b))||(s==null||s(P),i==null||i(P),P.defaultPrevented||a==null||a())},p);return $n(P=>{E===d.layers.size-1&&(n==null||n(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},p),u.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Qt=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),rr(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Qt)}},[f,p,r,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),rr())},[f,d]),u.useEffect(()=>{const P=()=>g({});return document.addEventListener(Qe,P),()=>document.removeEventListener(Qe,P)},[]),c.jsx(j.div,{...l,ref:v,style:{pointerEvents:N?C?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,O.onFocusCapture),onBlurCapture:H(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,T.onPointerDownCapture)})});tr.displayName=Fn;var Wn="DismissableLayerBranch",Bn=u.forwardRef((e,t)=>{const r=u.useContext(er),n=u.useRef(null),o=X(t,n);return u.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),c.jsx(j.div,{...e,ref:o})});Bn.displayName=Wn;function Vn(e,t=globalThis==null?void 0:globalThis.document){const r=G(e),n=u.useRef(!1),o=u.useRef(()=>{});return u.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){nr(zn,r,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Rn(e,t=globalThis==null?void 0:globalThis.document){const r=G(e),n=u.useRef(!1);return u.useEffect(()=>{const o=s=>{s.target&&!n.current&&nr(Hn,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function rr(){const e=new CustomEvent(Qe);document.dispatchEvent(e)}function nr(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?cn(o,s):o.dispatchEvent(s)}var jn=u[" useId ".trim().toString()]||(()=>{}),Yn=0;function Xn(e){const[t,r]=u.useState(jn());return ie(()=>{r(n=>n??String(Yn++))},[e]),t?`radix-${t}`:""}const Un=["top","right","bottom","left"],ae=Math.min,U=Math.max,Le=Math.round,_e=Math.floor,ee=e=>({x:e,y:e}),qn={left:"right",right:"left",bottom:"top",top:"bottom"},Jn={start:"end",end:"start"};function et(e,t,r){return U(e,ae(t,r))}function oe(e,t){return typeof e=="function"?e(t):e}function se(e){return e.split("-")[0]}function ue(e){return e.split("-")[1]}function tt(e){return e==="x"?"y":"x"}function rt(e){return e==="y"?"height":"width"}const Gn=new Set(["top","bottom"]);function te(e){return Gn.has(se(e))?"y":"x"}function nt(e){return tt(te(e))}function Kn(e,t,r){r===void 0&&(r=!1);const n=ue(e),o=nt(e),s=rt(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ke(i)),[i,ke(i)]}function Zn(e){const t=ke(e);return[ot(e),t,ot(t)]}function ot(e){return e.replace(/start|end/g,t=>Jn[t])}const or=["left","right"],sr=["right","left"],Qn=["top","bottom"],eo=["bottom","top"];function to(e,t,r){switch(e){case"top":case"bottom":return r?t?sr:or:t?or:sr;case"left":case"right":return t?Qn:eo;default:return[]}}function ro(e,t,r,n){const o=ue(e);let s=to(se(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ot)))),s}function ke(e){return e.replace(/left|right|bottom|top/g,t=>qn[t])}function no(e){return{top:0,right:0,bottom:0,left:0,...e}}function ir(e){return typeof e!="number"?no(e):{top:e,right:e,bottom:e,left:e}}function Me(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ar(e,t,r){let{reference:n,floating:o}=e;const s=te(t),i=nt(t),a=rt(i),l=se(t),d=s==="y",f=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,p=n[a]/2-o[a]/2;let g;switch(l){case"top":g={x:f,y:n.y-o.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:h};break;case"left":g={x:n.x-o.width,y:h};break;default:g={x:n.x,y:n.y}}switch(ue(t)){case"start":g[i]-=p*(r&&d?-1:1);break;case"end":g[i]+=p*(r&&d?-1:1);break}return g}const oo=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=ar(d,n,l),p=n,g={},v=0;for(let y=0;y<a.length;y++){const{name:x,fn:S}=a[y],{x:E,y:N,data:C,reset:T}=await S({x:f,y:h,initialPlacement:n,placement:p,strategy:o,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});f=E??f,h=N??h,g={...g,[x]:{...g[x],...C}},T&&v<=50&&(v++,typeof T=="object"&&(T.placement&&(p=T.placement),T.rects&&(d=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:f,y:h}=ar(d,p,l)),y=-1)}return{x:f,y:h,placement:p,strategy:o,middlewareData:g}};async function be(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:p=!1,padding:g=0}=oe(t,e),v=ir(g),x=a[p?h==="floating"?"reference":"floating":h],S=Me(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:d,rootBoundary:f,strategy:l})),E=h==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(N))?await(s.getScale==null?void 0:s.getScale(N))||{x:1,y:1}:{x:1,y:1},T=Me(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:N,strategy:l}):E);return{top:(S.top-T.top+v.top)/C.y,bottom:(T.bottom-S.bottom+v.bottom)/C.y,left:(S.left-T.left+v.left)/C.x,right:(T.right-S.right+v.right)/C.x}}const so=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:d,padding:f=0}=oe(e,t)||{};if(d==null)return{};const h=ir(f),p={x:r,y:n},g=nt(o),v=rt(g),y=await i.getDimensions(d),x=g==="y",S=x?"top":"left",E=x?"bottom":"right",N=x?"clientHeight":"clientWidth",C=s.reference[v]+s.reference[g]-p[g]-s.floating[v],T=p[g]-s.reference[g],O=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let P=O?O[N]:0;(!P||!await(i.isElement==null?void 0:i.isElement(O)))&&(P=a.floating[N]||s.floating[v]);const b=C/2-T/2,w=P/2-y[v]/2-1,m=ae(h[S],w),A=ae(h[E],w),k=m,I=P-y[v]-A,F=P/2-y[v]/2+b,W=et(k,F,I),$=!l.arrow&&ue(o)!=null&&F!==W&&s.reference[v]/2-(F<k?m:A)-y[v]/2<0,M=$?F<k?F-k:F-I:0;return{[g]:p[g]+M,data:{[g]:W,centerOffset:F-W-M,...$&&{alignmentOffset:M}},reset:$}}}),io=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...x}=oe(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const S=se(o),E=te(a),N=se(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(d.floating)),T=p||(N||!y?[ke(a)]:Zn(a)),O=v!=="none";!p&&O&&T.push(...ro(a,y,v,C));const P=[a,...T],b=await be(t,x),w=[];let m=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&w.push(b[S]),h){const F=Kn(o,i,C);w.push(b[F[0]],b[F[1]])}if(m=[...m,{placement:o,overflows:w}],!w.every(F=>F<=0)){var A,k;const F=(((A=s.flip)==null?void 0:A.index)||0)+1,W=P[F];if(W&&(!(h==="alignment"?E!==te(W):!1)||m.every(D=>D.overflows[0]>0&&te(D.placement)===E)))return{data:{index:F,overflows:m},reset:{placement:W}};let $=(k=m.filter(M=>M.overflows[0]<=0).sort((M,D)=>M.overflows[1]-D.overflows[1])[0])==null?void 0:k.placement;if(!$)switch(g){case"bestFit":{var I;const M=(I=m.filter(D=>{if(O){const z=te(D.placement);return z===E||z==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(z=>z>0).reduce((z,Y)=>z+Y,0)]).sort((D,z)=>D[1]-z[1])[0])==null?void 0:I[0];M&&($=M);break}case"initialPlacement":$=a;break}if(o!==$)return{reset:{placement:$}}}return{}}}};function lr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cr(e){return Un.some(t=>e[t]>=0)}const ao=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=oe(e,t);switch(n){case"referenceHidden":{const s=await be(t,{...o,elementContext:"reference"}),i=lr(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:cr(i)}}}case"escaped":{const s=await be(t,{...o,altBoundary:!0}),i=lr(s,r.floating);return{data:{escapedOffsets:i,escaped:cr(i)}}}default:return{}}}}},dr=new Set(["left","top"]);async function lo(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=se(r),a=ue(r),l=te(r)==="y",d=dr.has(i)?-1:1,f=s&&l?-1:1,h=oe(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*f,y:p*d}:{x:p*d,y:g*f}}const co=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await lo(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},fo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:x=>{let{x:S,y:E}=x;return{x:S,y:E}}},...l}=oe(e,t),d={x:r,y:n},f=await be(t,l),h=te(se(o)),p=tt(h);let g=d[p],v=d[h];if(s){const x=p==="y"?"top":"left",S=p==="y"?"bottom":"right",E=g+f[x],N=g-f[S];g=et(E,g,N)}if(i){const x=h==="y"?"top":"left",S=h==="y"?"bottom":"right",E=v+f[x],N=v-f[S];v=et(E,v,N)}const y=a.fn({...t,[p]:g,[h]:v});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[p]:s,[h]:i}}}}}},uo=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:d=!0}=oe(e,t),f={x:r,y:n},h=te(o),p=tt(h);let g=f[p],v=f[h];const y=oe(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const N=p==="y"?"height":"width",C=s.reference[p]-s.floating[N]+x.mainAxis,T=s.reference[p]+s.reference[N]-x.mainAxis;g<C?g=C:g>T&&(g=T)}if(d){var S,E;const N=p==="y"?"width":"height",C=dr.has(se(o)),T=s.reference[h]-s.floating[N]+(C&&((S=i.offset)==null?void 0:S[h])||0)+(C?0:x.crossAxis),O=s.reference[h]+s.reference[N]+(C?0:((E=i.offset)==null?void 0:E[h])||0)-(C?x.crossAxis:0);v<T?v=T:v>O&&(v=O)}return{[p]:g,[h]:v}}}},ho=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...d}=oe(e,t),f=await be(t,d),h=se(o),p=ue(o),g=te(o)==="y",{width:v,height:y}=s.floating;let x,S;h==="top"||h==="bottom"?(x=h,S=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(S=h,x=p==="end"?"top":"bottom");const E=y-f.top-f.bottom,N=v-f.left-f.right,C=ae(y-f[x],E),T=ae(v-f[S],N),O=!t.middlewareData.shift;let P=C,b=T;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(b=N),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(P=E),O&&!p){const m=U(f.left,0),A=U(f.right,0),k=U(f.top,0),I=U(f.bottom,0);g?b=v-2*(m!==0||A!==0?m+A:U(f.left,f.right)):P=y-2*(k!==0||I!==0?k+I:U(f.top,f.bottom))}await l({...t,availableWidth:b,availableHeight:P});const w=await i.getDimensions(a.floating);return v!==w.width||y!==w.height?{reset:{rects:!0}}:{}}}};function Ie(){return typeof window<"u"}function he(e){return fr(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function re(e){var t;return(t=(fr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fr(e){return Ie()?e instanceof Node||e instanceof q(e).Node:!1}function K(e){return Ie()?e instanceof Element||e instanceof q(e).Element:!1}function ne(e){return Ie()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function ur(e){return!Ie()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}const po=new Set(["inline","contents"]);function ye(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!po.has(o)}const go=new Set(["table","td","th"]);function mo(e){return go.has(he(e))}const vo=[":popover-open",":modal"];function $e(e){return vo.some(t=>{try{return e.matches(t)}catch{return!1}})}const wo=["transform","translate","scale","rotate","perspective"],bo=["transform","translate","scale","rotate","perspective","filter"],yo=["paint","layout","strict","content"];function st(e){const t=it(),r=K(e)?Z(e):e;return wo.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||bo.some(n=>(r.willChange||"").includes(n))||yo.some(n=>(r.contain||"").includes(n))}function xo(e){let t=le(e);for(;ne(t)&&!pe(t);){if(st(t))return t;if($e(t))return null;t=le(t)}return null}function it(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Co=new Set(["html","body","#document"]);function pe(e){return Co.has(he(e))}function Z(e){return q(e).getComputedStyle(e)}function Fe(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function le(e){if(he(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ur(e)&&e.host||re(e);return ur(t)?t.host:t}function hr(e){const t=le(e);return pe(t)?e.ownerDocument?e.ownerDocument.body:e.body:ne(t)&&ye(t)?t:hr(t)}function xe(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=hr(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=q(o);if(s){const a=at(i);return t.concat(i,i.visualViewport||[],ye(o)?o:[],a&&r?xe(a):[])}return t.concat(o,xe(o,[],r))}function at(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pr(e){const t=Z(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=ne(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,a=Le(r)!==s||Le(n)!==i;return a&&(r=s,n=i),{width:r,height:n,$:a}}function lt(e){return K(e)?e:e.contextElement}function ge(e){const t=lt(e);if(!ne(t))return ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=pr(t);let i=(s?Le(r.width):r.width)/n,a=(s?Le(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const So=ee(0);function gr(e){const t=q(e);return!it()||!t.visualViewport?So:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function To(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==q(e)?!1:t}function ce(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=lt(e);let i=ee(1);t&&(n?K(n)&&(i=ge(n)):i=ge(e));const a=To(s,r,n)?gr(s):ee(0);let l=(o.left+a.x)/i.x,d=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s){const p=q(s),g=n&&K(n)?q(n):n;let v=p,y=at(v);for(;y&&n&&g!==v;){const x=ge(y),S=y.getBoundingClientRect(),E=Z(y),N=S.left+(y.clientLeft+parseFloat(E.paddingLeft))*x.x,C=S.top+(y.clientTop+parseFloat(E.paddingTop))*x.y;l*=x.x,d*=x.y,f*=x.x,h*=x.y,l+=N,d+=C,v=q(y),y=at(v)}}return Me({width:f,height:h,x:l,y:d})}function ct(e,t){const r=Fe(e).scrollLeft;return t?t.left+r:ce(re(e)).left+r}function mr(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:ct(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function Eo(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=re(n),a=t?$e(t.floating):!1;if(n===i||a&&s)return r;let l={scrollLeft:0,scrollTop:0},d=ee(1);const f=ee(0),h=ne(n);if((h||!h&&!s)&&((he(n)!=="body"||ye(i))&&(l=Fe(n)),ne(n))){const g=ce(n);d=ge(n),f.x=g.x+n.clientLeft,f.y=g.y+n.clientTop}const p=i&&!h&&!s?mr(i,l,!0):ee(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-l.scrollLeft*d.x+f.x+p.x,y:r.y*d.y-l.scrollTop*d.y+f.y+p.y}}function Po(e){return Array.from(e.getClientRects())}function No(e){const t=re(e),r=Fe(e),n=e.ownerDocument.body,o=U(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=U(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+ct(e);const a=-r.scrollTop;return Z(n).direction==="rtl"&&(i+=U(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Ao(e,t){const r=q(e),n=re(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const d=it();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}const Oo=new Set(["absolute","fixed"]);function Do(e,t){const r=ce(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=ne(e)?ge(e):ee(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,d=n*s.y;return{width:i,height:a,x:l,y:d}}function vr(e,t,r){let n;if(t==="viewport")n=Ao(e,r);else if(t==="document")n=No(re(e));else if(K(t))n=Do(t,r);else{const o=gr(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Me(n)}function wr(e,t){const r=le(e);return r===t||!K(r)||pe(r)?!1:Z(r).position==="fixed"||wr(r,t)}function Lo(e,t){const r=t.get(e);if(r)return r;let n=xe(e,[],!1).filter(a=>K(a)&&he(a)!=="body"),o=null;const s=Z(e).position==="fixed";let i=s?le(e):e;for(;K(i)&&!pe(i);){const a=Z(i),l=st(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&Oo.has(o.position)||ye(i)&&!l&&wr(e,i))?n=n.filter(f=>f!==i):o=a,i=le(i)}return t.set(e,n),n}function _o(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?$e(t)?[]:Lo(t,this._c):[].concat(r),n],a=i[0],l=i.reduce((d,f)=>{const h=vr(t,f,o);return d.top=U(h.top,d.top),d.right=ae(h.right,d.right),d.bottom=ae(h.bottom,d.bottom),d.left=U(h.left,d.left),d},vr(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ko(e){const{width:t,height:r}=pr(e);return{width:t,height:r}}function Mo(e,t,r){const n=ne(t),o=re(t),s=r==="fixed",i=ce(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ee(0);function d(){l.x=ct(o)}if(n||!n&&!s)if((he(t)!=="body"||ye(o))&&(a=Fe(t)),n){const g=ce(t,!0,s,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&d();s&&!n&&o&&d();const f=o&&!n&&!s?mr(o,a):ee(0),h=i.left+a.scrollLeft-l.x-f.x,p=i.top+a.scrollTop-l.y-f.y;return{x:h,y:p,width:i.width,height:i.height}}function dt(e){return Z(e).position==="static"}function br(e,t){if(!ne(e)||Z(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return re(e)===r&&(r=r.ownerDocument.body),r}function yr(e,t){const r=q(e);if($e(e))return r;if(!ne(e)){let o=le(e);for(;o&&!pe(o);){if(K(o)&&!dt(o))return o;o=le(o)}return r}let n=br(e,t);for(;n&&mo(n)&&dt(n);)n=br(n,t);return n&&pe(n)&&dt(n)&&!st(n)?r:n||xo(e)||r}const Io=async function(e){const t=this.getOffsetParent||yr,r=this.getDimensions,n=await r(e.floating);return{reference:Mo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function $o(e){return Z(e).direction==="rtl"}const Fo={convertOffsetParentRelativeRectToViewportRelativeRect:Eo,getDocumentElement:re,getClippingRect:_o,getOffsetParent:yr,getElementRects:Io,getClientRects:Po,getDimensions:ko,getScale:ge,isElement:K,isRTL:$o};function xr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zo(e,t){let r=null,n;const o=re(e);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const d=e.getBoundingClientRect(),{left:f,top:h,width:p,height:g}=d;if(a||t(),!p||!g)return;const v=_e(h),y=_e(o.clientWidth-(f+p)),x=_e(o.clientHeight-(h+g)),S=_e(f),N={rootMargin:-v+"px "+-y+"px "+-x+"px "+-S+"px",threshold:U(0,ae(1,l))||1};let C=!0;function T(O){const P=O[0].intersectionRatio;if(P!==l){if(!C)return i();P?i(!1,P):n=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!xr(d,e.getBoundingClientRect())&&i(),C=!1}try{r=new IntersectionObserver(T,{...N,root:o.ownerDocument})}catch{r=new IntersectionObserver(T,N)}r.observe(e)}return i(!0),s}function Ho(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,d=lt(e),f=o||s?[...d?xe(d):[],...xe(t)]:[];f.forEach(S=>{o&&S.addEventListener("scroll",r,{passive:!0}),s&&S.addEventListener("resize",r)});const h=d&&a?zo(d,r):null;let p=-1,g=null;i&&(g=new ResizeObserver(S=>{let[E]=S;E&&E.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var N;(N=g)==null||N.observe(t)})),r()}),d&&!l&&g.observe(d),g.observe(t));let v,y=l?ce(e):null;l&&x();function x(){const S=ce(e);y&&!xr(y,S)&&r(),y=S,v=requestAnimationFrame(x)}return r(),()=>{var S;f.forEach(E=>{o&&E.removeEventListener("scroll",r),s&&E.removeEventListener("resize",r)}),h==null||h(),(S=g)==null||S.disconnect(),g=null,l&&cancelAnimationFrame(v)}}const Wo=co,Bo=fo,Vo=io,Ro=ho,jo=ao,Cr=so,Yo=uo,Xo=(e,t,r)=>{const n=new Map,o={platform:Fo,...r},s={...o.platform,_c:n};return oo(e,t,{...o,platform:s})};var Uo=typeof document<"u",qo=function(){},ze=Uo?_.useLayoutEffect:qo;function He(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!He(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!He(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Sr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Tr(e,t){const r=Sr(e);return Math.round(t*r)/r}function ft(e){const t=u.useRef(e);return ze(()=>{t.current=e}),t}function Jo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:d}=e,[f,h]=u.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=u.useState(n);He(p,n)||g(n);const[v,y]=u.useState(null),[x,S]=u.useState(null),E=u.useCallback(D=>{D!==O.current&&(O.current=D,y(D))},[]),N=u.useCallback(D=>{D!==P.current&&(P.current=D,S(D))},[]),C=s||v,T=i||x,O=u.useRef(null),P=u.useRef(null),b=u.useRef(f),w=l!=null,m=ft(l),A=ft(o),k=ft(d),I=u.useCallback(()=>{if(!O.current||!P.current)return;const D={placement:t,strategy:r,middleware:p};A.current&&(D.platform=A.current),Xo(O.current,P.current,D).then(z=>{const Y={...z,isPositioned:k.current!==!1};F.current&&!He(b.current,Y)&&(b.current=Y,bt.flushSync(()=>{h(Y)}))})},[p,t,r,A,k]);ze(()=>{d===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,h(D=>({...D,isPositioned:!1})))},[d]);const F=u.useRef(!1);ze(()=>(F.current=!0,()=>{F.current=!1}),[]),ze(()=>{if(C&&(O.current=C),T&&(P.current=T),C&&T){if(m.current)return m.current(C,T,I);I()}},[C,T,I,m,w]);const W=u.useMemo(()=>({reference:O,floating:P,setReference:E,setFloating:N}),[E,N]),$=u.useMemo(()=>({reference:C,floating:T}),[C,T]),M=u.useMemo(()=>{const D={position:r,left:0,top:0};if(!$.floating)return D;const z=Tr($.floating,f.x),Y=Tr($.floating,f.y);return a?{...D,transform:"translate("+z+"px, "+Y+"px)",...Sr($.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:z,top:Y}},[r,a,$.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:I,refs:W,elements:$,floatingStyles:M}),[f,I,W,$,M])}const Go=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Cr({element:n.current,padding:o}).fn(r):{}:n?Cr({element:n,padding:o}).fn(r):{}}}},Ko=(e,t)=>({...Wo(e),options:[e,t]}),Zo=(e,t)=>({...Bo(e),options:[e,t]}),Qo=(e,t)=>({...Yo(e),options:[e,t]}),es=(e,t)=>({...Vo(e),options:[e,t]}),ts=(e,t)=>({...Ro(e),options:[e,t]}),rs=(e,t)=>({...jo(e),options:[e,t]}),ns=(e,t)=>({...Go(e),options:[e,t]});var os="Arrow",Er=u.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return c.jsx(j.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Er.displayName=os;var ss=Er;function is(e){const[t,r]=u.useState(void 0);return ie(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,d=Array.isArray(l)?l[0]:l;i=d.inlineSize,a=d.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var ut="Popper",[Pr,Nr]=qe(ut),[as,Ar]=Pr(ut),Or=e=>{const{__scopePopper:t,children:r}=e,[n,o]=u.useState(null);return c.jsx(as,{scope:t,anchor:n,onAnchorChange:o,children:r})};Or.displayName=ut;var Dr="PopperAnchor",Lr=u.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Ar(Dr,r),i=u.useRef(null),a=X(t,i);return u.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:c.jsx(j.div,{...o,ref:a})});Lr.displayName=Dr;var ht="PopperContent",[ls,cs]=Pr(ht),_r=u.forwardRef((e,t)=>{var Xr,Ur,qr,Jr,Gr,Kr;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:v,...y}=e,x=Ar(ht,r),[S,E]=u.useState(null),N=X(t,Se=>E(Se)),[C,T]=u.useState(null),O=is(C),P=(O==null?void 0:O.width)??0,b=(O==null?void 0:O.height)??0,w=n+(s!=="center"?"-"+s:""),m=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],k=A.length>0,I={padding:m,boundary:A.filter(fs),altBoundary:k},{refs:F,floatingStyles:W,placement:$,isPositioned:M,middlewareData:D}=Jo({strategy:"fixed",placement:w,whileElementsMounted:(...Se)=>Ho(...Se,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[Ko({mainAxis:o+b,alignmentAxis:i}),l&&Zo({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Qo():void 0,...I}),l&&es({...I}),ts({...I,apply:({elements:Se,rects:Zr,availableWidth:Zs,availableHeight:Qs})=>{const{width:ei,height:ti}=Zr.reference,je=Se.floating.style;je.setProperty("--radix-popper-available-width",`${Zs}px`),je.setProperty("--radix-popper-available-height",`${Qs}px`),je.setProperty("--radix-popper-anchor-width",`${ei}px`),je.setProperty("--radix-popper-anchor-height",`${ti}px`)}}),C&&ns({element:C,padding:a}),us({arrowWidth:P,arrowHeight:b}),p&&rs({strategy:"referenceHidden",...I})]}),[z,Y]=Ir($),Re=G(v);ie(()=>{M&&(Re==null||Re())},[M,Re]);const Us=(Xr=D.arrow)==null?void 0:Xr.x,qs=(Ur=D.arrow)==null?void 0:Ur.y,Js=((qr=D.arrow)==null?void 0:qr.centerOffset)!==0,[Gs,Ks]=u.useState();return ie(()=>{S&&Ks(window.getComputedStyle(S).zIndex)},[S]),c.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:M?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Gs,"--radix-popper-transform-origin":[(Jr=D.transformOrigin)==null?void 0:Jr.x,(Gr=D.transformOrigin)==null?void 0:Gr.y].join(" "),...((Kr=D.hide)==null?void 0:Kr.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(ls,{scope:r,placedSide:z,onArrowChange:T,arrowX:Us,arrowY:qs,shouldHideArrow:Js,children:c.jsx(j.div,{"data-side":z,"data-align":Y,...y,ref:N,style:{...y.style,animation:M?void 0:"none"}})})})});_r.displayName=ht;var kr="PopperArrow",ds={top:"bottom",right:"left",bottom:"top",left:"right"},Mr=u.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=cs(kr,n),i=ds[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(ss,{...o,ref:r,style:{...o.style,display:"block"}})})});Mr.displayName=kr;function fs(e){return e!==null}var us=e=>({name:"transformOrigin",options:e,fn(t){var x,S,E;const{placement:r,rects:n,middlewareData:o}=t,i=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[d,f]=Ir(r),h={start:"0%",center:"50%",end:"100%"}[f],p=(((S=o.arrow)==null?void 0:S.x)??0)+a/2,g=(((E=o.arrow)==null?void 0:E.y)??0)+l/2;let v="",y="";return d==="bottom"?(v=i?h:`${p}px`,y=`${-l}px`):d==="top"?(v=i?h:`${p}px`,y=`${n.floating.height+l}px`):d==="right"?(v=`${-l}px`,y=i?h:`${g}px`):d==="left"&&(v=`${n.floating.width+l}px`,y=i?h:`${g}px`),{data:{x:v,y}}}});function Ir(e){const[t,r="center"]=e.split("-");return[t,r]}var hs=Or,ps=Lr,gs=_r,ms=Mr,vs=u[" useInsertionEffect ".trim().toString()]||ie;function ws({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=bs({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const h=f.current;h!==a&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,n])}const d=u.useCallback(f=>{var h;if(a){const p=ys(f)?f(e):f;p!==e&&((h=i.current)==null||h.call(i,p))}else s(f)},[a,e,s,i]);return[l,d]}function bs({defaultProp:e,onChange:t}){const[r,n]=u.useState(e),o=u.useRef(r),s=u.useRef(t);return vs(()=>{s.current=t},[t]),u.useEffect(()=>{var i;o.current!==r&&((i=s.current)==null||i.call(s,r),o.current=r)},[r,o]),[r,n,s]}function ys(e){return typeof e=="function"}var xs=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Cs="VisuallyHidden",$r=u.forwardRef((e,t)=>c.jsx(j.span,{...e,ref:t,style:{...xs,...e.style}}));$r.displayName=Cs;var Ss=$r,[We,ni]=qe("Tooltip",[Nr]),Be=Nr(),Fr="TooltipProvider",Ts=700,pt="tooltip.open",[Es,gt]=We(Fr),zr=e=>{const{__scopeTooltip:t,delayDuration:r=Ts,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,i=u.useRef(!0),a=u.useRef(!1),l=u.useRef(0);return u.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),c.jsx(Es,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:u.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:u.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:s})};zr.displayName=Fr;var Ce="Tooltip",[Ps,Ve]=We(Ce),Hr=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=gt(Ce,e.__scopeTooltip),d=Be(t),[f,h]=u.useState(null),p=Xn(),g=u.useRef(0),v=i??l.disableHoverableContent,y=a??l.delayDuration,x=u.useRef(!1),[S,E]=ws({prop:n,defaultProp:o??!1,onChange:P=>{P?(l.onOpen(),document.dispatchEvent(new CustomEvent(pt))):l.onClose(),s==null||s(P)},caller:Ce}),N=u.useMemo(()=>S?x.current?"delayed-open":"instant-open":"closed",[S]),C=u.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,E(!0)},[E]),T=u.useCallback(()=>{window.clearTimeout(g.current),g.current=0,E(!1)},[E]),O=u.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,E(!0),g.current=0},y)},[y,E]);return u.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),c.jsx(hs,{...d,children:c.jsx(Ps,{scope:t,contentId:p,open:S,stateAttribute:N,trigger:f,onTriggerChange:h,onTriggerEnter:u.useCallback(()=>{l.isOpenDelayedRef.current?O():C()},[l.isOpenDelayedRef,O,C]),onTriggerLeave:u.useCallback(()=>{v?T():(window.clearTimeout(g.current),g.current=0)},[T,v]),onOpen:C,onClose:T,disableHoverableContent:v,children:r})})};Hr.displayName=Ce;var mt="TooltipTrigger",Wr=u.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Ve(mt,r),s=gt(mt,r),i=Be(r),a=u.useRef(null),l=X(t,a,o.onTriggerChange),d=u.useRef(!1),f=u.useRef(!1),h=u.useCallback(()=>d.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(ps,{asChild:!0,...i,children:c.jsx(j.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:H(e.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:H(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:H(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:H(e.onBlur,o.onClose),onClick:H(e.onClick,o.onClose)})})});Wr.displayName=mt;var Ns="TooltipPortal",[oi,As]=We(Ns,{forceMount:void 0}),me="TooltipContent",Br=u.forwardRef((e,t)=>{const r=As(me,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...s}=e,i=Ve(me,e.__scopeTooltip);return c.jsx(de,{present:n||i.open,children:i.disableHoverableContent?c.jsx(Vr,{side:o,...s,ref:t}):c.jsx(Os,{side:o,...s,ref:t})})}),Os=u.forwardRef((e,t)=>{const r=Ve(me,e.__scopeTooltip),n=gt(me,e.__scopeTooltip),o=u.useRef(null),s=X(t,o),[i,a]=u.useState(null),{trigger:l,onClose:d}=r,f=o.current,{onPointerInTransitChange:h}=n,p=u.useCallback(()=>{a(null),h(!1)},[h]),g=u.useCallback((v,y)=>{const x=v.currentTarget,S={x:v.clientX,y:v.clientY},E=Ms(S,x.getBoundingClientRect()),N=Is(S,E),C=$s(y.getBoundingClientRect()),T=zs([...N,...C]);a(T),h(!0)},[h]);return u.useEffect(()=>()=>p(),[p]),u.useEffect(()=>{if(l&&f){const v=x=>g(x,f),y=x=>g(x,l);return l.addEventListener("pointerleave",v),f.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",y)}}},[l,f,g,p]),u.useEffect(()=>{if(i){const v=y=>{const x=y.target,S={x:y.clientX,y:y.clientY},E=(l==null?void 0:l.contains(x))||(f==null?void 0:f.contains(x)),N=!Fs(S,i);E?p():N&&(p(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,f,i,d,p]),c.jsx(Vr,{...e,ref:s})}),[Ds,Ls]=We(Ce,{isInside:!1}),_s=Ye.createSlottable("TooltipContent"),Vr=u.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=Ve(me,r),d=Be(r),{onClose:f}=l;return u.useEffect(()=>(document.addEventListener(pt,f),()=>document.removeEventListener(pt,f)),[f]),u.useEffect(()=>{if(l.trigger){const h=p=>{const g=p.target;g!=null&&g.contains(l.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,f]),c.jsx(tr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:c.jsxs(gs,{"data-state":l.stateAttribute,...d,...a,ref:t,style:{...a.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:[c.jsx(_s,{children:n}),c.jsx(Ds,{scope:r,isInside:!0,children:c.jsx(Ss,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Br.displayName=me;var Rr="TooltipArrow",ks=u.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Be(r);return Ls(Rr,r).isInside?null:c.jsx(ms,{...o,...n,ref:t})});ks.displayName=Rr;function Ms(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Is(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function $s(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Fs(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],d=a.x,f=a.y,h=l.x,p=l.y;f>n!=p>n&&r<(h-d)*(n-f)/(p-f)+d&&(o=!o)}return o}function zs(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Hs(t)}function Hs(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],i=r[r.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Ws=zr,Bs=Hr,Vs=Wr,jr=Br;const Rs=Ws,js=Bs,Ys=Vs,Yr=u.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(jr,{ref:n,sideOffset:t,className:V("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Yr.displayName=jr.displayName;const Xs={ChatProvider:Xe,ChatInterface:ve,MessageComponent:Ue,ThreadManager:we,ChatApp:xt,useChat:Te};L.Button=R,L.Card=Ct,L.CardContent=Pt,L.CardDescription=Et,L.CardFooter=Nt,L.CardHeader=St,L.CardTitle=Tt,L.ChatApp=xt,L.ChatInterface=ve,L.ChatProvider=Xe,L.Input=At,L.Label=Lt,L.MessageComponent=Ue,L.ScrollArea=Kt,L.Separator=It,L.Textarea=Ee,L.ThreadManager=we,L.Tooltip=js,L.TooltipContent=Yr,L.TooltipProvider=Rs,L.TooltipTrigger=Ys,L.cn=V,L.default=Xs,L.useChat=Te,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChatProvider, useChat } from '../components/chat/ChatProvider';
|
|
2
|
+
import { ChatInterface } from '../components/chat/ChatInterface';
|
|
3
|
+
import { MessageComponent } from '../components/chat/MessageComponent';
|
|
4
|
+
import { ThreadManager } from '../components/chat/ThreadManager';
|
|
5
|
+
import { ChatApp } from '../components/chat/ChatApp';
|
|
6
|
+
export { ChatProvider, useChat } from '../components/chat/ChatProvider';
|
|
7
|
+
export { ChatInterface } from '../components/chat/ChatInterface';
|
|
8
|
+
export { MessageComponent } from '../components/chat/MessageComponent';
|
|
9
|
+
export { ThreadManager } from '../components/chat/ThreadManager';
|
|
10
|
+
export { ChatApp } from '../components/chat/ChatApp';
|
|
11
|
+
export { Button } from '../components/ui/button';
|
|
12
|
+
export { Textarea } from '../components/ui/textarea';
|
|
13
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '../components/ui/card';
|
|
14
|
+
export { Input } from '../components/ui/input';
|
|
15
|
+
export { Label } from '../components/ui/label';
|
|
16
|
+
export { Separator } from '../components/ui/separator';
|
|
17
|
+
export { ScrollArea } from '../components/ui/scroll-area';
|
|
18
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../components/ui/tooltip';
|
|
19
|
+
export { cn } from '../lib/utils';
|
|
20
|
+
export type { Message, Thread, Branch } from '../components/chat/ChatProvider';
|
|
21
|
+
export * from '../components/chat';
|
|
22
|
+
declare const NewChatUI: {
|
|
23
|
+
ChatProvider: typeof ChatProvider;
|
|
24
|
+
ChatInterface: typeof ChatInterface;
|
|
25
|
+
MessageComponent: typeof MessageComponent;
|
|
26
|
+
ThreadManager: typeof ThreadManager;
|
|
27
|
+
ChatApp: typeof ChatApp;
|
|
28
|
+
useChat: typeof useChat;
|
|
29
|
+
};
|
|
30
|
+
export default NewChatUI;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" fill="none"><rect width="1200" height="1200" fill="#EAEAEA" rx="3"/><g opacity=".5"><g opacity=".5"><path fill="#FAFAFA" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/><path stroke="#C9C9C9" stroke-width="2.418" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/></g><path stroke="url(#a)" stroke-width="2.418" d="M0-1.209h553.581" transform="scale(1 -1) rotate(45 1163.11 91.165)"/><path stroke="url(#b)" stroke-width="2.418" d="M404.846 598.671h391.726"/><path stroke="url(#c)" stroke-width="2.418" d="M599.5 795.742V404.017"/><path stroke="url(#d)" stroke-width="2.418" d="m795.717 796.597-391.441-391.44"/><path fill="#fff" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/><g clip-path="url(#e)"><path fill="#666" fill-rule="evenodd" d="M616.426 586.58h-31.434v16.176l3.553-3.554.531-.531h9.068l.074-.074 8.463-8.463h2.565l7.18 7.181V586.58Zm-15.715 14.654 3.698 3.699 1.283 1.282-2.565 2.565-1.282-1.283-5.2-5.199h-6.066l-5.514 5.514-.073.073v2.876a2.418 2.418 0 0 0 2.418 2.418h26.598a2.418 2.418 0 0 0 2.418-2.418v-8.317l-8.463-8.463-7.181 7.181-.071.072Zm-19.347 5.442v4.085a6.045 6.045 0 0 0 6.046 6.045h26.598a6.044 6.044 0 0 0 6.045-6.045v-7.108l1.356-1.355-1.282-1.283-.074-.073v-17.989h-38.689v23.43l-.146.146.146.147Z" clip-rule="evenodd"/></g><path stroke="#C9C9C9" stroke-width="2.418" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/></g><defs><linearGradient id="a" x1="554.061" x2="-.48" y1=".083" y2=".087" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="b" x1="796.912" x2="404.507" y1="599.963" y2="599.965" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="c" x1="600.792" x2="600.794" y1="403.677" y2="796.082" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="d" x1="404.85" x2="796.972" y1="403.903" y2="796.02" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><clipPath id="e"><path fill="#fff" d="M581.364 580.535h38.689v38.689h-38.689z"/></clipPath></defs></svg>
|
package/dist/robots.txt
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "teodor-new-chat-ui",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "React chat UI components with streaming support, tool calls, and modern design",
|
|
5
|
+
"main": "dist/index.umd.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.esm.js",
|
|
11
|
+
"require": "./dist/index.umd.js",
|
|
12
|
+
"types": "./dist/lib/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"react",
|
|
21
|
+
"chat",
|
|
22
|
+
"ui",
|
|
23
|
+
"components",
|
|
24
|
+
"streaming",
|
|
25
|
+
"typescript",
|
|
26
|
+
"tailwind"
|
|
27
|
+
],
|
|
28
|
+
"author": "Teodor Rustadkvisberg",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/TeodorRusKvi/new-chat-ui.git"
|
|
33
|
+
},
|
|
34
|
+
"private": false,
|
|
35
|
+
"type": "module",
|
|
36
|
+
"scripts": {
|
|
37
|
+
"dev": "vite",
|
|
38
|
+
"build": "npm run build:lib && npm run build:types",
|
|
39
|
+
"build:lib": "vite build --mode library",
|
|
40
|
+
"build:types": "tsc --project tsconfig.build.json",
|
|
41
|
+
"build:dev": "vite build --mode development",
|
|
42
|
+
"lint": "eslint .",
|
|
43
|
+
"preview": "vite preview",
|
|
44
|
+
"prepublishOnly": "npm run build"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@hookform/resolvers": "^3.9.0",
|
|
48
|
+
"@radix-ui/react-accordion": "^1.2.0",
|
|
49
|
+
"@radix-ui/react-alert-dialog": "^1.1.1",
|
|
50
|
+
"@radix-ui/react-aspect-ratio": "^1.1.0",
|
|
51
|
+
"@radix-ui/react-avatar": "^1.1.0",
|
|
52
|
+
"@radix-ui/react-checkbox": "^1.1.1",
|
|
53
|
+
"@radix-ui/react-collapsible": "^1.1.0",
|
|
54
|
+
"@radix-ui/react-context-menu": "^2.2.1",
|
|
55
|
+
"@radix-ui/react-dialog": "^1.1.2",
|
|
56
|
+
"@radix-ui/react-dropdown-menu": "^2.1.1",
|
|
57
|
+
"@radix-ui/react-hover-card": "^1.1.1",
|
|
58
|
+
"@radix-ui/react-label": "^2.1.0",
|
|
59
|
+
"@radix-ui/react-menubar": "^1.1.1",
|
|
60
|
+
"@radix-ui/react-navigation-menu": "^1.2.0",
|
|
61
|
+
"@radix-ui/react-popover": "^1.1.1",
|
|
62
|
+
"@radix-ui/react-progress": "^1.1.0",
|
|
63
|
+
"@radix-ui/react-radio-group": "^1.2.0",
|
|
64
|
+
"@radix-ui/react-scroll-area": "^1.1.0",
|
|
65
|
+
"@radix-ui/react-select": "^2.1.1",
|
|
66
|
+
"@radix-ui/react-separator": "^1.1.0",
|
|
67
|
+
"@radix-ui/react-slider": "^1.2.0",
|
|
68
|
+
"@radix-ui/react-slot": "^1.1.0",
|
|
69
|
+
"@radix-ui/react-switch": "^1.1.0",
|
|
70
|
+
"@radix-ui/react-tabs": "^1.1.0",
|
|
71
|
+
"@radix-ui/react-toast": "^1.2.1",
|
|
72
|
+
"@radix-ui/react-toggle": "^1.1.0",
|
|
73
|
+
"@radix-ui/react-toggle-group": "^1.1.0",
|
|
74
|
+
"@radix-ui/react-tooltip": "^1.1.4",
|
|
75
|
+
"@tanstack/react-query": "^5.56.2",
|
|
76
|
+
"class-variance-authority": "^0.7.1",
|
|
77
|
+
"clsx": "^2.1.1",
|
|
78
|
+
"cmdk": "^1.0.0",
|
|
79
|
+
"date-fns": "^3.6.0",
|
|
80
|
+
"embla-carousel-react": "^8.3.0",
|
|
81
|
+
"input-otp": "^1.2.4",
|
|
82
|
+
"lucide-react": "^0.462.0",
|
|
83
|
+
"next-themes": "^0.4.6",
|
|
84
|
+
"react": "^18.3.1",
|
|
85
|
+
"react-day-picker": "^8.10.1",
|
|
86
|
+
"react-dom": "^18.3.1",
|
|
87
|
+
"react-hook-form": "^7.53.0",
|
|
88
|
+
"react-markdown": "^10.1.0",
|
|
89
|
+
"react-resizable-panels": "^2.1.3",
|
|
90
|
+
"react-router-dom": "^6.26.2",
|
|
91
|
+
"recharts": "^2.12.7",
|
|
92
|
+
"remark-gfm": "^4.0.1",
|
|
93
|
+
"sonner": "^1.5.0",
|
|
94
|
+
"tailwind-merge": "^2.5.2",
|
|
95
|
+
"tailwindcss-animate": "^1.0.7",
|
|
96
|
+
"vaul": "^0.9.3",
|
|
97
|
+
"zod": "^3.23.8"
|
|
98
|
+
},
|
|
99
|
+
"devDependencies": {
|
|
100
|
+
"@eslint/js": "^9.9.0",
|
|
101
|
+
"@tailwindcss/typography": "^0.5.15",
|
|
102
|
+
"@types/node": "^22.5.5",
|
|
103
|
+
"@types/react": "^18.3.3",
|
|
104
|
+
"@types/react-dom": "^18.3.0",
|
|
105
|
+
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
106
|
+
"autoprefixer": "^10.4.20",
|
|
107
|
+
"eslint": "^9.9.0",
|
|
108
|
+
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
109
|
+
"eslint-plugin-react-refresh": "^0.4.9",
|
|
110
|
+
"globals": "^15.9.0",
|
|
111
|
+
"lovable-tagger": "^1.1.7",
|
|
112
|
+
"postcss": "^8.4.47",
|
|
113
|
+
"tailwindcss": "^3.4.11",
|
|
114
|
+
"typescript": "^5.5.3",
|
|
115
|
+
"typescript-eslint": "^8.0.1",
|
|
116
|
+
"vite": "^5.4.1"
|
|
117
|
+
}
|
|
118
|
+
}
|