cortex-react-components 2.13.14 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/{chunk-GETYSIZV.mjs → chunk-255P6K5W.mjs} +1 -1
  2. package/dist/{chunk-VRE6VCHX.mjs → chunk-2BR55L74.mjs} +1 -1
  3. package/dist/{chunk-P6OSMPUQ.mjs → chunk-2RQDJ5XT.mjs} +1 -1
  4. package/dist/{chunk-GLBQHEMQ.mjs → chunk-2Z5N6HIX.mjs} +1 -1
  5. package/dist/chunk-3BG2SCNC.mjs +1 -0
  6. package/dist/chunk-4RGIPI27.mjs +1 -0
  7. package/dist/{chunk-BQQ4V4PX.mjs → chunk-5SHZBJ5R.mjs} +1 -1
  8. package/dist/{chunk-R6AYIVIR.mjs → chunk-5WVFEIMC.mjs} +1 -1
  9. package/dist/{chunk-QQFIVSBW.mjs → chunk-62A35O55.mjs} +1 -1
  10. package/dist/{chunk-GAZHKHGB.mjs → chunk-67QPOSVV.mjs} +1 -1
  11. package/dist/chunk-6OT5PQXV.mjs +13 -0
  12. package/dist/{chunk-7OMPPFGG.mjs → chunk-7GMAMIHM.mjs} +1 -1
  13. package/dist/{chunk-2GM2LPLB.mjs → chunk-ERJXTG6X.mjs} +1 -1
  14. package/dist/{chunk-TO7SVJIU.mjs → chunk-F2Y3ELUO.mjs} +1 -1
  15. package/dist/{chunk-HDKHF3EA.mjs → chunk-FKU4VQR6.mjs} +1 -1
  16. package/dist/{chunk-DPZHVBGG.mjs → chunk-GSOFCLPO.mjs} +1 -1
  17. package/dist/{chunk-F64CA5CH.mjs → chunk-H3CJOE6S.mjs} +1 -1
  18. package/dist/{chunk-U3FYDDE2.mjs → chunk-HKGW6JI2.mjs} +1 -1
  19. package/dist/{chunk-KZAYLEFB.mjs → chunk-I2GNNRFH.mjs} +1 -1
  20. package/dist/{chunk-PNUBVBSR.mjs → chunk-IF3425JX.mjs} +1 -1
  21. package/dist/{chunk-PTZT4QJW.mjs → chunk-LJQPLE4S.mjs} +1 -1
  22. package/dist/{chunk-2OOJ4ZFB.mjs → chunk-M7NV6EFH.mjs} +1 -1
  23. package/dist/{chunk-4SRUEQTP.mjs → chunk-MXCW6SOT.mjs} +1 -1
  24. package/dist/{chunk-FYQBRCQM.mjs → chunk-N3B3XNV3.mjs} +1 -1
  25. package/dist/{chunk-FEWOSBUJ.mjs → chunk-NWISIJFD.mjs} +1 -1
  26. package/dist/{chunk-RIRZRO6U.mjs → chunk-P55W6AFU.mjs} +1 -1
  27. package/dist/{chunk-MO4HRQEL.mjs → chunk-PK3OBSCB.mjs} +1 -1
  28. package/dist/{chunk-T5HJS6OF.mjs → chunk-RSDUFAIB.mjs} +1 -1
  29. package/dist/{chunk-PKEBARQB.mjs → chunk-TILPSVAP.mjs} +1 -1
  30. package/dist/{chunk-UZSBX5GO.mjs → chunk-X3JZSN3W.mjs} +1 -1
  31. package/dist/{chunk-VNYUNZ3M.mjs → chunk-XGIYNUGC.mjs} +1 -1
  32. package/dist/{chunk-OQCMTGML.mjs → chunk-XKGBG5FX.mjs} +1 -1
  33. package/dist/{chunk-HKMNAXLM.mjs → chunk-YKG4FNS4.mjs} +1 -1
  34. package/dist/components/Blocks/Banner.mjs +1 -1
  35. package/dist/components/Blocks/CallToAction.mjs +1 -1
  36. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  37. package/dist/components/Blocks/Content.mjs +1 -1
  38. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  39. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  40. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  41. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  42. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  43. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  44. package/dist/components/Blocks/index.mjs +1 -1
  45. package/dist/components/Cards/ContentCard.mjs +1 -1
  46. package/dist/components/Cards/FeatureCard.mjs +1 -1
  47. package/dist/components/Cards/index.mjs +1 -1
  48. package/dist/components/Chat/ChatInterface.js +12 -3
  49. package/dist/components/Chat/ChatInterface.mjs +1 -1
  50. package/dist/components/Chat/Components/ApprovalRequest.d.ts +12 -0
  51. package/dist/components/Chat/Components/ApprovalRequest.js +13 -0
  52. package/dist/components/Chat/Components/ApprovalRequest.mjs +2 -0
  53. package/dist/components/Chat/CopilotInterface.js +12 -3
  54. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  55. package/dist/components/Chat/PartTypes/PartApprovalTool.d.ts +15 -0
  56. package/dist/components/Chat/PartTypes/PartApprovalTool.js +13 -0
  57. package/dist/components/Chat/PartTypes/PartApprovalTool.mjs +1 -0
  58. package/dist/components/Chat/PartTypes/index.d.ts +1 -0
  59. package/dist/components/Chat/PartTypes/index.js +13 -4
  60. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  61. package/dist/components/Chat/demo-long-messages.js +23 -14
  62. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  63. package/dist/components/Chat/demo-tests.js +38 -29
  64. package/dist/components/Chat/demo-tests.mjs +1 -1
  65. package/dist/components/Chat/demo.js +12 -3
  66. package/dist/components/Chat/demo.mjs +1 -1
  67. package/dist/components/Chat/example-usage.js +12 -3
  68. package/dist/components/Chat/example-usage.mjs +1 -1
  69. package/dist/components/Chat/example-with-vercel-ai.js +12 -3
  70. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  71. package/dist/components/Chat/index.d.ts +2 -0
  72. package/dist/components/Chat/index.js +13 -4
  73. package/dist/components/Chat/index.mjs +1 -1
  74. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  75. package/dist/components/DigitalColleagues/index.mjs +1 -1
  76. package/dist/components/Foundary/MainPage.mjs +1 -1
  77. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  78. package/dist/components/Foundary/Views/index.mjs +1 -1
  79. package/dist/components/Foundary/index.mjs +1 -1
  80. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  81. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  82. package/dist/components/HeaderFooter/index.mjs +1 -1
  83. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  84. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  85. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  86. package/dist/components/Heros/RenderHero.mjs +1 -1
  87. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  88. package/dist/components/Heros/index.mjs +1 -1
  89. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  90. package/dist/components/Layouts/Print.mjs +1 -1
  91. package/dist/components/Layouts/SlideShow.mjs +1 -1
  92. package/dist/components/Layouts/index.mjs +1 -1
  93. package/dist/components/Other/index.mjs +1 -1
  94. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  95. package/dist/components/Payload/Media/index.mjs +1 -1
  96. package/dist/components/Payload/PayloadCard/index.mjs +1 -1
  97. package/dist/components/Payload/RichText/index.mjs +1 -1
  98. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  99. package/dist/components/Payload/index.mjs +1 -1
  100. package/dist/components/index.js +22 -13
  101. package/dist/components/index.mjs +1 -1
  102. package/dist/globals.css +1 -1
  103. package/dist/index.js +28 -19
  104. package/dist/index.mjs +1 -1
  105. package/dist/metafile-cjs.json +1 -1
  106. package/dist/metafile-esm.json +1 -1
  107. package/dist/pages/Blog.mjs +1 -1
  108. package/dist/pages/Documentation.mjs +1 -1
  109. package/dist/pages/IndexPage.mjs +1 -1
  110. package/dist/pages/Intranet.mjs +1 -1
  111. package/dist/pages/LandingPage.mjs +1 -1
  112. package/dist/pages/Page.mjs +1 -1
  113. package/dist/pages/Publish.mjs +1 -1
  114. package/dist/pages/Website.mjs +1 -1
  115. package/dist/sections/AboutSection.mjs +1 -1
  116. package/dist/sections/BlogDetail.mjs +1 -1
  117. package/dist/sections/BlogList.mjs +1 -1
  118. package/dist/sections/BlogListSection.mjs +1 -1
  119. package/dist/sections/ContactSection.mjs +1 -1
  120. package/dist/sections/PageSections.mjs +1 -1
  121. package/dist/sections/PricingSection.mjs +1 -1
  122. package/dist/sections/ServiceDetail.mjs +1 -1
  123. package/dist/sections/ServiceDetailSection.mjs +1 -1
  124. package/dist/sections/ServiceSection.mjs +1 -1
  125. package/dist/sections/index.mjs +1 -1
  126. package/package.json +1 -1
  127. package/dist/chunk-FDRX3CL2.mjs +0 -1
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a}from"../../chunk-TO7SVJIU.mjs";import"../../chunk-E6UOMRHI.mjs";import"../../chunk-56X4PU43.mjs";import"../../chunk-FDRX3CL2.mjs";import"../../chunk-SIL7AP7H.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-DBY4SXQI.mjs";import"../../chunk-I2PVJQQR.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-4WA47ZQA.mjs";import"../../chunk-NPVUICIF.mjs";import"../../chunk-QG4QCB5I.mjs";import"../../chunk-MU5WPW4N.mjs";import"../../chunk-AZKOVKSK.mjs";import"../../chunk-FGEFYI5E.mjs";import"../../chunk-Q2DPE66H.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-RLVKIMGU.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-FLHDNCNY.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as CopilotInterface};
2
+ "use strict";import{a}from"../../chunk-F2Y3ELUO.mjs";import"../../chunk-E6UOMRHI.mjs";import"../../chunk-56X4PU43.mjs";import"../../chunk-4RGIPI27.mjs";import"../../chunk-3BG2SCNC.mjs";import"../../chunk-6OT5PQXV.mjs";import"../../chunk-SIL7AP7H.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-DBY4SXQI.mjs";import"../../chunk-I2PVJQQR.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-4WA47ZQA.mjs";import"../../chunk-NPVUICIF.mjs";import"../../chunk-QG4QCB5I.mjs";import"../../chunk-MU5WPW4N.mjs";import"../../chunk-AZKOVKSK.mjs";import"../../chunk-FGEFYI5E.mjs";import"../../chunk-Q2DPE66H.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-RLVKIMGU.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-FLHDNCNY.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as CopilotInterface};
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ interface TaskToolPart {
3
+ type: string;
4
+ state: 'input-available' | 'output-available' | 'output-error';
5
+ input?: any;
6
+ output?: any;
7
+ errorText?: string;
8
+ }
9
+ interface ChatTaskToolRendererProps {
10
+ toolPart: TaskToolPart;
11
+ index: number;
12
+ addToolResult: (toolCallId: string, tool: string, output: any) => void;
13
+ }
14
+ export declare const PartApprovalTool: React.FC<ChatTaskToolRendererProps>;
15
+ export {};
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ "use strict";
3
+
4
+ "use strict";var f=Object.create;var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var o in t)p(e,o,{get:t[o],enumerable:!0})},v=(e,t,o,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of h(t))!A.call(e,n)&&n!==o&&p(e,n,{get:()=>t[n],enumerable:!(l=y(t,n))||l.enumerable});return e};var N=(e,t,o)=>(o=e!=null?f(k(e)):{},v(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),C=e=>v(p({},"__esModule",{value:!0}),e);var T={};w(T,{PartApprovalTool:()=>R});module.exports=C(T);var c=N(require("react"));var m=require("react"),a=require("react/jsx-runtime"),g=({isOpen:e=!0,reason:t,onClose:o,onApprove:l,onDeny:n,title:d="Approval Required"})=>{let[s,i]=(0,m.useState)(!1),u=()=>{i(!0),l(),o()},b=()=>{i(!0),n(),o()},x=()=>{i(!0),n(),o()};return e?(0,a.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,a.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:d}),(0,a.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:u,disabled:s,className:`
5
+ px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
6
+ ${s?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
7
+ `,children:s?"Processing...":"Approve"}),(0,a.jsx)("button",{onClick:b,disabled:s,className:`
8
+ px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
9
+ ${s?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
10
+ `,children:s?"Processing...":"Deny"}),(0,a.jsx)("button",{onClick:x,disabled:s,className:`
11
+ px-4 py-2 text-white border-none rounded text-sm
12
+ ${s?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
13
+ `,children:"Cancel"})]})]}):null};var R=({toolPart:e,index:t,addToolResult:o})=>{let[l,n]=c.default.useState(!0),[d,s]=c.default.useState(null),i=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),s("approve")},u=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),s("deny")};switch(e.state){case"input-available":return(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsx)(g,{isOpen:l,onApprove:i,onDeny:u,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!l&&(0,a.jsxs)(a.Fragment,{children:[d==="approve"&&(0,a.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,a.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,a.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),d==="deny"&&(0,a.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,a.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,a.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,a.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};0&&(module.exports={PartApprovalTool});
@@ -0,0 +1 @@
1
+ import{a}from"../../../chunk-3BG2SCNC.mjs";import"../../../chunk-6OT5PQXV.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as PartApprovalTool};
@@ -1,2 +1,3 @@
1
1
  export * from "./PartAuthenticateTool";
2
2
  export * from "./PartText";
3
+ export * from "./PartApprovalTool";
@@ -1,10 +1,19 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- "use strict";var M=Object.create;var p=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var o in t)p(e,o,{get:t[o],enumerable:!0})},h=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of O(t))!I.call(e,r)&&r!==o&&p(e,r,{get:()=>t[r],enumerable:!(s=R(t,r))||s.enumerable});return e};var x=(e,t,o)=>(o=e!=null?M(L(e)):{},h(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),S=e=>h(p({},"__esModule",{value:!0}),e);var F={};P(F,{PartAuthenticateTool:()=>z,PartText:()=>N});module.exports=S(F);var v=x(require("react"));var m=require("react"),n=require("react/jsx-runtime"),y=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:s,description:r="This endpoint requires authentication to sync functions."})=>{let[c,d]=(0,m.useState)(!1),[g,i]=(0,m.useState)(""),A=()=>{if(!t){i("No authentication URL provided");return}d(!0),i("");try{let l=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!l){i("Popup blocked. Please allow popups for this site and try again."),d(!1);return}let f=setInterval(()=>{try{l.closed&&(clearInterval(f),d(!1),s(),o())}catch{}},1e3);setTimeout(()=>{l.closed||(l.close(),clearInterval(f),d(!1),i("Authentication timed out. Please try again."))},6e5)}catch{i("Failed to open authentication window"),d(!1)}},C=async()=>{try{await navigator.clipboard.writeText(t),i("")}catch{i("Failed to copy URL to clipboard")}};return e?(0,n.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,n.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,n.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,n.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:r}),g&&(0,n.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:g}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("button",{onClick:A,disabled:c||!t,className:`
4
+ "use strict";var I=Object.create;var g=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var o in t)g(e,o,{get:t[o],enumerable:!0})},N=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of S(t))!B.call(e,r)&&r!==o&&g(e,r,{get:()=>t[r],enumerable:!(a=q(t,r))||a.enumerable});return e};var x=(e,t,o)=>(o=e!=null?I($(e)):{},N(t||!e||!e.__esModule?g(o,"default",{value:e,enumerable:!0}):o,e)),F=e=>N(g({},"__esModule",{value:!0}),e);var j={};D(j,{PartApprovalTool:()=>W,PartAuthenticateTool:()=>z,PartText:()=>L});module.exports=F(j);var T=x(require("react"));var h=require("react"),l=require("react/jsx-runtime"),A=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:r="This endpoint requires authentication to sync functions."})=>{let[d,n]=(0,h.useState)(!1),[c,i]=(0,h.useState)(""),v=()=>{if(!t){i("No authentication URL provided");return}n(!0),i("");try{let m=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!m){i("Popup blocked. Please allow popups for this site and try again."),n(!1);return}let w=setInterval(()=>{try{m.closed&&(clearInterval(w),n(!1),a(),o())}catch{}},1e3);setTimeout(()=>{m.closed||(m.close(),clearInterval(w),n(!1),i("Authentication timed out. Please try again."))},6e5)}catch{i("Failed to open authentication window"),n(!1)}},f=async()=>{try{await navigator.clipboard.writeText(t),i("")}catch{i("Failed to copy URL to clipboard")}};return e?(0,l.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,l.jsxs)("div",{className:"bg-white rounded-lg l-6 max-w-md w-[90%] shadow-lg",children:[(0,l.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,l.jsx)("l",{className:"text-sm text-gray-600 mb-4",children:r}),c&&(0,l.jsx)("div",{className:"mb-4 l-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:c}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{onClick:v,disabled:d||!t,className:`
5
5
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
6
- ${c||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
7
- `,children:c?"Authenticating...":"Authenticate"}),(0,n.jsx)("button",{onClick:C,disabled:!t,className:`
6
+ ${d||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
7
+ `,children:d?"Authenticating...":"Authenticate"}),(0,l.jsx)("button",{onClick:f,disabled:!t,className:`
8
8
  px-4 py-2 text-white border-none rounded text-sm
9
9
  ${t?"bg-blue-600 hover:bg-blue-700 cursor-pointer":"bg-gray-400 cursor-not-allowed"}
10
- `,children:"Copy URL"}),(0,n.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 z=({toolPart:e,index:t,addToolResult:o})=>{let[s,r]=v.default.useState(!0),c=()=>{o(e.input?.toolCallId,e.input?.tool,"Authentication completed"),r(!1)};switch(e.state){case"input-available":return(0,n.jsxs)("div",{className:"mb-2",children:[(0,n.jsx)(y,{isOpen:s,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>r(!1),onSuccess:c,description:e.output?.reason||e.input?.reason}),!s&&(0,n.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,n.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,n.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,n.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var k=require("marked"),w=x(require("react-markdown"));function B(e){return k.marked.lexer(e).map(o=>o.raw)}var T=(0,m.memo)(({content:e})=>(0,n.jsx)(w.default,{children:e}),(e,t)=>e.content===t.content);T.displayName="MemoizedMarkdownBlock";var N=(0,m.memo)(({content:e,id:t})=>(0,m.useMemo)(()=>B(e),[e]).map((s,r)=>(0,n.jsx)(T,{content:s},`${t}-block_${r}`)));N.displayName="PartText";0&&(module.exports={PartAuthenticateTool,PartText});
10
+ `,children:"Copy URL"}),(0,l.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 z=({toolPart:e,index:t,addToolResult:o})=>{let[a,r]=T.default.useState(!0),d=()=>{o(e.input?.toolCallId,e.input?.tool,"Authentication completed"),r(!1)};switch(e.state){case"input-available":return(0,l.jsxs)("div",{className:"mb-2",children:[(0,l.jsx)(A,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>r(!1),onSuccess:d,description:e.output?.reason||e.input?.reason}),!a&&(0,l.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,l.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,l.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,l.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var C=require("marked"),R=x(require("react-markdown"));function E(e){return C.marked.lexer(e).map(o=>o.raw)}var M=(0,h.memo)(({content:e})=>(0,l.jsx)(R.default,{children:e}),(e,t)=>e.content===t.content);M.displayName="MemoizedMarkdownBlock";var L=(0,h.memo)(({content:e,id:t})=>(0,h.useMemo)(()=>E(e),[e]).map((a,r)=>(0,l.jsx)(M,{content:a},`${t}-block_${r}`)));L.displayName="PartText";var k=x(require("react"));var P=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:r,title:d="Approval Required"})=>{let[n,c]=(0,h.useState)(!1),i=()=>{c(!0),a(),o()},v=()=>{c(!0),r(),o()},f=()=>{c(!0),r(),o()};return e?(0,l.jsxs)("div",{className:"bg-white rounded-lg l-6 max-w-md w-full shadow-lg",children:[(0,l.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:d}),(0,l.jsx)("l",{className:"text-sm text-gray-600 mb-6",children:t}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{onClick:i,disabled:n,className:`
11
+ px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
12
+ ${n?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
13
+ `,children:n?"Processing...":"Approve"}),(0,l.jsx)("button",{onClick:v,disabled:n,className:`
14
+ px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
15
+ ${n?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
16
+ `,children:n?"Processing...":"Deny"}),(0,l.jsx)("button",{onClick:f,disabled:n,className:`
17
+ px-4 py-2 text-white border-none rounded text-sm
18
+ ${n?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
19
+ `,children:"Cancel"})]})]}):null};var W=({toolPart:e,index:t,addToolResult:o})=>{let[a,r]=k.default.useState(!0),[d,n]=k.default.useState(null),c=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),r(!1),n("approve")},i=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),r(!1),n("deny")};switch(e.state){case"input-available":return(0,l.jsxs)("div",{className:"mb-2",children:[(0,l.jsx)(P,{isOpen:a,onApprove:c,onDeny:i,onClose:()=>r(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,l.jsxs)(l.Fragment,{children:[d==="approve"&&(0,l.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,l.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,l.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),d==="deny"&&(0,l.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,l.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,l.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,l.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};0&&(module.exports={PartApprovalTool,PartAuthenticateTool,PartText});
@@ -1 +1 @@
1
- import{a}from"../../../chunk-SIL7AP7H.mjs";import"../../../chunk-QM5FOQHG.mjs";import{a as b}from"../../../chunk-6OCLRAHU.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as PartAuthenticateTool,b as PartText};
1
+ import{a as c}from"../../../chunk-3BG2SCNC.mjs";import"../../../chunk-6OT5PQXV.mjs";import{a}from"../../../chunk-SIL7AP7H.mjs";import"../../../chunk-QM5FOQHG.mjs";import{a as b}from"../../../chunk-6OCLRAHU.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{c as PartApprovalTool,a as PartAuthenticateTool,b as PartText};