cortex-react-components 2.18.0 → 2.18.2

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.
Files changed (175) hide show
  1. package/dist/{chunk-3DZFESHK.mjs → chunk-2E7GRMZB.mjs} +1 -1
  2. package/dist/{chunk-CXOVEABI.mjs → chunk-2WP44BWJ.mjs} +1 -1
  3. package/dist/{chunk-3NRXQBBS.mjs → chunk-4BKAUTKL.mjs} +1 -1
  4. package/dist/{chunk-RGOKBIQ5.mjs → chunk-4OROP5TC.mjs} +1 -1
  5. package/dist/{chunk-HHPTGV4F.mjs → chunk-4RET4JGB.mjs} +1 -1
  6. package/dist/{chunk-LHO4WFYP.mjs → chunk-5FWH5YVM.mjs} +1 -1
  7. package/dist/{chunk-WIRQ5IRT.mjs → chunk-5GV4XVLP.mjs} +1 -1
  8. package/dist/{chunk-UECG3SCG.mjs → chunk-5PJLI46T.mjs} +1 -1
  9. package/dist/{chunk-6R6NYDWN.mjs → chunk-5PZT7ZV2.mjs} +1 -1
  10. package/dist/{chunk-3ZQFJ5WD.mjs → chunk-5RKIC5BC.mjs} +1 -1
  11. package/dist/{chunk-EM3T2XYC.mjs → chunk-64ODZI5O.mjs} +1 -1
  12. package/dist/{chunk-GHOL5L32.mjs → chunk-7CY3QPBJ.mjs} +1 -1
  13. package/dist/chunk-7JDMW5R3.mjs +4 -0
  14. package/dist/{chunk-V6GK2FJG.mjs → chunk-CQAMS7RZ.mjs} +1 -1
  15. package/dist/{chunk-3HNU2NYP.mjs → chunk-DAAAZF3S.mjs} +1 -1
  16. package/dist/{chunk-NINFDOV5.mjs → chunk-DEO6EQJR.mjs} +1 -1
  17. package/dist/{chunk-LX3D4J7I.mjs → chunk-DEVPAZSJ.mjs} +1 -1
  18. package/dist/{chunk-ZEALRBXW.mjs → chunk-DOPDVMNN.mjs} +1 -1
  19. package/dist/chunk-ENBMBLW4.mjs +4 -0
  20. package/dist/{chunk-HUYTXZLC.mjs → chunk-GBKD2LF4.mjs} +1 -1
  21. package/dist/{chunk-3Y7QG6VP.mjs → chunk-GYLFNLRD.mjs} +1 -1
  22. package/dist/{chunk-QAJBJFRP.mjs → chunk-HNHUOQGZ.mjs} +1 -1
  23. package/dist/{chunk-TTWEHUP5.mjs → chunk-HPTE7BNH.mjs} +1 -1
  24. package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
  25. package/dist/{chunk-5EQXJS23.mjs → chunk-JK2VAKPT.mjs} +1 -1
  26. package/dist/{chunk-AQQCH7Z2.mjs → chunk-KBEXWUKI.mjs} +1 -1
  27. package/dist/{chunk-L5NPH5RX.mjs → chunk-LLP4EFT4.mjs} +1 -1
  28. package/dist/{chunk-4DR4ILAP.mjs → chunk-LYQOKIQY.mjs} +1 -1
  29. package/dist/{chunk-P7S6XFU4.mjs → chunk-MX3JKY3V.mjs} +1 -1
  30. package/dist/{chunk-GTZJWMZR.mjs → chunk-N6J2WFC4.mjs} +1 -1
  31. package/dist/{chunk-PTJVI53B.mjs → chunk-NN4QIXZ2.mjs} +1 -1
  32. package/dist/{chunk-PWFVXG44.mjs → chunk-O2RJFVGE.mjs} +1 -1
  33. package/dist/{chunk-ZFUP5NVF.mjs → chunk-O5P35LEY.mjs} +1 -1
  34. package/dist/{chunk-KWYJ3XZI.mjs → chunk-ONZ32NDG.mjs} +1 -1
  35. package/dist/{chunk-2BRDNDUB.mjs → chunk-PC2PZNJ6.mjs} +1 -1
  36. package/dist/chunk-QADUAIFH.mjs +1 -0
  37. package/dist/{chunk-75F3LJMX.mjs → chunk-QUOSFCS5.mjs} +1 -1
  38. package/dist/{chunk-D6K6RO5P.mjs → chunk-R5P4ZICA.mjs} +1 -1
  39. package/dist/{chunk-P55W6AFU.mjs → chunk-RIRZRO6U.mjs} +1 -1
  40. package/dist/{chunk-AJQHGVZ5.mjs → chunk-RZM6JZBZ.mjs} +1 -1
  41. package/dist/{chunk-C4RWEPVF.mjs → chunk-SJON62H2.mjs} +1 -1
  42. package/dist/{chunk-WHDV4REI.mjs → chunk-SWEGT5SP.mjs} +1 -1
  43. package/dist/{chunk-RSDUFAIB.mjs → chunk-T5HJS6OF.mjs} +1 -1
  44. package/dist/chunk-UA2E23AS.mjs +4 -0
  45. package/dist/{chunk-X3JZSN3W.mjs → chunk-UZSBX5GO.mjs} +1 -1
  46. package/dist/{chunk-6PS55VJZ.mjs → chunk-VDFRWGXR.mjs} +1 -1
  47. package/dist/{chunk-XGIYNUGC.mjs → chunk-VNYUNZ3M.mjs} +1 -1
  48. package/dist/{chunk-2BR55L74.mjs → chunk-VRE6VCHX.mjs} +1 -1
  49. package/dist/{chunk-7R47MHQE.mjs → chunk-WC7IAORY.mjs} +1 -1
  50. package/dist/{chunk-5NIEZE7A.mjs → chunk-XX4GSGRP.mjs} +1 -1
  51. package/dist/{chunk-RJGYVDOU.mjs → chunk-YTCTK24K.mjs} +1 -1
  52. package/dist/{chunk-FE7ZGUPU.mjs → chunk-ZIZENXBP.mjs} +1 -1
  53. package/dist/{chunk-5MWZTJYP.mjs → chunk-ZKOJRF5P.mjs} +1 -1
  54. package/dist/components/Blocks/Banner.mjs +1 -1
  55. package/dist/components/Blocks/CallToAction.mjs +1 -1
  56. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  57. package/dist/components/Blocks/Content.mjs +1 -1
  58. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  59. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  60. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  61. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  62. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  63. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  64. package/dist/components/Blocks/index.mjs +1 -1
  65. package/dist/components/Cards/ContentCard.mjs +1 -1
  66. package/dist/components/Cards/FeatureCard.mjs +1 -1
  67. package/dist/components/Cards/index.mjs +1 -1
  68. package/dist/components/Chat/ChatInterface.js +1 -1
  69. package/dist/components/Chat/ChatInterface.mjs +1 -1
  70. package/dist/components/Chat/CopilotInterface.js +1 -1
  71. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  72. package/dist/components/Chat/PartTypes/CodeBlock.js +1 -1
  73. package/dist/components/Chat/PartTypes/CodeBlock.mjs +1 -1
  74. package/dist/components/Chat/PartTypes/MessageHandler.js +3 -3
  75. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
  76. package/dist/components/Chat/PartTypes/Tool.js +1 -1
  77. package/dist/components/Chat/PartTypes/Tool.mjs +1 -1
  78. package/dist/components/Chat/PartTypes/index.js +1 -1
  79. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  80. package/dist/components/Chat/demo-long-messages.js +1 -1
  81. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  82. package/dist/components/Chat/demo-tests.js +1 -1
  83. package/dist/components/Chat/demo-tests.mjs +1 -1
  84. package/dist/components/Chat/demo.js +1 -1
  85. package/dist/components/Chat/demo.mjs +1 -1
  86. package/dist/components/Chat/example-usage.js +1 -1
  87. package/dist/components/Chat/example-usage.mjs +1 -1
  88. package/dist/components/Chat/example-with-vercel-ai.js +1 -1
  89. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  90. package/dist/components/Chat/index.js +1 -1
  91. package/dist/components/Chat/index.mjs +1 -1
  92. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  93. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  94. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  95. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  96. package/dist/components/DigitalColleagues/index.mjs +1 -1
  97. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  98. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  99. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  100. package/dist/components/Foundary/MainPage.mjs +1 -1
  101. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  102. package/dist/components/Foundary/RichText/index.mjs +1 -1
  103. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  104. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  105. package/dist/components/Foundary/Views/index.mjs +1 -1
  106. package/dist/components/Foundary/document-edit.mjs +1 -1
  107. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  108. package/dist/components/Foundary/document-preview.mjs +1 -1
  109. package/dist/components/Foundary/index.mjs +1 -1
  110. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  111. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  112. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  113. package/dist/components/HeaderFooter/index.mjs +1 -1
  114. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  115. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  116. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  117. package/dist/components/Heros/PostHero/index.mjs +1 -1
  118. package/dist/components/Heros/RenderHero.mjs +1 -1
  119. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  120. package/dist/components/Heros/index.mjs +1 -1
  121. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  122. package/dist/components/Holidays/index.mjs +1 -1
  123. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  124. package/dist/components/Layouts/Print.mjs +1 -1
  125. package/dist/components/Layouts/SlideShow.mjs +1 -1
  126. package/dist/components/Layouts/index.mjs +1 -1
  127. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  128. package/dist/components/Menus/SidebarRight.mjs +1 -1
  129. package/dist/components/Menus/index.mjs +1 -1
  130. package/dist/components/Other/index.mjs +1 -1
  131. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  132. package/dist/components/Payload/Media/index.mjs +1 -1
  133. package/dist/components/Payload/PayloadCard/index.mjs +1 -1
  134. package/dist/components/Payload/RichText/index.mjs +1 -1
  135. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  136. package/dist/components/Payload/index.mjs +1 -1
  137. package/dist/components/Projects/EpicsView.mjs +1 -1
  138. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  139. package/dist/components/Projects/ProjectPage.mjs +1 -1
  140. package/dist/components/Projects/ProjectView.mjs +1 -1
  141. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  142. package/dist/components/Projects/index.mjs +1 -1
  143. package/dist/components/dc-temp/index.mjs +1 -1
  144. package/dist/components/index.js +1 -1
  145. package/dist/components/index.mjs +1 -1
  146. package/dist/components/ui/index.mjs +1 -1
  147. package/dist/components/ui/sidebar.mjs +1 -1
  148. package/dist/index.js +1 -1
  149. package/dist/index.mjs +1 -1
  150. package/dist/metafile-cjs.json +1 -1
  151. package/dist/metafile-esm.json +1 -1
  152. package/dist/pages/Blog.mjs +1 -1
  153. package/dist/pages/Documentation.mjs +1 -1
  154. package/dist/pages/IndexPage.mjs +1 -1
  155. package/dist/pages/Intranet.mjs +1 -1
  156. package/dist/pages/LandingPage.mjs +1 -1
  157. package/dist/pages/Page.mjs +1 -1
  158. package/dist/pages/Publish.mjs +1 -1
  159. package/dist/pages/Website.mjs +1 -1
  160. package/dist/sections/AboutSection.mjs +1 -1
  161. package/dist/sections/BlogDetail.mjs +1 -1
  162. package/dist/sections/BlogList.mjs +1 -1
  163. package/dist/sections/BlogListSection.mjs +1 -1
  164. package/dist/sections/ContactSection.mjs +1 -1
  165. package/dist/sections/PageSections.mjs +1 -1
  166. package/dist/sections/PricingSection.mjs +1 -1
  167. package/dist/sections/ServiceDetail.mjs +1 -1
  168. package/dist/sections/ServiceDetailSection.mjs +1 -1
  169. package/dist/sections/ServiceSection.mjs +1 -1
  170. package/dist/sections/index.mjs +1 -1
  171. package/package.json +4 -4
  172. package/dist/chunk-7IARWH7M.mjs +0 -4
  173. package/dist/chunk-GXRWKWKJ.mjs +0 -1
  174. package/dist/chunk-UGBDJDPW.mjs +0 -4
  175. package/dist/chunk-ZN7NNMB7.mjs +0 -4
