cortex-react-components 2.18.6 → 2.19.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.
- package/dist/{chunk-MFUZNS7C.mjs → chunk-2BRDNDUB.mjs} +1 -1
- package/dist/{chunk-JSHD7QTU.mjs → chunk-2YULWG5F.mjs} +1 -1
- package/dist/{chunk-QILFMWE5.mjs → chunk-3HNU2NYP.mjs} +1 -1
- package/dist/{chunk-GO42W2BM.mjs → chunk-3NRXQBBS.mjs} +1 -1
- package/dist/{chunk-MEVSHOG4.mjs → chunk-3Y7QG6VP.mjs} +1 -1
- package/dist/{chunk-YWRU7OE3.mjs → chunk-5MWZTJYP.mjs} +1 -1
- package/dist/{chunk-XYJ4S67W.mjs → chunk-6MSM3CZ6.mjs} +1 -1
- package/dist/{chunk-CTC6WSB6.mjs → chunk-75F3LJMX.mjs} +1 -1
- package/dist/{chunk-33CHGT4N.mjs → chunk-7R47MHQE.mjs} +1 -1
- package/dist/{chunk-PAEL4O5F.mjs → chunk-AEACICA7.mjs} +1 -1
- package/dist/{chunk-RMZLEIRP.mjs → chunk-AJQHGVZ5.mjs} +1 -1
- package/dist/{chunk-VQBOJHZF.mjs → chunk-C4RWEPVF.mjs} +1 -1
- package/dist/{chunk-3EGSOIRH.mjs → chunk-CXOVEABI.mjs} +1 -1
- package/dist/{chunk-CCJJAUGB.mjs → chunk-EM3T2XYC.mjs} +1 -1
- package/dist/{chunk-347B45ZS.mjs → chunk-EPJJKGCG.mjs} +1 -1
- package/dist/{chunk-JNJJAJPI.mjs → chunk-FE7ZGUPU.mjs} +1 -1
- package/dist/{chunk-YPSUDHCJ.mjs → chunk-GHOL5L32.mjs} +1 -1
- package/dist/chunk-GLARGNXX.mjs +4 -0
- package/dist/{chunk-JEWBD2UD.mjs → chunk-GTZDHELR.mjs} +1 -1
- package/dist/{chunk-R33MOMFK.mjs → chunk-GTZJWMZR.mjs} +1 -1
- package/dist/{chunk-4DR4ILAP.mjs → chunk-H7NKR2WR.mjs} +1 -1
- package/dist/chunk-HEKQ55BA.mjs +4 -0
- package/dist/{chunk-H5VFV6Q4.mjs → chunk-LJXTXROJ.mjs} +1 -1
- package/dist/chunk-MTA6RFZ7.mjs +1 -0
- package/dist/{chunk-6EKGV4I2.mjs → chunk-NINFDOV5.mjs} +1 -1
- package/dist/chunk-PLOUY2B7.mjs +4 -0
- package/dist/{chunk-MGSTQLZC.mjs → chunk-RGOKBIQ5.mjs} +1 -1
- package/dist/{chunk-HLTP3ZQN.mjs → chunk-RJGYVDOU.mjs} +1 -1
- package/dist/chunk-SH5SK6V2.mjs +1 -0
- package/dist/{chunk-UTRR5NUU.mjs → chunk-TVTTUSWM.mjs} +1 -1
- package/dist/{chunk-SRUG246N.mjs → chunk-TXVA6XJT.mjs} +1 -1
- package/dist/{chunk-WAVVCASZ.mjs → chunk-UJITFLIZ.mjs} +1 -1
- package/dist/chunk-W2LPR7SX.mjs +1 -0
- package/dist/{chunk-ANCSWAD7.mjs → chunk-WIRQ5IRT.mjs} +1 -1
- package/dist/{chunk-QZIJTAPO.mjs → chunk-ZEALRBXW.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/Chat/ChatInterface.js +6 -6
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.js +3 -3
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/PartTypes/MessageHandler.js +5 -5
- package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
- package/dist/components/Chat/PartTypes/PartApprovalTool.js +4 -4
- package/dist/components/Chat/PartTypes/PartApprovalTool.mjs +1 -1
- package/dist/components/Chat/PartTypes/PartAuthenticateTool.d.ts +2 -1
- package/dist/components/Chat/PartTypes/PartAuthenticateTool.js +3 -3
- package/dist/components/Chat/PartTypes/PartAuthenticateTool.mjs +1 -1
- package/dist/components/Chat/PartTypes/index.js +6 -6
- package/dist/components/Chat/PartTypes/index.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.js +11 -11
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.js +32 -32
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.js +3 -3
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.js +3 -3
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.js +3 -3
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.js +4 -4
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-knowledge-modal.js +1 -1
- package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.js +1 -2
- package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
- package/dist/components/Foundary/Views/index.js +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/document-edit.js +1 -1
- package/dist/components/Foundary/document-edit.mjs +1 -1
- package/dist/components/Foundary/document-preview-examples.js +5 -5
- package/dist/components/Foundary/document-preview-examples.mjs +1 -1
- package/dist/components/Foundary/document-preview.js +1 -1
- package/dist/components/Foundary/document-preview.mjs +1 -1
- package/dist/components/Foundary/index.js +1 -1
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/Foundary/knowledge-browser.js +1 -1
- package/dist/components/Foundary/knowledge-browser.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/SectionHero/index.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Other/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/index.js +20 -20
- package/dist/components/index.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/index.js +25 -25
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-3DZFESHK.mjs +0 -4
- package/dist/chunk-3F6AUCZF.mjs +0 -1
- package/dist/chunk-3ZQFJ5WD.mjs +0 -4
- package/dist/chunk-HHPTGV4F.mjs +0 -4
- package/dist/chunk-V5VE3EIY.mjs +0 -1
- package/dist/chunk-WRZP5K5X.mjs +0 -1
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
"use client"
|
|
4
4
|
'use client';
|
|
5
5
|
|
|
6
|
-
"use strict";var to=Object.create;var Le=Object.defineProperty;var oo=Object.getOwnPropertyDescriptor;var ro=Object.getOwnPropertyNames;var ao=Object.getPrototypeOf,no=Object.prototype.hasOwnProperty;var so=(e,t)=>{for(var o in t)Le(e,o,{get:t[o],enumerable:!0})},lt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ro(t))!no.call(e,s)&&s!==o&&Le(e,s,{get:()=>t[s],enumerable:!(r=oo(t,s))||r.enumerable});return e};var V=(e,t,o)=>(o=e!=null?to(ao(e)):{},lt(t||!e||!e.__esModule?Le(o,"default",{value:e,enumerable:!0}):o,e)),io=e=>lt(Le({},"__esModule",{value:!0}),e);var rr={};so(rr,{ChatInterface:()=>or});module.exports=io(rr);var _=require("react"),xe=V(require("motion/react-client")),I=require("lucide-react");var De=V(require("react")),Q=V(require("@radix-ui/react-avatar"));var vt=require("clsx");var Ke="-",lo=e=>{let t=po(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{let i=n.split(Ke);return i[0]===""&&i.length!==1&&i.shift(),pt(i,t)||co(n)},getConflictingClassGroupIds:(n,i)=>{let c=o[n]||[];return i&&r[n]?[...c,...r[n]]:c}}},pt=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),s=r?pt(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;let a=e.join(Ke);return t.validators.find(({validator:n})=>n(a))?.classGroupId},ct=/^\[(.+)\]$/,co=e=>{if(ct.test(e)){let t=ct.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},po=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return mo(Object.entries(e.classGroups),o).forEach(([a,n])=>{qe(n,r,a,t)}),r},qe=(e,t,o,r)=>{e.forEach(s=>{if(typeof s=="string"){let a=s===""?t:dt(t,s);a.classGroupId=o;return}if(typeof s=="function"){if(uo(s)){qe(s(r),t,o,r);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([a,n])=>{qe(n,dt(t,a),o,r)})})},dt=(e,t)=>{let o=e;return t.split(Ke).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},uo=e=>e.isThemeGetter,mo=(e,t)=>t?e.map(([o,r])=>{let s=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([n,i])=>[t+n,i])):a);return[o,s]}):e,go=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,s=(a,n)=>{o.set(a,n),t++,t>e&&(t=0,r=o,o=new Map)};return{get(a){let n=o.get(a);if(n!==void 0)return n;if((n=r.get(a))!==void 0)return s(a,n),n},set(a,n){o.has(a)?o.set(a,n):s(a,n)}}},ut="!",fo=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,s=t[0],a=t.length,n=i=>{let c=[],g=0,h=0,f;for(let y=0;y<i.length;y++){let C=i[y];if(g===0){if(C===s&&(r||i.slice(y,y+a)===t)){c.push(i.slice(h,y)),h=y+a;continue}if(C==="/"){f=y;continue}}C==="["?g++:C==="]"&&g--}let v=c.length===0?i:i.substring(h),R=v.startsWith(ut),P=R?v.substring(1):v,x=f&&f>h?f-h:void 0;return{modifiers:c,hasImportantModifier:R,baseClassName:P,maybePostfixModifierPosition:x}};return o?i=>o({className:i,parseClassName:n}):n},bo=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},vo=e=>({cache:go(e.cacheSize),parseClassName:fo(e),...lo(e)}),ho=/\s+/,yo=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],n=e.trim().split(ho),i="";for(let c=n.length-1;c>=0;c-=1){let g=n[c],{modifiers:h,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:R}=o(g),P=!!R,x=r(P?v.substring(0,R):v);if(!x){if(!P){i=g+(i.length>0?" "+i:i);continue}if(x=r(v),!x){i=g+(i.length>0?" "+i:i);continue}P=!1}let y=bo(h).join(":"),C=f?y+ut:y,E=C+x;if(a.includes(E))continue;a.push(E);let A=s(x,P);for(let S=0;S<A.length;++S){let q=A[S];a.push(C+q)}i=g+(i.length>0?" "+i:i)}return i};function xo(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=mt(t))&&(r&&(r+=" "),r+=o);return r}var mt=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=mt(e[r]))&&(o&&(o+=" "),o+=t);return o};function Co(e,...t){let o,r,s,a=n;function n(c){let g=t.reduce((h,f)=>f(h),e());return o=vo(g),r=o.cache.get,s=o.cache.set,a=i,i(c)}function i(c){let g=r(c);if(g)return g;let h=yo(c,o);return s(c,h),h}return function(){return a(xo.apply(null,arguments))}}var N=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},gt=/^\[(?:([a-z-]+):)?(.+)\]$/i,wo=/^\d+\/\d+$/,No=new Set(["px","full","screen"]),ko=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Po=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,To=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ro=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ao=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,J=e=>be(e)||No.has(e)||wo.test(e),re=e=>ve(e,"length",Bo),be=e=>!!e&&!Number.isNaN(Number(e)),_e=e=>ve(e,"number",be),ke=e=>!!e&&Number.isInteger(Number(e)),So=e=>e.endsWith("%")&&be(e.slice(0,-1)),b=e=>gt.test(e),ae=e=>ko.test(e),Mo=new Set(["length","size","percentage"]),Io=e=>ve(e,Mo,ft),Lo=e=>ve(e,"position",ft),Do=new Set(["image","url"]),Eo=e=>ve(e,Do,Oo),zo=e=>ve(e,"",Ho),Pe=()=>!0,ve=(e,t,o)=>{let r=gt.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},Bo=e=>Po.test(e)&&!To.test(e),ft=()=>!1,Ho=e=>Ro.test(e),Oo=e=>Ao.test(e);var Fo=()=>{let e=N("colors"),t=N("spacing"),o=N("blur"),r=N("brightness"),s=N("borderColor"),a=N("borderRadius"),n=N("borderSpacing"),i=N("borderWidth"),c=N("contrast"),g=N("grayscale"),h=N("hueRotate"),f=N("invert"),v=N("gap"),R=N("gradientColorStops"),P=N("gradientColorStopPositions"),x=N("inset"),y=N("margin"),C=N("opacity"),E=N("padding"),A=N("saturate"),S=N("scale"),q=N("sepia"),ue=N("skew"),We=N("space"),Ce=N("translate"),me=()=>["auto","contain","none"],ie=()=>["auto","hidden","clip","visible","scroll"],we=()=>["auto",b,t],w=()=>[b,t],Ae=()=>["",J,re],ge=()=>["auto",be,b],Se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],fe=()=>["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"],Ne=()=>["start","end","center","between","around","evenly","stretch"],le=()=>["","0",b],u=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>[be,b];return{cacheSize:500,separator:":",theme:{colors:[Pe],spacing:[J,re],blur:["none","",ae,b],brightness:T(),borderColor:[e],borderRadius:["none","","full",ae,b],borderSpacing:w(),borderWidth:Ae(),contrast:T(),grayscale:le(),hueRotate:T(),invert:le(),gap:w(),gradientColorStops:[e],gradientColorStopPositions:[So,re],inset:we(),margin:we(),opacity:T(),padding:w(),saturate:T(),scale:T(),sepia:le(),skew:T(),space:w(),translate:w()},classGroups:{aspect:[{aspect:["auto","square","video",b]}],container:["container"],columns:[{columns:[ae]}],"break-after":[{"break-after":u()}],"break-before":[{"break-before":u()}],"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(),b]}],overflow:[{overflow:ie()}],"overflow-x":[{"overflow-x":ie()}],"overflow-y":[{"overflow-y":ie()}],overscroll:[{overscroll:me()}],"overscroll-x":[{"overscroll-x":me()}],"overscroll-y":[{"overscroll-y":me()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ke,b]}],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",b]}],grow:[{grow:le()}],shrink:[{shrink:le()}],order:[{order:["first","last","none",ke,b]}],"grid-cols":[{"grid-cols":[Pe]}],"col-start-end":[{col:["auto",{span:["full",ke,b]},b]}],"col-start":[{"col-start":ge()}],"col-end":[{"col-end":ge()}],"grid-rows":[{"grid-rows":[Pe]}],"row-start-end":[{row:["auto",{span:[ke,b]},b]}],"row-start":[{"row-start":ge()}],"row-end":[{"row-end":ge()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",b]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",b]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...Ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],Be:[{Be:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],Be:[{Be:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],Be:[{Be:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[We]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[We]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",b,t]}],"min-w":[{"min-w":[b,t,"min","max","fit"]}],"max-w":[{"max-w":[b,t,"none","full","min","max","fit","prose",{screen:[ae]},ae]}],h:[{h:[b,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[b,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[b,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[b,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ae,re]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",_e]}],"font-family":[{font:[Pe]}],"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",b]}],"line-clamp":[{"line-clamp":["none",be,_e]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",J,b]}],"list-image":[{"list-image":["none",b]}],"list-style-type":[{list:["none","disc","decimal",b]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",J,re]}],"underline-offset":[{"underline-offset":["auto",J,b]}],"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:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",b]}],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",b]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Se(),Lo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Io]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","Be","tl"]},Eo]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[P]}],"gradient-via-pos":[{via:[P]}],"gradient-to-pos":[{to:[P]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-Be":[{"rounded-Be":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-Be":[{"rounded-Be":[a]}],"rounded-Be":[{"rounded-Be":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"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-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-Be":[{"border-Be":[i]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...fe(),"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":[C]}],"divide-style":[{divide:fe()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-Be":[{"border-Be":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...fe()]}],"outline-offset":[{"outline-offset":[J,b]}],"outline-w":[{outline:[J,re]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[J,re]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ae,zo]}],"shadow-color":[{shadow:[Pe]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...Me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Me()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ae,b]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[f]}],saturate:[{saturate:[A]}],sepia:[{sepia:[q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",b]}],duration:[{duration:T()}],ease:[{ease:["linear","in","out","in-out",b]}],delay:[{delay:T()}],animate:[{animate:["none","spin","ping","pulse","bounce",b]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[ke,b]}],"translate-x":[{"translate-x":[Ce]}],"translate-y":[{"translate-y":[Ce]}],"skew-x":[{"skew-x":[ue]}],"skew-y":[{"skew-y":[ue]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",b]}],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","Be-resize","nw-resize","Be-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",b]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-Be":[{"scroll-Be":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-Be":[{"scroll-Be":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-Be":[{"scroll-Be":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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",b]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[J,re,_e]}],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"],Be:["px","py","ps","Be","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],Be:["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-r","rounded-b","rounded-Be","rounded-ss","rounded-Be","rounded-Be","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Be","rounded-Be"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-Be":["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-r","border-w-b","border-w-Be"],"border-w-x":["border-w-r","border-w-Be"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-Be"],"border-color-x":["border-color-r","border-color-Be"],"border-color-y":["border-color-t","border-color-b"],"scroll-Be":["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-Be":["scroll-px","scroll-py","scroll-ps","scroll-Be","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 bt=Co(Fo);function d(...e){return bt((0,vt.clsx)(e))}var Be=require("react/jsx-runtime"),Ee=De.forwardRef(({className:e,...t},o)=>(0,Be.jsx)(Q.Root,{ref:o,className:d("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ee.displayName=Q.Root.displayName;var Vo=De.forwardRef(({className:e,...t},o)=>(0,Be.jsx)(Q.Image,{ref:o,className:d("aspect-square h-full w-full",e),...t}));Vo.displayName=Q.Image.displayName;var ze=De.forwardRef(({className:e,...t},o)=>(0,Be.jsx)(Q.Fallback,{ref:o,className:d("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));ze.displayName=Q.Fallback.displayName;var ht=require("@radix-ui/react-slot"),yt=require("class-variance-authority"),xt=V(require("react")),Uo=(0,yt.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"}}}),z=xt.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...s},a)=>(0,Be.jsx)(e?ht.Slot:"button",{className:d(Uo({className:t,size:o,variant:r})),ref:a,...s}));z.displayName="Button";var wt=V(require("react"));var Je=wt.forwardRef(({className:e,type:t,...o},r)=>(0,Be.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:r,...o}));Je.displayName="Input";var Qe=V(require("react")),O=V(require("@radix-ui/react-scroll-area"));var Xe=Qe.forwardRef(({className:e,children:t,...o},r)=>(0,Be.jsxs)(O.Root,{ref:r,className:d("relative overflow-hidden",e),...o,children:[(0,Be.jsx)(O.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Be.jsx)(kt,{}),(0,Be.jsx)(O.Corner,{})]}));Xe.displayName=O.Root.displayName;var kt=Qe.forwardRef(({className:e,orientation:t="vertical",...o},r)=>(0,Be.jsx)(O.ScrollAreaScrollbar,{ref:r,orientation:t,className:d("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-Be border-Be-transparent Be-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent Be-[1px]",e),...o,children:(0,Be.jsx)(O.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));kt.displayName=O.ScrollAreaScrollbar.displayName;var G=require("motion/react");var Go=(0,yt.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 X({className:e,variant:t,...o}){return(0,Be.jsx)("div",{className:d(Go({variant:t}),e),...o})}var Rt={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 Ye(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function At({capabilities:e,isOpen:t,onToggle:o,onActionSelect:r,onContextChange:s,colorScheme:a=Rt,className:n}){let[i,c]=(0,_.useState)([]),[g,h]=(0,_.useState)([]),f=i[i.length-1],v=f?.children||e,R=(A,S)=>{switch(A.type){case"category":return a.categories[S%a.categories.length];case"list":return a.lists[S%a.lists.length];case"item":return a.items[S%a.items.length];default:return a.primary}},P=(0,_.useMemo)(()=>({path:i,selectedItems:g,filters:{}}),[i,g]);(0,_.useEffect)(()=>{s&&s(P)},[P,s]);let x=A=>{A.type==="category"||A.type==="list"?c([...i,A]):A.type==="item"&&h([...g,A])},y=()=>{c(i.slice(0,-1))},C=A=>{c(i.slice(0,A+1))},E=()=>f?.actions?f.actions:[];return t?(0,Be.jsxs)("div",{className:d("w-full",n),children:[(0,Be.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Be.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,Be.jsx)(G.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:y,className:d("group Be-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,Be.jsx)(I.ChevronLeft,{className:d("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Be.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,Be.jsx)(G.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 Be-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,Be.jsx)(I.X,{className:d("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,Be.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Be.jsx)(G.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>c([]),className:d("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Be.jsxs)("span",{className:"relative",children:["Capabilities",(0,Be.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((A,S)=>(0,Be.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Be.jsx)(I.ChevronRight,{className:"h-2 w-2"}),(0,Be.jsx)(G.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>C(S),className:d("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Be.jsxs)("span",{className:"relative",children:[A.name,(0,Be.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.id))]}),(0,Be.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,Be.jsx)(G.AnimatePresence,{mode:"wait",children:(0,Be.jsx)(G.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:f?.type==="list"&&f.data?(0,Be.jsx)(Wo,{data:f.data,onItemSelect:A=>h([...g,A]),colorScheme:a}):(0,Be.jsx)($o,{capabilities:v,onSelect:x,colorScheme:a})},f?.id||"root")})})]}):(0,Be.jsxs)(z,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Be.jsx)(I.Menu,{className:"h-4 w-4"}),(0,Be.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function $o({capabilities:e,onSelect:t,colorScheme:o}){return(0,Be.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((r,s)=>(0,Be.jsx)(jo,{capability:r,onClick:()=>t(r),color:o.categories[s%o.categories.length]},r.id))})}function jo({capability:e,onClick:t,selected:o,color:r}){return(0,Be.jsxs)(G.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,Be.jsx)("div",{className:d("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",r)}),(0,Be.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Be.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,Be.jsx)(I.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,Be.jsx)(X,{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 Wo({data:e,onItemSelect:t,colorScheme:o}){return(0,Be.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((r,s)=>(0,Be.jsxs)(G.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(r),children:[(0,Be.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,Be.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Be.jsxs)("span",{className:"truncate relative font-medium",children:[r.title,(0,Be.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"})]}),r.subtitle&&(0,Be.jsx)("div",{className:d("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:r.subtitle})]}),r.value&&(0,Be.jsx)(X,{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:r.value})]},r.id))})}var Mt=V(require("react"));var St=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:r,description:s="This endpoint requires authentication to sync functions."})=>{let[a,n]=(0,_.useState)(!1),[i,c]=(0,_.useState)(""),g=()=>{if(!t){c("No authentication URL provided");return}n(!0),c("");try{let f=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!f){c("Popup blocked. Please allow popups for this site and try again."),n(!1);return}let v=setInterval(()=>{try{f.closed&&(clearInterval(v),n(!1),r(),o())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(v),n(!1),c("Authentication timed out. Please try again."))},6e5)}catch{c("Failed to open authentication window"),n(!1)}},h=async()=>{try{await navigator.clipboard.writeText(t),c("")}catch{c("Failed to copy URL to clipboard")}};return e?(0,Be.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Be.jsxs)("div",{className:"bg-white rounded-lg Be-6 max-w-md w-[90%] shadow-lg",children:[(0,Be.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Be.jsx)("Be",{className:"text-sm text-gray-600 mb-4",children:s}),i&&(0,Be.jsx)("div",{className:"mb-4 Be-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:i}),(0,Be.jsxs)("div",{className:"flex gap-2",children:[(0,Be.jsx)("button",{onClick:g,disabled:a||!t,className:`
|
|
6
|
+
"use strict";var to=Object.create;var Le=Object.defineProperty;var oo=Object.getOwnPropertyDescriptor;var ro=Object.getOwnPropertyNames;var ao=Object.getPrototypeOf,no=Object.prototype.hasOwnProperty;var so=(e,t)=>{for(var o in t)Le(e,o,{get:t[o],enumerable:!0})},lt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ro(t))!no.call(e,s)&&s!==o&&Le(e,s,{get:()=>t[s],enumerable:!(r=oo(t,s))||r.enumerable});return e};var j=(e,t,o)=>(o=e!=null?to(ao(e)):{},lt(t||!e||!e.__esModule?Le(o,"default",{value:e,enumerable:!0}):o,e)),io=e=>lt(Le({},"__esModule",{value:!0}),e);var rr={};so(rr,{ChatInterface:()=>or});module.exports=io(rr);var q=require("react"),xe=j(require("motion/react-client")),D=require("lucide-react");var De=j(require("react")),X=j(require("@radix-ui/react-avatar"));var vt=require("clsx");var Ke="-",lo=e=>{let t=po(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{let i=n.split(Ke);return i[0]===""&&i.length!==1&&i.shift(),pt(i,t)||co(n)},getConflictingClassGroupIds:(n,i)=>{let c=o[n]||[];return i&&r[n]?[...c,...r[n]]:c}}},pt=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),s=r?pt(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;let a=e.join(Ke);return t.validators.find(({validator:n})=>n(a))?.classGroupId},ct=/^\[(.+)\]$/,co=e=>{if(ct.test(e)){let t=ct.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},po=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return mo(Object.entries(e.classGroups),o).forEach(([a,n])=>{qe(n,r,a,t)}),r},qe=(e,t,o,r)=>{e.forEach(s=>{if(typeof s=="string"){let a=s===""?t:dt(t,s);a.classGroupId=o;return}if(typeof s=="function"){if(uo(s)){qe(s(r),t,o,r);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([a,n])=>{qe(n,dt(t,a),o,r)})})},dt=(e,t)=>{let o=e;return t.split(Ke).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},uo=e=>e.isThemeGetter,mo=(e,t)=>t?e.map(([o,r])=>{let s=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([n,i])=>[t+n,i])):a);return[o,s]}):e,go=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,s=(a,n)=>{o.set(a,n),t++,t>e&&(t=0,r=o,o=new Map)};return{get(a){let n=o.get(a);if(n!==void 0)return n;if((n=r.get(a))!==void 0)return s(a,n),n},set(a,n){o.has(a)?o.set(a,n):s(a,n)}}},ut="!",fo=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,s=t[0],a=t.length,n=i=>{let c=[],g=0,h=0,f;for(let y=0;y<i.length;y++){let C=i[y];if(g===0){if(C===s&&(r||i.slice(y,y+a)===t)){c.push(i.slice(h,y)),h=y+a;continue}if(C==="/"){f=y;continue}}C==="["?g++:C==="]"&&g--}let v=c.length===0?i:i.substring(h),A=v.startsWith(ut),P=A?v.substring(1):v,x=f&&f>h?f-h:void 0;return{modifiers:c,hasImportantModifier:A,baseClassName:P,maybePostfixModifierPosition:x}};return o?i=>o({className:i,parseClassName:n}):n},bo=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},vo=e=>({cache:go(e.cacheSize),parseClassName:fo(e),...lo(e)}),ho=/\s+/,yo=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],n=e.trim().split(ho),i="";for(let c=n.length-1;c>=0;c-=1){let g=n[c],{modifiers:h,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:A}=o(g),P=!!A,x=r(P?v.substring(0,A):v);if(!x){if(!P){i=g+(i.length>0?" "+i:i);continue}if(x=r(v),!x){i=g+(i.length>0?" "+i:i);continue}P=!1}let y=bo(h).join(":"),C=f?y+ut:y,B=C+x;if(a.includes(B))continue;a.push(B);let S=s(x,P);for(let M=0;M<S.length;++M){let K=S[M];a.push(C+K)}i=g+(i.length>0?" "+i:i)}return i};function xo(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=mt(t))&&(r&&(r+=" "),r+=o);return r}var mt=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=mt(e[r]))&&(o&&(o+=" "),o+=t);return o};function Co(e,...t){let o,r,s,a=n;function n(c){let g=t.reduce((h,f)=>f(h),e());return o=vo(g),r=o.cache.get,s=o.cache.set,a=i,i(c)}function i(c){let g=r(c);if(g)return g;let h=yo(c,o);return s(c,h),h}return function(){return a(xo.apply(null,arguments))}}var k=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},gt=/^\[(?:([a-z-]+):)?(.+)\]$/i,wo=/^\d+\/\d+$/,No=new Set(["px","full","screen"]),ko=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,To=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Po=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ro=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)D-?((\d+)?\.?(\d+)[a-z]+|0)/,Ao=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Q=e=>be(e)||No.has(e)||wo.test(e),re=e=>ve(e,"length",zo),be=e=>!!e&&!Number.isNaN(Number(e)),_e=e=>ve(e,"number",be),ke=e=>!!e&&Number.isInteger(Number(e)),So=e=>e.endsWith("%")&&be(e.slice(0,-1)),b=e=>gt.test(e),ae=e=>ko.test(e),Mo=new Set(["length","size","percentage"]),Io=e=>ve(e,Mo,ft),Lo=e=>ve(e,"position",ft),Do=new Set(["image","url"]),Eo=e=>ve(e,Do,Oo),Bo=e=>ve(e,"",Ho),Te=()=>!0,ve=(e,t,o)=>{let r=gt.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},zo=e=>To.test(e)&&!Po.test(e),ft=()=>!1,Ho=e=>Ro.test(e),Oo=e=>Ao.test(e);var Fo=()=>{let e=k("colors"),t=k("spacing"),o=k("blur"),r=k("brightness"),s=k("borderColor"),a=k("borderRadius"),n=k("borderSpacing"),i=k("borderWidth"),c=k("contrast"),g=k("grayscale"),h=k("hueRotate"),f=k("invert"),v=k("gap"),A=k("gradientColorStops"),P=k("gradientColorStopPositions"),x=k("inset"),y=k("margin"),C=k("opacity"),B=k("padding"),S=k("saturate"),M=k("scale"),K=k("sepia"),ue=k("skew"),We=k("space"),Ce=k("translate"),me=()=>["auto","contain","none"],ie=()=>["auto","hidden","clip","visible","scroll"],we=()=>["auto",b,t],w=()=>[b,t],Ae=()=>["",Q,re],ge=()=>["auto",be,b],Se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],fe=()=>["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"],Ne=()=>["start","end","center","between","around","evenly","stretch"],le=()=>["","0",b],u=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>[be,b];return{cacheSize:500,separator:":",theme:{colors:[Te],spacing:[Q,re],blur:["none","",ae,b],brightness:R(),borderColor:[e],borderRadius:["none","","full",ae,b],borderSpacing:w(),borderWidth:Ae(),contrast:R(),grayscale:le(),hueRotate:R(),invert:le(),gap:w(),gradientColorStops:[e],gradientColorStopPositions:[So,re],inset:we(),margin:we(),opacity:R(),padding:w(),saturate:R(),scale:R(),sepia:le(),skew:R(),space:w(),translate:w()},classGroups:{aspect:[{aspect:["auto","square","video",b]}],container:["container"],columns:[{columns:[ae]}],"break-after":[{"break-after":u()}],"break-before":[{"break-before":u()}],"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(),b]}],overflow:[{overflow:ie()}],"overflow-x":[{"overflow-x":ie()}],"overflow-y":[{"overflow-y":ie()}],overscroll:[{overscroll:me()}],"overscroll-x":[{"overscroll-x":me()}],"overscroll-y":[{"overscroll-y":me()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ke,b]}],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",b]}],grow:[{grow:le()}],shrink:[{shrink:le()}],order:[{order:["first","last","none",ke,b]}],"grid-cols":[{"grid-cols":[Te]}],"col-start-end":[{col:["auto",{span:["full",ke,b]},b]}],"col-start":[{"col-start":ge()}],"col-end":[{"col-end":ge()}],"grid-rows":[{"grid-rows":[Te]}],"row-start-end":[{row:["auto",{span:[ke,b]},b]}],"row-start":[{"row-start":ge()}],"row-end":[{"row-end":ge()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",b]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",b]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...Ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],ze:[{ze:[B]}],px:[{px:[B]}],py:[{py:[B]}],ps:[{ps:[B]}],ze:[{ze:[B]}],pt:[{pt:[B]}],pr:[{pr:[B]}],pb:[{pb:[B]}],pl:[{pl:[B]}],ze:[{ze:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[We]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[We]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",b,t]}],"min-w":[{"min-w":[b,t,"min","max","fit"]}],"max-w":[{"max-w":[b,t,"none","full","min","max","fit","prose",{screen:[ae]},ae]}],h:[{h:[b,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[b,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[b,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[b,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ae,re]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",_e]}],"font-family":[{font:[Te]}],"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",b]}],"line-clamp":[{"line-clamp":["none",be,_e]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Q,b]}],"list-image":[{"list-image":["none",b]}],"list-style-type":[{list:["none","disc","decimal",b]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Q,re]}],"underline-offset":[{"underline-offset":["auto",Q,b]}],"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:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",b]}],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",b]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Se(),Lo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Io]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","ze","tl"]},Eo]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[P]}],"gradient-via-pos":[{via:[P]}],"gradient-to-pos":[{to:[P]}],"gradient-from":[{from:[A]}],"gradient-via":[{via:[A]}],"gradient-to":[{to:[A]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-ze":[{"rounded-ze":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-ze":[{"rounded-ze":[a]}],"rounded-ze":[{"rounded-ze":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"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-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-ze":[{"border-ze":[i]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...fe(),"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":[C]}],"divide-style":[{divide:fe()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-ze":[{"border-ze":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...fe()]}],"outline-offset":[{"outline-offset":[Q,b]}],"outline-w":[{outline:[Q,re]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[Q,re]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ae,Bo]}],"shadow-color":[{shadow:[Te]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...Me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Me()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ae,b]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[K]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",b]}],duration:[{duration:R()}],ease:[{ease:["linear","in","out","in-out",b]}],delay:[{delay:R()}],animate:[{animate:["none","spin","ping","pulse","bounce",b]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[ke,b]}],"translate-x":[{"translate-x":[Ce]}],"translate-y":[{"translate-y":[Ce]}],"skew-x":[{"skew-x":[ue]}],"skew-y":[{"skew-y":[ue]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",b]}],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","ze-resize","nw-resize","ze-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",b]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-ze":[{"scroll-ze":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-ze":[{"scroll-ze":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-ze":[{"scroll-ze":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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",b]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Q,re,_e]}],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"],ze:["px","py","ps","ze","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],ze:["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-r","rounded-b","rounded-ze","rounded-ss","rounded-ze","rounded-ze","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-ze","rounded-ze"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-ze":["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-r","border-w-b","border-w-ze"],"border-w-x":["border-w-r","border-w-ze"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-ze"],"border-color-x":["border-color-r","border-color-ze"],"border-color-y":["border-color-t","border-color-b"],"scroll-ze":["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-ze":["scroll-px","scroll-py","scroll-ps","scroll-ze","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 bt=Co(Fo);function d(...e){return bt((0,vt.clsx)(e))}var ze=require("react/jsx-runtime"),Ee=De.forwardRef(({className:e,...t},o)=>(0,ze.jsx)(X.Root,{ref:o,className:d("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ee.displayName=X.Root.displayName;var Vo=De.forwardRef(({className:e,...t},o)=>(0,ze.jsx)(X.Image,{ref:o,className:d("aspect-square h-full w-full",e),...t}));Vo.displayName=X.Image.displayName;var Be=De.forwardRef(({className:e,...t},o)=>(0,ze.jsx)(X.Fallback,{ref:o,className:d("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Be.displayName=X.Fallback.displayName;var ht=require("@radix-ui/react-slot"),yt=require("class-variance-authority"),xt=j(require("react")),jo=(0,yt.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"}}}),z=xt.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...s},a)=>(0,ze.jsx)(e?ht.Slot:"button",{className:d(jo({className:t,size:o,variant:r})),ref:a,...s}));z.displayName="Button";var wt=j(require("react"));var Je=wt.forwardRef(({className:e,type:t,...o},r)=>(0,ze.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:r,...o}));Je.displayName="Input";var Qe=j(require("react")),F=j(require("@radix-ui/react-scroll-area"));var Xe=Qe.forwardRef(({className:e,children:t,...o},r)=>(0,ze.jsxs)(F.Root,{ref:r,className:d("relative overflow-hidden",e),...o,children:[(0,ze.jsx)(F.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,ze.jsx)(kt,{}),(0,ze.jsx)(F.Corner,{})]}));Xe.displayName=F.Root.displayName;var kt=Qe.forwardRef(({className:e,orientation:t="vertical",...o},r)=>(0,ze.jsx)(F.ScrollAreaScrollbar,{ref:r,orientation:t,className:d("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-ze border-ze-transparent ze-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent ze-[1px]",e),...o,children:(0,ze.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));kt.displayName=F.ScrollAreaScrollbar.displayName;var G=require("motion/react");var Uo=(0,yt.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 Y({className:e,variant:t,...o}){return(0,ze.jsx)("div",{className:d(Uo({variant:t}),e),...o})}var Rt={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 Ye(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function At({capabilities:e,isOpen:t,onToggle:o,onActionSelect:r,onContextChange:s,colorScheme:a=Rt,className:n}){let[i,c]=(0,q.useState)([]),[g,h]=(0,q.useState)([]),f=i[i.length-1],v=f?.children||e,A=(S,M)=>{switch(S.type){case"category":return a.categories[M%a.categories.length];case"list":return a.lists[M%a.lists.length];case"item":return a.items[M%a.items.length];default:return a.primary}},P=(0,q.useMemo)(()=>({path:i,selectedItems:g,filters:{}}),[i,g]);(0,q.useEffect)(()=>{s&&s(P)},[P,s]);let x=S=>{S.type==="category"||S.type==="list"?c([...i,S]):S.type==="item"&&h([...g,S])},y=()=>{c(i.slice(0,-1))},C=S=>{c(i.slice(0,S+1))},B=()=>f?.actions?f.actions:[];return t?(0,ze.jsxs)("div",{className:d("w-full",n),children:[(0,ze.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ze.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,ze.jsx)(G.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:y,className:d("group ze-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,ze.jsx)(D.ChevronLeft,{className:d("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,ze.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,ze.jsx)(G.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 ze-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,ze.jsx)(D.X,{className:d("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,ze.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,ze.jsx)(G.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>c([]),className:d("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ze.jsxs)("span",{className:"relative",children:["Capabilities",(0,ze.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((S,M)=>(0,ze.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ze.jsx)(D.ChevronRight,{className:"h-2 w-2"}),(0,ze.jsx)(G.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>C(M),className:d("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ze.jsxs)("span",{className:"relative",children:[S.name,(0,ze.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"})]})})]},S.id))]}),(0,ze.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,ze.jsx)(G.AnimatePresence,{mode:"wait",children:(0,ze.jsx)(G.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:f?.type==="list"&&f.data?(0,ze.jsx)(Wo,{data:f.data,onItemSelect:S=>h([...g,S]),colorScheme:a}):(0,ze.jsx)(Go,{capabilities:v,onSelect:x,colorScheme:a})},f?.id||"root")})})]}):(0,ze.jsxs)(z,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,ze.jsx)(D.Menu,{className:"h-4 w-4"}),(0,ze.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Go({capabilities:e,onSelect:t,colorScheme:o}){return(0,ze.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((r,s)=>(0,ze.jsx)($o,{capability:r,onClick:()=>t(r),color:o.categories[s%o.categories.length]},r.id))})}function $o({capability:e,onClick:t,selected:o,color:r}){return(0,ze.jsxs)(G.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,ze.jsx)("div",{className:d("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",r)}),(0,ze.jsxs)("span",{className:"truncate relative",children:[e.name,(0,ze.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,ze.jsx)(D.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,ze.jsx)(Y,{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 Wo({data:e,onItemSelect:t,colorScheme:o}){return(0,ze.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((r,s)=>(0,ze.jsxs)(G.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(r),children:[(0,ze.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,ze.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ze.jsxs)("span",{className:"truncate relative font-medium",children:[r.title,(0,ze.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"})]}),r.subtitle&&(0,ze.jsx)("div",{className:d("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:r.subtitle})]}),r.value&&(0,ze.jsx)(Y,{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:r.value})]},r.id))})}var Mt=j(require("react"));var St=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:r,description:s="This endpoint requires authentication to sync functions."})=>{let[a,n]=(0,q.useState)(!1),[i,c]=(0,q.useState)(""),g=()=>{if(!t){c("No authentication URL provided");return}n(!0),c("");try{let f=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!f){c("Popup blocked. Please allow popups for this site and try again."),n(!1);return}let v=setInterval(()=>{try{f.closed&&(clearInterval(v),n(!1),r(),o())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(v),n(!1),c("Authentication timed out. Please try again."))},6e5)}catch{c("Failed to open authentication window"),n(!1)}},h=async()=>{try{await navigator.clipboard.writeText(t),c("")}catch{c("Failed to copy URL to clipboard")}};return e?(0,ze.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,ze.jsxs)("div",{className:"bg-white rounded-lg ze-6 max-w-md w-[90%] shadow-lg",children:[(0,ze.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,ze.jsx)("ze",{className:"text-sm text-gray-600 mb-4",children:s}),i&&(0,ze.jsx)("div",{className:"mb-4 ze-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:i}),(0,ze.jsxs)("div",{className:"flex gap-2",children:[(0,ze.jsx)("button",{onClick:g,disabled:a||!t,className:`
|
|
7
7
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
8
8
|
${a||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
|
|
9
|
-
`,children:a?"Authenticating...":"Authenticate"}),(0,
|
|
9
|
+
`,children:a?"Authenticating...":"Authenticate"}),(0,ze.jsx)("button",{onClick:h,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,
|
|
12
|
+
`,children:"Copy URL"}),(0,ze.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 et=({toolPart:e,index:t,addToolResult:o})=>{let[r,s]=Mt.default.useState(!0),a=()=>{o(e.toolCallId,e.type,"Authentication completed"),s(!1)};switch(e.state){case"input-available":return(0,ze.jsxs)("div",{className:"mb-2",children:[(0,ze.jsx)(St,{isOpen:r,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>s(!1),onSuccess:a,description:e.output?.reason||e.input?.reason}),!r&&(0,ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,ze.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,ze.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,ze.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,ze.jsx)(ze.Fragment,{children:e.output==="Authentication completed"?(0,ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,ze.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,ze.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})}):(0,ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,ze.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,ze.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Authentication failed"]})})});default:return null}};var tt=j(require("react"));var Lt=({isOpen:e=!0,reason:t,onClose:o,onApprove:r,onDeny:s,title:a="Approval Required"})=>{let[n,i]=(0,q.useState)(!1),c=()=>{i(!0),r(),o()},g=()=>{i(!0),s(),o()},h=()=>{i(!0),s(),o()};return e?(0,ze.jsxs)("div",{className:"bg-white rounded-lg ze-6 max-w-md w-full shadow-lg",children:[(0,ze.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:a}),(0,ze.jsx)("ze",{className:"text-sm text-gray-600 mb-6",children:t}),(0,ze.jsxs)("div",{className:"flex gap-2",children:[(0,ze.jsx)("button",{onClick:c,disabled:n,className:`
|
|
13
13
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
14
14
|
${n?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
|
|
15
|
-
`,children:n?"Processing...":"Approve"}),(0,
|
|
15
|
+
`,children:n?"Processing...":"Approve"}),(0,ze.jsx)("button",{onClick:g,disabled:n,className:`
|
|
16
16
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
17
17
|
${n?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
|
|
18
|
-
`,children:n?"Processing...":"Deny"}),(0,
|
|
18
|
+
`,children:n?"Processing...":"Deny"}),(0,ze.jsx)("button",{onClick:h,disabled:n,className:`
|
|
19
19
|
px-4 py-2 text-white border-none rounded text-sm
|
|
20
20
|
${n?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
|
|
21
|
-
`,children:"Cancel"})]})]}):null};var Dt=({toolPart:e,index:t,addToolResult:o})=>{let[r,s]=tt.default.useState(!0),[a,n]=tt.default.useState(null),i=()=>{o(e.toolCallId,e.type,"Approved"),s(!1),n("approve")},c=()=>{o(e.toolCallId,e.type,"Denied"),s(!1),n("deny")};switch(e.state){case"input-available":return(0,Be.jsxs)("div",{className:"mb-2",children:[(0,Be.jsx)(Lt,{isOpen:r,onApprove:i,onDeny:c,onClose:()=>s(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!r&&(0,Be.jsxs)(Be.Fragment,{children:[a==="approve"&&(0,Be.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Be.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,Be.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Be.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),a==="deny"&&(0,Be.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Be.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,Be.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Be.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Be.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var ot=require("@radix-ui/react-use-controllable-state");var he=V(require("@radix-ui/react-collapsible")),He=he.Root,Oe=he.CollapsibleTrigger,Fe=he.CollapsibleContent;var zt=require("streamdown"),Te=(0,_.memo)(({className:e,...t})=>(0,Be.jsx)(zt.Streamdown,{className:d("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Te.displayName="Response";var Ht=(0,_.createContext)(null),_o=()=>{let e=(0,_.useContext)(Ht);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},qo=1e3,Ko=1e3,rt=(0,_.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:r=!0,onOpenChange:s,duration:a,children:n,...i})=>{let[c,g]=(0,ot.useControllableState)({prop:o,defaultProp:r,onChange:s}),[h,f]=(0,ot.useControllableState)({prop:a,defaultProp:0}),[v,R]=(0,_.useState)(!1),[P,x]=(0,_.useState)(null);(0,_.useEffect)(()=>{t?P===null&&x(Date.now()):P!==null&&(f(Math.ceil((Date.now()-P)/Ko)),x(null))},[t,P,f]),(0,_.useEffect)(()=>{if(r&&!t&&c&&!v){let C=setTimeout(()=>{g(!1),R(!0)},qo);return()=>clearTimeout(C)}},[t,c,r,g,v]);let y=C=>{g(C)};return(0,Be.jsx)(Ht.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:g,duration:h},children:(0,Be.jsx)(He,{className:d("not-prose mb-4",e),onOpenChange:y,open:c,...i,children:n})})}),Jo=(e,t)=>e||t===0?(0,Be.jsx)("Be",{children:"Thinking..."}):t===void 0?(0,Be.jsx)("Be",{children:"Thought for a few seconds"}):(0,Be.jsxs)("Be",{children:["Thought for ",t," seconds"]}),at=(0,_.memo)(({className:e,children:t,...o})=>{let{isStreaming:r,isOpen:s,duration:a}=_o();return(0,Be.jsx)(Oe,{className:d("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsx)(I.BrainIcon,{className:"size-4"}),Jo(r,a),(0,Be.jsx)(I.ChevronDownIcon,{className:d("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),nt=(0,_.memo)(({className:e,children:t,...o})=>(0,Be.jsx)(Fe,{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,Be.jsx)(Te,{className:"grid gap-2",children:t})}));rt.displayName="Reasoning";at.displayName="ReasoningTrigger";nt.displayName="ReasoningContent";var st=require("react-syntax-highlighter"),Ge=require("react-syntax-highlighter/dist/esm/styles/prism"),Qo=(0,_.createContext)({code:""}),$e=({code:e,language:t,showLineNumbers:o=!1,className:r,children:s,...a})=>(0,Be.jsx)(Qo.Provider,{value:{code:e},children:(0,Be.jsx)("div",{className:d("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",r),...a,children:(0,Be.jsxs)("div",{className:"relative",children:[(0,Be.jsx)(st.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,Be.jsx)(st.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,Be.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:s})]})})});var Ft=({className:e,...t})=>(0,Be.jsx)(He,{className:d("not-prose mb-4 w-full",e),...t}),Xo=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Be.jsxs)(X,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Be.jsx)(I.CircleIcon,{className:"size-4"}),"input-available":(0,Be.jsx)(I.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Be.jsx)(I.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Be.jsx)(I.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Vt=({className:e,type:t,state:o,...r})=>(0,Be.jsxs)(Oe,{className:d("flex w-full items-center justify-between gap-4 Be-3 pl-0 w-2xl",e),...r,children:[(0,Be.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Be.jsx)(I.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Be.jsx)("span",{className:"font-medium text-sm",children:t}),Xo(o)]}),(0,Be.jsx)(I.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Ut=({className:e,...t})=>(0,Be.jsx)(Fe,{className:d("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}),Gt=({className:e,input:t,...o})=>(0,Be.jsxs)("div",{className:d("space-y-2 overflow-hidden Be-4",e),...o,children:[(0,Be.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Be.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Be.jsx)($e,{code:JSON.stringify(t,null,2),language:"json"})})]}),$t=({className:e,output:t,errorText:o,...r})=>{if(!(t||o))return null;let s=(0,Be.jsx)("div",{children:t});return typeof t=="object"?s=(0,Be.jsx)($e,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(s=(0,Be.jsx)($e,{code:t,language:"json"})),(0,Be.jsxs)("div",{className:d("space-y-2 Be-4",e),...r,children:[(0,Be.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Be.jsxs)("div",{className:d("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,Be.jsx)("div",{children:o}),s]})]})};var de=V(require("react"));var $=de.forwardRef(({className:e,...t},o)=>(0,Be.jsx)("div",{ref:o,className:d("rounded-xl border bg-card text-card-foreground shadow",e),...t}));$.displayName="Card";var te=de.forwardRef(({className:e,...t},o)=>(0,Be.jsx)("div",{ref:o,className:d("flex flex-col space-y-1.5 Be-6",e),...t}));te.displayName="CardHeader";var oe=de.forwardRef(({className:e,...t},o)=>(0,Be.jsx)("div",{ref:o,className:d("font-semibold leading-none tracking-tight",e),...t}));oe.displayName="CardTitle";var it=de.forwardRef(({className:e,...t},o)=>(0,Be.jsx)("div",{ref:o,className:d("text-sm text-muted-foreground",e),...t}));it.displayName="CardDescription";var j=de.forwardRef(({className:e,...t},o)=>(0,Be.jsx)("div",{ref:o,className:d("Be-6 pt-0",e),...t}));j.displayName="CardContent";var Re=de.forwardRef(({className:e,...t},o)=>(0,Be.jsx)("div",{ref:o,className:d("flex items-center Be-6 pt-0",e),...t}));Re.displayName="CardFooter";var _t=require("date-fns");function jt({taskId:e,polling:t=!0,system:o="payload"}){let[r,s]=(0,_.useState)(null),[a,n]=(0,_.useState)(!1),[i,c]=(0,_.useState)(null),g=async(f=!0)=>{if(e){f&&n(!0);try{let v=await fetch(`/api/tasks/${e}`);if(!v.ok)throw new Error(`Failed to fetch task: ${v.statusText}`);let R=await v.json();s(R)}catch(v){console.error("Error fetching task:",v),c(v instanceof Error?v:new Error("Unknown error occurred"))}finally{f&&n(!1)}}},h=()=>g(!1);return(0,_.useEffect)(()=>{e&&g(!0);let f=null;return e&&t&&(f=setInterval(h,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:r,loading:a,error:i}}var Yo=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"}},Zo=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function qt({data:e}){let{id:t,system:o,fetchLatest:r,taskData:s,error:a}=e||{};if(!t)return null;let n=null,i=!0,c=a,g=r!==void 0?r:!0;if(n=s||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:r,system:o,fetchLatest:g,taskData:n,error:c}),g){let{task:R,loading:P,error:x}=jt({taskId:t,system:o});n=R,i=P,c=x}else i=!1;let h=Yo(n?.status||"todo"),f=Zo(n?.status||"todo"),v=n?.dateLogged||new Date().toISOString();try{let R=new Date(n?.dateLogged||"");isNaN(R.getTime())||(v=(0,_t.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Be.jsxs)($,{className:d("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Be.jsxs)(te,{className:"pb-2",children:[(0,Be.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Be.jsx)(oe,{className:"text-lg font-semibold",children:i?"Loading...":n?.name||"Task"}),(0,Be.jsx)(X,{className:`${h}`,children:f})]}),n?.project&&(0,Be.jsxs)(it,{className:"text-sm text-gray-500",children:["Project: ",n.project.name]})]}),(0,Be.jsx)(j,{className:"pb-2",children:i?(0,Be.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,Be.jsx)("Be",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Be.jsx)("Be",{className:"text-sm text-foreground",children:n?.description||"......."})}),(0,Be.jsx)(Re,{className:"pt-2 flex items-center justify-between",children:(0,Be.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Be.jsx)(I.Clock,{className:"h-3 w-3 mr-1"}),(0,Be.jsxs)("span",{children:["Created ",v]}),(0,Be.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Be.jsxs)("span",{children:["Task #",t]})]})})]})}function Qt({artefact:e,taskId:t,taskData:o,loading:r=!1,error:s=null}){let a=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=a.dateLogged;try{let i=new Date(a.dateLogged);isNaN(i.getTime())||(n=(0,_t.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,Be.jsxs)($,{className:"w-full max-w-md shadow-md",children:[(0,Be.jsx)(te,{className:"pb-2",children:(0,Be.jsx)("div",{className:"flex justify-between items-start",children:(0,Be.jsx)(oe,{className:"text-lg font-semibold",children:r?"Loading...":a.name})})}),(0,Be.jsx)(j,{className:"pb-2",children:r?(0,Be.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,Be.jsx)("Be",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Be.jsx)("Be",{className:"text-sm text-foreground",children:e})}),(0,Be.jsx)(Re,{className:"pt-2 flex items-center justify-between",children:(0,Be.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Be.jsx)(I.Clock,{className:"h-3 w-3 mr-1"}),(0,Be.jsxs)("span",{children:["Created ",n]}),(0,Be.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Be.jsxs)("span",{children:["Task #",a.id]})]})})]})}var er=e=>e.startsWith("image/")?(0,Be.jsx)(I.Image,{className:"h-4 w-4"}):e.startsWith("text/")?(0,Be.jsx)(I.FileText,{className:"h-4 w-4"}):(0,Be.jsx)(I.File,{className:"h-4 w-4"}),Xt=({message:e,addToolResult:t,status:o,messages:r})=>e.parts.map((s,a)=>{if(s.type==="text")return(0,Be.jsx)(Te,{children:s.text},`${a}`);if(s.type==="file"){let n=s;return(0,Be.jsx)("div",{className:"mb-2 Be-2 bg-background/50 rounded-lg",children:(0,Be.jsxs)("div",{className:"flex items-center gap-2",children:[er(n.mediaType||"application/octet-stream"),(0,Be.jsx)("div",{className:"flex-1 min-w-0",children:(0,Be.jsx)("Be",{className:"text-sm font-medium truncate",children:n.filename||n.url?.split("/").pop()||"File"})}),n.url&&(0,Be.jsx)(z,{variant:"ghost",size:"sm",onClick:()=>window.open(n.url,"_blank"),className:"h-8 w-8 Be-0",children:(0,Be.jsx)(I.Download,{className:"h-4 w-4"})})]})},a)}if(s.type.startsWith("tool-")){let n=s,i=s.type.replace("tool-","");if(i==="task")switch(n.state){case"input-available":return(0,Be.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},a);case"output-available":return(0,Be.jsx)("div",{className:"mb-2",children:(0,Be.jsx)(qt,{data:{id:n.output?.id||n.input?.id,fetchLatest:!1,taskData:n.output||n.input}})},a);case"output-error":return(0,Be.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},a);default:return null}if(s.type==="tool-requestEndpointLogin")return(0,Be.jsx)("div",{className:"mb-2",children:(0,Be.jsx)(et,{toolPart:n,index:a,addToolResult:t??(()=>{})})},a);if(s.type==="tool-authenticate")return(0,Be.jsx)("div",{className:"mb-2",children:(0,Be.jsx)(et,{toolPart:n,index:a,addToolResult:t??(()=>{})})},a);if(s.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",n),(0,Be.jsx)("div",{className:"mb-2",children:(0,Be.jsx)(Dt,{toolPart:n,index:a,addToolResult:t??(()=>{})})},a);if(i==="artefact")switch(n.state){case"input-available":return(0,Be.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},a);case"output-available":return(0,Be.jsx)("div",{className:"mb-2",children:(0,Be.jsx)(Qt,{artefact:n.output?.description||"",taskId:n.output?.id||n.input?.id,taskData:n.output||n.input})},a);case"output-error":return(0,Be.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},a);default:return null}return(0,Be.jsx)("div",{className:"mb-2",children:(0,Be.jsxs)($,{className:"w-full max-w-md",children:[(0,Be.jsx)(te,{children:(0,Be.jsx)(oe,{className:"text-lg",children:i})}),(0,Be.jsxs)(j,{children:[n.state==="input-available"&&(0,Be.jsxs)("Be",{className:"text-sm",children:["Processing ",i,"..."]}),n.state==="output-available"&&(0,Be.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.output,null,2)}),n.state==="output-error"&&(0,Be.jsxs)("Be",{className:"text-sm text-red-500",children:["Error: ",n.errorText]})]})]})},a)}if(s.type.startsWith("data-")){let n=s,i=s.type.replace("data-","");return i==="reference"?(0,Be.jsx)("div",{className:"mb-2",children:(0,Be.jsx)($,{className:"w-full",children:(0,Be.jsx)(j,{className:"Be-4",children:(0,Be.jsx)("div",{className:"space-y-2",children:n.data?.references?.map((c,g)=>(0,Be.jsxs)("div",{className:"flex items-center gap-2 Be-2 rounded-md bg-muted/50",children:[(0,Be.jsx)(X,{variant:"outline",children:c.type||"link"}),(0,Be.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Be.jsx)("Be",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Be.jsx)("Be",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Be.jsx)(z,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"h-8 w-8 Be-0",children:(0,Be.jsx)(I.ExternalLink,{className:"h-4 w-4"})})]},g))})})})},a):i==="menu"?(0,Be.jsx)("div",{className:"mb-2",children:(0,Be.jsxs)($,{className:"w-full",children:[(0,Be.jsx)(te,{children:(0,Be.jsx)(oe,{className:"text-lg",children:n.data?.title})}),(0,Be.jsx)(j,{children:(0,Be.jsx)("div",{className:"space-y-2",children:n.data?.items?.map((c,g)=>(0,Be.jsx)(z,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Be.jsxs)("div",{className:"text-left",children:[(0,Be.jsx)("Be",{className:"font-medium",children:c.label}),c.description&&(0,Be.jsx)("Be",{className:"text-xs text-muted-foreground",children:c.description})]})},g))})})]})},a):(0,Be.jsx)("div",{className:"mb-2",children:(0,Be.jsxs)($,{className:"w-full max-w-md",children:[(0,Be.jsx)(te,{children:(0,Be.jsx)(oe,{className:"text-lg",children:i})}),(0,Be.jsx)(j,{children:(0,Be.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.data,null,2)})})]})},a)}if(s.type==="reasoning")return(0,Be.jsxs)(rt,{className:"w-full",isStreaming:o==="streaming"&&a===e.parts.length-1&&e.id===r.at(-1)?.id,children:[(0,Be.jsx)(at,{}),(0,Be.jsx)(nt,{children:s.text})]},`${a}`);if(s.type==="dynamic-tool")return(0,Be.jsxs)(Ft,{defaultOpen:s.state!=="output-available",children:[(0,Be.jsx)(Vt,{type:`tool-${s.toolName}`,state:s.state}),(0,Be.jsxs)(Ut,{children:[(0,Be.jsx)(Gt,{input:s.input}),(0,Be.jsx)($t,{output:s.output,errorText:s.errorText})]})]},`${e.id}-${a}`)});var Zt=({className:e,from:t,...o})=>(0,Be.jsx)("div",{className:d("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...o}),tr=(0,yt.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),eo=({children:e,className:t,variant:o,...r})=>(0,Be.jsx)("div",{className:d(tr({variant:o,className:t})),...r,children:e});function or({messages:e,input:t,isTyping:o=!1,currentSessionTitle:r,capabilities:s,fileUploads:a,isDragOver:n,enableFileUpload:i,onInputChange:c,addToolResult:g,onSendMessage:h,onKeyPress:f,onFileUpload:v,onRemoveFile:R,onDragOver:P,className:x,status:y="ready"}){let C=(0,_.useRef)(null),E=(0,_.useRef)(null),A=(0,_.useRef)(null),[S,q]=(0,_.useState)(!1),[ue,We]=(0,_.useState)({path:[],selectedItems:[],filters:{}});(0,_.useEffect)(()=>{C.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,_.useEffect)(()=>{S&&setTimeout(()=>{C.current?.scrollIntoView({behavior:"smooth"})},100)},[S]);let Ce=()=>Ye(ue),me=()=>{let u=[];return s.forEach(T=>{T.actions&&T.actions.forEach(K=>{u.push({label:K.label,action:()=>ie(K.id,{path:[T],selectedItems:[],filters:{}})})}),T.children&&T.children.forEach(K=>{K.type==="list"&&K.data&&u.push({label:`View ${K.name}`,action:()=>q(!0)})})}),u.slice(0,5)},ie=(u,T)=>{console.log("Capability action:",u,T);let K=`Executing ${u} with context: ${JSON.stringify(T.path.map(Ie=>Ie.name))}`;q(!1)},we=Ye({path:[],selectedItems:[],filters:{}}),w=u=>{v(u.target.files),u.target.files&&(u.target.value="")},Ae=u=>{u.preventDefault(),P(!0)},ge=u=>{u.preventDefault(),P(!1)},Se=u=>{u.preventDefault(),P(!1),v(u.dataTransfer.files)},fe=u=>{if(u===0)return"0 Bytes";let T=1024,K=["Bytes","KB","MB","GB"],Ie=Math.floor(Math.log(u)/Math.log(T));return parseFloat((u/Math.pow(T,Ie)).toFixed(2))+" "+K[Ie]},Me=u=>u.startsWith("image/")?(0,Be.jsx)(I.Image,{className:"h-4 w-4"}):u.startsWith("text/")?(0,Be.jsx)(I.FileText,{className:"h-4 w-4"}):(0,Be.jsx)(I.File,{className:"h-4 w-4"}),Ne={messages:e,currentSessionTitle:r,capabilities:s,currentCapabilityContext:ue,contextualActions:we,getQuickSuggestions:me().map(u=>u.label)},le=()=>{navigator.clipboard.writeText(JSON.stringify(Ne,null,2)),alert("Debug info copied to clipboard")};return(0,Be.jsxs)("div",{className:`h-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${x||""}`,children:[(0,Be.jsxs)(Xe,{ref:E,className:"flex-1 Be-4 bg-background border-0",onDragOver:Ae,onDragLeave:ge,onDrop:Se,children:[(0,Be.jsxs)("div",{className:d("space-y-4",n&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Be.jsx)(xe.animate,{children:e.map(u=>(0,Be.jsx)(xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,Be.jsx)(Zt,{from:u.role,children:(0,Be.jsx)(eo,{variant:"flat",children:Xt({message:u,addToolResult:g??(()=>{}),status:y,messages:e})})},u.id)},u.id))}),S&&(0,Be.jsxs)(xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Be.jsx)(Ee,{className:"h-8 w-8",children:(0,Be.jsx)(ze,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Be.jsx)(I.Bot,{className:"h-4 w-4"})})}),(0,Be.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Be.jsx)(At,{capabilities:s,isOpen:S,onToggle:()=>q(!S),onActionSelect:ie,className:"w-full"})})]}),o&&(0,Be.jsxs)(xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Be.jsx)(Ee,{className:"h-8 w-8",children:(0,Be.jsx)(ze,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Be.jsx)(I.Bot,{className:"h-4 w-4"})})}),(0,Be.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Be.jsxs)("div",{className:"flex space-x-1",children:[(0,Be.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Be.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Be.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Be.jsx)("div",{ref:C})]}),a.length>0&&(0,Be.jsx)("div",{className:"Be-4 border-t bg-muted/10",children:(0,Be.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(u=>(0,Be.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg Be-2 border",children:[Me(u.file.type),(0,Be.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,Be.jsx)("span",{className:"text-xs text-muted-foreground",children:fe(u.file.size)}),(0,Be.jsx)(z,{variant:"ghost",size:"sm",onClick:()=>R(u.id),className:"h-6 w-6 Be-0",children:(0,Be.jsx)(I.X,{className:"h-4 w-4"})})]},u.id))})}),(0,Be.jsxs)("div",{className:"border rounded-2xl Be-4 bg-muted/20",children:[(0,Be.jsxs)("div",{className:"flex gap-3",children:[(0,Be.jsx)(Je,{value:t,onChange:u=>c(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),i&&(0,Be.jsx)(z,{variant:"outline",size:"icon",onClick:()=>A.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Be.jsx)(I.Paperclip,{className:"h-4 w-4"})}),(0,Be.jsx)(z,{onClick:h,disabled:!t.trim()&&a.length===0||o,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Be.jsx)(I.Send,{className:"h-4 w-4"})})]}),(0,Be.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Be.jsxs)(z,{onClick:()=>q(!S),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Be.jsx)(I.Menu,{className:"h-3 w-3 mr-1"}),S?"Hide":"Show"," Capabilities"]}),(0,Be.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[Ce().map((u,T)=>(0,Be.jsx)(z,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>ie(u.id,ue),children:u.label},`context-${u.id}`)),Ce().length===0&&me().map((u,T)=>(0,Be.jsx)(z,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${T}`)),(0,Be.jsx)(z,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:le,children:"Debug"})]})]}),i&&(0,Be.jsx)("input",{ref:A,type:"file",multiple:!0,onChange:w,className:"hidden"})]})]})}0&&(module.exports={ChatInterface});
|
|
21
|
+
`,children:"Cancel"})]})]}):null};var Dt=({toolPart:e,index:t,addToolResult:o})=>{let[r,s]=tt.default.useState(!0),[a,n]=tt.default.useState(null),i=()=>{o(e.toolCallId,e.type,"Approved"),s(!1),n("approve")},c=()=>{o(e.toolCallId,e.type,"Denied"),s(!1),n("deny")};switch(e.state){case"input-available":return(0,ze.jsxs)("div",{className:"mb-2",children:[(0,ze.jsx)(Lt,{isOpen:r,onApprove:i,onDeny:c,onClose:()=>s(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!r&&(0,ze.jsxs)(ze.Fragment,{children:[a==="approve"&&(0,ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,ze.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,ze.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),a==="deny"&&(0,ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,ze.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,ze.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,ze.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,ze.jsxs)(ze.Fragment,{children:[e.output==="approve"&&(0,ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,ze.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,ze.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),e.output==="deny"&&(0,ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,ze.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,ze.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]});default:return null}};var ot=require("@radix-ui/react-use-controllable-state");var he=j(require("@radix-ui/react-collapsible")),He=he.Root,Oe=he.CollapsibleTrigger,Fe=he.CollapsibleContent;var Bt=require("streamdown"),Pe=(0,q.memo)(({className:e,...t})=>(0,ze.jsx)(Bt.Streamdown,{className:d("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Pe.displayName="Response";var Ht=(0,q.createContext)(null),_o=()=>{let e=(0,q.useContext)(Ht);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},qo=1e3,Ko=1e3,rt=(0,q.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:r=!0,onOpenChange:s,duration:a,children:n,...i})=>{let[c,g]=(0,ot.useControllableState)({prop:o,defaultProp:r,onChange:s}),[h,f]=(0,ot.useControllableState)({prop:a,defaultProp:0}),[v,A]=(0,q.useState)(!1),[P,x]=(0,q.useState)(null);(0,q.useEffect)(()=>{t?P===null&&x(Date.now()):P!==null&&(f(Math.ceil((Date.now()-P)/Ko)),x(null))},[t,P,f]),(0,q.useEffect)(()=>{if(r&&!t&&c&&!v){let C=setTimeout(()=>{g(!1),A(!0)},qo);return()=>clearTimeout(C)}},[t,c,r,g,v]);let y=C=>{g(C)};return(0,ze.jsx)(Ht.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:g,duration:h},children:(0,ze.jsx)(He,{className:d("not-prose mb-4",e),onOpenChange:y,open:c,...i,children:n})})}),Jo=(e,t)=>e||t===0?(0,ze.jsx)("ze",{children:"Thinking..."}):t===void 0?(0,ze.jsx)("ze",{children:"Thought for a few seconds"}):(0,ze.jsxs)("ze",{children:["Thought for ",t," seconds"]}),at=(0,q.memo)(({className:e,children:t,...o})=>{let{isStreaming:r,isOpen:s,duration:a}=_o();return(0,ze.jsx)(Oe,{className:d("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)(D.BrainIcon,{className:"size-4"}),Jo(r,a),(0,ze.jsx)(D.ChevronDownIcon,{className:d("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),nt=(0,q.memo)(({className:e,children:t,...o})=>(0,ze.jsx)(Fe,{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,ze.jsx)(Pe,{className:"grid gap-2",children:t})}));rt.displayName="Reasoning";at.displayName="ReasoningTrigger";nt.displayName="ReasoningContent";var st=require("react-syntax-highlighter"),Ue=require("react-syntax-highlighter/dist/esm/styles/prism"),Qo=(0,q.createContext)({code:""}),Ge=({code:e,language:t,showLineNumbers:o=!1,className:r,children:s,...a})=>(0,ze.jsx)(Qo.Provider,{value:{code:e},children:(0,ze.jsx)("div",{className:d("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",r),...a,children:(0,ze.jsxs)("div",{className:"relative",children:[(0,ze.jsx)(st.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:Ue.oneLight,children:e}),(0,ze.jsx)(st.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:Ue.oneDark,children:e}),s&&(0,ze.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:s})]})})});var Ft=({className:e,...t})=>(0,ze.jsx)(He,{className:d("not-prose mb-4 w-full",e),...t}),Xo=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,ze.jsxs)(Y,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,ze.jsx)(D.CircleIcon,{className:"size-4"}),"input-available":(0,ze.jsx)(D.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,ze.jsx)(D.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,ze.jsx)(D.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Vt=({className:e,type:t,state:o,...r})=>(0,ze.jsxs)(Oe,{className:d("flex w-full items-center justify-between gap-4 ze-3 pl-0 w-2xl",e),...r,children:[(0,ze.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ze.jsx)(D.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,ze.jsx)("span",{className:"font-medium text-sm",children:t}),Xo(o)]}),(0,ze.jsx)(D.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),jt=({className:e,...t})=>(0,ze.jsx)(Fe,{className:d("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}),Ut=({className:e,input:t,...o})=>(0,ze.jsxs)("div",{className:d("space-y-2 overflow-hidden ze-4",e),...o,children:[(0,ze.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,ze.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,ze.jsx)(Ge,{code:JSON.stringify(t,null,2),language:"json"})})]}),Gt=({className:e,output:t,errorText:o,...r})=>{if(!(t||o))return null;let s=(0,ze.jsx)("div",{children:t});return typeof t=="object"?s=(0,ze.jsx)(Ge,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(s=(0,ze.jsx)(Ge,{code:t,language:"json"})),(0,ze.jsxs)("div",{className:d("space-y-2 ze-4",e),...r,children:[(0,ze.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,ze.jsxs)("div",{className:d("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,ze.jsx)("div",{children:o}),s]})]})};var de=j(require("react"));var $=de.forwardRef(({className:e,...t},o)=>(0,ze.jsx)("div",{ref:o,className:d("rounded-xl border bg-card text-card-foreground shadow",e),...t}));$.displayName="Card";var te=de.forwardRef(({className:e,...t},o)=>(0,ze.jsx)("div",{ref:o,className:d("flex flex-col space-y-1.5 ze-6",e),...t}));te.displayName="CardHeader";var oe=de.forwardRef(({className:e,...t},o)=>(0,ze.jsx)("div",{ref:o,className:d("font-semibold leading-none tracking-tight",e),...t}));oe.displayName="CardTitle";var it=de.forwardRef(({className:e,...t},o)=>(0,ze.jsx)("div",{ref:o,className:d("text-sm text-muted-foreground",e),...t}));it.displayName="CardDescription";var W=de.forwardRef(({className:e,...t},o)=>(0,ze.jsx)("div",{ref:o,className:d("ze-6 pt-0",e),...t}));W.displayName="CardContent";var Re=de.forwardRef(({className:e,...t},o)=>(0,ze.jsx)("div",{ref:o,className:d("flex items-center ze-6 pt-0",e),...t}));Re.displayName="CardFooter";var _t=require("date-fns");function $t({taskId:e,polling:t=!0,system:o="payload"}){let[r,s]=(0,q.useState)(null),[a,n]=(0,q.useState)(!1),[i,c]=(0,q.useState)(null),g=async(f=!0)=>{if(e){f&&n(!0);try{let v=await fetch(`/api/tasks/${e}`);if(!v.ok)throw new Error(`Failed to fetch task: ${v.statusText}`);let A=await v.json();s(A)}catch(v){console.error("Error fetching task:",v),c(v instanceof Error?v:new Error("Unknown error occurred"))}finally{f&&n(!1)}}},h=()=>g(!1);return(0,q.useEffect)(()=>{e&&g(!0);let f=null;return e&&t&&(f=setInterval(h,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:r,loading:a,error:i}}var Yo=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"}},Zo=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function qt({data:e}){let{id:t,system:o,fetchLatest:r,taskData:s,error:a}=e||{};if(!t)return null;let n=null,i=!0,c=a,g=r!==void 0?r:!0;if(n=s||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:r,system:o,fetchLatest:g,taskData:n,error:c}),g){let{task:A,loading:P,error:x}=$t({taskId:t,system:o});n=A,i=P,c=x}else i=!1;let h=Yo(n?.status||"todo"),f=Zo(n?.status||"todo"),v=n?.dateLogged||new Date().toISOString();try{let A=new Date(n?.dateLogged||"");isNaN(A.getTime())||(v=(0,_t.formatDistanceToNow)(A,{addSuffix:!0}))}catch{}return(0,ze.jsxs)($,{className:d("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,ze.jsxs)(te,{className:"pb-2",children:[(0,ze.jsxs)("div",{className:"flex justify-between items-start",children:[(0,ze.jsx)(oe,{className:"text-lg font-semibold",children:i?"Loading...":n?.name||"Task"}),(0,ze.jsx)(Y,{className:`${h}`,children:f})]}),n?.project&&(0,ze.jsxs)(it,{className:"text-sm text-gray-500",children:["Project: ",n.project.name]})]}),(0,ze.jsx)(W,{className:"pb-2",children:i?(0,ze.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,ze.jsx)("ze",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ze.jsx)("ze",{className:"text-sm text-foreground",children:n?.description||"......."})}),(0,ze.jsx)(Re,{className:"pt-2 flex items-center justify-between",children:(0,ze.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ze.jsx)(D.Clock,{className:"h-3 w-3 mr-1"}),(0,ze.jsxs)("span",{children:["Created ",v]}),(0,ze.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ze.jsxs)("span",{children:["Task #",t]})]})})]})}function Qt({artefact:e,taskId:t,taskData:o,loading:r=!1,error:s=null}){let a=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=a.dateLogged;try{let i=new Date(a.dateLogged);isNaN(i.getTime())||(n=(0,_t.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,ze.jsxs)($,{className:"w-full max-w-md shadow-md",children:[(0,ze.jsx)(te,{className:"pb-2",children:(0,ze.jsx)("div",{className:"flex justify-between items-start",children:(0,ze.jsx)(oe,{className:"text-lg font-semibold",children:r?"Loading...":a.name})})}),(0,ze.jsx)(W,{className:"pb-2",children:r?(0,ze.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,ze.jsx)("ze",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ze.jsx)("ze",{className:"text-sm text-foreground",children:e})}),(0,ze.jsx)(Re,{className:"pt-2 flex items-center justify-between",children:(0,ze.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ze.jsx)(D.Clock,{className:"h-3 w-3 mr-1"}),(0,ze.jsxs)("span",{children:["Created ",n]}),(0,ze.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ze.jsxs)("span",{children:["Task #",a.id]})]})})]})}var er=e=>e.startsWith("image/")?(0,ze.jsx)(D.Image,{className:"h-4 w-4"}):e.startsWith("text/")?(0,ze.jsx)(D.FileText,{className:"h-4 w-4"}):(0,ze.jsx)(D.File,{className:"h-4 w-4"}),Xt=({message:e,addToolResult:t,status:o,messages:r})=>e.parts.map((s,a)=>{if(s.type==="text")return(0,ze.jsx)(Pe,{children:s.text},`${a}`);if(s.type==="file"){let n=s;return(0,ze.jsx)("div",{className:"mb-2 ze-2 bg-background/50 rounded-lg",children:(0,ze.jsxs)("div",{className:"flex items-center gap-2",children:[er(n.mediaType||"application/octet-stream"),(0,ze.jsx)("div",{className:"flex-1 min-w-0",children:(0,ze.jsx)("ze",{className:"text-sm font-medium truncate",children:n.filename||n.url?.split("/").pop()||"File"})}),n.url&&(0,ze.jsx)(z,{variant:"ghost",size:"sm",onClick:()=>window.open(n.url,"_blank"),className:"h-8 w-8 ze-0",children:(0,ze.jsx)(D.Download,{className:"h-4 w-4"})})]})},a)}if(s.type.startsWith("tool-")){let n=s,i=s.type.replace("tool-","");if(i==="task")switch(n.state){case"input-available":return(0,ze.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},a);case"output-available":return(0,ze.jsx)("div",{className:"mb-2",children:(0,ze.jsx)(qt,{data:{id:n.output?.id||n.input?.id,fetchLatest:!1,taskData:n.output||n.input}})},a);case"output-error":return(0,ze.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},a);default:return null}if(s.type==="tool-requestEndpointLogin")return(0,ze.jsx)("div",{className:"mb-2",children:(0,ze.jsx)(et,{toolPart:n,index:a,addToolResult:t??(()=>{})})},a);if(s.type==="tool-authenticate")return(0,ze.jsx)("div",{className:"mb-2",children:(0,ze.jsx)(et,{toolPart:n,index:a,addToolResult:t??(()=>{})})},a);if(s.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",n),(0,ze.jsx)("div",{className:"mb-2",children:(0,ze.jsx)(Dt,{toolPart:n,index:a,addToolResult:t??(()=>{})})},a);if(i==="artefact")switch(n.state){case"input-available":return(0,ze.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},a);case"output-available":return(0,ze.jsx)("div",{className:"mb-2",children:(0,ze.jsx)(Qt,{artefact:n.output?.description||"",taskId:n.output?.id||n.input?.id,taskData:n.output||n.input})},a);case"output-error":return(0,ze.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},a);default:return null}return(0,ze.jsx)("div",{className:"mb-2",children:(0,ze.jsxs)($,{className:"w-full max-w-md",children:[(0,ze.jsx)(te,{children:(0,ze.jsx)(oe,{className:"text-lg",children:i})}),(0,ze.jsxs)(W,{children:[n.state==="input-available"&&(0,ze.jsxs)("ze",{className:"text-sm",children:["Processing ",i,"..."]}),n.state==="output-available"&&(0,ze.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.output,null,2)}),n.state==="output-error"&&(0,ze.jsxs)("ze",{className:"text-sm text-red-500",children:["Error: ",n.errorText]})]})]})},a)}if(s.type.startsWith("data-")){let n=s,i=s.type.replace("data-","");return i==="reference"?(0,ze.jsx)("div",{className:"mb-2",children:(0,ze.jsx)($,{className:"w-full",children:(0,ze.jsx)(W,{className:"ze-4",children:(0,ze.jsx)("div",{className:"space-y-2",children:n.data?.references?.map((c,g)=>(0,ze.jsxs)("div",{className:"flex items-center gap-2 ze-2 rounded-md bg-muted/50",children:[(0,ze.jsx)(Y,{variant:"outline",children:c.type||"link"}),(0,ze.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ze.jsx)("ze",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,ze.jsx)("ze",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,ze.jsx)(z,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"h-8 w-8 ze-0",children:(0,ze.jsx)(D.ExternalLink,{className:"h-4 w-4"})})]},g))})})})},a):i==="menu"?(0,ze.jsx)("div",{className:"mb-2",children:(0,ze.jsxs)($,{className:"w-full",children:[(0,ze.jsx)(te,{children:(0,ze.jsx)(oe,{className:"text-lg",children:n.data?.title})}),(0,ze.jsx)(W,{children:(0,ze.jsx)("div",{className:"space-y-2",children:n.data?.items?.map((c,g)=>(0,ze.jsx)(z,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,ze.jsxs)("div",{className:"text-left",children:[(0,ze.jsx)("ze",{className:"font-medium",children:c.label}),c.description&&(0,ze.jsx)("ze",{className:"text-xs text-muted-foreground",children:c.description})]})},g))})})]})},a):(0,ze.jsx)("div",{className:"mb-2",children:(0,ze.jsxs)($,{className:"w-full max-w-md",children:[(0,ze.jsx)(te,{children:(0,ze.jsx)(oe,{className:"text-lg",children:i})}),(0,ze.jsx)(W,{children:(0,ze.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.data,null,2)})})]})},a)}if(s.type==="reasoning")return(0,ze.jsxs)(rt,{className:"w-full",isStreaming:o==="streaming"&&a===e.parts.length-1&&e.id===r.at(-1)?.id,children:[(0,ze.jsx)(at,{}),(0,ze.jsx)(nt,{children:s.text})]},`${a}`);if(s.type==="dynamic-tool")return(0,ze.jsxs)(Ft,{defaultOpen:s.state!=="output-available",children:[(0,ze.jsx)(Vt,{type:`tool-${s.toolName}`,state:s.state}),(0,ze.jsxs)(jt,{children:[(0,ze.jsx)(Ut,{input:s.input}),(0,ze.jsx)(Gt,{output:s.output,errorText:s.errorText})]})]},`${e.id}-${a}`)});var Zt=({className:e,from:t,...o})=>(0,$e.jsx)("div",{className:d("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...o}),tr=(0,yt.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),eo=({children:e,className:t,variant:o,...r})=>(0,$e.jsx)("div",{className:d(tr({variant:o,className:t})),...r,children:e});function or({messages:e,input:t,isTyping:o=!1,currentSessionTitle:r,capabilities:s,fileUploads:a,isDragOver:n,enableFileUpload:i,onInputChange:c,addToolResult:g,onSendMessage:h,onKeyPress:f,onFileUpload:v,onRemoveFile:A,onDragOver:P,className:x,status:y="ready"}){let C=(0,q.useRef)(null),B=(0,q.useRef)(null),S=(0,q.useRef)(null),[M,K]=(0,q.useState)(!1),[ue,We]=(0,q.useState)({path:[],selectedItems:[],filters:{}});(0,q.useEffect)(()=>{C.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,q.useEffect)(()=>{M&&setTimeout(()=>{C.current?.scrollIntoView({behavior:"smooth"})},100)},[M]);let Ce=()=>Ye(ue),me=()=>{let u=[];return s.forEach(R=>{R.actions&&R.actions.forEach(J=>{u.push({label:J.label,action:()=>ie(J.id,{path:[R],selectedItems:[],filters:{}})})}),R.children&&R.children.forEach(J=>{J.type==="list"&&J.data&&u.push({label:`View ${J.name}`,action:()=>K(!0)})})}),u.slice(0,5)},ie=(u,R)=>{console.log("Capability action:",u,R);let J=`Executing ${u} with context: ${JSON.stringify(R.path.map(Ie=>Ie.name))}`;K(!1)},we=Ye({path:[],selectedItems:[],filters:{}}),w=u=>{v(u.target.files),u.target.files&&(u.target.value="")},Ae=u=>{u.preventDefault(),P(!0)},ge=u=>{u.preventDefault(),P(!1)},Se=u=>{u.preventDefault(),P(!1),v(u.dataTransfer.files)},fe=u=>{if(u===0)return"0 Bytes";let R=1024,J=["Bytes","KB","MB","GB"],Ie=Math.floor(Math.log(u)/Math.log(R));return parseFloat((u/Math.pow(R,Ie)).toFixed(2))+" "+J[Ie]},Me=u=>u.startsWith("image/")?(0,ze.jsx)(D.Image,{className:"h-4 w-4"}):u.startsWith("text/")?(0,ze.jsx)(D.FileText,{className:"h-4 w-4"}):(0,ze.jsx)(D.File,{className:"h-4 w-4"}),Ne={messages:e,currentSessionTitle:r,capabilities:s,currentCapabilityContext:ue,contextualActions:we,getQuickSuggestions:me().map(u=>u.label)},le=()=>{navigator.clipboard.writeText(JSON.stringify(Ne,null,2)),alert("Debug info copied to clipboard")};return(0,ze.jsxs)("div",{className:`h-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${x||""}`,children:[(0,ze.jsxs)(Xe,{ref:B,className:"flex-1 ze-4 bg-background border-0",onDragOver:Ae,onDragLeave:ge,onDrop:Se,children:[(0,ze.jsxs)("div",{className:d("space-y-4",n&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,ze.jsx)(xe.animate,{children:e.map(u=>(0,ze.jsx)(xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,ze.jsx)(Zt,{from:u.role,children:(0,ze.jsx)(eo,{variant:"flat",children:Xt({message:u,addToolResult:g??(()=>{}),status:y,messages:e})})},u.id)},u.id))}),M&&(0,ze.jsxs)(xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,ze.jsx)(Ee,{className:"h-8 w-8",children:(0,ze.jsx)(Be,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,ze.jsx)(D.Bot,{className:"h-4 w-4"})})}),(0,ze.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ze.jsx)(At,{capabilities:s,isOpen:M,onToggle:()=>K(!M),onActionSelect:ie,className:"w-full"})})]}),o&&(0,ze.jsxs)(xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,ze.jsx)(Ee,{className:"h-8 w-8",children:(0,ze.jsx)(Be,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,ze.jsx)(D.Bot,{className:"h-4 w-4"})})}),(0,ze.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ze.jsxs)("div",{className:"flex space-x-1",children:[(0,ze.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,ze.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,ze.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,ze.jsx)("div",{ref:C})]}),a.length>0&&(0,ze.jsx)("div",{className:"ze-4 border-t bg-muted/10",children:(0,ze.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(u=>(0,ze.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg ze-2 border",children:[Me(u.file.type),(0,ze.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,ze.jsx)("span",{className:"text-xs text-muted-foreground",children:fe(u.file.size)}),(0,ze.jsx)(z,{variant:"ghost",size:"sm",onClick:()=>A(u.id),className:"h-6 w-6 ze-0",children:(0,ze.jsx)(D.X,{className:"h-4 w-4"})})]},u.id))})}),(0,ze.jsxs)("div",{className:"border rounded-2xl ze-4 bg-muted/20",children:[(0,ze.jsxs)("div",{className:"flex gap-3",children:[(0,ze.jsx)(Je,{value:t,onChange:u=>c(u.target.value),onKeyPress:f,placeholder:"How can ze help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),i&&(0,ze.jsx)(z,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,ze.jsx)(D.Paperclip,{className:"h-4 w-4"})}),(0,ze.jsx)(z,{onClick:h,disabled:!t.trim()&&a.length===0||o,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,ze.jsx)(D.Send,{className:"h-4 w-4"})})]}),(0,ze.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,ze.jsxs)(z,{onClick:()=>K(!M),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,ze.jsx)(D.Menu,{className:"h-3 w-3 mr-1"}),M?"Hide":"Show"," Capabilities"]}),(0,ze.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[Ce().map((u,R)=>(0,ze.jsx)(z,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>ie(u.id,ue),children:u.label},`context-${u.id}`)),Ce().length===0&&me().map((u,R)=>(0,ze.jsx)(z,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${R}`)),(0,ze.jsx)(z,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:le,children:"Debug"})]})]}),i&&(0,ze.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:w,className:"hidden"})]})]})}0&&(module.exports={ChatInterface});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-UJITFLIZ.mjs";import"../../chunk-EPJJKGCG.mjs";import"../../chunk-MTA6RFZ7.mjs";import"../../chunk-SH5SK6V2.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-5Y6FKL5W.mjs";import"../../chunk-EW6KWAHS.mjs";import"../../chunk-7JDMW5R3.mjs";import"../../chunk-UA2E23AS.mjs";import"../../chunk-6OT5PQXV.mjs";import"../../chunk-YPZAYXNQ.mjs";import"../../chunk-7TSR2LQB.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-RL6365DN.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-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as ChatInterface};
|