cortex-react-components 2.15.0 → 2.16.0

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 (104) hide show
  1. package/dist/{chunk-TILPSVAP.mjs → chunk-A5MYHSX7.mjs} +1 -1
  2. package/dist/{chunk-RX63ABAF.mjs → chunk-B7AXSCTN.mjs} +1 -1
  3. package/dist/{chunk-MFCVMJBO.mjs → chunk-BDDEMCAH.mjs} +1 -1
  4. package/dist/{chunk-XKGBG5FX.mjs → chunk-CBIULUZQ.mjs} +1 -1
  5. package/dist/{chunk-CJDUN6R4.mjs → chunk-DKRRVTCV.mjs} +1 -1
  6. package/dist/{chunk-D2H36ZLW.mjs → chunk-DXE6AGJX.mjs} +1 -1
  7. package/dist/{chunk-MDBYZZXI.mjs → chunk-ESPA7NWT.mjs} +1 -1
  8. package/dist/{chunk-A2KX5N75.mjs → chunk-EZKKO2SR.mjs} +1 -1
  9. package/dist/{chunk-PO3XUUWY.mjs → chunk-L5NPH5RX.mjs} +1 -1
  10. package/dist/{chunk-I2GNNRFH.mjs → chunk-LJOWXPWW.mjs} +1 -1
  11. package/dist/{chunk-AMVJPDM3.mjs → chunk-M527EJIX.mjs} +1 -1
  12. package/dist/{chunk-JTVWQ42C.mjs → chunk-N7BHIWS5.mjs} +1 -1
  13. package/dist/{chunk-R5SXUWYU.mjs → chunk-NWRU6YZM.mjs} +1 -1
  14. package/dist/chunk-R72ZFTOO.mjs +1 -0
  15. package/dist/{chunk-HSQAHQNP.mjs → chunk-TKCFCYEQ.mjs} +1 -1
  16. package/dist/chunk-UGBDJDPW.mjs +4 -0
  17. package/dist/{chunk-OLIYPWO3.mjs → chunk-UPDEVKI7.mjs} +1 -1
  18. package/dist/{chunk-2UNIT7NC.mjs → chunk-UPRS7OYQ.mjs} +1 -1
  19. package/dist/chunk-ZN7NNMB7.mjs +4 -0
  20. package/dist/components/Blocks/index.mjs +1 -1
  21. package/dist/components/CRM/CogeBoard.mjs +1 -1
  22. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  23. package/dist/components/CRM/index.mjs +1 -1
  24. package/dist/components/Chat/ChatInterface.js +6 -6
  25. package/dist/components/Chat/ChatInterface.mjs +1 -1
  26. package/dist/components/Chat/CopilotInterface.js +7 -7
  27. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  28. package/dist/components/Chat/PartTypes/CodeBlock.css +1 -0
  29. package/dist/components/Chat/PartTypes/CodeBlock.d.ts +15 -0
  30. package/dist/components/Chat/PartTypes/CodeBlock.js +4 -0
  31. package/dist/components/Chat/PartTypes/CodeBlock.mjs +2 -0
  32. package/dist/components/Chat/PartTypes/Tool.css +1 -0
  33. package/dist/components/Chat/PartTypes/Tool.d.ts +22 -0
  34. package/dist/components/Chat/PartTypes/Tool.js +5 -0
  35. package/dist/components/Chat/PartTypes/Tool.mjs +2 -0
  36. package/dist/components/Chat/PartTypes/index.d.ts +2 -0
  37. package/dist/components/Chat/PartTypes/index.js +6 -6
  38. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  39. package/dist/components/Chat/demo-long-messages.js +12 -12
  40. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  41. package/dist/components/Chat/demo-tests.js +27 -27
  42. package/dist/components/Chat/demo-tests.mjs +1 -1
  43. package/dist/components/Chat/demo.js +7 -7
  44. package/dist/components/Chat/demo.mjs +1 -1
  45. package/dist/components/Chat/example-usage.js +7 -7
  46. package/dist/components/Chat/example-usage.mjs +1 -1
  47. package/dist/components/Chat/example-with-vercel-ai.js +7 -7
  48. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  49. package/dist/components/Chat/index.js +11 -11
  50. package/dist/components/Chat/index.mjs +1 -1
  51. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  52. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  53. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
  54. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  55. package/dist/components/DigitalColleagues/index.mjs +1 -1
  56. package/dist/components/Foundary/MainPage.mjs +1 -1
  57. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  58. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  59. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  60. package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
  61. package/dist/components/Foundary/Views/index.mjs +1 -1
  62. package/dist/components/Foundary/index.mjs +1 -1
  63. package/dist/components/HeaderFooter/Header.mjs +1 -1
  64. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  65. package/dist/components/HeaderFooter/index.mjs +1 -1
  66. package/dist/components/Heros/RenderHero.mjs +1 -1
  67. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  68. package/dist/components/Heros/index.mjs +1 -1
  69. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  70. package/dist/components/Layouts/Print.mjs +1 -1
  71. package/dist/components/Layouts/SlideShow.mjs +1 -1
  72. package/dist/components/Layouts/index.mjs +1 -1
  73. package/dist/components/Other/index.mjs +1 -1
  74. package/dist/components/Payload/index.mjs +1 -1
  75. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  76. package/dist/components/Projects/ProjectPage.mjs +1 -1
  77. package/dist/components/Projects/ProjectView.mjs +1 -1
  78. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  79. package/dist/components/Projects/index.mjs +1 -1
  80. package/dist/components/dc-temp/index.mjs +1 -1
  81. package/dist/components/index.js +14 -14
  82. package/dist/components/index.mjs +1 -1
  83. package/dist/globals.css +1 -1
  84. package/dist/index.js +25 -25
  85. package/dist/index.mjs +1 -1
  86. package/dist/metafile-cjs.json +1 -1
  87. package/dist/metafile-esm.json +1 -1
  88. package/dist/pages/Blog.mjs +1 -1
  89. package/dist/pages/Documentation.mjs +1 -1
  90. package/dist/pages/IndexPage.mjs +1 -1
  91. package/dist/pages/Intranet.mjs +1 -1
  92. package/dist/pages/LandingPage.mjs +1 -1
  93. package/dist/pages/Page.mjs +1 -1
  94. package/dist/pages/Publish.mjs +1 -1
  95. package/dist/pages/Website.mjs +1 -1
  96. package/dist/sections/AboutSection.mjs +1 -1
  97. package/dist/sections/BlogDetail.mjs +1 -1
  98. package/dist/sections/BlogList.mjs +1 -1
  99. package/dist/sections/PageSections.mjs +1 -1
  100. package/dist/sections/PricingSection.mjs +1 -1
  101. package/dist/sections/ServiceSection.mjs +1 -1
  102. package/dist/sections/index.mjs +1 -1
  103. package/package.json +5 -2
  104. package/dist/chunk-UTHKFW4R.mjs +0 -1
@@ -3,19 +3,19 @@
3
3
  "use client"
4
4
  'use client';
5
5
 