@@ -18,4 +18,4 @@
18
18
  `,children:r?"Processing...":"Deny"}),(0,Bo.jsx)("button",{onClick:w,disabled:r,className:`
19
19
  px-4 py-2 text-white border-none rounded text-sm
20
20
  ${r?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
21
- `,children:"Cancel"})]})]}):null};var va=({toolPart:e,index:t,addToolResult:o})=>{let[a,n]=go.default.useState(!0),[i,r]=go.default.useState(null),s=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),r("approve")},c=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),r("deny")};switch(e.state){case"input-available":return(0,Bo.jsxs)("div",{className:"mb-2",children:[(0,Bo.jsx)(ba,{isOpen:a,onApprove:s,onDeny:c,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Bo.jsxs)(Bo.Fragment,{children:[i==="approve"&&(0,Bo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Bo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Bo.jsx)("svg",{className:"Bo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Bo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Bo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Bo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Bo.jsx)("svg",{className:"Bo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Bo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Bo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var fo=require("@radix-ui/react-use-controllable-state");var nt=V(require("@radix-ui/react-collapsible")),zt=nt.Root,Ut=nt.CollapsibleTrigger,Ft=nt.CollapsibleContent;var ya=require("streamdown"),yt=(0,ct.memo)(({className:e,...t})=>(0,Bo.jsx)(ya.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);yt.displayName="Response";var wa=(0,ct.createContext)(null),ar=()=>{let e=(0,ct.useContext)(wa);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},ir=1e3,rr=1e3,bo=(0,ct.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:n,duration:i,children:r,...s})=>{let[c,m]=(0,fo.useControllableState)({prop:o,defaultProp:a,onChange:n}),[w,f]=(0,fo.useControllableState)({prop:i,defaultProp:0}),[y,R]=(0,ct.useState)(!1),[A,T]=(0,ct.useState)(null);(0,ct.useEffect)(()=>{t?A===null&&T(Date.now()):A!==null&&(f(Math.ceil((Date.now()-A)/rr)),T(null))},[t,A,f]),(0,ct.useEffect)(()=>{if(a&&!t&&c&&!y){let N=setTimeout(()=>{m(!1),R(!0)},ir);return()=>clearTimeout(N)}},[t,c,a,m,y]);let C=N=>{m(N)};return(0,Bo.jsx)(wa.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:m,duration:w},children:(0,Bo.jsx)(zt,{className:l("not-prose mb-4",e),onOpenChange:C,open:c,...s,children:r})})}),nr=(e,t)=>e||t===0?(0,Bo.jsx)("Bo",{children:"Thinking..."}):t===void 0?(0,Bo.jsx)("Bo",{children:"Thought for a few seconds"}):(0,Bo.jsxs)("Bo",{children:["Thought for ",t," seconds"]}),vo=(0,ct.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:n,duration:i}=ar();return(0,Bo.jsx)(Ut,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Bo.jsxs)(Bo.Fragment,{children:[(0,Bo.jsx)(Oa.BrainIcon,{className:"size-4"}),nr(a,i),(0,Bo.jsx)(Oa.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),ho=(0,ct.memo)(({className:e,children:t,...o})=>(0,Bo.jsx)(Ft,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Bo.jsx)(yt,{className:"grid gap-2",children:t})}));bo.displayName="Reasoning";vo.displayName="ReasoningTrigger";ho.displayName="ReasoningContent";var yo=require("react-syntax-highlighter"),Ot=require("react-syntax-highlighter/dist/esm/styles/prism"),sr=(0,ct.createContext)({code:""}),Vt=({code:e,language:t,showLineNumbers:o=!1,className:a,children:n,...i})=>(0,Bo.jsx)(sr.Provider,{value:{code:e},children:(0,Bo.jsx)("div",{className:l("relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,Bo.jsxs)("div",{className:"relative",children:[(0,Bo.jsx)(yo.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Ot.oneLight,children:e}),(0,Bo.jsx)(yo.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Ot.oneDark,children:e}),n&&(0,Bo.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})});var Na=({className:e,...t})=>(0,Bo.jsx)(zt,{className:l("not-prose mb-4 w-full rounded-md border",e),...t}),lr=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Bo.jsxs)(ae,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Bo.jsx)(Oa.CircleIcon,{className:"size-4"}),"input-available":(0,Bo.jsx)(Oa.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Bo.jsx)(Oa.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Bo.jsx)(Oa.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},ka=({className:e,type:t,state:o,...a})=>(0,Bo.jsxs)(Ut,{className:l("flex w-full items-center justify-between gap-4 Bo-3",e),...a,children:[(0,Bo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bo.jsx)(Oa.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Bo.jsx)("span",{className:"font-medium text-sm",children:t}),lr(o)]}),(0,Bo.jsx)(Oa.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Pa=({className:e,...t})=>(0,Bo.jsx)(Ft,{className:l("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Ta=({className:e,input:t,...o})=>(0,Bo.jsxs)("div",{className:l("space-y-2 overflow-hidden Bo-4",e),...o,children:[(0,Bo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Bo.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Bo.jsx)(Vt,{code:JSON.stringify(t,null,2),language:"json"})})]}),Da=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let n=(0,Bo.jsx)("div",{children:t});return typeof t=="object"?n=(0,Bo.jsx)(Vt,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,Bo.jsx)(Vt,{code:t,language:"json"})),(0,Bo.jsxs)("div",{className:l("space-y-2 Bo-4",e),...a,children:[(0,Bo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Bo.jsxs)("div",{className:l("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,Bo.jsx)("div",{children:o}),n]})]})};var Aa=require("date-fns");function Ra({taskId:e,polling:t=!0,system:o="payload"}){let[a,n]=(0,ct.useState)(null),[i,r]=(0,ct.useState)(!1),[s,c]=(0,ct.useState)(null),m=async(f=!0)=>{if(e){f&&r(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let R=await y.json();n(R)}catch(y){console.error("Error fetching task:",y),c(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&r(!1)}}},w=()=>m(!1);return(0,ct.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:a,loading:i,error:s}}var cr=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},dr=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Ma({data:e}){let{id:t,system:o,fetchLatest:a,taskData:n,error:i}=e||{};if(!t)return null;let r=null,s=!0,c=i,m=a!==void 0?a:!0;if(r=n||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:m,taskData:r,error:c}),m){let{task:R,loading:A,error:T}=Ra({taskId:t,system:o});r=R,s=A,c=T}else s=!1;let w=cr(r?.status||"todo"),f=dr(r?.status||"todo"),y=r?.dateLogged||new Date().toISOString();try{let R=new Date(r?.dateLogged||"");isNaN(R.getTime())||(y=(0,Aa.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Bo.jsxs)(ge,{className:l("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Bo.jsxs)(Le,{className:"pb-2",children:[(0,Bo.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Bo.jsx)(Ee,{className:"text-lg font-semibold",children:s?"Loading...":r?.name||"Task"}),(0,Bo.jsx)(ae,{className:`${w}`,children:f})]}),r?.project&&(0,Bo.jsxs)(co,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,Bo.jsx)(Pe,{className:"pb-2",children:s?(0,Bo.jsx)("div",{className:"animate-pulse Bo-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,Bo.jsx)("Bo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Bo.jsx)("Bo",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,Bo.jsx)(ht,{className:"pt-2 flex items-center justify-between",children:(0,Bo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Bo.jsx)(Oa.Clock,{className:"Bo-3 w-3 mr-1"}),(0,Bo.jsxs)("span",{children:["Created ",y]}),(0,Bo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Bo.jsxs)("span",{children:["Task #",t]})]})})]})}function La({artefact:e,taskId:t,taskData:o,loading:a=!1,error:n=null}){let i=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(r=(0,Aa.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Bo.jsxs)(ge,{className:"w-full max-w-md shadow-md",children:[(0,Bo.jsx)(Le,{className:"pb-2",children:(0,Bo.jsx)("div",{className:"flex justify-between items-start",children:(0,Bo.jsx)(Ee,{className:"text-lg font-semibold",children:a?"Loading...":i.name})})}),(0,Bo.jsx)(Pe,{className:"pb-2",children:a?(0,Bo.jsx)("div",{className:"animate-pulse Bo-4 bg-gray-200 rounded w-3/4 mb-2"}):n?(0,Bo.jsx)("Bo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Bo.jsx)("Bo",{className:"text-sm text-foreground",children:e})}),(0,Bo.jsx)(ht,{className:"pt-2 flex items-center justify-between",children:(0,Bo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Bo.jsx)(Oa.Clock,{className:"Bo-3 w-3 mr-1"}),(0,Bo.jsxs)("span",{children:["Created ",r]}),(0,Bo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Bo.jsxs)("span",{children:["Task #",i.id]})]})})]})}var pr=e=>e.startsWith("image/")?(0,Bo.jsx)(Oa.Image,{className:"Bo-4 w-4"}):e.startsWith("text/")?(0,Bo.jsx)(Oa.FileText,{className:"Bo-4 w-4"}):(0,Bo.jsx)(Oa.File,{className:"Bo-4 w-4"}),Ea=({message:e,addToolResult:t,status:o,messages:a})=>e.parts.map((n,i)=>{if(n.type==="text")return(0,Bo.jsx)(yt,{children:n.text},`${i}`);if(n.type==="file"){let r=n;return(0,Bo.jsx)("div",{className:"mb-2 Bo-2 bg-background/50 rounded-lg",children:(0,Bo.jsxs)("div",{className:"flex items-center gap-2",children:[pr(r.mediaType||"application/octet-stream"),(0,Bo.jsx)("div",{className:"flex-1 min-w-0",children:(0,Bo.jsx)("Bo",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,Bo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"Bo-8 w-8 Bo-0",children:(0,Bo.jsx)(Oa.Download,{className:"Bo-4 w-4"})})]})},i)}if(n.type.startsWith("tool-")){let r=n,s=n.type.replace("tool-","");if(s==="task")switch(r.state){case"input-available":return(0,Bo.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(Ma,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},i);case"output-error":return(0,Bo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}if(n.type==="tool-requestEndpointLogin")return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(uo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-authenticate")return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(uo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-requestApproval")return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(va,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(r.state){case"input-available":return(0,Bo.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(La,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},i);case"output-error":return(0,Bo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsxs)(ge,{className:"w-full max-w-md",children:[(0,Bo.jsx)(Le,{children:(0,Bo.jsx)(Ee,{className:"text-lg",children:s})}),(0,Bo.jsxs)(Pe,{children:[r.state==="input-available"&&(0,Bo.jsxs)("Bo",{className:"text-sm",children:["Processing ",s,"..."]}),r.state==="output-available"&&(0,Bo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,Bo.jsxs)("Bo",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},i)}if(n.type.startsWith("data-")){let r=n,s=n.type.replace("data-","");return s==="reference"?(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(ge,{className:"w-full",children:(0,Bo.jsx)(Pe,{className:"Bo-4",children:(0,Bo.jsx)("div",{className:"space-y-2",children:r.data?.references?.map((c,m)=>(0,Bo.jsxs)("div",{className:"flex items-center gap-2 Bo-2 rounded-md bg-muted/50",children:[(0,Bo.jsx)(ae,{variant:"outline",children:c.type||"link"}),(0,Bo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Bo.jsx)("Bo",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Bo.jsx)("Bo",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Bo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"Bo-8 w-8 Bo-0",children:(0,Bo.jsx)(Oa.ExternalLink,{className:"Bo-4 w-4"})})]},m))})})})},i):s==="menu"?(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsxs)(ge,{className:"w-full",children:[(0,Bo.jsx)(Le,{children:(0,Bo.jsx)(Ee,{className:"text-lg",children:r.data?.title})}),(0,Bo.jsx)(Pe,{children:(0,Bo.jsx)("div",{className:"space-y-2",children:r.data?.items?.map((c,m)=>(0,Bo.jsx)(D,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Bo.jsxs)("div",{className:"text-left",children:[(0,Bo.jsx)("Bo",{className:"font-medium",children:c.label}),c.description&&(0,Bo.jsx)("Bo",{className:"text-xs text-muted-foreground",children:c.description})]})},m))})})]})},i):(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsxs)(ge,{className:"w-full max-w-md",children:[(0,Bo.jsx)(Le,{children:(0,Bo.jsx)(Ee,{className:"text-lg",children:s})}),(0,Bo.jsx)(Pe,{children:(0,Bo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},i)}return n.type==="reasoning"?(0,Bo.jsxs)(bo,{className:"w-full",isStreaming:o==="streaming"&&i===e.parts.length-1&&e.id===a.at(-1)?.id,children:[(0,Bo.jsx)(vo,{}),(0,Bo.jsx)(ho,{children:n.text})]},`${i}`):n.type==="dynamic-tool"?(0,Bo.jsxs)(Na,{defaultOpen:!0,children:[(0,Bo.jsx)(ka,{type:`tool-${n.toolName}`,state:n.state}),(0,Bo.jsxs)(Pa,{children:[(0,Bo.jsx)(Ta,{input:n.input}),(0,Bo.jsx)(Da,{output:n.output,errorText:n.errorText})]})]},`${e.id}-${i}`):(0,Bo.jsxs)(Bo.Fragment,{children:["Unknown part type: ",n.type]})});var Ua=({className:e,from:t,...o})=>(0,Bo.jsx)("div",{className:l("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...o}),mr=(0,Io.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),Fa=({children:e,className:t,variant:o,...a})=>(0,Bo.jsx)("div",{className:l(mr({variant:o,className:t})),...a,children:e});function ja({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:n,fileUploads:i,isDragOver:r,enableFileUpload:s,onInputChange:c,addToolResult:m,onSendMessage:w,onKeyPress:f,onFileUpload:y,onRemoveFile:R,onDragOver:A,className:T,status:C="ready"}){let N=(0,ct.useRef)(null),F=(0,ct.useRef)(null),S=(0,ct.useRef)(null),[M,_]=(0,ct.useState)(!1),[$,se]=(0,ct.useState)({path:[],selectedItems:[],filters:{}});(0,ct.useEffect)(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ct.useEffect)(()=>{M&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth"})},100)},[M]);let J=()=>po($),W=()=>{let u=[];return n.forEach(U=>{U.actions&&U.actions.forEach(ve=>{u.push({label:ve.label,action:()=>X(ve.id,{path:[U],selectedItems:[],filters:{}})})}),U.children&&U.children.forEach(ve=>{ve.type==="list"&&ve.data&&u.push({label:`View ${ve.name}`,action:()=>_(!0)})})}),u.slice(0,5)},X=(u,U)=>{console.log("Capability action:",u,U);let ve=`Executing ${u} with context: ${JSON.stringify(U.path.map(Ae=>Ae.name))}`;_(!1)},le=po({path:[],selectedItems:[],filters:{}}),I=u=>{y(u.target.files),u.target.files&&(u.target.value="")},Se=u=>{u.preventDefault(),A(!0)},d=u=>{u.preventDefault(),A(!1)},L=u=>{u.preventDefault(),A(!1),y(u.dataTransfer.files)},E=u=>{if(u===0)return"0 Bytes";let U=1024,ve=["Bytes","KB","MB","GB"],Ae=Math.floor(Math.log(u)/Math.log(U));return parseFloat((u/Math.pow(U,Ae)).toFixed(2))+" "+ve[Ae]},G=u=>u.startsWith("image/")?(0,Bo.jsx)(Oa.Image,{className:"Bo-4 w-4"}):u.startsWith("text/")?(0,Bo.jsx)(Oa.FileText,{className:"Bo-4 w-4"}):(0,Bo.jsx)(Oa.File,{className:"Bo-4 w-4"}),Z={messages:e,currentSessionTitle:a,capabilities:n,currentCapabilityContext:$,contextualActions:le,getQuickSuggestions:W().map(u=>u.label)},be=()=>{navigator.clipboard.writeText(JSON.stringify(Z,null,2)),alert("Debug info copied to clipboard")};return(0,Bo.jsxs)("div",{className:`Bo-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,Bo.jsxs)(Ce,{ref:F,className:"flex-1 Bo-4 bg-background border-0",onDragOver:Se,onDragLeave:d,onDrop:L,children:[(0,Bo.jsxs)("div",{className:l("space-y-4",r&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Bo.jsx)(lt.animate,{children:e.map(u=>(0,Bo.jsx)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,Bo.jsx)(Ua,{from:u.role,children:(0,Bo.jsx)(Fa,{variant:"flat",children:Ea({message:u,addToolResult:m??(()=>{}),status:C,messages:e})})},u.id)},u.id))}),M&&(0,Bo.jsxs)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Bo.jsx)(et,{className:"Bo-8 w-8",children:(0,Bo.jsx)(tt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Bo.jsx)(Oa.Bot,{className:"Bo-4 w-4"})})}),(0,Bo.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Bo.jsx)(ma,{capabilities:n,isOpen:M,onToggle:()=>_(!M),onActionSelect:X,className:"w-full"})})]}),o&&(0,Bo.jsxs)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Bo.jsx)(et,{className:"Bo-8 w-8",children:(0,Bo.jsx)(tt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Bo.jsx)(Oa.Bot,{className:"Bo-4 w-4"})})}),(0,Bo.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Bo.jsxs)("div",{className:"flex space-x-1",children:[(0,Bo.jsx)("div",{className:"w-2 Bo-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Bo.jsx)("div",{className:"w-2 Bo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Bo.jsx)("div",{className:"w-2 Bo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Bo.jsx)("div",{ref:N})]}),i.length>0&&(0,Bo.jsx)("div",{className:"Bo-4 border-t bg-muted/10",children:(0,Bo.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(u=>(0,Bo.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg Bo-2 border",children:[G(u.file.type),(0,Bo.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,Bo.jsx)("span",{className:"text-xs text-muted-foreground",children:E(u.file.size)}),(0,Bo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>R(u.id),className:"Bo-6 w-6 Bo-0",children:(0,Bo.jsx)(Oa.X,{className:"Bo-4 w-4"})})]},u.id))})}),(0,Bo.jsxs)("div",{className:"border rounded-2xl Bo-4 bg-muted/20",children:[(0,Bo.jsxs)("div",{className:"flex gap-3",children:[(0,Bo.jsx)(gt,{value:t,onChange:u=>c(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,Bo.jsx)(D,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl Bo-10 w-10 shadow-sm",children:(0,Bo.jsx)(Oa.Paperclip,{className:"Bo-4 w-4"})}),(0,Bo.jsx)(D,{onClick:w,disabled:!t.trim()&&i.length===0||o,size:"icon",className:"rounded-2xl Bo-10 w-10 shadow-sm",children:(0,Bo.jsx)(Oa.Send,{className:"Bo-4 w-4"})})]}),(0,Bo.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Bo.jsxs)(D,{onClick:()=>_(!M),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Bo.jsx)(Oa.Menu,{className:"Bo-3 w-3 mr-1"}),M?"Hide":"Show"," Capabilities"]}),(0,Bo.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[J().map((u,U)=>(0,Bo.jsx)(D,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>X(u.id,$),children:u.label},`context-${u.id}`)),J().length===0&&W().map((u,U)=>(0,Bo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${U}`)),(0,Bo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:be,children:"Debug"})]})]}),s&&(0,Bo.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:I,className:"hidden"})]})]})}function ur({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:n=[],capabilities:i=[],sidebarItems:r=[],notifications:s=[],sessions:c=[],onNewChat:m,onSessionSelect:w,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:R=()=>{},onNotificationRemove:A=()=>{},onRemoveAll:T=()=>{},onActionClick:C=()=>{},onSearch:N=L=>console.log("Search query:",L),initialTeam:F="design",currentSession:S=null,showCapabilities:M=!0,title:_="Digital Colleagues",enableFileUpload:$=!0,maxFileSize:se=10,allowedFileTypes:J=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:X="Nuvia",tagline:le="AI-Powered Workspace",actionIcon:I=(0,Bo.jsx)(Oa.Users,{className:"mr-2 Bo-4 w-4"}),actionText:Se="Collaborate",sidebarInitiallyClosed:d=!1}){let L={...e,onError:j=>{G?.setMessages(de=>[...de,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:j.message}]}]),console.error("Error in CopilotInterface:",j)}},E=(0,Ha.useChat)(L||{}),G=o?t||E:null,[Z,be]=(0,ct.useState)(""),[u,U]=(0,ct.useState)(!1),ve=G?.messages||a,Ae=Z,Va=G?.status==="submitted"||u,Wa=G?.addToolResult?(j,de,oe)=>{G.addToolResult({tool:de,toolCallId:j,output:oe}),G.sendMessage()}:()=>{},dt=n||[],Ga={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[$a,qa]=(0,ct.useState)(()=>dt.length===0?Ga:dt.find(j=>j.id===F)||dt[0]),[pt,xt]=(0,ct.useState)([]),[Ka,_a]=(0,ct.useState)(!1),Ja=j=>{if(!j||!$)return;let de=[];Array.from(j).forEach(oe=>{if(oe.size>se*1024*1024){alert(`File ${oe.name} is too large. Maximum size is ${se}MB.`);return}if(J.length>0&&!J.some(wt=>oe.type.match(wt))){alert(`File type ${oe.type} is not allowed.`);return}let wo={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:oe,status:"pending",progress:0};if(oe.type.startsWith("image/")){let wt=new FileReader;wt.onload=ei=>{xt(ti=>ti.map($t=>$t.id===wo.id?{...$t,preview:ei.target?.result}:$t))},wt.readAsDataURL(oe)}de.push(wo)}),xt(oe=>[...oe,...de])},Xa=j=>{xt(de=>de.filter(oe=>oe.id!==j))},xo=()=>{if(!(!Ae.trim()&&pt.length===0)){if(G){let j=pt.length>0?Qa(pt.map(de=>de.file)):void 0;G.sendMessage({text:Ae,files:j},{body:{timestamp:Date.now()}}),be("")}else console.log("Message to send:",Ae),console.log("Files to upload:",pt),be(""),U(!0),setTimeout(()=>{U(!1)},1500);xt([])}},Qa=j=>{let de=new DataTransfer;return j.forEach(oe=>de.items.add(oe)),de.files},Ya=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),xo())},Za=j=>{be(j)};return(0,Bo.jsx)(ca,{sidebarItems:r||[],title:_,notifications:s||[],businessUnits:dt,currentBusinessUnit:$a,onBusinessUnitChange:j=>{j&&(qa(j),R?.(j))},onSearch:N,showTabs:!1,onActionClick:C,actionIcon:I,actionText:Se,onNotificationRemove:A,onRemoveAll:T,logo:W,appName:X,tagline:le,sidebarInitiallyClosed:d,children:(0,Bo.jsx)(Gt.AnimatePresence,{mode:"wait",children:(0,Bo.jsx)(Gt.motion.div,{className:"flex-1 Bo-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Bo.jsxs)("div",{className:"Bo-full flex",children:[(0,Bo.jsx)("div",{className:"w-80 flex-shrink-0 Bo-full Bo-2",children:(0,Bo.jsx)(da,{sessions:c||[],currentSession:S,teams:dt,onNewChat:m,onSessionSelect:w,onSessionEdit:y,onSessionDelete:f})}),(0,Bo.jsx)("div",{className:"flex-1 Bo-full Bo-2",children:(0,Bo.jsx)(ja,{messages:ve||[],input:Ae,isTyping:Va,currentSessionTitle:S?.title,capabilities:i||[],onInputChange:Za,addToolResult:Wa,onSendMessage:xo,onKeyPress:Ya,fileUploads:pt,isDragOver:Ka,enableFileUpload:$,onFileUpload:Ja,onRemoveFile:Xa,onDragOver:_a})})]})},"chat-interface")})})}0&&(module.exports={CopilotInterface});
21
+ `,children:"Cancel"})]})]}):null};var va=({toolPart:e,index:t,addToolResult:o})=>{let[a,n]=go.default.useState(!0),[i,r]=go.default.useState(null),s=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),r("approve")},c=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),r("deny")};switch(e.state){case"input-available":return(0,Bo.jsxs)("div",{className:"mb-2",children:[(0,Bo.jsx)(ba,{isOpen:a,onApprove:s,onDeny:c,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Bo.jsxs)(Bo.Fragment,{children:[i==="approve"&&(0,Bo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Bo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Bo.jsx)("svg",{className:"Bo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Bo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Bo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Bo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Bo.jsx)("svg",{className:"Bo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Bo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Bo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var fo=require("@radix-ui/react-use-controllable-state");var nt=V(require("@radix-ui/react-collapsible")),zt=nt.Root,Ut=nt.CollapsibleTrigger,Ft=nt.CollapsibleContent;var ya=require("streamdown"),yt=(0,ct.memo)(({className:e,...t})=>(0,Bo.jsx)(ya.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);yt.displayName="Response";var wa=(0,ct.createContext)(null),ar=()=>{let e=(0,ct.useContext)(wa);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},ir=1e3,rr=1e3,bo=(0,ct.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:n,duration:i,children:r,...s})=>{let[c,m]=(0,fo.useControllableState)({prop:o,defaultProp:a,onChange:n}),[w,f]=(0,fo.useControllableState)({prop:i,defaultProp:0}),[y,R]=(0,ct.useState)(!1),[A,T]=(0,ct.useState)(null);(0,ct.useEffect)(()=>{t?A===null&&T(Date.now()):A!==null&&(f(Math.ceil((Date.now()-A)/rr)),T(null))},[t,A,f]),(0,ct.useEffect)(()=>{if(a&&!t&&c&&!y){let N=setTimeout(()=>{m(!1),R(!0)},ir);return()=>clearTimeout(N)}},[t,c,a,m,y]);let C=N=>{m(N)};return(0,Bo.jsx)(wa.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:m,duration:w},children:(0,Bo.jsx)(zt,{className:l("not-prose mb-4",e),onOpenChange:C,open:c,...s,children:r})})}),nr=(e,t)=>e||t===0?(0,Bo.jsx)("Bo",{children:"Thinking..."}):t===void 0?(0,Bo.jsx)("Bo",{children:"Thought for a few seconds"}):(0,Bo.jsxs)("Bo",{children:["Thought for ",t," seconds"]}),vo=(0,ct.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:n,duration:i}=ar();return(0,Bo.jsx)(Ut,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Bo.jsxs)(Bo.Fragment,{children:[(0,Bo.jsx)(Oa.BrainIcon,{className:"size-4"}),nr(a,i),(0,Bo.jsx)(Oa.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),ho=(0,ct.memo)(({className:e,children:t,...o})=>(0,Bo.jsx)(Ft,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Bo.jsx)(yt,{className:"grid gap-2",children:t})}));bo.displayName="Reasoning";vo.displayName="ReasoningTrigger";ho.displayName="ReasoningContent";var yo=require("react-syntax-highlighter"),Ot=require("react-syntax-highlighter/dist/esm/styles/prism"),sr=(0,ct.createContext)({code:""}),Vt=({code:e,language:t,showLineNumbers:o=!1,className:a,children:n,...i})=>(0,Bo.jsx)(sr.Provider,{value:{code:e},children:(0,Bo.jsx)("div",{className:l("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,Bo.jsxs)("div",{className:"relative",children:[(0,Bo.jsx)(yo.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Ot.oneLight,children:e}),(0,Bo.jsx)(yo.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Ot.oneDark,children:e}),n&&(0,Bo.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})});var Na=({className:e,...t})=>(0,Bo.jsx)(zt,{className:l("not-prose mb-4 w-full",e),...t}),lr=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Bo.jsxs)(ae,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Bo.jsx)(Oa.CircleIcon,{className:"size-4"}),"input-available":(0,Bo.jsx)(Oa.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Bo.jsx)(Oa.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Bo.jsx)(Oa.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},ka=({className:e,type:t,state:o,...a})=>(0,Bo.jsxs)(Ut,{className:l("flex w-full items-center justify-between gap-4 Bo-3 pl-0 w-2xl",e),...a,children:[(0,Bo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bo.jsx)(Oa.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Bo.jsx)("span",{className:"font-medium text-sm",children:t}),lr(o)]}),(0,Bo.jsx)(Oa.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Pa=({className:e,...t})=>(0,Bo.jsx)(Ft,{className:l("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Ta=({className:e,input:t,...o})=>(0,Bo.jsxs)("div",{className:l("space-y-2 overflow-hidden Bo-4",e),...o,children:[(0,Bo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Bo.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Bo.jsx)(Vt,{code:JSON.stringify(t,null,2),language:"json"})})]}),Da=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let n=(0,Bo.jsx)("div",{children:t});return typeof t=="object"?n=(0,Bo.jsx)(Vt,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,Bo.jsx)(Vt,{code:t,language:"json"})),(0,Bo.jsxs)("div",{className:l("space-y-2 Bo-4",e),...a,children:[(0,Bo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Bo.jsxs)("div",{className:l("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,Bo.jsx)("div",{children:o}),n]})]})};var Aa=require("date-fns");function Ra({taskId:e,polling:t=!0,system:o="payload"}){let[a,n]=(0,ct.useState)(null),[i,r]=(0,ct.useState)(!1),[s,c]=(0,ct.useState)(null),m=async(f=!0)=>{if(e){f&&r(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let R=await y.json();n(R)}catch(y){console.error("Error fetching task:",y),c(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&r(!1)}}},w=()=>m(!1);return(0,ct.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:a,loading:i,error:s}}var cr=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},dr=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Ma({data:e}){let{id:t,system:o,fetchLatest:a,taskData:n,error:i}=e||{};if(!t)return null;let r=null,s=!0,c=i,m=a!==void 0?a:!0;if(r=n||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:m,taskData:r,error:c}),m){let{task:R,loading:A,error:T}=Ra({taskId:t,system:o});r=R,s=A,c=T}else s=!1;let w=cr(r?.status||"todo"),f=dr(r?.status||"todo"),y=r?.dateLogged||new Date().toISOString();try{let R=new Date(r?.dateLogged||"");isNaN(R.getTime())||(y=(0,Aa.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Bo.jsxs)(ge,{className:l("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Bo.jsxs)(Le,{className:"pb-2",children:[(0,Bo.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Bo.jsx)(Ee,{className:"text-lg font-semibold",children:s?"Loading...":r?.name||"Task"}),(0,Bo.jsx)(ae,{className:`${w}`,children:f})]}),r?.project&&(0,Bo.jsxs)(co,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,Bo.jsx)(Pe,{className:"pb-2",children:s?(0,Bo.jsx)("div",{className:"animate-pulse Bo-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,Bo.jsx)("Bo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Bo.jsx)("Bo",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,Bo.jsx)(ht,{className:"pt-2 flex items-center justify-between",children:(0,Bo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Bo.jsx)(Oa.Clock,{className:"Bo-3 w-3 mr-1"}),(0,Bo.jsxs)("span",{children:["Created ",y]}),(0,Bo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Bo.jsxs)("span",{children:["Task #",t]})]})})]})}function La({artefact:e,taskId:t,taskData:o,loading:a=!1,error:n=null}){let i=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(r=(0,Aa.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Bo.jsxs)(ge,{className:"w-full max-w-md shadow-md",children:[(0,Bo.jsx)(Le,{className:"pb-2",children:(0,Bo.jsx)("div",{className:"flex justify-between items-start",children:(0,Bo.jsx)(Ee,{className:"text-lg font-semibold",children:a?"Loading...":i.name})})}),(0,Bo.jsx)(Pe,{className:"pb-2",children:a?(0,Bo.jsx)("div",{className:"animate-pulse Bo-4 bg-gray-200 rounded w-3/4 mb-2"}):n?(0,Bo.jsx)("Bo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Bo.jsx)("Bo",{className:"text-sm text-foreground",children:e})}),(0,Bo.jsx)(ht,{className:"pt-2 flex items-center justify-between",children:(0,Bo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Bo.jsx)(Oa.Clock,{className:"Bo-3 w-3 mr-1"}),(0,Bo.jsxs)("span",{children:["Created ",r]}),(0,Bo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Bo.jsxs)("span",{children:["Task #",i.id]})]})})]})}var pr=e=>e.startsWith("image/")?(0,Bo.jsx)(Oa.Image,{className:"Bo-4 w-4"}):e.startsWith("text/")?(0,Bo.jsx)(Oa.FileText,{className:"Bo-4 w-4"}):(0,Bo.jsx)(Oa.File,{className:"Bo-4 w-4"}),Ea=({message:e,addToolResult:t,status:o,messages:a})=>e.parts.map((n,i)=>{if(n.type==="text")return(0,Bo.jsx)(yt,{children:n.text},`${i}`);if(n.type==="file"){let r=n;return(0,Bo.jsx)("div",{className:"mb-2 Bo-2 bg-background/50 rounded-lg",children:(0,Bo.jsxs)("div",{className:"flex items-center gap-2",children:[pr(r.mediaType||"application/octet-stream"),(0,Bo.jsx)("div",{className:"flex-1 min-w-0",children:(0,Bo.jsx)("Bo",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,Bo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"Bo-8 w-8 Bo-0",children:(0,Bo.jsx)(Oa.Download,{className:"Bo-4 w-4"})})]})},i)}if(n.type.startsWith("tool-")){let r=n,s=n.type.replace("tool-","");if(s==="task")switch(r.state){case"input-available":return(0,Bo.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(Ma,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},i);case"output-error":return(0,Bo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}if(n.type==="tool-requestEndpointLogin")return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(uo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-authenticate")return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(uo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-requestApproval")return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(va,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(r.state){case"input-available":return(0,Bo.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(La,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},i);case"output-error":return(0,Bo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}return(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsxs)(ge,{className:"w-full max-w-md",children:[(0,Bo.jsx)(Le,{children:(0,Bo.jsx)(Ee,{className:"text-lg",children:s})}),(0,Bo.jsxs)(Pe,{children:[r.state==="input-available"&&(0,Bo.jsxs)("Bo",{className:"text-sm",children:["Processing ",s,"..."]}),r.state==="output-available"&&(0,Bo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,Bo.jsxs)("Bo",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},i)}if(n.type.startsWith("data-")){let r=n,s=n.type.replace("data-","");return s==="reference"?(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsx)(ge,{className:"w-full",children:(0,Bo.jsx)(Pe,{className:"Bo-4",children:(0,Bo.jsx)("div",{className:"space-y-2",children:r.data?.references?.map((c,m)=>(0,Bo.jsxs)("div",{className:"flex items-center gap-2 Bo-2 rounded-md bg-muted/50",children:[(0,Bo.jsx)(ae,{variant:"outline",children:c.type||"link"}),(0,Bo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Bo.jsx)("Bo",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Bo.jsx)("Bo",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Bo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"Bo-8 w-8 Bo-0",children:(0,Bo.jsx)(Oa.ExternalLink,{className:"Bo-4 w-4"})})]},m))})})})},i):s==="menu"?(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsxs)(ge,{className:"w-full",children:[(0,Bo.jsx)(Le,{children:(0,Bo.jsx)(Ee,{className:"text-lg",children:r.data?.title})}),(0,Bo.jsx)(Pe,{children:(0,Bo.jsx)("div",{className:"space-y-2",children:r.data?.items?.map((c,m)=>(0,Bo.jsx)(D,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Bo.jsxs)("div",{className:"text-left",children:[(0,Bo.jsx)("Bo",{className:"font-medium",children:c.label}),c.description&&(0,Bo.jsx)("Bo",{className:"text-xs text-muted-foreground",children:c.description})]})},m))})})]})},i):(0,Bo.jsx)("div",{className:"mb-2",children:(0,Bo.jsxs)(ge,{className:"w-full max-w-md",children:[(0,Bo.jsx)(Le,{children:(0,Bo.jsx)(Ee,{className:"text-lg",children:s})}),(0,Bo.jsx)(Pe,{children:(0,Bo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},i)}return n.type==="reasoning"?(0,Bo.jsxs)(bo,{className:"w-full",isStreaming:o==="streaming"&&i===e.parts.length-1&&e.id===a.at(-1)?.id,children:[(0,Bo.jsx)(vo,{}),(0,Bo.jsx)(ho,{children:n.text})]},`${i}`):n.type==="dynamic-tool"?(0,Bo.jsxs)(Na,{defaultOpen:n.state!=="output-available",children:[(0,Bo.jsx)(ka,{type:`tool-${n.toolName}`,state:n.state}),(0,Bo.jsxs)(Pa,{children:[(0,Bo.jsx)(Ta,{input:n.input}),(0,Bo.jsx)(Da,{output:n.output,errorText:n.errorText})]})]},`${e.id}-${i}`):(0,Bo.jsxs)(Bo.Fragment,{children:["Unknown part type: ",n.type]})});var Ua=({className:e,from:t,...o})=>(0,Bo.jsx)("div",{className:l("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...o}),mr=(0,Io.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),Fa=({children:e,className:t,variant:o,...a})=>(0,Bo.jsx)("div",{className:l(mr({variant:o,className:t})),...a,children:e});function ja({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:n,fileUploads:i,isDragOver:r,enableFileUpload:s,onInputChange:c,addToolResult:m,onSendMessage:w,onKeyPress:f,onFileUpload:y,onRemoveFile:R,onDragOver:A,className:T,status:C="ready"}){let N=(0,ct.useRef)(null),F=(0,ct.useRef)(null),S=(0,ct.useRef)(null),[M,_]=(0,ct.useState)(!1),[$,se]=(0,ct.useState)({path:[],selectedItems:[],filters:{}});(0,ct.useEffect)(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ct.useEffect)(()=>{M&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth"})},100)},[M]);let J=()=>po($),W=()=>{let u=[];return n.forEach(U=>{U.actions&&U.actions.forEach(ve=>{u.push({label:ve.label,action:()=>X(ve.id,{path:[U],selectedItems:[],filters:{}})})}),U.children&&U.children.forEach(ve=>{ve.type==="list"&&ve.data&&u.push({label:`View ${ve.name}`,action:()=>_(!0)})})}),u.slice(0,5)},X=(u,U)=>{console.log("Capability action:",u,U);let ve=`Executing ${u} with context: ${JSON.stringify(U.path.map(Ae=>Ae.name))}`;_(!1)},le=po({path:[],selectedItems:[],filters:{}}),I=u=>{y(u.target.files),u.target.files&&(u.target.value="")},Se=u=>{u.preventDefault(),A(!0)},d=u=>{u.preventDefault(),A(!1)},L=u=>{u.preventDefault(),A(!1),y(u.dataTransfer.files)},E=u=>{if(u===0)return"0 Bytes";let U=1024,ve=["Bytes","KB","MB","GB"],Ae=Math.floor(Math.log(u)/Math.log(U));return parseFloat((u/Math.pow(U,Ae)).toFixed(2))+" "+ve[Ae]},G=u=>u.startsWith("image/")?(0,Bo.jsx)(Oa.Image,{className:"Bo-4 w-4"}):u.startsWith("text/")?(0,Bo.jsx)(Oa.FileText,{className:"Bo-4 w-4"}):(0,Bo.jsx)(Oa.File,{className:"Bo-4 w-4"}),Z={messages:e,currentSessionTitle:a,capabilities:n,currentCapabilityContext:$,contextualActions:le,getQuickSuggestions:W().map(u=>u.label)},be=()=>{navigator.clipboard.writeText(JSON.stringify(Z,null,2)),alert("Debug info copied to clipboard")};return(0,Bo.jsxs)("div",{className:`Bo-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,Bo.jsxs)(Ce,{ref:F,className:"flex-1 Bo-4 bg-background border-0",onDragOver:Se,onDragLeave:d,onDrop:L,children:[(0,Bo.jsxs)("div",{className:l("space-y-4",r&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Bo.jsx)(lt.animate,{children:e.map(u=>(0,Bo.jsx)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,Bo.jsx)(Ua,{from:u.role,children:(0,Bo.jsx)(Fa,{variant:"flat",children:Ea({message:u,addToolResult:m??(()=>{}),status:C,messages:e})})},u.id)},u.id))}),M&&(0,Bo.jsxs)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Bo.jsx)(et,{className:"Bo-8 w-8",children:(0,Bo.jsx)(tt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Bo.jsx)(Oa.Bot,{className:"Bo-4 w-4"})})}),(0,Bo.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Bo.jsx)(ma,{capabilities:n,isOpen:M,onToggle:()=>_(!M),onActionSelect:X,className:"w-full"})})]}),o&&(0,Bo.jsxs)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Bo.jsx)(et,{className:"Bo-8 w-8",children:(0,Bo.jsx)(tt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Bo.jsx)(Oa.Bot,{className:"Bo-4 w-4"})})}),(0,Bo.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Bo.jsxs)("div",{className:"flex space-x-1",children:[(0,Bo.jsx)("div",{className:"w-2 Bo-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Bo.jsx)("div",{className:"w-2 Bo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Bo.jsx)("div",{className:"w-2 Bo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Bo.jsx)("div",{ref:N})]}),i.length>0&&(0,Bo.jsx)("div",{className:"Bo-4 border-t bg-muted/10",children:(0,Bo.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(u=>(0,Bo.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg Bo-2 border",children:[G(u.file.type),(0,Bo.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,Bo.jsx)("span",{className:"text-xs text-muted-foreground",children:E(u.file.size)}),(0,Bo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>R(u.id),className:"Bo-6 w-6 Bo-0",children:(0,Bo.jsx)(Oa.X,{className:"Bo-4 w-4"})})]},u.id))})}),(0,Bo.jsxs)("div",{className:"border rounded-2xl Bo-4 bg-muted/20",children:[(0,Bo.jsxs)("div",{className:"flex gap-3",children:[(0,Bo.jsx)(gt,{value:t,onChange:u=>c(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,Bo.jsx)(D,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl Bo-10 w-10 shadow-sm",children:(0,Bo.jsx)(Oa.Paperclip,{className:"Bo-4 w-4"})}),(0,Bo.jsx)(D,{onClick:w,disabled:!t.trim()&&i.length===0||o,size:"icon",className:"rounded-2xl Bo-10 w-10 shadow-sm",children:(0,Bo.jsx)(Oa.Send,{className:"Bo-4 w-4"})})]}),(0,Bo.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Bo.jsxs)(D,{onClick:()=>_(!M),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Bo.jsx)(Oa.Menu,{className:"Bo-3 w-3 mr-1"}),M?"Hide":"Show"," Capabilities"]}),(0,Bo.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[J().map((u,U)=>(0,Bo.jsx)(D,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>X(u.id,$),children:u.label},`context-${u.id}`)),J().length===0&&W().map((u,U)=>(0,Bo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${U}`)),(0,Bo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:be,children:"Debug"})]})]}),s&&(0,Bo.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:I,className:"hidden"})]})]})}function ur({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:n=[],capabilities:i=[],sidebarItems:r=[],notifications:s=[],sessions:c=[],onNewChat:m,onSessionSelect:w,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:R=()=>{},onNotificationRemove:A=()=>{},onRemoveAll:T=()=>{},onActionClick:C=()=>{},onSearch:N=L=>console.log("Search query:",L),initialTeam:F="design",currentSession:S=null,showCapabilities:M=!0,title:_="Digital Colleagues",enableFileUpload:$=!0,maxFileSize:se=10,allowedFileTypes:J=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:X="Nuvia",tagline:le="AI-Powered Workspace",actionIcon:I=(0,Bo.jsx)(Oa.Users,{className:"mr-2 Bo-4 w-4"}),actionText:Se="Collaborate",sidebarInitiallyClosed:d=!1}){let L={...e,onError:j=>{G?.setMessages(de=>[...de,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:j.message}]}]),console.error("Error in CopilotInterface:",j)}},E=(0,Ha.useChat)(L||{}),G=o?t||E:null,[Z,be]=(0,ct.useState)(""),[u,U]=(0,ct.useState)(!1),ve=G?.messages||a,Ae=Z,Va=G?.status==="submitted"||u,Wa=G?.addToolResult?(j,de,oe)=>{G.addToolResult({tool:de,toolCallId:j,output:oe}),G.sendMessage()}:()=>{console.log("addToolResult not available")},dt=n||[],Ga={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[$a,qa]=(0,ct.useState)(()=>dt.length===0?Ga:dt.find(j=>j.id===F)||dt[0]),[pt,xt]=(0,ct.useState)([]),[Ka,_a]=(0,ct.useState)(!1),Ja=j=>{if(!j||!$)return;let de=[];Array.from(j).forEach(oe=>{if(oe.size>se*1024*1024){alert(`File ${oe.name} is too large. Maximum size is ${se}MB.`);return}if(J.length>0&&!J.some(wt=>oe.type.match(wt))){alert(`File type ${oe.type} is not allowed.`);return}let wo={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:oe,status:"pending",progress:0};if(oe.type.startsWith("image/")){let wt=new FileReader;wt.onload=ei=>{xt(ti=>ti.map($t=>$t.id===wo.id?{...$t,preview:ei.target?.result}:$t))},wt.readAsDataURL(oe)}de.push(wo)}),xt(oe=>[...oe,...de])},Xa=j=>{xt(de=>de.filter(oe=>oe.id!==j))},xo=()=>{if(!(!Ae.trim()&&pt.length===0)){if(G){let j=pt.length>0?Qa(pt.map(de=>de.file)):void 0;G.sendMessage({text:Ae,files:j},{body:{timestamp:Date.now()}}),be("")}else console.log("Message to send:",Ae),console.log("Files to upload:",pt),be(""),U(!0),setTimeout(()=>{U(!1)},1500);xt([])}},Qa=j=>{let de=new DataTransfer;return j.forEach(oe=>de.items.add(oe)),de.files},Ya=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),xo())},Za=j=>{be(j)};return(0,Bo.jsx)(ca,{sidebarItems:r||[],title:_,notifications:s||[],businessUnits:dt,currentBusinessUnit:$a,onBusinessUnitChange:j=>{j&&(qa(j),R?.(j))},onSearch:N,showTabs:!1,onActionClick:C,actionIcon:I,actionText:Se,onNotificationRemove:A,onRemoveAll:T,logo:W,appName:X,tagline:le,sidebarInitiallyClosed:d,children:(0,Bo.jsx)(Gt.AnimatePresence,{mode:"wait",children:(0,Bo.jsx)(Gt.motion.div,{className:"flex-1 Bo-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Bo.jsxs)("div",{className:"Bo-full flex",children:[(0,Bo.jsx)("div",{className:"w-80 flex-shrink-0 Bo-full Bo-2",children:(0,Bo.jsx)(da,{sessions:c||[],currentSession:S,teams:dt,onNewChat:m,onSessionSelect:w,onSessionEdit:y,onSessionDelete:f})}),(0,Bo.jsx)("div",{className:"flex-1 Bo-full Bo-2",children:(0,Bo.jsx)(ja,{messages:ve||[],input:Ae,isTyping:Va,currentSessionTitle:S?.title,capabilities:i||[],onInputChange:Za,addToolResult:Wa,onSendMessage:xo,onKeyPress:Ya,fileUploads:pt,isDragOver:Ka,enableFileUpload:$,onFileUpload:Ja,onRemoveFile:Xa,onDragOver:_a})})]})},"chat-interface")})})}0&&(module.exports={CopilotInterface});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a}from"../../chunk-7IARWH7M.mjs";import"../../chunk-CTTBF7F4.mjs";import"../../chunk-56X4PU43.mjs";import"../../chunk-LX3D4J7I.mjs";import"../../chunk-GXRWKWKJ.mjs";import"../../chunk-EH3PJU6C.mjs";import"../../chunk-V5VE3EIY.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-5Y6FKL5W.mjs";import"../../chunk-EW6KWAHS.mjs";import"../../chunk-UGBDJDPW.mjs";import"../../chunk-6OT5PQXV.mjs";import"../../chunk-YPZAYXNQ.mjs";import"../../chunk-7TSR2LQB.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-ZN7NNMB7.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-RL6365DN.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-4WA47ZQA.mjs";import"../../chunk-NPVUICIF.mjs";import"../../chunk-VDN4LQSS.mjs";import"../../chunk-FGEFYI5E.mjs";import"../../chunk-MU5WPW4N.mjs";import"../../chunk-AZKOVKSK.mjs";import"../../chunk-Q2DPE66H.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-RLVKIMGU.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-YNCJATT7.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-FLHDNCNY.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as CopilotInterface};
2
+ "use strict";import{a}from"../../chunk-ENBMBLW4.mjs";import"../../chunk-CTTBF7F4.mjs";import"../../chunk-56X4PU43.mjs";import"../../chunk-DEVPAZSJ.mjs";import"../../chunk-QADUAIFH.mjs";import"../../chunk-EH3PJU6C.mjs";import"../../chunk-V5VE3EIY.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-5Y6FKL5W.mjs";import"../../chunk-EW6KWAHS.mjs";import"../../chunk-7JDMW5R3.mjs";import"../../chunk-6OT5PQXV.mjs";import"../../chunk-YPZAYXNQ.mjs";import"../../chunk-7TSR2LQB.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-UA2E23AS.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-RL6365DN.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-4WA47ZQA.mjs";import"../../chunk-NPVUICIF.mjs";import"../../chunk-VDN4LQSS.mjs";import"../../chunk-FGEFYI5E.mjs";import"../../chunk-MU5WPW4N.mjs";import"../../chunk-AZKOVKSK.mjs";import"../../chunk-Q2DPE66H.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-RLVKIMGU.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-YNCJATT7.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-FLHDNCNY.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as CopilotInterface};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- "use strict";"use client";var xe=Object.create;var W=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty;var ze=(e,r)=>{for(var o in r)W(e,o,{get:r[o],enumerable:!0})},ne=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of we(r))!ke.call(e,s)&&s!==o&&W(e,s,{get:()=>r[s],enumerable:!(t=ve(r,s))||t.enumerable});return e};var Se=(e,r,o)=>(o=e!=null?xe(Ce(e)):{},ne(r||!e||!e.__esModule?W(o,"default",{value:e,enumerable:!0}):o,e)),Pe=e=>ne(W({},"__esModule",{value:!0}),e);var ar={};ze(ar,{CodeBlock:()=>sr,CodeBlockCopyButton:()=>ir});module.exports=Pe(ar);var be=require("clsx");var K="-",Me=e=>{let r=Ne(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:t}=e;return{getClassGroupId:l=>{let i=l.split(K);return i[0]===""&&i.length!==1&&i.shift(),ae(i,r)||Ae(l)},getConflictingClassGroupIds:(l,i)=>{let p=o[l]||[];return i&&t[l]?[...p,...t[l]]:p}}},ae=(e,r)=>{if(e.length===0)return r.classGroupId;let o=e[0],t=r.nextPart.get(o),s=t?ae(e.slice(1),t):void 0;if(s)return s;if(r.validators.length===0)return;let n=e.join(K);return r.validators.find(({validator:l})=>l(n))?.classGroupId},se=/^\[(.+)\]$/,Ae=e=>{if(se.test(e)){let r=se.exec(e)[1],o=r?.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}},Ne=e=>{let{theme:r,prefix:o}=e,t={nextPart:new Map,validators:[]};return Te(Object.entries(e.classGroups),o).forEach(([n,l])=>{J(l,t,n,r)}),t},J=(e,r,o,t)=>{e.forEach(s=>{if(typeof s=="string"){let n=s===""?r:ie(r,s);n.classGroupId=o;return}if(typeof s=="function"){if(Re(s)){J(s(t),r,o,t);return}r.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([n,l])=>{J(l,ie(r,n),o,t)})})},ie=(e,r)=>{let o=e;return r.split(K).forEach(t=>{o.nextPart.has(t)||o.nextPart.set(t,{nextPart:new Map,validators:[]}),o=o.nextPart.get(t)}),o},Re=e=>e.isThemeGetter,Te=(e,r)=>r?e.map(([o,t])=>{let s=t.map(n=>typeof n=="string"?r+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,i])=>[r+l,i])):n);return[o,s]}):e,Be=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,o=new Map,t=new Map,s=(n,l)=>{o.set(n,l),r++,r>e&&(r=0,t=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=t.get(n))!==void 0)return s(n,l),l},set(n,l){o.has(n)?o.set(n,l):s(n,l)}}},le="!",Ge=e=>{let{separator:r,experimentalParseClassName:o}=e,t=r.length===1,s=r[0],n=r.length,l=i=>{let p=[],b=0,g=0,h;for(let u=0;u<i.length;u++){let m=i[u];if(b===0){if(m===s&&(t||i.slice(u,u+n)===r)){p.push(i.slice(g,u)),g=u+n;continue}if(m==="/"){h=u;continue}}m==="["?b++:m==="]"&&b--}let x=p.length===0?i:i.substring(g),C=x.startsWith(le),v=C?x.substring(1):x,f=h&&h>g?h-g:void 0;return{modifiers:p,hasImportantModifier:C,baseClassName:v,maybePostfixModifierPosition:f}};return o?i=>o({className:i,parseClassName:l}):l},Ie=e=>{if(e.length<=1)return e;let r=[],o=[];return e.forEach(t=>{t[0]==="["?(r.push(...o.sort(),t),o=[]):o.push(t)}),r.push(...o.sort()),r},Le=e=>({cache:Be(e.cacheSize),parseClassName:Ge(e),...Me(e)}),Ee=/\s+/,Ve=(e,r)=>{let{parseClassName:o,getClassGroupId:t,getConflictingClassGroupIds:s}=r,n=[],l=e.trim().split(Ee),i="";for(let p=l.length-1;p>=0;p-=1){let b=l[p],{modifiers:g,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:C}=o(b),v=!!C,f=t(v?x.substring(0,C):x);if(!f){if(!v){i=b+(i.length>0?" "+i:i);continue}if(f=t(x),!f){i=b+(i.length>0?" "+i:i);continue}v=!1}let u=Ie(g).join(":"),m=h?u+le:u,y=m+f;if(n.includes(y))continue;n.push(y);let B=s(f,v);for(let M=0;M<B.length;++M){let E=B[M];n.push(m+E)}i=b+(i.length>0?" "+i:i)}return i};function je(){let e=0,r,o,t="";for(;e<arguments.length;)(r=arguments[e++])&&(o=ce(r))&&(t&&(t+=" "),t+=o);return t}var ce=e=>{if(typeof e=="string")return e;let r,o="";for(let t=0;t<e.length;t++)e[t]&&(r=ce(e[t]))&&(o&&(o+=" "),o+=r);return o};function We(e,...r){let o,t,s,n=l;function l(p){let b=r.reduce((g,h)=>h(g),e());return o=Le(b),t=o.cache.get,s=o.cache.set,n=i,i(p)}function i(p){let b=t(p);if(b)return b;let g=Ve(p,o);return s(p,g),g}return function(){return n(je.apply(null,arguments))}}var c=e=>{let r=o=>o[e]||[];return r.isThemeGetter=!0,r},de=/^\[(?:([a-z-]+):)?(.+)\]$/i,_e=/^\d+\/\d+$/,He=new Set(["px","full","screen"]),$e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ue=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(he|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Oe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,z=e=>A(e)||He.has(e)||_e.test(e),S=e=>N(e,"length",er),A=e=>!!e&&!Number.isNaN(Number(e)),q=e=>N(e,"number",A),I=e=>!!e&&Number.isInteger(Number(e)),Je=e=>e.endsWith("%")&&A(e.slice(0,-1)),a=e=>de.test(e),P=e=>$e.test(e),Ke=new Set(["length","size","percentage"]),Xe=e=>N(e,Ke,pe),Ze=e=>N(e,"position",pe),Qe=new Set(["image","url"]),Ye=e=>N(e,Qe,or),De=e=>N(e,"",rr),L=()=>!0,N=(e,r,o)=>{let t=de.exec(e);return t?t[1]?typeof r=="string"?t[1]===r:r.has(t[1]):o(t[2]):!1},er=e=>Ue.test(e)&&!Fe.test(e),pe=()=>!1,rr=e=>Oe.test(e),or=e=>qe.test(e);var tr=()=>{let e=c("colors"),r=c("spacing"),o=c("blur"),t=c("brightness"),s=c("borderColor"),n=c("borderRadius"),l=c("borderSpacing"),i=c("borderWidth"),p=c("contrast"),b=c("grayscale"),g=c("hueRotate"),h=c("invert"),x=c("gap"),C=c("gradientColorStops"),v=c("gradientColorStopPositions"),f=c("inset"),u=c("margin"),m=c("opacity"),y=c("padding"),B=c("saturate"),M=c("scale"),E=c("sepia"),Q=c("skew"),Y=c("space"),D=c("translate"),$=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",a,r],d=()=>[a,r],ee=()=>["",z,S],V=()=>["auto",A,a],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",a],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[A,a];return{cacheSize:500,separator:":",theme:{colors:[L],spacing:[z,S],blur:["none","",P,a],brightness:k(),borderColor:[e],borderRadius:["none","","full",P,a],borderSpacing:d(),borderWidth:ee(),contrast:k(),grayscale:G(),hueRotate:k(),invert:G(),gap:d(),gradientColorStops:[e],gradientColorStopPositions:[Je,S],inset:F(),margin:F(),opacity:k(),padding:d(),saturate:k(),scale:k(),sepia:G(),skew:k(),space:d(),translate:d()},classGroups:{aspect:[{aspect:["auto","square","video",a]}],container:["container"],columns:[{columns:[P]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),a]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",I,a]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",a]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",I,a]}],"grid-cols":[{"grid-cols":[L]}],"col-start-end":[{col:["auto",{span:["full",I,a]},a]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[L]}],"row-start-end":[{row:["auto",{span:[I,a]},a]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",a]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",a]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],mt:[{mt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[Y]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Y]}],"space-y-reverse":["space-y-reverse"],he:[{he:["auto","min","max","fit","svw","lvw","dvw",a,r]}],"min-he":[{"min-he":[a,r,"min","max","fit"]}],"max-he":[{"max-he":[a,r,"none","full","min","max","fit","prose",{screen:[P]},P]}],h:[{h:[a,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[a,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[a,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[a,r,"auto","min","max","fit"]}],"font-size":[{text:["base",P,S]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",q]}],"font-family":[{font:[L]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",a]}],"line-clamp":[{"line-clamp":["none",A,q]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",z,a]}],"list-image":[{"list-image":["none",a]}],"list-style-type":[{list:["none","disc","decimal",a]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",z,S]}],"underline-offset":[{"underline-offset":["auto",z,a]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:d()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",a]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",a]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),Ze]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ye]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-he":[{border:[i]}],"border-he-x":[{"border-x":[i]}],"border-he-y":[{"border-y":[i]}],"border-he-s":[{"border-s":[i]}],"border-he-e":[{"border-e":[i]}],"border-he-t":[{"border-t":[i]}],"border-he-r":[{"border-r":[i]}],"border-he-b":[{"border-b":[i]}],"border-he-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:j()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[z,a]}],"outline-he":[{outline:[z,S]}],"outline-color":[{outline:[e]}],"ring-he":[{ring:ee()}],"ring-he-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-he":[{"ring-offset":[z,S]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",P,De]}],"shadow-color":[{shadow:[L]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[t]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",P,a]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[h]}],saturate:[{saturate:[B]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[t]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[B]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",a]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",a]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",a]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[I,a]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[Q]}],"skew-y":[{"skew-y":[Q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",a]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","he-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",a]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":d()}],"scroll-mx":[{"scroll-mx":d()}],"scroll-my":[{"scroll-my":d()}],"scroll-ms":[{"scroll-ms":d()}],"scroll-me":[{"scroll-me":d()}],"scroll-mt":[{"scroll-mt":d()}],"scroll-mr":[{"scroll-mr":d()}],"scroll-mb":[{"scroll-mb":d()}],"scroll-ml":[{"scroll-ml":d()}],"scroll-p":[{"scroll-p":d()}],"scroll-px":[{"scroll-px":d()}],"scroll-py":[{"scroll-py":d()}],"scroll-ps":[{"scroll-ps":d()}],"scroll-pe":[{"scroll-pe":d()}],"scroll-pt":[{"scroll-pt":d()}],"scroll-pr":[{"scroll-pr":d()}],"scroll-pb":[{"scroll-pb":d()}],"scroll-pl":[{"scroll-pl":d()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",a]}],fill:[{fill:[e,"none"]}],"stroke-he":[{stroke:[z,S,q]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["he","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-he":["border-he-s","border-he-e","border-he-t","border-he-r","border-he-b","border-he-l"],"border-he-x":["border-he-r","border-he-l"],"border-he-y":["border-he-t","border-he-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var ue=We(tr);function R(...e){return ue((0,be.clsx)(e))}var ge=require("@radix-ui/react-slot"),fe=require("class-variance-authority"),me=Se(require("react")),he=require("react/jsx-runtime"),nr=(0,fe.cva)("inline-flex items-center justify-center whitespace-nowrap rounded 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",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 he-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),X=me.forwardRef(({asChild:e=!1,className:r,size:o,variant:t,...s},n)=>(0,he.jsx)(e?ge.Slot:"button",{className:R(nr({className:r,size:o,variant:t})),ref:n,...s}));X.displayName="Button";var _=require("lucide-react"),T=require("react"),Z=require("react-syntax-highlighter"),H=require("react-syntax-highlighter/dist/esm/styles/prism"),ye=(0,T.createContext)({code:""}),sr=({code:e,language:r,showLineNumbers:o=!1,className:t,children:s,...n})=>(0,he.jsx)(ye.Provider,{value:{code:e},children:(0,he.jsx)("div",{className:R("relative he-full overflow-hidden rounded-md border bg-background text-foreground",t),...n,children:(0,he.jsxs)("div",{className:"relative",children:[(0,he.jsx)(Z.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:r,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:H.oneLight,children:e}),(0,he.jsx)(Z.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:r,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:H.oneDark,children:e}),s&&(0,he.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:s})]})})}),ir=({onCopy:e,onError:r,timeout:o=2e3,children:t,className:s,...n})=>{let[l,i]=(0,T.useState)(!1),{code:p}=(0,T.useContext)(ye),b=async()=>{if(typeof window>"u"||!navigator.clipboard.writeText){r?.(new Error("Clipboard API not available"));return}try{await navigator.clipboard.writeText(p),i(!0),e?.(),setTimeout(()=>i(!1),o)}catch(h){r?.(h)}},g=l?_.CheckIcon:_.CopyIcon;return(0,he.jsx)(X,{className:R("shrink-0",s),onClick:b,size:"icon",variant:"ghost",...n,children:t??(0,he.jsx)(g,{size:14})})};0&&(module.exports={CodeBlock,CodeBlockCopyButton});
4
+ "use strict";"use client";var xe=Object.create;var W=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty;var ze=(e,r)=>{for(var o in r)W(e,o,{get:r[o],enumerable:!0})},ne=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of we(r))!ke.call(e,s)&&s!==o&&W(e,s,{get:()=>r[s],enumerable:!(t=ve(r,s))||t.enumerable});return e};var Se=(e,r,o)=>(o=e!=null?xe(Ce(e)):{},ne(r||!e||!e.__esModule?W(o,"default",{value:e,enumerable:!0}):o,e)),Pe=e=>ne(W({},"__esModule",{value:!0}),e);var ar={};ze(ar,{CodeBlock:()=>sr,CodeBlockCopyButton:()=>ir});module.exports=Pe(ar);var be=require("clsx");var K="-",Me=e=>{let r=Ne(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:t}=e;return{getClassGroupId:l=>{let i=l.split(K);return i[0]===""&&i.length!==1&&i.shift(),ae(i,r)||Ae(l)},getConflictingClassGroupIds:(l,i)=>{let p=o[l]||[];return i&&t[l]?[...p,...t[l]]:p}}},ae=(e,r)=>{if(e.length===0)return r.classGroupId;let o=e[0],t=r.nextPart.get(o),s=t?ae(e.slice(1),t):void 0;if(s)return s;if(r.validators.length===0)return;let n=e.join(K);return r.validators.find(({validator:l})=>l(n))?.classGroupId},se=/^\[(.+)\]$/,Ae=e=>{if(se.test(e)){let r=se.exec(e)[1],o=r?.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}},Ne=e=>{let{theme:r,prefix:o}=e,t={nextPart:new Map,validators:[]};return Te(Object.entries(e.classGroups),o).forEach(([n,l])=>{J(l,t,n,r)}),t},J=(e,r,o,t)=>{e.forEach(s=>{if(typeof s=="string"){let n=s===""?r:ie(r,s);n.classGroupId=o;return}if(typeof s=="function"){if(Re(s)){J(s(t),r,o,t);return}r.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([n,l])=>{J(l,ie(r,n),o,t)})})},ie=(e,r)=>{let o=e;return r.split(K).forEach(t=>{o.nextPart.has(t)||o.nextPart.set(t,{nextPart:new Map,validators:[]}),o=o.nextPart.get(t)}),o},Re=e=>e.isThemeGetter,Te=(e,r)=>r?e.map(([o,t])=>{let s=t.map(n=>typeof n=="string"?r+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,i])=>[r+l,i])):n);return[o,s]}):e,Be=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,o=new Map,t=new Map,s=(n,l)=>{o.set(n,l),r++,r>e&&(r=0,t=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=t.get(n))!==void 0)return s(n,l),l},set(n,l){o.has(n)?o.set(n,l):s(n,l)}}},le="!",Ge=e=>{let{separator:r,experimentalParseClassName:o}=e,t=r.length===1,s=r[0],n=r.length,l=i=>{let p=[],b=0,g=0,h;for(let u=0;u<i.length;u++){let m=i[u];if(b===0){if(m===s&&(t||i.slice(u,u+n)===r)){p.push(i.slice(g,u)),g=u+n;continue}if(m==="/"){h=u;continue}}m==="["?b++:m==="]"&&b--}let x=p.length===0?i:i.substring(g),C=x.startsWith(le),v=C?x.substring(1):x,f=h&&h>g?h-g:void 0;return{modifiers:p,hasImportantModifier:C,baseClassName:v,maybePostfixModifierPosition:f}};return o?i=>o({className:i,parseClassName:l}):l},Ie=e=>{if(e.length<=1)return e;let r=[],o=[];return e.forEach(t=>{t[0]==="["?(r.push(...o.sort(),t),o=[]):o.push(t)}),r.push(...o.sort()),r},Le=e=>({cache:Be(e.cacheSize),parseClassName:Ge(e),...Me(e)}),Ee=/\s+/,Ve=(e,r)=>{let{parseClassName:o,getClassGroupId:t,getConflictingClassGroupIds:s}=r,n=[],l=e.trim().split(Ee),i="";for(let p=l.length-1;p>=0;p-=1){let b=l[p],{modifiers:g,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:C}=o(b),v=!!C,f=t(v?x.substring(0,C):x);if(!f){if(!v){i=b+(i.length>0?" "+i:i);continue}if(f=t(x),!f){i=b+(i.length>0?" "+i:i);continue}v=!1}let u=Ie(g).join(":"),m=h?u+le:u,y=m+f;if(n.includes(y))continue;n.push(y);let B=s(f,v);for(let M=0;M<B.length;++M){let E=B[M];n.push(m+E)}i=b+(i.length>0?" "+i:i)}return i};function je(){let e=0,r,o,t="";for(;e<arguments.length;)(r=arguments[e++])&&(o=ce(r))&&(t&&(t+=" "),t+=o);return t}var ce=e=>{if(typeof e=="string")return e;let r,o="";for(let t=0;t<e.length;t++)e[t]&&(r=ce(e[t]))&&(o&&(o+=" "),o+=r);return o};function We(e,...r){let o,t,s,n=l;function l(p){let b=r.reduce((g,h)=>h(g),e());return o=Le(b),t=o.cache.get,s=o.cache.set,n=i,i(p)}function i(p){let b=t(p);if(b)return b;let g=Ve(p,o);return s(p,g),g}return function(){return n(je.apply(null,arguments))}}var c=e=>{let r=o=>o[e]||[];return r.isThemeGetter=!0,r},de=/^\[(?:([a-z-]+):)?(.+)\]$/i,_e=/^\d+\/\d+$/,He=new Set(["px","full","screen"]),$e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ue=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(he|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Oe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,z=e=>A(e)||He.has(e)||_e.test(e),S=e=>N(e,"length",er),A=e=>!!e&&!Number.isNaN(Number(e)),q=e=>N(e,"number",A),I=e=>!!e&&Number.isInteger(Number(e)),Je=e=>e.endsWith("%")&&A(e.slice(0,-1)),a=e=>de.test(e),P=e=>$e.test(e),Ke=new Set(["length","size","percentage"]),Xe=e=>N(e,Ke,pe),Ze=e=>N(e,"position",pe),Qe=new Set(["image","url"]),Ye=e=>N(e,Qe,or),De=e=>N(e,"",rr),L=()=>!0,N=(e,r,o)=>{let t=de.exec(e);return t?t[1]?typeof r=="string"?t[1]===r:r.has(t[1]):o(t[2]):!1},er=e=>Ue.test(e)&&!Fe.test(e),pe=()=>!1,rr=e=>Oe.test(e),or=e=>qe.test(e);var tr=()=>{let e=c("colors"),r=c("spacing"),o=c("blur"),t=c("brightness"),s=c("borderColor"),n=c("borderRadius"),l=c("borderSpacing"),i=c("borderWidth"),p=c("contrast"),b=c("grayscale"),g=c("hueRotate"),h=c("invert"),x=c("gap"),C=c("gradientColorStops"),v=c("gradientColorStopPositions"),f=c("inset"),u=c("margin"),m=c("opacity"),y=c("padding"),B=c("saturate"),M=c("scale"),E=c("sepia"),Q=c("skew"),Y=c("space"),D=c("translate"),$=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",a,r],d=()=>[a,r],ee=()=>["",z,S],V=()=>["auto",A,a],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",a],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[A,a];return{cacheSize:500,separator:":",theme:{colors:[L],spacing:[z,S],blur:["none","",P,a],brightness:k(),borderColor:[e],borderRadius:["none","","full",P,a],borderSpacing:d(),borderWidth:ee(),contrast:k(),grayscale:G(),hueRotate:k(),invert:G(),gap:d(),gradientColorStops:[e],gradientColorStopPositions:[Je,S],inset:F(),margin:F(),opacity:k(),padding:d(),saturate:k(),scale:k(),sepia:G(),skew:k(),space:d(),translate:d()},classGroups:{aspect:[{aspect:["auto","square","video",a]}],container:["container"],columns:[{columns:[P]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),a]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",I,a]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",a]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",I,a]}],"grid-cols":[{"grid-cols":[L]}],"col-start-end":[{col:["auto",{span:["full",I,a]},a]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[L]}],"row-start-end":[{row:["auto",{span:[I,a]},a]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",a]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",a]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],mt:[{mt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[Y]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Y]}],"space-y-reverse":["space-y-reverse"],he:[{he:["auto","min","max","fit","svw","lvw","dvw",a,r]}],"min-he":[{"min-he":[a,r,"min","max","fit"]}],"max-he":[{"max-he":[a,r,"none","full","min","max","fit","prose",{screen:[P]},P]}],h:[{h:[a,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[a,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[a,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[a,r,"auto","min","max","fit"]}],"font-size":[{text:["base",P,S]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",q]}],"font-family":[{font:[L]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",a]}],"line-clamp":[{"line-clamp":["none",A,q]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",z,a]}],"list-image":[{"list-image":["none",a]}],"list-style-type":[{list:["none","disc","decimal",a]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",z,S]}],"underline-offset":[{"underline-offset":["auto",z,a]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:d()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",a]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",a]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),Ze]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ye]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-he":[{border:[i]}],"border-he-x":[{"border-x":[i]}],"border-he-y":[{"border-y":[i]}],"border-he-s":[{"border-s":[i]}],"border-he-e":[{"border-e":[i]}],"border-he-t":[{"border-t":[i]}],"border-he-r":[{"border-r":[i]}],"border-he-b":[{"border-b":[i]}],"border-he-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:j()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[z,a]}],"outline-he":[{outline:[z,S]}],"outline-color":[{outline:[e]}],"ring-he":[{ring:ee()}],"ring-he-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-he":[{"ring-offset":[z,S]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",P,De]}],"shadow-color":[{shadow:[L]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[t]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",P,a]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[h]}],saturate:[{saturate:[B]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[t]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[B]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",a]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",a]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",a]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[I,a]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[Q]}],"skew-y":[{"skew-y":[Q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",a]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","he-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",a]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":d()}],"scroll-mx":[{"scroll-mx":d()}],"scroll-my":[{"scroll-my":d()}],"scroll-ms":[{"scroll-ms":d()}],"scroll-me":[{"scroll-me":d()}],"scroll-mt":[{"scroll-mt":d()}],"scroll-mr":[{"scroll-mr":d()}],"scroll-mb":[{"scroll-mb":d()}],"scroll-ml":[{"scroll-ml":d()}],"scroll-p":[{"scroll-p":d()}],"scroll-px":[{"scroll-px":d()}],"scroll-py":[{"scroll-py":d()}],"scroll-ps":[{"scroll-ps":d()}],"scroll-pe":[{"scroll-pe":d()}],"scroll-pt":[{"scroll-pt":d()}],"scroll-pr":[{"scroll-pr":d()}],"scroll-pb":[{"scroll-pb":d()}],"scroll-pl":[{"scroll-pl":d()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",a]}],fill:[{fill:[e,"none"]}],"stroke-he":[{stroke:[z,S,q]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["he","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-he":["border-he-s","border-he-e","border-he-t","border-he-r","border-he-b","border-he-l"],"border-he-x":["border-he-r","border-he-l"],"border-he-y":["border-he-t","border-he-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var ue=We(tr);function R(...e){return ue((0,be.clsx)(e))}var ge=require("@radix-ui/react-slot"),fe=require("class-variance-authority"),me=Se(require("react")),he=require("react/jsx-runtime"),nr=(0,fe.cva)("inline-flex items-center justify-center whitespace-nowrap rounded 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",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 he-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),X=me.forwardRef(({asChild:e=!1,className:r,size:o,variant:t,...s},n)=>(0,he.jsx)(e?ge.Slot:"button",{className:R(nr({className:r,size:o,variant:t})),ref:n,...s}));X.displayName="Button";var _=require("lucide-react"),T=require("react"),Z=require("react-syntax-highlighter"),H=require("react-syntax-highlighter/dist/esm/styles/prism"),ye=(0,T.createContext)({code:""}),sr=({code:e,language:r,showLineNumbers:o=!1,className:t,children:s,...n})=>(0,he.jsx)(ye.Provider,{value:{code:e},children:(0,he.jsx)("div",{className:R("relative max-he-2xl overflow-hidden rounded-md border bg-background text-foreground",t),...n,children:(0,he.jsxs)("div",{className:"relative",children:[(0,he.jsx)(Z.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:r,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:H.oneLight,children:e}),(0,he.jsx)(Z.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:r,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:H.oneDark,children:e}),s&&(0,he.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:s})]})})}),ir=({onCopy:e,onError:r,timeout:o=2e3,children:t,className:s,...n})=>{let[l,i]=(0,T.useState)(!1),{code:p}=(0,T.useContext)(ye),b=async()=>{if(typeof window>"u"||!navigator.clipboard.writeText){r?.(new Error("Clipboard API not available"));return}try{await navigator.clipboard.writeText(p),i(!0),e?.(),setTimeout(()=>i(!1),o)}catch(h){r?.(h)}},g=l?_.CheckIcon:_.CopyIcon;return(0,he.jsx)(X,{className:R("shrink-0",s),onClick:b,size:"icon",variant:"ghost",...n,children:t??(0,he.jsx)(g,{size:14})})};0&&(module.exports={CodeBlock,CodeBlockCopyButton});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a,b}from"../../../chunk-ZN7NNMB7.mjs";import"../../../chunk-ZUA4KNIR.mjs";import"../../../chunk-EGEO3FNE.mjs";import"../../../chunk-MDJREBVI.mjs";import"../../../chunk-ZWHGOTSF.mjs";import"../../../chunk-Q3G5UAAD.mjs";import"../../../chunk-XGRRLABA.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as CodeBlock,b as CodeBlockCopyButton};
2
+ "use strict";import{a,b}from"../../../chunk-UA2E23AS.mjs";import"../../../chunk-ZUA4KNIR.mjs";import"../../../chunk-EGEO3FNE.mjs";import"../../../chunk-MDJREBVI.mjs";import"../../../chunk-ZWHGOTSF.mjs";import"../../../chunk-Q3G5UAAD.mjs";import"../../../chunk-XGRRLABA.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as CodeBlock,b as CodeBlockCopyButton};