6
- "use strict";var Ut=Object.create;var Le=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var qt=Object.getPrototypeOf,Kt=Object.prototype.hasOwnProperty;var Jt=(e,t)=>{for(var o in t)Le(e,o,{get:t[o],enumerable:!0})},tt=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _t(t))!Kt.call(e,s)&&s!==o&&Le(e,s,{get:()=>t[s],enumerable:!(a=Wt(t,s))||a.enumerable});return e};var V=(e,t,o)=>(o=e!=null?Ut(qt(e)):{},tt(t||!e||!e.__esModule?Le(o,"default",{value:e,enumerable:!0}):o,e)),Qt=e=>tt(Le({},"__esModule",{value:!0}),e);var jo={};Jt(jo,{ChatInterface:()=>$o});module.exports=Qt(jo);var q=require("react"),ue=V(require("motion/react-client")),A=require("lucide-react");var Ie=V(require("react")),J=V(require("@radix-ui/react-avatar"));var dt=require("clsx");var Oe="-",Xt=e=>{let t=Zt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{let i=l.split(Oe);return i[0]===""&&i.length!==1&&i.shift(),at(i,t)||Yt(l)},getConflictingClassGroupIds:(l,i)=>{let p=o[l]||[];return i&&a[l]?[...p,...a[l]]:p}}},at=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),s=a?at(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;let n=e.join(Oe);return t.validators.find(({validator:l})=>l(n))?.classGroupId},ot=/^\[(.+)\]$/,Yt=e=>{if(ot.test(e)){let t=ot.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Zt=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return to(Object.entries(e.classGroups),o).forEach(([n,l])=>{Fe(l,a,n,t)}),a},Fe=(e,t,o,a)=>{e.forEach(s=>{if(typeof s=="string"){let n=s===""?t:rt(t,s);n.classGroupId=o;return}if(typeof s=="function"){if(eo(s)){Fe(s(a),t,o,a);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([n,l])=>{Fe(l,rt(t,n),o,a)})})},rt=(e,t)=>{let o=e;return t.split(Oe).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},eo=e=>e.isThemeGetter,to=(e,t)=>t?e.map(([o,a])=>{let s=a.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,i])=>[t+l,i])):n);return[o,s]}):e,oo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,s=(n,l)=>{o.set(n,l),t++,t>e&&(t=0,a=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=a.get(n))!==void 0)return s(n,l),l},set(n,l){o.has(n)?o.set(n,l):s(n,l)}}},nt="!",ro=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,s=t[0],n=t.length,l=i=>{let p=[],f=0,h=0,m;for(let x=0;x<i.length;x++){let P=i[x];if(f===0){if(P===s&&(a||i.slice(x,x+n)===t)){p.push(i.slice(h,x)),h=x+n;continue}if(P==="/"){m=x;continue}}P==="["?f++:P==="]"&&f--}let b=p.length===0?i:i.substring(h),T=b.startsWith(nt),R=T?b.substring(1):b,w=m&&m>h?m-h:void 0;return{modifiers:p,hasImportantModifier:T,baseClassName:R,maybePostfixModifierPosition:w}};return o?i=>o({className:i,parseClassName:l}):l},ao=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},no=e=>({cache:oo(e.cacheSize),parseClassName:ro(e),...Xt(e)}),io=/\s+/,so=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:s}=t,n=[],l=e.trim().split(io),i="";for(let p=l.length-1;p>=0;p-=1){let f=l[p],{modifiers:h,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:T}=o(f),R=!!T,w=a(R?b.substring(0,T):b);if(!w){if(!R){i=f+(i.length>0?" "+i:i);continue}if(w=a(b),!w){i=f+(i.length>0?" "+i:i);continue}R=!1}let x=ao(h).join(":"),P=m?x+nt:x,E=P+w;if(n.includes(E))continue;n.push(E);let C=s(w,R);for(let L=0;L<C.length;++L){let ne=C[L];n.push(P+ne)}i=f+(i.length>0?" "+i:i)}return i};function lo(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=it(t))&&(a&&(a+=" "),a+=o);return a}var it=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=it(e[a]))&&(o&&(o+=" "),o+=t);return o};function co(e,...t){let o,a,s,n=l;function l(p){let f=t.reduce((h,m)=>m(h),e());return o=no(f),a=o.cache.get,s=o.cache.set,n=i,i(p)}function i(p){let f=a(p);if(f)return f;let h=so(p,o);return s(p,h),h}return function(){return n(lo.apply(null,arguments))}}var k=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},st=/^\[(?:([a-De-]+):)?(.+)\]$/i,po=/^\d+\/\d+$/,uo=new Set(["px","full","screen"]),mo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,go=/\d+(%|px|De?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|De?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,bo=/^(inset_)?-?((\d+)?\.?(\d+)[a-De]+|0)_-?((\d+)?\.?(\d+)[a-De]+|0)/,vo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,K=e=>ge(e)||uo.has(e)||po.test(e),oe=e=>fe(e,"length",Ro),ge=e=>!!e&&!Number.isNaN(Number(e)),He=e=>fe(e,"number",ge),xe=e=>!!e&&Number.isInteger(Number(e)),ho=e=>e.endsWith("%")&&ge(e.slice(0,-1)),g=e=>st.test(e),re=e=>mo.test(e),yo=new Set(["length","size","percentage"]),xo=e=>fe(e,yo,lt),Co=e=>fe(e,"position",lt),wo=new Set(["image","url"]),No=e=>fe(e,wo,Ao),ko=e=>fe(e,"",Po),Ce=()=>!0,fe=(e,t,o)=>{let a=st.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Ro=e=>go.test(e)&&!fo.test(e),lt=()=>!1,Po=e=>bo.test(e),Ao=e=>vo.test(e);var To=()=>{let e=k("colors"),t=k("spacing"),o=k("blur"),a=k("brightness"),s=k("borderColor"),n=k("borderRadius"),l=k("borderSpacing"),i=k("borderWidth"),p=k("contrast"),f=k("grayscale"),h=k("hueRotate"),m=k("invert"),b=k("gap"),T=k("gradientColorStops"),R=k("gradientColorStopPositions"),w=k("inset"),x=k("margin"),P=k("opacity"),E=k("padding"),C=k("saturate"),L=k("scale"),ne=k("sepia"),ze=k("skew"),he=k("space"),Pe=k("translate"),ie=()=>["auto","contain","none"],Ae=()=>["auto","hidden","clip","visible","scroll"],ye=()=>["auto",g,t],N=()=>[g,t],Te=()=>["",K,oe],me=()=>["auto",ge,g],Se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],se=()=>["solid","dashed","dotted","double","none"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],c=()=>["start","end","center","between","around","evenly","stretch"],S=()=>["","0",g],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>[ge,g];return{cacheSize:500,separator:":",theme:{colors:[Ce],spacing:[K,oe],blur:["none","",re,g],brightness:y(),borderColor:[e],borderRadius:["none","","full",re,g],borderSpacing:N(),borderWidth:Te(),contrast:y(),grayscale:S(),hueRotate:y(),invert:S(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[ho,oe],inset:ye(),margin:ye(),opacity:y(),padding:N(),saturate:y(),scale:y(),sepia:S(),skew:y(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",g]}],container:["container"],columns:[{columns:[re]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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:[...Se(),g]}],overflow:[{overflow:Ae()}],"overflow-x":[{"overflow-x":Ae()}],"overflow-y":[{"overflow-y":Ae()}],overscroll:[{overscroll:ie()}],"overscroll-x":[{"overscroll-x":ie()}],"overscroll-y":[{"overscroll-y":ie()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],De:[{De:["auto",xe,g]}],basis:[{basis:ye()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",g]}],grow:[{grow:S()}],shrink:[{shrink:S()}],order:[{order:["first","last","none",xe,g]}],"grid-cols":[{"grid-cols":[Ce]}],"col-start-end":[{col:["auto",{span:["full",xe,g]},g]}],"col-start":[{"col-start":me()}],"col-end":[{"col-end":me()}],"grid-rows":[{"grid-rows":[Ce]}],"row-start-end":[{row:["auto",{span:[xe,g]},g]}],"row-start":[{"row-start":me()}],"row-end":[{"row-end":me()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",g]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",g]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...c()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...c(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...c(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],q:[{q:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[he]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[he]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",g,t]}],"min-w":[{"min-w":[g,t,"min","max","fit"]}],"max-w":[{"max-w":[g,t,"none","full","min","max","fit","prose",{screen:[re]},re]}],h:[{h:[g,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[g,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[g,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[g,t,"auto","min","max","fit"]}],"font-size":[{text:["base",re,oe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",He]}],"font-family":[{font:[Ce]}],"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",g]}],"line-clamp":[{"line-clamp":["none",ge,He]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",K,g]}],"list-image":[{"list-image":["none",g]}],"list-style-type":[{list:["none","disc","decimal",g]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",K,oe]}],"underline-offset":[{"underline-offset":["auto",K,g]}],"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:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g]}],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",g]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Se(),Co]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",xo]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","De","br","b","bl","l","tl"]},No]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[R]}],"gradient-via-pos":[{via:[R]}],"gradient-to-pos":[{to:[R]}],"gradient-from":[{from:[T]}],"gradient-via":[{via:[T]}],"gradient-to":[{to:[T]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-De":[{"rounded-De":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-De":[{"rounded-De":[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-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-De":[{"border-De":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...se(),"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":[P]}],"divide-style":[{divide:se()}],"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-De":[{"border-De":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...se()]}],"outline-offset":[{"outline-offset":[K,g]}],"outline-w":[{outline:[K,oe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[K,oe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",re,ko]}],"shadow-color":[{shadow:[Ce]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...Me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Me()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",re,g]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[m]}],saturate:[{saturate:[C]}],sepia:[{sepia:[ne]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[ne]}],"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",g]}],duration:[{duration:y()}],ease:[{ease:["linear","in","out","in-out",g]}],delay:[{delay:y()}],animate:[{animate:["none","spin","ping","pulse","bounce",g]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[xe,g]}],"translate-x":[{"translate-x":[Pe]}],"translate-y":[{"translate-y":[Pe]}],"skew-x":[{"skew-x":[ze]}],"skew-y":[{"skew-y":[ze]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",g]}],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","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-q":[{"scroll-q":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",g]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[K,oe,He]}],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","q","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:["w","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-De","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-De","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-De"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-De":["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-w":["border-w-s","border-w-e","border-w-t","border-w-De","border-w-b","border-w-l"],"border-w-x":["border-w-De","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-De","border-color-b","border-color-l"],"border-color-x":["border-color-De","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-q","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 ct=co(To);function d(...e){return ct((0,dt.clsx)(e))}var De=require("react/jsx-runtime"),we=Ie.forwardRef(({className:e,...t},o)=>(0,De.jsx)(J.Root,{ref:o,className:d("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));we.displayName=J.Root.displayName;var So=Ie.forwardRef(({className:e,...t},o)=>(0,De.jsx)(J.Image,{ref:o,className:d("aspect-square h-full w-full",e),...t}));So.displayName=J.Image.displayName;var Ne=Ie.forwardRef(({className:e,...t},o)=>(0,De.jsx)(J.Fallback,{ref:o,className:d("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Ne.displayName=J.Fallback.displayName;var pt=require("@radix-ui/react-slot"),ut=require("class-variance-authority"),mt=V(require("react")),Mo=(0,ut.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 w-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"}}}),O=mt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...s},n)=>(0,De.jsx)(e?pt.Slot:"button",{className:d(Mo({className:t,size:o,variant:a})),ref:n,...s}));O.displayName="Button";var le=V(require("react"));var U=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("rounded-xl border bg-card text-card-foreground shadow",e),...t}));U.displayName="Card";var Q=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("flex flex-col space-y-1.5 p-6",e),...t}));Q.displayName="CardHeader";var X=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("font-semibold leading-none tracking-tight",e),...t}));X.displayName="CardTitle";var Ve=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("text-sm text-muted-foreground",e),...t}));Ve.displayName="CardDescription";var W=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("p-6 pt-0",e),...t}));W.displayName="CardContent";var ke=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("flex items-center p-6 pt-0",e),...t}));ke.displayName="CardFooter";var ft=V(require("react"));var Ge=ft.forwardRef(({className:e,type:t,...o},a)=>(0,De.jsx)("input",{type:t,className:d("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));Ge.displayName="Input";var $e=V(require("react")),G=V(require("@radix-ui/react-scroll-area"));var je=$e.forwardRef(({className:e,children:t,...o},a)=>(0,De.jsxs)(G.Root,{ref:a,className:d("relative overflow-hidden",e),...o,children:[(0,De.jsx)(G.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,De.jsx)(vt,{}),(0,De.jsx)(G.Corner,{})]}));je.displayName=G.Root.displayName;var vt=$e.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,De.jsx)(G.ScrollAreaScrollbar,{ref:a,orientation:t,className:d("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,De.jsx)(G.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));vt.displayName=G.ScrollAreaScrollbar.displayName;var Lo=(0,ut.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function de({className:e,variant:t,...o}){return(0,De.jsx)("div",{className:d(Lo({variant:t}),e),...o})}var _=require("motion/react");var xt={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]};function Ue(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function Ct({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:s,colorScheme:n=xt,className:l}){let[i,p]=(0,q.useState)([]),[f,h]=(0,q.useState)([]),m=i[i.length-1],b=m?.children||e,T=(C,L)=>{switch(C.type){case"category":return n.categories[L%n.categories.length];case"list":return n.lists[L%n.lists.length];case"item":return n.items[L%n.items.length];default:return n.primary}},R=(0,q.useMemo)(()=>({path:i,selectedItems:f,filters:{}}),[i,f]);(0,q.useEffect)(()=>{s&&s(R)},[R,s]);let w=C=>{C.type==="category"||C.type==="list"?p([...i,C]):C.type==="item"&&h([...f,C])},x=()=>{p(i.slice(0,-1))},P=C=>{p(i.slice(0,C+1))},E=()=>m?.actions?m.actions:[];return t?(0,De.jsxs)("div",{className:d("w-full",l),children:[(0,De.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,De.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,De.jsx)(_.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:x,className:d("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,De.jsx)(A.ChevronLeft,{className:d("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,De.jsx)("h4",{className:"font-medium text-sm",children:m?.name||"Capabilities"})]}),(0,De.jsx)(_.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:o,className:d("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,De.jsx)(A.X,{className:d("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,De.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,De.jsx)(_.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>p([]),className:d("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,De.jsxs)("span",{className:"relative",children:["Capabilities",(0,De.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((C,L)=>(0,De.jsxs)("div",{className:"flex items-center gap-1",children:[(0,De.jsx)(A.ChevronRight,{className:"h-2 w-2"}),(0,De.jsx)(_.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>P(L),className:d("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,De.jsxs)("span",{className:"relative",children:[C.name,(0,De.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},C.id))]}),(0,De.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,De.jsx)(_.AnimatePresence,{mode:"wait",children:(0,De.jsx)(_.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:m?.type==="list"&&m.data?(0,De.jsx)(Eo,{data:m.data,onItemSelect:C=>h([...f,C]),colorScheme:n}):(0,De.jsx)(Io,{capabilities:b,onSelect:w,colorScheme:n})},m?.id||"root")})})]}):(0,De.jsxs)(O,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,De.jsx)(A.Menu,{className:"h-4 w-4"}),(0,De.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Io({capabilities:e,onSelect:t,colorScheme:o}){return(0,De.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,De.jsx)(Do,{capability:a,onClick:()=>t(a),color:o.categories[s%o.categories.length]},a.id))})}function Do({capability:e,onClick:t,selected:o,color:a}){return(0,De.jsxs)(_.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:d("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",o&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,De.jsx)("div",{className:d("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,De.jsxs)("span",{className:"truncate relative",children:[e.name,(0,De.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,De.jsx)(A.ChevronRight,{className:d("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,De.jsx)(de,{variant:"secondary",className:d("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function Eo({data:e,onItemSelect:t,colorScheme:o}){return(0,De.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,De.jsxs)(_.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:d("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(a),children:[(0,De.jsx)("div",{className:d("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[s%o.items.length])}),(0,De.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,De.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,De.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),a.subtitle&&(0,De.jsx)("div",{className:d("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:a.subtitle})]}),a.value&&(0,De.jsx)(de,{variant:"secondary",className:d("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}var kt=require("date-fns");function wt({taskId:e,polling:t=!0,system:o="payload"}){let[a,s]=(0,q.useState)(null),[n,l]=(0,q.useState)(!1),[i,p]=(0,q.useState)(null),f=async(m=!0)=>{if(e){m&&l(!0);try{let b=await fetch(`/api/tasks/${e}`);if(!b.ok)throw new Error(`Failed to fetch task: ${b.statusText}`);let T=await b.json();s(T)}catch(b){console.error("Error fetching task:",b),p(b instanceof Error?b:new Error("Unknown error occurred"))}finally{m&&l(!1)}}},h=()=>f(!1);return(0,q.useEffect)(()=>{e&&f(!0);let m=null;return e&&t&&(m=setInterval(h,5e3)),()=>{m&&clearInterval(m)}},[e,t]),{task:a,loading:n,error:i}}var zo=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"}},Bo=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Rt({data:e}){let{id:t,system:o,fetchLatest:a,taskData:s,error:n}=e||{};if(!t)return null;let l=null,i=!0,p=n,f=a!==void 0?a:!0;if(l=s||{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:f,taskData:l,error:p}),f){let{task:T,loading:R,error:w}=wt({taskId:t,system:o});l=T,i=R,p=w}else i=!1;let h=zo(l?.status||"todo"),m=Bo(l?.status||"todo"),b=l?.dateLogged||new Date().toISOString();try{let T=new Date(l?.dateLogged||"");isNaN(T.getTime())||(b=(0,kt.formatDistanceToNow)(T,{addSuffix:!0}))}catch{}return(0,De.jsxs)(U,{className:d("w-full max-w-md shadow-md",p&&"border border-destructive"),children:[(0,De.jsxs)(Q,{className:"pb-2",children:[(0,De.jsxs)("div",{className:"flex justify-between items-start",children:[(0,De.jsx)(X,{className:"text-lg font-semibold",children:i?"Loading...":l?.name||"Task"}),(0,De.jsx)(de,{className:`${h}`,children:m})]}),l?.project&&(0,De.jsxs)(Ve,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,De.jsx)(W,{className:"pb-2",children:i?(0,De.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):p?(0,De.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,De.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,De.jsx)(ke,{className:"pt-2 flex items-center justify-between",children:(0,De.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,De.jsx)(A.Clock,{className:"h-3 w-3 mr-1"}),(0,De.jsxs)("span",{children:["Created ",b]}),(0,De.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,De.jsxs)("span",{children:["Task #",t]})]})})]})}function Tt({artefact:e,taskId:t,taskData:o,loading:a=!1,error:s=null}){let n=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=n.dateLogged;try{let i=new Date(n.dateLogged);isNaN(i.getTime())||(l=(0,kt.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,De.jsxs)(U,{className:"w-full max-w-md shadow-md",children:[(0,De.jsx)(Q,{className:"pb-2",children:(0,De.jsx)("div",{className:"flex justify-between items-start",children:(0,De.jsx)(X,{className:"text-lg font-semibold",children:a?"Loading...":n.name})})}),(0,De.jsx)(W,{className:"pb-2",children:a?(0,De.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,De.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,De.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,De.jsx)(ke,{className:"pt-2 flex items-center justify-between",children:(0,De.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,De.jsx)(A.Clock,{className:"h-3 w-3 mr-1"}),(0,De.jsxs)("span",{children:["Created ",l]}),(0,De.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,De.jsxs)("span",{children:["Task #",n.id]})]})})]})}var Mt=V(require("react"));var St=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:s="This endpoint requires authentication to sync functions."})=>{let[n,l]=(0,q.useState)(!1),[i,p]=(0,q.useState)(""),f=()=>{if(!t){p("No authentication URL provided");return}l(!0),p("");try{let m=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!m){p("Popup blocked. Please allow popups for this site and try again."),l(!1);return}let b=setInterval(()=>{try{m.closed&&(clearInterval(b),l(!1),a(),o())}catch{}},1e3);setTimeout(()=>{m.closed||(m.close(),clearInterval(b),l(!1),p("Authentication timed out. Please try again."))},6e5)}catch{p("Failed to open authentication window"),l(!1)}},h=async()=>{try{await navigator.clipboard.writeText(t),p("")}catch{p("Failed to copy URL to clipboard")}};return e?(0,De.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center De-[1000]",children:(0,De.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,De.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,De.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s}),i&&(0,De.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:i}),(0,De.jsxs)("div",{className:"flex gap-2",children:[(0,De.jsx)("button",{onClick:f,disabled:n||!t,className:`
6
+ "use strict";var ro=Object.create;var Be=Object.defineProperty;var ao=Object.getOwnPropertyDescriptor;var no=Object.getOwnPropertyNames;var so=Object.getPrototypeOf,io=Object.prototype.hasOwnProperty;var lo=(e,t)=>{for(var o in t)Be(e,o,{get:t[o],enumerable:!0})},pt=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of no(t))!io.call(e,s)&&s!==o&&Be(e,s,{get:()=>t[s],enumerable:!(a=ao(t,s))||a.enumerable});return e};var U=(e,t,o)=>(o=e!=null?ro(so(e)):{},pt(t||!e||!e.__esModule?Be(o,"default",{value:e,enumerable:!0}):o,e)),co=e=>pt(Be({},"__esModule",{value:!0}),e);var ar={};lo(ar,{ChatInterface:()=>rr});module.exports=co(ar);var J=require("react"),fe=U(require("motion/react-client")),A=require("lucide-react");var ze=U(require("react")),X=U(require("@radix-ui/react-avatar"));var xt=require("clsx");var Je="-",po=e=>{let t=mo(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{let i=l.split(Je);return i[0]===""&&i.length!==1&&i.shift(),gt(i,t)||uo(l)},getConflictingClassGroupIds:(l,i)=>{let p=o[l]||[];return i&&a[l]?[...p,...a[l]]:p}}},gt=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),s=a?gt(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;let n=e.join(Je);return t.validators.find(({validator:l})=>l(n))?.classGroupId},ut=/^\[(.+)\]$/,uo=e=>{if(ut.test(e)){let t=ut.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},mo=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return fo(Object.entries(e.classGroups),o).forEach(([n,l])=>{Ke(l,a,n,t)}),a},Ke=(e,t,o,a)=>{e.forEach(s=>{if(typeof s=="string"){let n=s===""?t:mt(t,s);n.classGroupId=o;return}if(typeof s=="function"){if(go(s)){Ke(s(a),t,o,a);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([n,l])=>{Ke(l,mt(t,n),o,a)})})},mt=(e,t)=>{let o=e;return t.split(Je).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},go=e=>e.isThemeGetter,fo=(e,t)=>t?e.map(([o,a])=>{let s=a.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,i])=>[t+l,i])):n);return[o,s]}):e,bo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,s=(n,l)=>{o.set(n,l),t++,t>e&&(t=0,a=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=a.get(n))!==void 0)return s(n,l),l},set(n,l){o.has(n)?o.set(n,l):s(n,l)}}},ft="!",vo=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,s=t[0],n=t.length,l=i=>{let p=[],f=0,y=0,m;for(let x=0;x<i.length;x++){let R=i[x];if(f===0){if(R===s&&(a||i.slice(x,x+n)===t)){p.push(i.slice(y,x)),y=x+n;continue}if(R==="/"){m=x;continue}}R==="["?f++:R==="]"&&f--}let v=p.length===0?i:i.substring(y),S=v.startsWith(ft),P=S?v.substring(1):v,w=m&&m>y?m-y:void 0;return{modifiers:p,hasImportantModifier:S,baseClassName:P,maybePostfixModifierPosition:w}};return o?i=>o({className:i,parseClassName:l}):l},ho=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},yo=e=>({cache:bo(e.cacheSize),parseClassName:vo(e),...po(e)}),xo=/\s+/,Co=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:s}=t,n=[],l=e.trim().split(xo),i="";for(let p=l.length-1;p>=0;p-=1){let f=l[p],{modifiers:y,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:S}=o(f),P=!!S,w=a(P?v.substring(0,S):v);if(!w){if(!P){i=f+(i.length>0?" "+i:i);continue}if(w=a(v),!w){i=f+(i.length>0?" "+i:i);continue}P=!1}let x=ho(y).join(":"),R=m?x+ft:x,B=R+w;if(n.includes(B))continue;n.push(B);let C=s(w,P);for(let L=0;L<C.length;++L){let ce=C[L];n.push(R+ce)}i=f+(i.length>0?" "+i:i)}return i};function wo(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=bt(t))&&(a&&(a+=" "),a+=o);return a}var bt=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=bt(e[a]))&&(o&&(o+=" "),o+=t);return o};function No(e,...t){let o,a,s,n=l;function l(p){let f=t.reduce((y,m)=>m(y),e());return o=yo(f),a=o.cache.get,s=o.cache.set,n=i,i(p)}function i(p){let f=a(p);if(f)return f;let y=Co(p,o);return s(p,y),y}return function(){return n(wo.apply(null,arguments))}}var k=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},vt=/^\[(?:([a-He-]+):)?(.+)\]$/i,ko=/^\d+\/\d+$/,To=new Set(["px","full","screen"]),Po=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ro=/\d+(%|px|He?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|He?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ao=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,So=/^(inset_)?-?((\d+)?\.?(\d+)[a-He]+|0)_-?((\d+)?\.?(\d+)[a-He]+|0)/,Mo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Q=e=>ve(e)||To.has(e)||ko.test(e),ne=e=>he(e,"length",Oo),ve=e=>!!e&&!Number.isNaN(Number(e)),qe=e=>he(e,"number",ve),Ne=e=>!!e&&Number.isInteger(Number(e)),Io=e=>e.endsWith("%")&&ve(e.slice(0,-1)),g=e=>vt.test(e),se=e=>Po.test(e),Lo=new Set(["length","size","percentage"]),Do=e=>he(e,Lo,ht),Eo=e=>he(e,"position",ht),Bo=new Set(["image","url"]),zo=e=>he(e,Bo,Vo),Ho=e=>he(e,"",Fo),ke=()=>!0,he=(e,t,o)=>{let a=vt.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Oo=e=>Ro.test(e)&&!Ao.test(e),ht=()=>!1,Fo=e=>So.test(e),Vo=e=>Mo.test(e);var Uo=()=>{let e=k("colors"),t=k("spacing"),o=k("blur"),a=k("brightness"),s=k("borderColor"),n=k("borderRadius"),l=k("borderSpacing"),i=k("borderWidth"),p=k("contrast"),f=k("grayscale"),y=k("hueRotate"),m=k("invert"),v=k("gap"),S=k("gradientColorStops"),P=k("gradientColorStopPositions"),w=k("inset"),x=k("margin"),R=k("opacity"),B=k("padding"),C=k("saturate"),L=k("scale"),ce=k("sepia"),We=k("skew"),Ce=k("space"),Me=k("translate"),de=()=>["auto","contain","none"],Ie=()=>["auto","hidden","clip","visible","scroll"],we=()=>["auto",g,t],N=()=>[g,t],Le=()=>["",Q,ne],be=()=>["auto",ve,g],De=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],pe=()=>["solid","dashed","dotted","double","none"],Ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],d=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",g],E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>[ve,g];return{cacheSize:500,separator:":",theme:{colors:[ke],spacing:[Q,ne],blur:["none","",se,g],brightness:b(),borderColor:[e],borderRadius:["none","","full",se,g],borderSpacing:N(),borderWidth:Le(),contrast:b(),grayscale:M(),hueRotate:b(),invert:M(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[Io,ne],inset:we(),margin:we(),opacity:b(),padding:N(),saturate:b(),scale:b(),sepia:M(),skew:b(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",g]}],container:["container"],columns:[{columns:[se]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:[...De(),g]}],overflow:[{overflow:Ie()}],"overflow-x":[{"overflow-x":Ie()}],"overflow-y":[{"overflow-y":Ie()}],overscroll:[{overscroll:de()}],"overscroll-x":[{"overscroll-x":de()}],"overscroll-y":[{"overscroll-y":de()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],He:[{He:["auto",Ne,g]}],basis:[{basis:we()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",g]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",Ne,g]}],"grid-cols":[{"grid-cols":[ke]}],"col-start-end":[{col:["auto",{span:["full",Ne,g]},g]}],"col-start":[{"col-start":be()}],"col-end":[{"col-end":be()}],"grid-rows":[{"grid-rows":[ke]}],"row-start-end":[{row:["auto",{span:[Ne,g]},g]}],"row-start":[{"row-start":be()}],"row-end":[{"row-end":be()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",g]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",g]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...d()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...d(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...d(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[B]}],px:[{px:[B]}],py:[{py:[B]}],ps:[{ps:[B]}],pe:[{pe:[B]}],pt:[{pt:[B]}],pr:[{pr:[B]}],pb:[{pb:[B]}],pl:[{pl:[B]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],He:[{He:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[Ce]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Ce]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",g,t]}],"min-w":[{"min-w":[g,t,"min","max","fit"]}],"max-w":[{"max-w":[g,t,"none","full","min","max","fit","prose",{screen:[se]},se]}],h:[{h:[g,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[g,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[g,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[g,t,"auto","min","max","fit"]}],"font-size":[{text:["base",se,ne]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qe]}],"font-family":[{font:[ke]}],"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",g]}],"line-clamp":[{"line-clamp":["none",ve,qe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Q,g]}],"list-image":[{"list-image":["none",g]}],"list-style-type":[{list:["none","disc","decimal",g]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Q,ne]}],"underline-offset":[{"underline-offset":["auto",Q,g]}],"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:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g]}],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",g]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...De(),Eo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Do]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","He","br","b","bl","l","tl"]},zo]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[P]}],"gradient-via-pos":[{via:[P]}],"gradient-to-pos":[{to:[P]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-He":[{"rounded-He":[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-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-He":[{"border-He":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[R]}],"border-style":[{border:[...pe(),"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":[R]}],"divide-style":[{divide:pe()}],"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-He":[{"border-He":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...pe()]}],"outline-offset":[{"outline-offset":[Q,g]}],"outline-w":[{outline:[Q,ne]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[Q,ne]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",se,Ho]}],"shadow-color":[{shadow:[ke]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...Ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ee()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",se,g]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[y]}],invert:[{invert:[m]}],saturate:[{saturate:[C]}],sepia:[{sepia:[ce]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[y]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[ce]}],"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",g]}],duration:[{duration:b()}],ease:[{ease:["linear","in","out","in-out",g]}],delay:[{delay:b()}],animate:[{animate:["none","spin","ping","pulse","bounce",g]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[Ne,g]}],"translate-x":[{"translate-x":[Me]}],"translate-y":[{"translate-y":[Me]}],"skew-x":[{"skew-x":[We]}],"skew-y":[{"skew-y":[We]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",g]}],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","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-He":[{"scroll-He":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",g]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Q,ne,qe]}],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","He","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","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-He","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-He":["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-w":["border-w-s","border-w-e","border-w-t","border-w-He","border-w-b","border-w-l"],"border-w-x":["border-w-He","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-He","border-color-b","border-color-l"],"border-color-x":["border-color-He","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-He","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 yt=No(Uo);function c(...e){return yt((0,xt.clsx)(e))}var He=require("react/jsx-runtime"),Te=ze.forwardRef(({className:e,...t},o)=>(0,He.jsx)(X.Root,{ref:o,className:c("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Te.displayName=X.Root.displayName;var $o=ze.forwardRef(({className:e,...t},o)=>(0,He.jsx)(X.Image,{ref:o,className:c("aspect-square h-full w-full",e),...t}));$o.displayName=X.Image.displayName;var Pe=ze.forwardRef(({className:e,...t},o)=>(0,He.jsx)(X.Fallback,{ref:o,className:c("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Pe.displayName=X.Fallback.displayName;var Ct=require("@radix-ui/react-slot"),wt=require("class-variance-authority"),Nt=U(require("react")),Go=(0,wt.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 w-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"}}}),V=Nt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...s},n)=>(0,He.jsx)(e?Ct.Slot:"button",{className:c(Go({className:t,size:o,variant:a})),ref:n,...s}));V.displayName="Button";var ue=U(require("react"));var _=ue.forwardRef(({className:e,...t},o)=>(0,He.jsx)("div",{ref:o,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));_.displayName="Card";var Y=ue.forwardRef(({className:e,...t},o)=>(0,He.jsx)("div",{ref:o,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Y.displayName="CardHeader";var Z=ue.forwardRef(({className:e,...t},o)=>(0,He.jsx)("div",{ref:o,className:c("font-semibold leading-none tracking-tight",e),...t}));Z.displayName="CardTitle";var Qe=ue.forwardRef(({className:e,...t},o)=>(0,He.jsx)("div",{ref:o,className:c("text-sm text-muted-foreground",e),...t}));Qe.displayName="CardDescription";var q=ue.forwardRef(({className:e,...t},o)=>(0,He.jsx)("div",{ref:o,className:c("p-6 pt-0",e),...t}));q.displayName="CardContent";var Re=ue.forwardRef(({className:e,...t},o)=>(0,He.jsx)("div",{ref:o,className:c("flex items-center p-6 pt-0",e),...t}));Re.displayName="CardFooter";var Tt=U(require("react"));var Xe=Tt.forwardRef(({className:e,type:t,...o},a)=>(0,He.jsx)("input",{type:t,className:c("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));Xe.displayName="Input";var Ye=U(require("react")),$=U(require("@radix-ui/react-scroll-area"));var Ze=Ye.forwardRef(({className:e,children:t,...o},a)=>(0,He.jsxs)($.Root,{ref:a,className:c("relative overflow-hidden",e),...o,children:[(0,He.jsx)($.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,He.jsx)(Rt,{}),(0,He.jsx)($.Corner,{})]}));Ze.displayName=$.Root.displayName;var Rt=Ye.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,He.jsx)($.ScrollAreaScrollbar,{ref:a,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,He.jsx)($.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Rt.displayName=$.ScrollAreaScrollbar.displayName;var jo=(0,wt.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ee({className:e,variant:t,...o}){return(0,He.jsx)("div",{className:c(jo({variant:t}),e),...o})}var K=require("motion/react");var Mt={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]};function et(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function It({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:s,colorScheme:n=Mt,className:l}){let[i,p]=(0,J.useState)([]),[f,y]=(0,J.useState)([]),m=i[i.length-1],v=m?.children||e,S=(C,L)=>{switch(C.type){case"category":return n.categories[L%n.categories.length];case"list":return n.lists[L%n.lists.length];case"item":return n.items[L%n.items.length];default:return n.primary}},P=(0,J.useMemo)(()=>({path:i,selectedItems:f,filters:{}}),[i,f]);(0,J.useEffect)(()=>{s&&s(P)},[P,s]);let w=C=>{C.type==="category"||C.type==="list"?p([...i,C]):C.type==="item"&&y([...f,C])},x=()=>{p(i.slice(0,-1))},R=C=>{p(i.slice(0,C+1))},B=()=>m?.actions?m.actions:[];return t?(0,He.jsxs)("div",{className:c("w-full",l),children:[(0,He.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,He.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,He.jsx)(K.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:x,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,He.jsx)(A.ChevronLeft,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,He.jsx)("h4",{className:"font-medium text-sm",children:m?.name||"Capabilities"})]}),(0,He.jsx)(K.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:o,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,He.jsx)(A.X,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,He.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,He.jsx)(K.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>p([]),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,He.jsxs)("span",{className:"relative",children:["Capabilities",(0,He.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((C,L)=>(0,He.jsxs)("div",{className:"flex items-center gap-1",children:[(0,He.jsx)(A.ChevronRight,{className:"h-2 w-2"}),(0,He.jsx)(K.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>R(L),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,He.jsxs)("span",{className:"relative",children:[C.name,(0,He.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},C.id))]}),(0,He.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,He.jsx)(K.AnimatePresence,{mode:"wait",children:(0,He.jsx)(K.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:m?.type==="list"&&m.data?(0,He.jsx)(qo,{data:m.data,onItemSelect:C=>y([...f,C]),colorScheme:n}):(0,He.jsx)(Wo,{capabilities:v,onSelect:w,colorScheme:n})},m?.id||"root")})})]}):(0,He.jsxs)(V,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,He.jsx)(A.Menu,{className:"h-4 w-4"}),(0,He.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Wo({capabilities:e,onSelect:t,colorScheme:o}){return(0,He.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,He.jsx)(_o,{capability:a,onClick:()=>t(a),color:o.categories[s%o.categories.length]},a.id))})}function _o({capability:e,onClick:t,selected:o,color:a}){return(0,He.jsxs)(K.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",o&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,He.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,He.jsxs)("span",{className:"truncate relative",children:[e.name,(0,He.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,He.jsx)(A.ChevronRight,{className:c("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,He.jsx)(ee,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function qo({data:e,onItemSelect:t,colorScheme:o}){return(0,He.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,He.jsxs)(K.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(a),children:[(0,He.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[s%o.items.length])}),(0,He.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,He.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,He.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),a.subtitle&&(0,He.jsx)("div",{className:c("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:a.subtitle})]}),a.value&&(0,He.jsx)(ee,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}var Et=require("date-fns");function Lt({taskId:e,polling:t=!0,system:o="payload"}){let[a,s]=(0,J.useState)(null),[n,l]=(0,J.useState)(!1),[i,p]=(0,J.useState)(null),f=async(m=!0)=>{if(e){m&&l(!0);try{let v=await fetch(`/api/tasks/${e}`);if(!v.ok)throw new Error(`Failed to fetch task: ${v.statusText}`);let S=await v.json();s(S)}catch(v){console.error("Error fetching task:",v),p(v instanceof Error?v:new Error("Unknown error occurred"))}finally{m&&l(!1)}}},y=()=>f(!1);return(0,J.useEffect)(()=>{e&&f(!0);let m=null;return e&&t&&(m=setInterval(y,5e3)),()=>{m&&clearInterval(m)}},[e,t]),{task:a,loading:n,error:i}}var Ko=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"}},Jo=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Bt({data:e}){let{id:t,system:o,fetchLatest:a,taskData:s,error:n}=e||{};if(!t)return null;let l=null,i=!0,p=n,f=a!==void 0?a:!0;if(l=s||{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:f,taskData:l,error:p}),f){let{task:S,loading:P,error:w}=Lt({taskId:t,system:o});l=S,i=P,p=w}else i=!1;let y=Ko(l?.status||"todo"),m=Jo(l?.status||"todo"),v=l?.dateLogged||new Date().toISOString();try{let S=new Date(l?.dateLogged||"");isNaN(S.getTime())||(v=(0,Et.formatDistanceToNow)(S,{addSuffix:!0}))}catch{}return(0,He.jsxs)(_,{className:c("w-full max-w-md shadow-md",p&&"border border-destructive"),children:[(0,He.jsxs)(Y,{className:"pb-2",children:[(0,He.jsxs)("div",{className:"flex justify-between items-start",children:[(0,He.jsx)(Z,{className:"text-lg font-semibold",children:i?"Loading...":l?.name||"Task"}),(0,He.jsx)(ee,{className:`${y}`,children:m})]}),l?.project&&(0,He.jsxs)(Qe,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,He.jsx)(q,{className:"pb-2",children:i?(0,He.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):p?(0,He.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,He.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,He.jsx)(Re,{className:"pt-2 flex items-center justify-between",children:(0,He.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,He.jsx)(A.Clock,{className:"h-3 w-3 mr-1"}),(0,He.jsxs)("span",{children:["Created ",v]}),(0,He.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,He.jsxs)("span",{children:["Task #",t]})]})})]})}function Ot({artefact:e,taskId:t,taskData:o,loading:a=!1,error:s=null}){let n=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=n.dateLogged;try{let i=new Date(n.dateLogged);isNaN(i.getTime())||(l=(0,Et.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,He.jsxs)(_,{className:"w-full max-w-md shadow-md",children:[(0,He.jsx)(Y,{className:"pb-2",children:(0,He.jsx)("div",{className:"flex justify-between items-start",children:(0,He.jsx)(Z,{className:"text-lg font-semibold",children:a?"Loading...":n.name})})}),(0,He.jsx)(q,{className:"pb-2",children:a?(0,He.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,He.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,He.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,He.jsx)(Re,{className:"pt-2 flex items-center justify-between",children:(0,He.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,He.jsx)(A.Clock,{className:"h-3 w-3 mr-1"}),(0,He.jsxs)("span",{children:["Created ",l]}),(0,He.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,He.jsxs)("span",{children:["Task #",n.id]})]})})]})}var Vt=U(require("react"));var Ft=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:s="This endpoint requires authentication to sync functions."})=>{let[n,l]=(0,J.useState)(!1),[i,p]=(0,J.useState)(""),f=()=>{if(!t){p("No authentication URL provided");return}l(!0),p("");try{let m=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!m){p("Popup blocked. Please allow popups for this site and try again."),l(!1);return}let v=setInterval(()=>{try{m.closed&&(clearInterval(v),l(!1),a(),o())}catch{}},1e3);setTimeout(()=>{m.closed||(m.close(),clearInterval(v),l(!1),p("Authentication timed out. Please try again."))},6e5)}catch{p("Failed to open authentication window"),l(!1)}},y=async()=>{try{await navigator.clipboard.writeText(t),p("")}catch{p("Failed to copy URL to clipboard")}};return e?(0,He.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center He-[1000]",children:(0,He.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,He.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,He.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s}),i&&(0,He.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:i}),(0,He.jsxs)("div",{className:"flex gap-2",children:[(0,He.jsx)("button",{onClick:f,disabled:n||!t,className:`
7
7
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
8
8
  ${n||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
9
- `,children:n?"Authenticating...":"Authenticate"}),(0,De.jsx)("button",{onClick:h,disabled:!t,className:`
9
+ `,children:n?"Authenticating...":"Authenticate"}),(0,He.jsx)("button",{onClick:y,disabled:!t,className:`
10
10
  px-4 py-2 text-white border-none rounded text-sm
11
11
  ${t?"bg-blue-600 hover:bg-blue-700 cursor-pointer":"bg-gray-400 cursor-not-allowed"}
12
- `,children:"Copy URL"}),(0,De.jsx)("button",{onClick:o,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var _e=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=Mt.default.useState(!0),n=()=>{o(e.input?.toolCallId,e.input?.tool,"Authentication completed"),s(!1)};switch(e.state){case"input-available":return(0,De.jsxs)("div",{className:"mb-2",children:[(0,De.jsx)(St,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>s(!1),onSuccess:n,description:e.output?.reason||e.input?.reason}),!a&&(0,De.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,De.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,De.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,De.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,De.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Lt=require("marked"),It=V(require("react-markdown"));function Ho(e){return Lt.marked.lexer(e).map(o=>o.raw)}var Dt=(0,q.memo)(({content:e})=>(0,De.jsx)(It.default,{children:e}),(e,t)=>e.content===t.content);Dt.displayName="MemoizedMarkdownBlock";var qe=(0,q.memo)(({content:e,id:t})=>(0,q.useMemo)(()=>Ho(e),[e]).map((a,s)=>(0,De.jsx)(Dt,{content:a},`${t}-block_${s}`)));qe.displayName="PartText";var Je=V(require("react"));var zt=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:s,title:n="Approval Required"})=>{let[l,i]=(0,q.useState)(!1),p=()=>{i(!0),a(),o()},f=()=>{i(!0),s(),o()},h=()=>{i(!0),s(),o()};return e?(0,De.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,De.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:n}),(0,De.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,De.jsxs)("div",{className:"flex gap-2",children:[(0,De.jsx)("button",{onClick:p,disabled:l,className:`
12
+ `,children:"Copy URL"}),(0,He.jsx)("button",{onClick:o,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var ot=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=Vt.default.useState(!0),n=()=>{o(e.input?.toolCallId,e.input?.tool,"Authentication completed"),s(!1)};switch(e.state){case"input-available":return(0,He.jsxs)("div",{className:"mb-2",children:[(0,He.jsx)(Ft,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>s(!1),onSuccess:n,description:e.output?.reason||e.input?.reason}),!a&&(0,He.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,He.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,He.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,He.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,He.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Ut=require("marked"),$t=U(require("react-markdown"));function Qo(e){return Ut.marked.lexer(e).map(o=>o.raw)}var Gt=(0,J.memo)(({content:e})=>(0,He.jsx)($t.default,{children:e}),(e,t)=>e.content===t.content);Gt.displayName="MemoizedMarkdownBlock";var rt=(0,J.memo)(({content:e,id:t})=>(0,J.useMemo)(()=>Qo(e),[e]).map((a,s)=>(0,He.jsx)(Gt,{content:a},`${t}-block_${s}`)));rt.displayName="PartText";var nt=U(require("react"));var Wt=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:s,title:n="Approval Required"})=>{let[l,i]=(0,J.useState)(!1),p=()=>{i(!0),a(),o()},f=()=>{i(!0),s(),o()},y=()=>{i(!0),s(),o()};return e?(0,He.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,He.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:n}),(0,He.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,He.jsxs)("div",{className:"flex gap-2",children:[(0,He.jsx)("button",{onClick:p,disabled:l,className:`
13
13
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
14
14
  ${l?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
15
- `,children:l?"Processing...":"Approve"}),(0,De.jsx)("button",{onClick:f,disabled:l,className:`
15
+ `,children:l?"Processing...":"Approve"}),(0,He.jsx)("button",{onClick:f,disabled:l,className:`
16
16
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
17
17
  ${l?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
18
- `,children:l?"Processing...":"Deny"}),(0,De.jsx)("button",{onClick:h,disabled:l,className:`
18
+ `,children:l?"Processing...":"Deny"}),(0,He.jsx)("button",{onClick:y,disabled:l,className:`
19
19
  px-4 py-2 text-white border-none rounded text-sm
20
20
  ${l?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
21
- `,children:"Cancel"})]})]}):null};var Bt=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=Je.default.useState(!0),[n,l]=Je.default.useState(null),i=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),s(!1),l("approve")},p=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),s(!1),l("deny")};switch(e.state){case"input-available":return(0,De.jsxs)("div",{className:"mb-2",children:[(0,De.jsx)(zt,{isOpen:a,onApprove:i,onDeny:p,onClose:()=>s(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,De.jsxs)(De.Fragment,{children:[n==="approve"&&(0,De.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,De.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,De.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,De.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),n==="deny"&&(0,De.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,De.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,De.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,De.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,De.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Xe=require("@radix-ui/react-use-controllable-state");var ve=V(require("@radix-ui/react-collapsible")),Ht=ve.Root,Ft=ve.CollapsibleTrigger,Ot=ve.CollapsibleContent;var Gt=require("streamdown"),Qe=(0,q.memo)(({className:e,...t})=>(0,$t.jsx)(Gt.Streamdown,{className:d("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Qe.displayName="Response";var jt=(0,q.createContext)(null),Fo=()=>{let e=(0,q.useContext)(jt);if(!e)throw new Error("Reasoning components must q used within Reasoning");return e},Oo=1e3,Vo=1e3,Ye=(0,q.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:s,duration:n,children:l,...i})=>{let[p,f]=(0,Xe.useControllableState)({prop:o,defaultProp:a,onChange:s}),[h,m]=(0,Xe.useControllableState)({prop:n,defaultProp:0}),[b,T]=(0,q.useState)(!1),[R,w]=(0,q.useState)(null);(0,q.useEffect)(()=>{t?R===null&&w(Date.now()):R!==null&&(m(Math.ceil((Date.now()-R)/Vo)),w(null))},[t,R,m]),(0,q.useEffect)(()=>{if(a&&!t&&p&&!b){let P=setTimeout(()=>{f(!1),T(!0)},Oo);return()=>clearTimeout(P)}},[t,p,a,f,b]);let x=P=>{f(P)};return(0,De.jsx)(jt.Provider,{value:{isStreaming:t,isOpen:p,setIsOpen:f,duration:h},children:(0,De.jsx)(Ht,{className:d("not-prose mb-4",e),onOpenChange:x,open:p,...i,children:l})})}),Go=(e,t)=>e||t===0?(0,De.jsx)("p",{children:"Thinking..."}):t===void 0?(0,De.jsx)("p",{children:"Thought for a few seconds"}):(0,De.jsxs)("p",{children:["Thought for ",t," seconds"]}),Ze=(0,q.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:s,duration:n}=Fo();return(0,De.jsx)(Ft,{className:d("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,De.jsxs)(De.Fragment,{children:[(0,De.jsx)(A.BrainIcon,{className:"size-4"}),Go(a,n),(0,De.jsx)(A.ChevronDownIcon,{className:d("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),et=(0,q.memo)(({className:e,children:t,...o})=>(0,De.jsx)(Ot,{className:d("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,De.jsx)(Qe,{className:"grid gap-2",children:t})}));Ye.displayName="Reasoning";Ze.displayName="ReasoningTrigger";et.displayName="ReasoningContent";function $o({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:s,fileUploads:n,isDragOver:l,enableFileUpload:i,onInputChange:p,addToolResult:f,onSendMessage:h,onKeyPress:m,onFileUpload:b,onRemoveFile:T,onDragOver:R,className:w}){let x=(0,q.useRef)(null),P=(0,q.useRef)(null),E=(0,q.useRef)(null),[C,L]=(0,q.useState)(!1),[ne,ze]=(0,q.useState)({path:[],selectedItems:[],filters:{}});(0,q.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,q.useEffect)(()=>{C&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[C]);let he=()=>Ue(ne),Pe=()=>{let c=[];return s.forEach(S=>{S.actions&&S.actions.forEach(D=>{c.push({label:D.label,action:()=>ie(D.id,{path:[S],selectedItems:[],filters:{}})})}),S.children&&S.children.forEach(D=>{D.type==="list"&&D.data&&c.push({label:`View ${D.name}`,action:()=>L(!0)})})}),c.slice(0,5)},ie=(c,S)=>{console.log("Capability action:",c,S);let D=`Executing ${c} with context: ${JSON.stringify(S.path.map(y=>y.name))}`;L(!1)},Ae=Ue({path:[],selectedItems:[],filters:{}}),ye=c=>{b(c.target.files),c.target.files&&(c.target.value="")},N=c=>{c.preventDefault(),R(!0)},Te=c=>{c.preventDefault(),R(!1)},me=c=>{c.preventDefault(),R(!1),b(c.dataTransfer.files)},Se=c=>{if(c===0)return"0 Bytes";let S=1024,D=["Bytes","KB","MB","GB"],y=Math.floor(Math.log(c)/Math.log(S));return parseFloat((c/Math.pow(S,y)).toFixed(2))+" "+D[y]},se=c=>c.startsWith("image/")?(0,De.jsx)(A.Image,{className:"h-4 w-4"}):c.startsWith("text/")?(0,De.jsx)(A.FileText,{className:"h-4 w-4"}):(0,De.jsx)(A.File,{className:"h-4 w-4"}),Me=c=>{let S=c.role==="assistant",D=c.role==="user";return(0,De.jsxs)("div",{className:d("flex my-2 items-start gap-3",D?"flex-row-reverse":""),children:[(0,De.jsx)(we,{className:"h-8 w-8 shrink-0",children:(0,De.jsx)(Ne,{className:d(D?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:D?(0,De.jsx)(A.User,{className:"h-4 w-4"}):(0,De.jsx)(A.Bot,{className:"h-4 w-4"})})}),(0,De.jsx)("div",{className:d("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",D?"bg-primary text-primary-foreground":"bg-muted"),children:c.parts.map((y,M)=>{if(y.type==="text")return(0,De.jsx)(qe,{id:c.id,content:y.text},`${c.id}-text`);if(y.type==="file"){let v=y;return(0,De.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,De.jsxs)("div",{className:"flex items-center gap-2",children:[se(v.mediaType||"application/octet-stream"),(0,De.jsx)("div",{className:"flex-1 min-w-0",children:(0,De.jsx)("p",{className:"text-sm font-medium truncate",children:v.filename||v.url?.split("/").pop()||"File"})}),v.url&&(0,De.jsx)(O,{variant:"ghost",size:"sm",onClick:()=>window.open(v.url,"_blank"),className:"h-8 w-8 p-0",children:(0,De.jsx)(A.Download,{className:"h-4 w-4"})})]})},M)}if(y.type.startsWith("tool-")){let v=y,te=y.type.replace("tool-","");if(te==="task")switch(v.state){case"input-available":return(0,De.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},M);case"output-available":return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(Rt,{data:{id:v.output?.id||v.input?.id,fetchLatest:!1,taskData:v.output||v.input}})},M);case"output-error":return(0,De.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",v.errorText]},M);default:return null}if(y.type==="tool-requestEndpointLogin")return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(_e,{toolPart:v,index:M,addToolResult:f??(()=>{})})},M);if(y.type==="tool-authenticate")return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(_e,{toolPart:v,index:M,addToolResult:f??(()=>{})})},M);if(y.type==="tool-requestApproval")return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(Bt,{toolPart:v,index:M,addToolResult:f??(()=>{})})},M);if(te==="artefact")switch(v.state){case"input-available":return(0,De.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},M);case"output-available":return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(Tt,{artefact:v.output?.description||"",taskId:v.output?.id||v.input?.id,taskData:v.output||v.input})},M);case"output-error":return(0,De.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",v.errorText]},M);default:return null}return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsxs)(U,{className:"w-full max-w-md",children:[(0,De.jsx)(Q,{children:(0,De.jsx)(X,{className:"text-lg",children:te})}),(0,De.jsxs)(W,{children:[v.state==="input-available"&&(0,De.jsxs)("p",{className:"text-sm",children:["Processing ",te,"..."]}),v.state==="output-available"&&(0,De.jsx)("pre",{className:"text-sm",children:JSON.stringify(v.output,null,2)}),v.state==="output-error"&&(0,De.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",v.errorText]})]})]})},M)}if(y.type.startsWith("data-")){let v=y,te=y.type.replace("data-","");return te==="reference"?(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(U,{className:"w-full",children:(0,De.jsx)(W,{className:"p-4",children:(0,De.jsx)("div",{className:"space-y-2",children:v.data?.references?.map(($,Be)=>(0,De.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,De.jsx)(de,{variant:"outline",children:$.type||"link"}),(0,De.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,De.jsx)("p",{className:"text-sm font-medium truncate",children:$.title}),$.description&&(0,De.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:$.description})]}),$.url&&(0,De.jsx)(O,{variant:"ghost",size:"sm",onClick:()=>window.open($.url,"_blank"),className:"h-8 w-8 p-0",children:(0,De.jsx)(A.ExternalLink,{className:"h-4 w-4"})})]},Be))})})})},M):te==="menu"?(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsxs)(U,{className:"w-full",children:[(0,De.jsx)(Q,{children:(0,De.jsx)(X,{className:"text-lg",children:v.data?.title})}),(0,De.jsx)(W,{children:(0,De.jsx)("div",{className:"space-y-2",children:v.data?.items?.map(($,Be)=>(0,De.jsx)(O,{variant:"outline",className:"w-full justify-start",onClick:$.action,children:(0,De.jsxs)("div",{className:"text-left",children:[(0,De.jsx)("p",{className:"font-medium",children:$.label}),$.description&&(0,De.jsx)("p",{className:"text-xs text-muted-foreground",children:$.description})]})},Be))})})]})},M):(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsxs)(U,{className:"w-full max-w-md",children:[(0,De.jsx)(Q,{children:(0,De.jsx)(X,{className:"text-lg",children:te})}),(0,De.jsx)(W,{children:(0,De.jsx)("pre",{className:"text-sm",children:JSON.stringify(v.data,null,2)})})]})},M)}if(y.type==="reasoning")return(0,De.jsxs)(Ye,{className:"w-full",isStreaming:status==="streaming"&&M===c.parts.length-1&&c.id===e.at(-1)?.id,children:[(0,De.jsx)(Ze,{}),(0,De.jsx)(et,{children:y.text})]},`${c.id}-${M}`)})})]})};return(0,De.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${w||""}`,children:[(0,De.jsxs)(je,{ref:P,className:"flex-1 p-4 bg-background border-0",onDragOver:N,onDragLeave:Te,onDrop:me,children:[(0,De.jsxs)("div",{className:d("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,De.jsx)(ue.animate,{children:e.map(c=>(0,De.jsx)(ue.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:d("flex gap-3",c.role==="user"?"flex-row-reverse":"flex-row"),children:Me(c)},c.id))}),C&&(0,De.jsxs)(ue.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,De.jsx)(we,{className:"h-8 w-8",children:(0,De.jsx)(Ne,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,De.jsx)(A.Bot,{className:"h-4 w-4"})})}),(0,De.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,De.jsx)(Ct,{capabilities:s,isOpen:C,onToggle:()=>L(!C),onActionSelect:ie,className:"w-full"})})]}),o&&(0,De.jsxs)(ue.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,De.jsx)(we,{className:"h-8 w-8",children:(0,De.jsx)(Ne,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,De.jsx)(A.Bot,{className:"h-4 w-4"})})}),(0,De.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,De.jsxs)("div",{className:"flex space-x-1",children:[(0,De.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,De.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,De.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,De.jsx)("div",{ref:x})]}),n.length>0&&(0,De.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,De.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(c=>(0,De.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[se(c.file.type),(0,De.jsx)("span",{className:"text-sm font-medium",children:c.file.name}),(0,De.jsx)("span",{className:"text-xs text-muted-foreground",children:Se(c.file.size)}),(0,De.jsx)(O,{variant:"ghost",size:"sm",onClick:()=>T(c.id),className:"h-6 w-6 p-0",children:(0,De.jsx)(A.X,{className:"h-4 w-4"})})]},c.id))})}),(0,De.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,De.jsxs)("div",{className:"flex gap-3",children:[(0,De.jsx)(Ge,{value:t,onChange:c=>p(c.target.value),onKeyPress:m,placeholder:"How can De help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),i&&(0,De.jsx)(O,{variant:"outline",size:"icon",onClick:()=>E.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,De.jsx)(A.Paperclip,{className:"h-4 w-4"})}),(0,De.jsx)(O,{onClick:h,disabled:!t.trim()&&n.length===0||o,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,De.jsx)(A.Send,{className:"h-4 w-4"})})]}),(0,De.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,De.jsxs)(O,{onClick:()=>L(!C),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,De.jsx)(A.Menu,{className:"h-3 w-3 mr-1"}),C?"Hide":"Show"," Capabilities"]}),(0,De.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[he().map((c,S)=>(0,De.jsx)(O,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>ie(c.id,ne),children:c.label},`context-${c.id}`)),he().length===0&&Pe().map((c,S)=>(0,De.jsx)(O,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:c.action,children:c.label},`suggestion-${S}`))]})]}),i&&(0,De.jsx)("input",{ref:E,type:"file",multiple:!0,onChange:ye,className:"hidden"})]})]})}0&&(module.exports={ChatInterface});
21
+ `,children:"Cancel"})]})]}):null};var _t=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=nt.default.useState(!0),[n,l]=nt.default.useState(null),i=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),s(!1),l("approve")},p=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),s(!1),l("deny")};switch(e.state){case"input-available":return(0,He.jsxs)("div",{className:"mb-2",children:[(0,He.jsx)(Wt,{isOpen:a,onApprove:i,onDeny:p,onClose:()=>s(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,He.jsxs)(He.Fragment,{children:[n==="approve"&&(0,He.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,He.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,He.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,He.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),n==="deny"&&(0,He.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,He.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,He.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,He.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,He.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var st=require("@radix-ui/react-use-controllable-state");var xe=U(require("@radix-ui/react-collapsible")),Oe=xe.Root,Fe=xe.CollapsibleTrigger,Ve=xe.CollapsibleContent;var Kt=require("streamdown"),Se=(0,J.memo)(({className:e,...t})=>(0,He.jsx)(Kt.Streamdown,{className:c("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Se.displayName="Response";var Qt=(0,J.createContext)(null),Xo=()=>{let e=(0,J.useContext)(Qt);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},Yo=1e3,Zo=1e3,it=(0,J.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:s,duration:n,children:l,...i})=>{let[p,f]=(0,st.useControllableState)({prop:o,defaultProp:a,onChange:s}),[y,m]=(0,st.useControllableState)({prop:n,defaultProp:0}),[v,S]=(0,J.useState)(!1),[P,w]=(0,J.useState)(null);(0,J.useEffect)(()=>{t?P===null&&w(Date.now()):P!==null&&(m(Math.ceil((Date.now()-P)/Zo)),w(null))},[t,P,m]),(0,J.useEffect)(()=>{if(a&&!t&&p&&!v){let R=setTimeout(()=>{f(!1),S(!0)},Yo);return()=>clearTimeout(R)}},[t,p,a,f,v]);let x=R=>{f(R)};return(0,He.jsx)(Qt.Provider,{value:{isStreaming:t,isOpen:p,setIsOpen:f,duration:y},children:(0,He.jsx)(Oe,{className:c("not-prose mb-4",e),onOpenChange:x,open:p,...i,children:l})})}),er=(e,t)=>e||t===0?(0,He.jsx)("p",{children:"Thinking..."}):t===void 0?(0,He.jsx)("p",{children:"Thought for a few seconds"}):(0,He.jsxs)("p",{children:["Thought for ",t," seconds"]}),lt=(0,J.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:s,duration:n}=Xo();return(0,He.jsx)(Fe,{className:c("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(A.BrainIcon,{className:"size-4"}),er(a,n),(0,He.jsx)(A.ChevronDownIcon,{className:c("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),ct=(0,J.memo)(({className:e,children:t,...o})=>(0,He.jsx)(Ve,{className:c("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,He.jsx)(Se,{className:"grid gap-2",children:t})}));it.displayName="Reasoning";lt.displayName="ReasoningTrigger";ct.displayName="ReasoningContent";var dt=require("react-syntax-highlighter"),Ge=require("react-syntax-highlighter/dist/esm/styles/prism"),tr=(0,$e.createContext)({code:""}),je=({code:e,language:t,showLineNumbers:o=!1,className:a,children:s,...n})=>(0,He.jsx)(tr.Provider,{value:{code:e},children:(0,He.jsx)("div",{className:c("relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...n,children:(0,He.jsxs)("div",{className:"relative",children:[(0,He.jsx)(dt.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:Ge.oneLight,children:e}),(0,He.jsx)(dt.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:Ge.oneDark,children:e}),s&&(0,He.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:s})]})})});var Yt=({className:e,...t})=>(0,He.jsx)(Oe,{className:c("not-prose mb-4 w-full rounded-md border",e),...t}),or=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,He.jsxs)(ee,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,He.jsx)(A.CircleIcon,{className:"size-4"}),"input-available":(0,He.jsx)(A.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,He.jsx)(A.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,He.jsx)(A.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Zt=({className:e,type:t,state:o,...a})=>(0,He.jsxs)(Fe,{className:c("flex w-full items-center justify-between gap-4 p-3",e),...a,children:[(0,He.jsxs)("div",{className:"flex items-center gap-2",children:[(0,He.jsx)(A.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,He.jsx)("span",{className:"font-medium text-sm",children:t}),or(o)]}),(0,He.jsx)(A.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),eo=({className:e,...t})=>(0,He.jsx)(Ve,{className:c("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}),to=({className:e,input:t,...o})=>(0,He.jsxs)("div",{className:c("space-y-2 overflow-hidden p-4",e),...o,children:[(0,He.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,He.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,He.jsx)(je,{code:JSON.stringify(t,null,2),language:"json"})})]}),oo=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let s=(0,He.jsx)("div",{children:t});return typeof t=="object"?s=(0,He.jsx)(je,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(s=(0,He.jsx)(je,{code:t,language:"json"})),(0,He.jsxs)("div",{className:c("space-y-2 p-4",e),...a,children:[(0,He.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,He.jsxs)("div",{className:c("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,He.jsx)("div",{children:o}),s]})]})};function rr({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:s,fileUploads:n,isDragOver:l,enableFileUpload:i,onInputChange:p,addToolResult:f,onSendMessage:y,onKeyPress:m,onFileUpload:v,onRemoveFile:S,onDragOver:P,className:w}){let x=(0,J.useRef)(null),R=(0,J.useRef)(null),B=(0,J.useRef)(null),[C,L]=(0,J.useState)(!1),[ce,We]=(0,J.useState)({path:[],selectedItems:[],filters:{}});(0,J.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,J.useEffect)(()=>{C&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[C]);let Ce=()=>et(ce),Me=()=>{let d=[];return s.forEach(M=>{M.actions&&M.actions.forEach(E=>{d.push({label:E.label,action:()=>de(E.id,{path:[M],selectedItems:[],filters:{}})})}),M.children&&M.children.forEach(E=>{E.type==="list"&&E.data&&d.push({label:`View ${E.name}`,action:()=>L(!0)})})}),d.slice(0,5)},de=(d,M)=>{console.log("Capability action:",d,M);let E=`Executing ${d} with context: ${JSON.stringify(M.path.map(b=>b.name))}`;L(!1)},Ie=et({path:[],selectedItems:[],filters:{}}),we=d=>{v(d.target.files),d.target.files&&(d.target.value="")},N=d=>{d.preventDefault(),P(!0)},Le=d=>{d.preventDefault(),P(!1)},be=d=>{d.preventDefault(),P(!1),v(d.dataTransfer.files)},De=d=>{if(d===0)return"0 Bytes";let M=1024,E=["Bytes","KB","MB","GB"],b=Math.floor(Math.log(d)/Math.log(M));return parseFloat((d/Math.pow(M,b)).toFixed(2))+" "+E[b]},pe=d=>d.startsWith("image/")?(0,He.jsx)(A.Image,{className:"h-4 w-4"}):d.startsWith("text/")?(0,He.jsx)(A.FileText,{className:"h-4 w-4"}):(0,He.jsx)(A.File,{className:"h-4 w-4"}),Ee=d=>{let M=d.role==="assistant",E=d.role==="user";return(0,He.jsxs)("div",{className:c("flex my-2 items-start gap-3",E?"flex-row-reverse":""),children:[(0,He.jsx)(Te,{className:"h-8 w-8 shrink-0",children:(0,He.jsx)(Pe,{className:c(E?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:E?(0,He.jsx)(A.User,{className:"h-4 w-4"}):(0,He.jsx)(A.Bot,{className:"h-4 w-4"})})}),(0,He.jsx)("div",{className:c("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",E?"bg-primary text-primary-foreground":"bg-muted"),children:d.parts.map((b,I)=>{if(b.type==="text")return(0,He.jsx)(rt,{id:d.id,content:b.text},`${d.id}-text`);if(b.type==="file"){let h=b;return(0,He.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,He.jsxs)("div",{className:"flex items-center gap-2",children:[pe(h.mediaType||"application/octet-stream"),(0,He.jsx)("div",{className:"flex-1 min-w-0",children:(0,He.jsx)("p",{className:"text-sm font-medium truncate",children:h.filename||h.url?.split("/").pop()||"File"})}),h.url&&(0,He.jsx)(V,{variant:"ghost",size:"sm",onClick:()=>window.open(h.url,"_blank"),className:"h-8 w-8 p-0",children:(0,He.jsx)(A.Download,{className:"h-4 w-4"})})]})},I)}if(b.type.startsWith("tool-")){let h=b,ae=b.type.replace("tool-","");if(ae==="task")switch(h.state){case"input-available":return(0,He.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},I);case"output-available":return(0,He.jsx)("div",{className:"mb-2",children:(0,He.jsx)(Bt,{data:{id:h.output?.id||h.input?.id,fetchLatest:!1,taskData:h.output||h.input}})},I);case"output-error":return(0,He.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",h.errorText]},I);default:return null}if(b.type==="tool-requestEndpointLogin")return(0,He.jsx)("div",{className:"mb-2",children:(0,He.jsx)(ot,{toolPart:h,index:I,addToolResult:f??(()=>{})})},I);if(b.type==="tool-authenticate")return(0,He.jsx)("div",{className:"mb-2",children:(0,He.jsx)(ot,{toolPart:h,index:I,addToolResult:f??(()=>{})})},I);if(b.type==="tool-requestApproval")return(0,He.jsx)("div",{className:"mb-2",children:(0,He.jsx)(_t,{toolPart:h,index:I,addToolResult:f??(()=>{})})},I);if(ae==="artefact")switch(h.state){case"input-available":return(0,He.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},I);case"output-available":return(0,He.jsx)("div",{className:"mb-2",children:(0,He.jsx)(Ot,{artefact:h.output?.description||"",taskId:h.output?.id||h.input?.id,taskData:h.output||h.input})},I);case"output-error":return(0,He.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",h.errorText]},I);default:return null}return(0,He.jsx)("div",{className:"mb-2",children:(0,He.jsxs)(_,{className:"w-full max-w-md",children:[(0,He.jsx)(Y,{children:(0,He.jsx)(Z,{className:"text-lg",children:ae})}),(0,He.jsxs)(q,{children:[h.state==="input-available"&&(0,He.jsxs)("p",{className:"text-sm",children:["Processing ",ae,"..."]}),h.state==="output-available"&&(0,He.jsx)("pre",{className:"text-sm",children:JSON.stringify(h.output,null,2)}),h.state==="output-error"&&(0,He.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",h.errorText]})]})]})},I)}if(b.type.startsWith("data-")){let h=b,ae=b.type.replace("data-","");return ae==="reference"?(0,He.jsx)("div",{className:"mb-2",children:(0,He.jsx)(_,{className:"w-full",children:(0,He.jsx)(q,{className:"p-4",children:(0,He.jsx)("div",{className:"space-y-2",children:h.data?.references?.map((j,_e)=>(0,He.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,He.jsx)(ee,{variant:"outline",children:j.type||"link"}),(0,He.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,He.jsx)("p",{className:"text-sm font-medium truncate",children:j.title}),j.description&&(0,He.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:j.description})]}),j.url&&(0,He.jsx)(V,{variant:"ghost",size:"sm",onClick:()=>window.open(j.url,"_blank"),className:"h-8 w-8 p-0",children:(0,He.jsx)(A.ExternalLink,{className:"h-4 w-4"})})]},_e))})})})},I):ae==="menu"?(0,He.jsx)("div",{className:"mb-2",children:(0,He.jsxs)(_,{className:"w-full",children:[(0,He.jsx)(Y,{children:(0,He.jsx)(Z,{className:"text-lg",children:h.data?.title})}),(0,He.jsx)(q,{children:(0,He.jsx)("div",{className:"space-y-2",children:h.data?.items?.map((j,_e)=>(0,He.jsx)(V,{variant:"outline",className:"w-full justify-start",onClick:j.action,children:(0,He.jsxs)("div",{className:"text-left",children:[(0,He.jsx)("p",{className:"font-medium",children:j.label}),j.description&&(0,He.jsx)("p",{className:"text-xs text-muted-foreground",children:j.description})]})},_e))})})]})},I):(0,He.jsx)("div",{className:"mb-2",children:(0,He.jsxs)(_,{className:"w-full max-w-md",children:[(0,He.jsx)(Y,{children:(0,He.jsx)(Z,{className:"text-lg",children:ae})}),(0,He.jsx)(q,{children:(0,He.jsx)("pre",{className:"text-sm",children:JSON.stringify(h.data,null,2)})})]})},I)}if(b.type==="reasoning")return(0,He.jsxs)(it,{className:"w-full",isStreaming:status==="streaming"&&I===d.parts.length-1&&d.id===e.He(-1)?.id,children:[(0,He.jsx)(lt,{}),(0,He.jsx)(ct,{children:b.text})]},`${d.id}-${I}`);if(b.type==="dynamic-tool")return(0,He.jsxs)(Yt,{defaultOpen:!0,children:[(0,He.jsx)(Zt,{type:`tool-${b.toolName}`,state:b.state}),(0,He.jsxs)(eo,{children:[(0,He.jsx)(to,{input:b.input}),(0,He.jsx)(oo,{output:(0,He.jsx)(Se,{children:String(b.output)}),errorText:b.errorText})]})]})})})]})};return(0,He.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${w||""}`,children:[(0,He.jsxs)(Ze,{ref:R,className:"flex-1 p-4 bg-background border-0",onDragOver:N,onDragLeave:Le,onDrop:be,children:[(0,He.jsxs)("div",{className:c("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,He.jsx)(fe.animate,{children:e.map(d=>(0,He.jsx)(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:c("flex gap-3",d.role==="user"?"flex-row-reverse":"flex-row"),children:Ee(d)},d.id))}),C&&(0,He.jsxs)(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,He.jsx)(Te,{className:"h-8 w-8",children:(0,He.jsx)(Pe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,He.jsx)(A.Bot,{className:"h-4 w-4"})})}),(0,He.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,He.jsx)(It,{capabilities:s,isOpen:C,onToggle:()=>L(!C),onActionSelect:de,className:"w-full"})})]}),o&&(0,He.jsxs)(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,He.jsx)(Te,{className:"h-8 w-8",children:(0,He.jsx)(Pe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,He.jsx)(A.Bot,{className:"h-4 w-4"})})}),(0,He.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,He.jsxs)("div",{className:"flex space-x-1",children:[(0,He.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,He.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,He.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,He.jsx)("div",{ref:x})]}),n.length>0&&(0,He.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,He.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(d=>(0,He.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[pe(d.file.type),(0,He.jsx)("span",{className:"text-sm font-medium",children:d.file.name}),(0,He.jsx)("span",{className:"text-xs text-muted-foreground",children:De(d.file.size)}),(0,He.jsx)(V,{variant:"ghost",size:"sm",onClick:()=>S(d.id),className:"h-6 w-6 p-0",children:(0,He.jsx)(A.X,{className:"h-4 w-4"})})]},d.id))})}),(0,He.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,He.jsxs)("div",{className:"flex gap-3",children:[(0,He.jsx)(Xe,{value:t,onChange:d=>p(d.target.value),onKeyPress:m,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),i&&(0,He.jsx)(V,{variant:"outline",size:"icon",onClick:()=>B.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,He.jsx)(A.Paperclip,{className:"h-4 w-4"})}),(0,He.jsx)(V,{onClick:y,disabled:!t.trim()&&n.length===0||o,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,He.jsx)(A.Send,{className:"h-4 w-4"})})]}),(0,He.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,He.jsxs)(V,{onClick:()=>L(!C),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,He.jsx)(A.Menu,{className:"h-3 w-3 mr-1"}),C?"Hide":"Show"," Capabilities"]}),(0,He.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[Ce().map((d,M)=>(0,He.jsx)(V,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>de(d.id,ce),children:d.label},`context-${d.id}`)),Ce().length===0&&Me().map((d,M)=>(0,He.jsx)(V,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:d.action,children:d.label},`suggestion-${M}`))]})]}),i&&(0,He.jsx)("input",{ref:B,type:"file",multiple:!0,onChange:we,className:"hidden"})]})]})}0&&(module.exports={ChatInterface});
@@ -1 +1 @@
1
- import{a}from"../../chunk-UTHKFW4R.mjs";import"../../chunk-3BG2SCNC.mjs";import"../../chunk-6OT5PQXV.mjs";import"../../chunk-SIL7AP7H.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-5Y6FKL5W.mjs";import"../../chunk-EW6KWAHS.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-DBY4SXQI.mjs";import"../../chunk-I2PVJQQR.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-Q2DPE66H.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-YNCJATT7.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as ChatInterface};
1
+ import{a}from"../../chunk-R72ZFTOO.mjs";import"../../chunk-SIL7AP7H.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-5Y6FKL5W.mjs";import"../../chunk-EW6KWAHS.mjs";import"../../chunk-UGBDJDPW.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-ZN7NNMB7.mjs";import"../../chunk-3BG2SCNC.mjs";import"../../chunk-6OT5PQXV.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-I2PVJQQR.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-DBY4SXQI.mjs";import"../../chunk-Q2DPE66H.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-YNCJATT7.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as ChatInterface};