modifywithai 2.0.0 → 2.2.1
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/assistant/index.d.ts +3 -3
- package/dist/assistant/index.js +1 -1
- package/dist/assistant-7f9B_gWg.js +2 -0
- package/dist/assistant-nextjs/api.d.ts +1 -1
- package/dist/assistant-remix/api.d.ts +1 -1
- package/dist/assistant-tanstack-start/api.d.ts +1 -1
- package/dist/{index-BiZCpmdI.d.ts → index-B2dmSvFt.d.ts} +95 -50
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{types-CzieyGF2.d.ts → types-C7I0JuqF.d.ts} +1 -1
- package/package.json +5 -4
- package/dist/assistant-NY2A-1_6.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { S as UseDynamicUIReturn, _ as ToolActionSchema, a as AssistantConfig, b as UseAssistantTokenOptions, c as DynamicButton, d as DynamicUITree, f as TokenRequest, g as ToolAction, h as TokenResponseSchema, i as ActionOptionSchema, l as DynamicButtonGroup, m as TokenResponse, n as ActionDefinitionSchema, o as ChatStatus, p as TokenRequestSchema, r as ActionOption, s as CreateAssistantTokenHandlerOptions, t as ActionDefinition, u as DynamicUIElement, v as UseAssistantOptions, x as UseAssistantTokenReturn, y as UseAssistantReturn } from "../types-
|
|
2
|
-
import { $ as MessageContentProps, A as PromptInputFooterProps, At as ConfirmationActions, B as DrawerContentProps, C as TaskProps, Ct as ConversationScrollButton, D as PromptInputButton, Dt as ConfirmationAcceptedProps, E as PromptInput, Et as ConfirmationAccepted, F as PromptInputTextarea, Ft as ConfirmationRequest, G as DrawerPortal, H as DrawerFooter, I as PromptInputTextareaProps, It as ConfirmationRequestProps, J as Collapsible, K as DrawerTitle, L as Drawer, Lt as ConfirmationTitle, M as PromptInputProps, Mt as ConfirmationProps, N as PromptInputSubmit, Nt as ConfirmationRejected, O as PromptInputButtonProps, Ot as ConfirmationAction, P as PromptInputSubmitProps, Pt as ConfirmationRejectedProps, Q as MessageContent, R as DrawerClose, Rt as ConfirmationTitleProps, S as TaskItemProps, St as ConversationProps, T as TaskTriggerProps, Tt as Confirmation, U as DrawerHeader, V as DrawerDescription, W as DrawerOverlay, X as CollapsibleTrigger, Y as CollapsibleContent, Z as Message, _ as TaskContent, _t as Conversation, a as useToolExecution, at as DateFieldRenderer, b as TaskItemFile, bt as ConversationEmptyState, c as useDynamicUIToolExecution, ct as TextFieldRenderer, d as useAssistant, dt as DynamicButtonRenderer, et as MessageProps, f as AssistantContextValue, ft as dynamicUIRegistry, g as Task, gt as DynamicActionModalProps, h as useAssistantContext, ht as DynamicActionModal, i as UseToolExecutionOptions, it as AssistantFormRendererProps, j as PromptInputMessage, jt as ConfirmationActionsProps, k as PromptInputFooter, kt as ConfirmationActionProps, l as UseDynamicUIOptions, lt as defaultFormRegistry, m as AssistantProviderProps, mt as DynamicUIProps, n as AssistantRoot, nt as MessageResponseProps, o as useAssistantToken, ot as FormRenderer, p as AssistantProvider, pt as DynamicUI, q as DrawerTrigger, r as AssistantRootProps, rt as AssistantFormRenderer, s as UseDynamicUIToolExecutionOptions, st as TextAreaRenderer, t as cn, tt as MessageResponse, u as useDynamicUI, ut as DynamicButtonGroupRenderer, v as TaskContentProps, vt as ConversationContent, w as TaskTrigger, wt as ConversationScrollButtonProps, x as TaskItemFileProps, xt as ConversationEmptyStateProps, y as TaskItem, yt as ConversationContentProps, z as DrawerContent, zt as ToolUIPartApproval } from "../index-
|
|
3
|
-
export { ActionDefinition, ActionDefinitionSchema, ActionOption, ActionOptionSchema, AssistantConfig, AssistantContextValue, AssistantFormRenderer, AssistantFormRendererProps, AssistantProvider, AssistantProviderProps, AssistantRoot, AssistantRootProps, ChatStatus, Collapsible, CollapsibleContent, CollapsibleTrigger, Confirmation, ConfirmationAccepted, ConfirmationAcceptedProps, ConfirmationAction, ConfirmationActionProps, ConfirmationActions, ConfirmationActionsProps, ConfirmationProps, ConfirmationRejected, ConfirmationRejectedProps, ConfirmationRequest, ConfirmationRequestProps, ConfirmationTitle, ConfirmationTitleProps, Conversation, ConversationContent, ConversationContentProps, ConversationEmptyState, ConversationEmptyStateProps, ConversationProps, ConversationScrollButton, ConversationScrollButtonProps, CreateAssistantTokenHandlerOptions, DateFieldRenderer, Drawer, DrawerClose, DrawerContent, DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DynamicActionModal, DynamicActionModalProps, DynamicButton, DynamicButtonGroup, DynamicButtonGroupRenderer, DynamicButtonRenderer, DynamicUI, DynamicUIElement, DynamicUIProps, DynamicUITree, FormRenderer, Message, MessageContent, MessageContentProps, MessageProps, MessageResponse, MessageResponseProps, PromptInput, PromptInputButton, PromptInputButtonProps, PromptInputFooter, PromptInputFooterProps, PromptInputMessage, PromptInputProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTextarea, PromptInputTextareaProps, Task, TaskContent, TaskContentProps, TaskItem, TaskItemFile, TaskItemFileProps, TaskItemProps, TaskProps, TaskTrigger, TaskTriggerProps, TextAreaRenderer, TextFieldRenderer, TokenRequest, TokenRequestSchema, TokenResponse, TokenResponseSchema, ToolAction, ToolActionSchema, ToolUIPartApproval, UseAssistantOptions, UseAssistantReturn, UseAssistantTokenOptions, UseAssistantTokenReturn, UseDynamicUIOptions, UseDynamicUIReturn, UseDynamicUIToolExecutionOptions, UseToolExecutionOptions, cn, defaultFormRegistry, dynamicUIRegistry, useAssistant, useAssistantContext, useAssistantToken, useDynamicUI, useDynamicUIToolExecution, useToolExecution };
|
|
1
|
+
import { S as UseDynamicUIReturn, _ as ToolActionSchema, a as AssistantConfig, b as UseAssistantTokenOptions, c as DynamicButton, d as DynamicUITree, f as TokenRequest, g as ToolAction, h as TokenResponseSchema, i as ActionOptionSchema, l as DynamicButtonGroup, m as TokenResponse, n as ActionDefinitionSchema, o as ChatStatus, p as TokenRequestSchema, r as ActionOption, s as CreateAssistantTokenHandlerOptions, t as ActionDefinition, u as DynamicUIElement, v as UseAssistantOptions, x as UseAssistantTokenReturn, y as UseAssistantReturn } from "../types-C7I0JuqF.js";
|
|
2
|
+
import { $ as MessageContentProps, A as PromptInputFooterProps, At as ConfirmationActions, B as DrawerContentProps, Bt as AssistantMessages, C as TaskProps, Ct as ConversationScrollButton, D as PromptInputButton, Dt as ConfirmationAcceptedProps, E as PromptInput, Et as ConfirmationAccepted, F as PromptInputTextarea, Ft as ConfirmationRequest, G as DrawerPortal, H as DrawerFooter, I as PromptInputTextareaProps, It as ConfirmationRequestProps, J as Collapsible, K as DrawerTitle, L as Drawer, Lt as ConfirmationTitle, M as PromptInputProps, Mt as ConfirmationProps, N as PromptInputSubmit, Nt as ConfirmationRejected, O as PromptInputButtonProps, Ot as ConfirmationAction, P as PromptInputSubmitProps, Pt as ConfirmationRejectedProps, Q as MessageContent, R as DrawerClose, Rt as ConfirmationTitleProps, S as TaskItemProps, St as ConversationProps, T as TaskTriggerProps, Tt as Confirmation, U as DrawerHeader, V as DrawerDescription, Vt as AssistantMessagesProps, W as DrawerOverlay, X as CollapsibleTrigger, Y as CollapsibleContent, Z as Message, _ as TaskContent, _t as Conversation, a as useToolExecution, at as DateFieldRenderer, b as TaskItemFile, bt as ConversationEmptyState, c as useDynamicUIToolExecution, ct as TextFieldRenderer, d as useAssistant, dt as DynamicButtonRenderer, et as MessageProps, f as AssistantContextValue, ft as dynamicUIRegistry, g as Task, gt as DynamicActionModalProps, h as useAssistantContext, ht as DynamicActionModal, i as UseToolExecutionOptions, it as AssistantFormRendererProps, j as PromptInputMessage, jt as ConfirmationActionsProps, k as PromptInputFooter, kt as ConfirmationActionProps, l as UseDynamicUIOptions, lt as defaultFormRegistry, m as AssistantProviderProps, mt as DynamicUIProps, n as AssistantRoot, nt as MessageResponseProps, o as useAssistantToken, ot as FormRenderer, p as AssistantProvider, pt as DynamicUI, q as DrawerTrigger, r as AssistantRootProps, rt as AssistantFormRenderer, s as UseDynamicUIToolExecutionOptions, st as TextAreaRenderer, t as cn, tt as MessageResponse, u as useDynamicUI, ut as DynamicButtonGroupRenderer, v as TaskContentProps, vt as ConversationContent, w as TaskTrigger, wt as ConversationScrollButtonProps, x as TaskItemFileProps, xt as ConversationEmptyStateProps, y as TaskItem, yt as ConversationContentProps, z as DrawerContent, zt as ToolUIPartApproval } from "../index-B2dmSvFt.js";
|
|
3
|
+
export { ActionDefinition, ActionDefinitionSchema, ActionOption, ActionOptionSchema, AssistantConfig, AssistantContextValue, AssistantFormRenderer, AssistantFormRendererProps, AssistantMessages, AssistantMessagesProps, AssistantProvider, AssistantProviderProps, AssistantRoot, AssistantRootProps, ChatStatus, Collapsible, CollapsibleContent, CollapsibleTrigger, Confirmation, ConfirmationAccepted, ConfirmationAcceptedProps, ConfirmationAction, ConfirmationActionProps, ConfirmationActions, ConfirmationActionsProps, ConfirmationProps, ConfirmationRejected, ConfirmationRejectedProps, ConfirmationRequest, ConfirmationRequestProps, ConfirmationTitle, ConfirmationTitleProps, Conversation, ConversationContent, ConversationContentProps, ConversationEmptyState, ConversationEmptyStateProps, ConversationProps, ConversationScrollButton, ConversationScrollButtonProps, CreateAssistantTokenHandlerOptions, DateFieldRenderer, Drawer, DrawerClose, DrawerContent, DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DynamicActionModal, DynamicActionModalProps, DynamicButton, DynamicButtonGroup, DynamicButtonGroupRenderer, DynamicButtonRenderer, DynamicUI, DynamicUIElement, DynamicUIProps, DynamicUITree, FormRenderer, Message, MessageContent, MessageContentProps, MessageProps, MessageResponse, MessageResponseProps, PromptInput, PromptInputButton, PromptInputButtonProps, PromptInputFooter, PromptInputFooterProps, PromptInputMessage, PromptInputProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTextarea, PromptInputTextareaProps, Task, TaskContent, TaskContentProps, TaskItem, TaskItemFile, TaskItemFileProps, TaskItemProps, TaskProps, TaskTrigger, TaskTriggerProps, TextAreaRenderer, TextFieldRenderer, TokenRequest, TokenRequestSchema, TokenResponse, TokenResponseSchema, ToolAction, ToolActionSchema, ToolUIPartApproval, UseAssistantOptions, UseAssistantReturn, UseAssistantTokenOptions, UseAssistantTokenReturn, UseDynamicUIOptions, UseDynamicUIReturn, UseDynamicUIToolExecutionOptions, UseToolExecutionOptions, cn, defaultFormRegistry, dynamicUIRegistry, useAssistant, useAssistantContext, useAssistantToken, useDynamicUI, useDynamicUIToolExecution, useToolExecution };
|
package/dist/assistant/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as D,a as O,at as k,b as A,c as j,ct as M,d as N,et as P,f as F,g as I,h as L,i as R,it as z,j as B,k as V,l as H,
|
|
1
|
+
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as D,a as O,at as k,b as A,c as j,ct as M,d as N,et as P,f as F,g as I,h as L,i as R,it as z,j as B,k as V,l as H,lt as U,m as W,n as G,nt as K,o as q,ot as J,p as Y,q as X,r as Z,rt as Q,s as $,st as ee,t as te,tt as ne,u as re,v as ie,w as ae,x as oe,y as se,z as ce}from"../assistant-7f9B_gWg.js";export{k as ActionDefinitionSchema,J as ActionOptionSchema,s as AssistantFormRenderer,m as AssistantMessages,r as AssistantProvider,te as AssistantRoot,ce as Collapsible,n as CollapsibleContent,S as CollapsibleTrigger,E as Confirmation,_ as ConfirmationAccepted,e as ConfirmationAction,P as ConfirmationActions,ne as ConfirmationRejected,K as ConfirmationRequest,Q as ConfirmationTitle,V as Conversation,t as ConversationContent,B as ConversationEmptyState,p as ConversationScrollButton,d as DateFieldRenderer,$ as Drawer,j as DrawerClose,H as DrawerContent,re as DrawerDescription,N as DrawerFooter,F as DrawerHeader,Y as DrawerOverlay,W as DrawerPortal,L as DrawerTitle,I as DrawerTrigger,h as DynamicActionModal,ie as DynamicButtonGroupRenderer,se as DynamicButtonRenderer,D as DynamicUI,X as FormRenderer,c as Message,x as MessageContent,C as MessageResponse,G as PromptInput,Z as PromptInputButton,R as PromptInputFooter,O as PromptInputSubmit,q as PromptInputTextarea,g as Task,o as TaskContent,l as TaskItem,f as TaskItemFile,v as TaskTrigger,u as TextAreaRenderer,T as TextFieldRenderer,ee as TokenRequestSchema,M as TokenResponseSchema,U as ToolActionSchema,z as cn,w as defaultFormRegistry,A as dynamicUIRegistry,b as useAssistant,ae as useAssistantContext,i as useAssistantToken,y as useDynamicUI,oe as useDynamicUIToolExecution,a as useToolExecution};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{z as e}from"zod";import{Children as t,createContext as n,memo as r,useCallback as i,useContext as a,useEffect as o,useMemo as s,useRef as c,useState as l}from"react";import{clsx as u}from"clsx";import{twMerge as d}from"tailwind-merge";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{JSONUIProvider as h,Renderer as g}from"@json-render/react";import{Streamdown as _}from"streamdown";import{ChevronDownIcon as v,CornerDownLeftIcon as y,Loader2Icon as b,SearchIcon as x,SquareIcon as S,XIcon as ee}from"lucide-react";import*as C from"@radix-ui/react-collapsible";import{useChat as te}from"@ai-sdk/react";import{DefaultChatTransport as ne,lastAssistantMessageIsCompleteWithApprovalResponses as re}from"ai";import{Drawer as w}from"vaul-base";import{createPortal as ie}from"react-dom";const ae=e.object({type:e.string(),description:e.string().optional(),required:e.boolean().optional()}),oe=e.object({name:e.string(),description:e.string(),options:e.record(e.string(),ae).optional(),approvalRequired:e.boolean().optional()}),T=e.object({name:e.string(),options:e.record(e.string(),e.unknown()).optional()}),se=e.object({token:e.string(),expiresAt:e.number()}),ce=e.object({endUserId:e.string(),availableActions:e.array(oe),context:e.record(e.string(),e.unknown()).optional()});function E(...e){return d(u(e))}const le=n(null);function D(){let e=a(le);if(!e)throw Error(`Confirmation components must be used within Confirmation`);return e}function O({className:e,approval:t,state:n,...r}){return!t||n===`input-streaming`||n===`input-available`?null:p(le.Provider,{value:{approval:t,state:n},children:p(`div`,{"data-slot":`confirmation`,"data-state":n,"data-approved":t?.approved,role:`alertdialog`,"aria-labelledby":`confirmation-title`,className:E(`flex flex-col gap-2 rounded-lg border p-4`,`data-[state=approval-requested]:border-amber-500/50 data-[state=approval-requested]:bg-amber-50/50 dark:data-[state=approval-requested]:bg-amber-950/20`,`data-[approved=true]:border-green-500/50 data-[approved=true]:bg-green-50/50 dark:data-[approved=true]:bg-green-950/20`,`data-[approved=false]:border-red-500/50 data-[approved=false]:bg-red-50/50 dark:data-[approved=false]:bg-red-950/20`,e),...r})})}function k({className:e,...t}){return p(`p`,{id:`confirmation-title`,"data-slot":`confirmation-title`,className:E(`text-sm font-medium`,e),...t})}function A({children:e}){let{state:t}=D();return t===`approval-requested`?p(`div`,{"data-slot":`confirmation-request`,children:e}):null}function j({children:e}){let{approval:t,state:n}=D();return!t?.approved||n!==`approval-responded`&&n!==`output-denied`&&n!==`output-available`?null:p(`div`,{"data-slot":`confirmation-accepted`,children:e})}function M({children:e}){let{approval:t,state:n}=D();return t?.approved!==!1||n!==`approval-responded`&&n!==`output-denied`&&n!==`output-available`?null:p(`div`,{"data-slot":`confirmation-rejected`,children:e})}function N({className:e,...t}){let{state:n}=D();return n===`approval-requested`?p(`div`,{"data-slot":`confirmation-actions`,className:E(`flex items-center justify-end gap-2 self-end`,e),...t}):null}function P({className:e,variant:t=`default`,...n}){return p(`button`,{"data-slot":`confirmation-action`,"data-variant":t,type:`button`,className:E(`inline-flex h-8 items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-sm font-medium 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`,t===`default`&&`bg-primary text-primary-foreground shadow hover:bg-primary/90`,t===`outline`&&`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,t===`destructive`&&`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,e),...n})}function F({element:e,children:t,onAction:n}){let{id:r=`form`,title:i,submitLabel:a=`Submit`}=e.props??{},o=e=>{e.preventDefault();let t=new FormData(e.currentTarget),i={};t.forEach((e,t)=>{typeof e==`string`&&(i[t]=e)}),n?.({name:`submit`,params:{formId:r,data:i}})};return m(`div`,{"data-slot":`form-card`,className:E(`w-full rounded-lg border bg-card text-card-foreground shadow-sm`),children:[i&&p(`div`,{className:`flex flex-col space-y-1.5 p-4 pb-3`,children:p(`h3`,{className:`text-base font-semibold leading-none tracking-tight`,children:i})}),p(`div`,{className:E(`p-4`,i?``:`pt-4`),children:m(`form`,{onSubmit:o,className:`space-y-4`,children:[t,m(`div`,{className:`flex justify-end gap-2 pt-2`,children:[p(`button`,{type:`button`,className:E(`inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors`,`hover:bg-accent hover:text-accent-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`),onClick:()=>n?.({name:`cancel`,params:{formId:r}}),children:`Cancel`}),p(`button`,{type:`submit`,className:E(`inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors`,`hover:bg-primary/90`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`),children:a})]})]})})]})}function I({element:e}){let{name:t=`field`,label:n=`Field`,placeholder:r,required:i,defaultValue:a}=e.props??{};return m(`div`,{className:`space-y-1.5`,children:[m(`label`,{htmlFor:t,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[n,i&&p(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),p(`input`,{id:t,name:t,type:`text`,placeholder:r,required:i,defaultValue:a,autoComplete:`off`,className:E(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors`,`placeholder:text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}function L({element:e}){let{name:t=`field`,label:n=`Field`,placeholder:r,required:i,defaultValue:a,rows:o=3}=e.props??{};return m(`div`,{className:`space-y-1.5`,children:[m(`label`,{htmlFor:t,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[n,i&&p(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),p(`textarea`,{id:t,name:t,placeholder:r,required:i,defaultValue:a,rows:o,className:E(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors`,`placeholder:text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}function R({element:e}){let{name:t=`date`,label:n=`Date`,required:r,defaultValue:i,min:a,max:o}=e.props??{};return m(`div`,{className:`space-y-1.5`,children:[m(`label`,{htmlFor:t,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[n,r&&p(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),p(`input`,{type:`date`,id:t,name:t,required:r,defaultValue:i,min:a,max:o,className:E(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}const z={Form:F,TextField:I,TextArea:L,DateField:R},ue=e.object({formId:e.string(),data:e.record(e.string(),e.string())}),de=e.object({formId:e.string()});function B({ui:e,context:t,onSubmit:n,onCancel:r,registry:i=z}){return p(h,{registry:i,initialData:t,actionHandlers:{submit:e=>{let t=ue.safeParse(e);t.success?n(t.data.formId,t.data.data):console.warn(`Form submit: Invalid params`,t.error.flatten())},cancel:e=>{let t=de.safeParse(e);t.success?r?.(t.data.formId):console.warn(`Form cancel: Invalid params`,t.error.flatten())}},children:p(g,{tree:e,registry:i})})}function V({className:e,from:t,...n}){return p(`div`,{"data-slot":`message`,"data-from":t,className:E(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant`,e),...n})}function H({children:e,className:t,...n}){return p(`div`,{"data-slot":`message-content`,className:E(`flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg 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`,t),...n,children:e})}const U=r(function({className:e,...t}){return p(_,{"data-slot":`message-response`,className:E(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),...t})},(e,t)=>e.children===t.children);function W({...e}){return p(C.Root,{"data-slot":`collapsible`,...e})}function G({...e}){return p(C.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...e})}function K({...e}){return p(C.CollapsibleContent,{"data-slot":`collapsible-content`,...e})}function fe({children:e,className:t,...n}){return p(`div`,{"data-slot":`task-item-file`,className:E(`inline-flex items-center gap-1 rounded-md border bg-secondary px-1.5 py-0.5 text-xs text-foreground`,t),...n,children:e})}function q({children:e,className:t,...n}){return p(`div`,{"data-slot":`task-item`,className:E(`text-sm text-muted-foreground`,t),...n,children:e})}function J({defaultOpen:e=!0,className:t,...n}){return p(W,{"data-slot":`task`,className:E(t),defaultOpen:e,...n})}function Y({children:e,className:t,title:n,icon:r,...i}){return p(G,{asChild:!0,className:E(`group`,t),...i,children:e??m(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:[r??p(x,{className:`size-4`}),p(`p`,{className:`text-sm`,children:n}),p(v,{className:`size-4 transition-transform group-data-[state=open]:rotate-180`})]})})}function X({children:e,className:t,...n}){return p(K,{"data-slot":`task-content`,className:E(`text-popover-foreground outline-none`,`data-[state=closed]:animate-out data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2`,t),...n,children:p(`div`,{className:`mt-4 space-y-2 border-l-2 border-muted pl-4`,children:e})})}const pe=e.object({actions:e.array(T).optional()}),me=e.object({id:e.string(),approved:e.boolean().optional()}),he=e.object({key:e.string(),type:e.string(),props:e.record(e.string(),e.unknown()).default({}),children:e.array(e.string()).optional()}),ge=e.object({root:e.string(),elements:e.record(e.string(),he)}),_e=e.object({ui:ge,context:e.record(e.string(),e.unknown()).optional()});function ve(e){return e.name}function ye({messages:e,sendMessage:t,addToolApprovalResponse:n,getActionDescription:r=ve,className:i}){let a=e.filter(e=>e.role===`user`||e.role===`assistant`);return p(`div`,{className:i,children:a.map((e,i)=>{let o=i===a.length-1;return p(V,{from:e.role,children:p(H,{children:e.parts.map((i,a)=>p(be,{part:i,messageId:e.id,partIndex:a,isLastMessage:o,sendMessage:t,addToolApprovalResponse:n,getActionDescription:r},`${e.id}-${a}`))})},e.id)})})}function be({part:e,messageId:t,partIndex:n,isLastMessage:r,sendMessage:i,addToolApprovalResponse:a,getActionDescription:o}){if(e.type===`text`)return p(U,{children:e.text});if(e.type===`tool-performActions`){let r=`input`in e?e.input:void 0,i=pe.safeParse(r),s=i.success?i.data.actions??[]:[];if(s.length===0)return null;let c=s.length,l=`state`in e?e.state:void 0,u=`approval`in e?e.approval:void 0,d=me.safeParse(u),f=d.success?d.data:void 0;return f&&l?m(O,{state:l,approval:f,children:[p(k,{children:c===1?`Confirm action`:`Confirm ${c} actions`}),p(A,{children:p(`ul`,{className:`list-disc list-inside text-sm text-muted-foreground mt-2`,children:s.map((e,r)=>p(`li`,{children:o(e)},`${t}-${n}-${r}`))})}),p(j,{children:p(`span`,{className:`text-sm text-muted-foreground`,children:c===1?`Action approved`:`${c} actions approved`})}),p(M,{children:p(`span`,{className:`text-sm text-muted-foreground`,children:c===1?`Action cancelled`:`${c} actions cancelled`})}),m(N,{children:[p(P,{variant:`outline`,onClick:()=>a({id:f.id,approved:!1}),children:`Deny`}),p(P,{onClick:()=>a({id:f.id,approved:!0}),children:`Approve`})]})]}):m(J,{defaultOpen:!1,children:[p(Y,{title:c===1?`Performing 1 action`:`Performing ${c} actions`}),p(X,{children:s.map((e,r)=>p(q,{children:o(e)},`${t}-${n}-${r}`))})]})}if(e.type===`tool-renderUI`&&r){if((`state`in e?e.state:void 0)===`output-available`&&`output`in e){let t=_e.safeParse(e.output);if(t.success)return p(B,{ui:t.data.ui,context:t.data.context,onSubmit:(e,t)=>{i({text:`[Form:${e}] ${JSON.stringify(t)}`})},onCancel:e=>{i({text:`[Form:${e}] cancelled`})}})}return null}return null}function xe({className:e,children:t,...n}){return p(`div`,{"data-slot":`conversation`,className:E(`relative flex-1 overflow-y-hidden min-h-0`,e),role:`log`,"aria-label":`Chat messages`,...n,children:t})}function Se({className:e,children:t,...n}){let r=c(null);return o(()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight)},[t]),p(`div`,{ref:r,"data-slot":`conversation-content`,className:E(`flex h-full flex-col gap-8 overflow-y-auto p-4`,e),...n,children:t})}function Ce({className:e,title:t=`No messages yet`,description:n=`Start a conversation to see messages here`,icon:r,children:i,...a}){return p(`div`,{"data-slot":`conversation-empty-state`,className:E(`flex size-full flex-col items-center justify-center gap-3 p-8 text-center`,e),...a,children:i??m(f,{children:[r&&p(`div`,{className:`text-muted-foreground`,children:r}),m(`div`,{className:`space-y-1`,children:[p(`h3`,{className:`text-sm font-medium`,children:t}),n&&p(`p`,{className:`text-muted-foreground text-sm`,children:n})]})]})})}function we({className:e,...t}){return null}function Te({button:e,availableActions:t,onExecute:n,onClose:r}){let[a,s]=l(null),[c,u]=l({}),d=i(()=>{if(!e||!t)return!1;for(let n of e.actions){let e=t.find(e=>e.name===n.name);if(e?.options){for(let[t,r]of Object.entries(e.options))if(r.required&&!n.options?.[t])return!0}}return!1},[e,t]),f=i(()=>!e||!t?!1:e.actions.some(e=>t.find(t=>t.name===e.name)?.approvalRequired===!0),[e,t]),h=i(()=>{if(!e||!t)return null;let n=[];for(let r of e.actions){let e=t.find(e=>e.name===r.name);if(e?.options){for(let[t,i]of Object.entries(e.options))if(i.required&&!r.options?.[t]){let e=`${r.name}_${t}`;n.push({key:e,type:(i.type,`TextField`),props:{name:e,label:i.description||t,required:!0}})}}}if(n.length===0)return null;let r={form:{key:`form`,type:`Form`,props:{id:`dynamic-action-${e.id}`,title:e.label,submitLabel:`Continue`},children:n.map(e=>e.key)}};for(let e of n)r[e.key]={key:e.key,type:e.type,props:e.props,parentKey:`form`};return{root:`form`,elements:r}},[e,t]),g=i(i=>{e&&(n(e.actions.map(e=>{let n={...e.options},r=t?.find(t=>t.name===e.name);for(let[t,a]of Object.entries(i)){let i=t.split(`_`),o=i[0],s=i.slice(1).join(`_`);if(o===e.name&&s){let e=r?.options?.[s],t=a;e?.type===`number`?t=Number(a):e?.type===`boolean`&&(t=a===`true`),n[s]=t}}return{...e,options:n}})),r())},[e,t,n,r]);o(()=>{if(!e){s(null),u({});return}if(d()){s(`input`);return}if(f()){s(`approval`);return}n(e.actions),r()},[e,d,f,n,r]);let _=i((e,t)=>{u(t),f()?s(`approval`):g(t)},[f,g]),v=i(()=>{Object.keys(c).length>0?g(c):e&&(n(e.actions),r())},[c,e,n,r,g]);if(!e||a===null)return null;let y=h();return m(Ee,{onClose:r,children:[a===`input`&&y&&p(B,{ui:y,onSubmit:_,onCancel:r}),a===`approval`&&p(De,{button:e,availableActions:t,onApprove:v,onDeny:r})]})}function Ee({children:e,onClose:t}){return p(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-8`,onClick:e=>{e.target===e.currentTarget&&t()},children:p(`div`,{className:`max-h-[90vh] w-full max-w-md overflow-auto`,onClick:e=>e.stopPropagation(),children:e})})}function De({button:e,availableActions:t,onApprove:n,onDeny:r}){return p(`div`,{className:`rounded-lg border bg-card text-card-foreground shadow-sm p-4`,children:m(`div`,{className:`flex flex-col gap-4`,children:[m(`div`,{className:`flex flex-col gap-2`,children:[p(`h3`,{className:`text-lg font-semibold`,children:`Confirm Action`}),p(`p`,{className:`text-sm text-muted-foreground`,children:`This will execute the following actions:`})]}),p(`ul`,{className:`list-inside list-disc space-y-1 text-sm`,children:e.actions.map((e,n)=>{let r=t?.find(t=>t.name===e.name);return m(`li`,{children:[p(`span`,{className:`font-medium`,children:e.name}),r?.description&&m(`span`,{className:`text-muted-foreground`,children:[` `,`- `,r.description]})]},n)})}),m(`div`,{className:`flex justify-end gap-2 pt-2`,children:[p(`button`,{type:`button`,onClick:r,className:E(`inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors`,`hover:bg-accent hover:text-accent-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`),children:`Cancel`}),p(`button`,{type:`button`,onClick:n,className:E(`inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors`,`hover:bg-primary/90`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`),children:`Confirm`})]})]})})}function Oe({tokenEndpoint:e,endUserId:t,availableActions:n,autoFetch:r=!0,refreshBuffer:a=3e4}){let[s,u]=l(null),[d,f]=l(null),[p,m]=l(!1),[h,g]=l(null),_=c(!0),v=c(!1),y=c(n);y.current=n;let b=i(async()=>{if(_.current){m(!0),g(null);try{let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({endUserId:t,availableActions:y.current})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Failed to get token: ${n.status}`)}let r=await n.json();if(!_.current)return;u(r.token),f(r.expiresAt)}catch(e){if(!_.current)return;g(e instanceof Error?e.message:`Failed to get token`),console.error(`Token fetch error:`,e)}finally{_.current&&m(!1)}}},[e,t]);return o(()=>{r&&!v.current&&(v.current=!0,b())},[r,b]),o(()=>{if(!d)return;let e=d-Date.now()-a;if(e<=0){b();return}let t=setTimeout(b,e);return()=>clearTimeout(t)},[d,a,b]),o(()=>(_.current=!0,()=>{_.current=!1}),[]),{token:s,expiresAt:d,isLoading:p,error:h,fetchToken:b}}function ke({messages:e,onAction:t}){let n=c(new Set);o(()=>{if(t){for(let r of e)if(r.role===`assistant`){for(let e of r.parts)if(e.type===`tool-performActions`&&`state`in e&&e.state===`output-available`&&`output`in e){let r=e.toolCallId;if(n.current.has(r))continue;let i=e.output;if(i?.actions)for(let e of i.actions)t(e);n.current.add(r)}}}},[e,t])}function Ae({tokenEndpoint:e=`/api/mwai/token`,apiUrl:t=`https://api.modifywithai.com`,endUserId:n,availableActions:r,getContext:a,onAction:o,onError:u}){let[d,f]=l(``),{token:p,isLoading:m,error:h,fetchToken:g}=Oe({tokenEndpoint:e,endUserId:n,availableActions:r,autoFetch:!0}),_=c(a);_.current=a;let v=c(p);v.current=p;let y=te({transport:s(()=>new ne({api:`${t}/api/assistant`,headers:()=>{let e=v.current;return e?{Authorization:`Bearer ${e}`}:{}},body:()=>({context:_.current?.()??{}})}),[t]),sendAutomaticallyWhen:re,onError:u});ke({messages:y.messages,onAction:o});let b=!!p&&!m,x=i(e=>{if(!b){console.warn(`Cannot send message: assistant not ready (token not available)`);return}y.sendMessage(e)},[y,b]),S=i(e=>{e?.preventDefault(),!(!d.trim()||!b)&&(x({text:d}),f(``))},[d,x,b]);return{messages:y.messages,sendMessage:x,status:y.status,error:y.error??null,input:d,setInput:f,handleSubmit:S,addToolApprovalResponse:y.addToolApprovalResponse,isReady:b,tokenError:h,refreshToken:g}}const je=n(null);function Me({children:e,tokenEndpoint:t,apiUrl:n,endUserId:r,availableActions:i,getContext:a,onAction:o,onError:c}){let l=Ae({tokenEndpoint:t,apiUrl:n,endUserId:r,availableActions:i,getContext:a,onAction:o,onError:c}),u=s(()=>({tokenEndpoint:t,apiUrl:n,endUserId:r,availableActions:i}),[t,n,r,i]),d=s(()=>({messages:l.messages,sendMessage:l.sendMessage,status:l.status,error:l.error,input:l.input,setInput:l.setInput,handleSubmit:l.handleSubmit,addToolApprovalResponse:l.addToolApprovalResponse,isReady:l.isReady,tokenError:l.tokenError,refreshToken:l.refreshToken,config:u,onAction:o}),[l.messages,l.sendMessage,l.status,l.error,l.input,l.setInput,l.handleSubmit,l.addToolApprovalResponse,l.isReady,l.tokenError,l.refreshToken,u,o]);return p(je.Provider,{value:d,children:e})}function Ne(){let e=a(je);if(!e)throw Error(`useAssistantContext must be used within an AssistantProvider`);return e}const Pe=e.object({id:e.string(),label:e.string(),variant:e.enum([`default`,`destructive`,`outline`,`secondary`,`ghost`]).optional(),icon:e.string().optional(),actions:e.array(T)}),Fe=e.object({key:e.string(),type:e.enum([`DynamicButton`,`DynamicButtonGroup`]),props:e.record(e.string(),e.unknown()),children:e.array(e.string()).optional(),parentKey:e.string().optional()}),Ie=e.object({root:e.string(),elements:e.record(e.string(),Fe)}),Le=e.object({version:e.literal(1),tree:Ie});function Re(e,t,n){return{key:e,type:`DynamicButton`,props:{...t},parentKey:n}}function Z(e,t,n=[],r){return{key:e,type:`DynamicButtonGroup`,props:{...t},children:n,parentKey:r}}function ze({storageKey:e}){let[t,n]=l(null),[r,a]=l(!0);return o(()=>{try{let t=localStorage.getItem(e);if(t){let r=JSON.parse(t),i=Le.safeParse(r);i.success?n(i.data.tree):(console.warn(`DynamicUI: Stored data failed validation. Discarding.`,i.error.flatten()),localStorage.removeItem(e))}}catch(e){console.error(`Failed to load DynamicUI state:`,e)}finally{a(!1)}},[e]),o(()=>{if(!r)try{if(t){let n={version:1,tree:t};localStorage.setItem(e,JSON.stringify(n))}else localStorage.removeItem(e)}catch(e){console.error(`Failed to save DynamicUI state:`,e)}},[t,e,r]),{tree:t,isLoading:r,addButton:i((e,t)=>{n(n=>{let r=`button-${e.id}`;if(!n){let t=`root-group`;return{root:t,elements:{[t]:Z(t,{id:`root`,direction:`horizontal`},[r]),[r]:Re(r,e,t)}}}if(n.elements[r])return console.warn(`Button with id "${e.id}" already exists`),n;let i=t?`group-${t}`:n.root,a=n.elements[i];a||console.warn(`Parent "${i}" not found, using root`);let o=a?i:n.root,s=n.elements[o];if(!s)return console.warn(`Parent element "${o}" not found`),n;let c={...n.elements,[o]:{key:s.key,type:s.type,props:s.props,children:[...s.children||[],r],parentKey:s.parentKey},[r]:Re(r,e,o)};return{root:n.root,elements:c}})},[]),removeButton:i(e=>{n(t=>{if(!t)return t;let n=`button-${e}`,r=t.elements[n];if(!r)return console.warn(`Button "${e}" not found`),t;let i={};for(let[e,a]of Object.entries(t.elements))e!==n&&(r.parentKey&&e===r.parentKey?i[e]={key:a.key,type:a.type,props:a.props,children:a.children?.filter(e=>e!==n),parentKey:a.parentKey}:i[e]=a);return Object.values(i).some(e=>e.type===`DynamicButton`)?{root:t.root,elements:i}:null})},[]),updateButton:i((e,t)=>{n(n=>{if(!n)return n;let r=`button-${e}`,i=n.elements[r];if(!i||i.type!==`DynamicButton`)return console.warn(`Button "${e}" not found`),n;let a=Pe.safeParse(i.props);if(!a.success)return console.warn(`Button "${e}" has invalid props`,a.error.flatten()),n;let o={...n.elements,[r]:{key:i.key,type:i.type,props:{...a.data,...t},children:i.children,parentKey:i.parentKey}};return{root:n.root,elements:o}})},[]),addGroup:i(e=>{n(t=>{let n=`group-${e.id}`;if(!t)return{root:n,elements:{[n]:Z(n,e,[])}};if(t.elements[n])return console.warn(`Group with id "${e.id}" already exists`),t;let r=t.elements[t.root];if(!r)return console.warn(`Root element "${t.root}" not found`),t;let i={...t.elements,[t.root]:{key:r.key,type:r.type,props:r.props,children:[...r.children||[],n],parentKey:r.parentKey},[n]:Z(n,e,[],t.root)};return{root:t.root,elements:i}})},[]),removeGroup:i(e=>{n(t=>{if(!t)return t;let n=`group-${e}`,r=t.elements[n];if(!r||r.type!==`DynamicButtonGroup`)return console.warn(`Group "${e}" not found`),t;if(t.root===n)return console.warn(`Cannot remove root group`),t;let i=new Set([n]),a=e=>{let n=t.elements[e];if(n?.children)for(let e of n.children)i.add(e),a(e)};a(n);let o={};for(let[e,a]of Object.entries(t.elements))i.has(e)||(r.parentKey&&e===r.parentKey?o[e]={key:a.key,type:a.type,props:a.props,children:a.children?.filter(e=>e!==n),parentKey:a.parentKey}:o[e]=a);return Object.values(o).some(e=>e.type===`DynamicButton`)?{root:t.root,elements:o}:null})},[]),clearAll:i(()=>{n(null)},[])}}function Be({messages:e,dynamicUI:t}){let n=c(new Set);o(()=>{for(let r of e)if(r.role===`assistant`){for(let e of r.parts)if(e.type===`tool-manageDynamicUI`&&`state`in e&&e.state===`output-available`&&`output`in e){let r=e.toolCallId;if(n.current.has(r))continue;let i=e.output;i&&Ve(i,t),n.current.add(r)}}},[e,t])}function Ve(e,t){let{operation:n,button:r,buttonId:i,updates:a,group:o,groupId:s}=e;switch(n){case`addButton`:if(r){let{parentGroupId:e,...n}=r;t.addButton(n,e)}break;case`removeButton`:i&&t.removeButton(i);break;case`updateButton`:i&&a&&t.updateButton(i,a);break;case`addGroup`:o&&t.addGroup(o);break;case`removeGroup`:s&&t.removeGroup(s);break;case`clearAll`:t.clearAll();break;default:console.warn(`Unknown DynamicUI operation: ${n}`)}}const He=e.object({id:e.string(),label:e.string(),variant:e.enum([`default`,`destructive`,`outline`,`secondary`,`ghost`]).optional().default(`default`),icon:e.string().optional(),actions:e.array(T)}),Ue=e.object({id:e.string(),label:e.string().optional(),direction:e.enum([`horizontal`,`vertical`]).optional().default(`horizontal`)});function We({element:e,onAction:t}){let n=He.safeParse(e.props??{});if(!n.success)return console.warn(`DynamicButton: Invalid props`,n.error.flatten()),null;let{id:r,label:i,variant:a,icon:o}=n.data,s=()=>{t?.({name:`executeButton`,params:{buttonId:r}})};return m(`button`,{type:`button`,"data-slot":`dynamic-button`,"data-button-id":r,"data-variant":a,onClick:s,className:E(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium 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`,a===`default`&&`bg-primary text-primary-foreground shadow hover:bg-primary/90`,a===`secondary`&&`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,a===`outline`&&`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,a===`ghost`&&`hover:bg-accent hover:text-accent-foreground`,a===`destructive`&&`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`),children:[o&&p(Ke,{name:o,className:`size-4 shrink-0`}),i]})}function Ge({element:e,children:t}){let n=Ue.safeParse(e.props??{});if(!n.success)return console.warn(`DynamicButtonGroup: Invalid props`,n.error.flatten()),p(f,{children:t});let{direction:r,label:i}=n.data;return i?m(`div`,{"data-slot":`dynamic-button-group`,"data-direction":r,className:E(`flex gap-2`,r===`vertical`?`flex-col`:`flex-row flex-wrap`),children:[p(`span`,{className:`text-sm font-medium text-muted-foreground`,children:i}),t]}):p(f,{children:t})}function Ke({name:e,className:t}){return{plus:m(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[p(`path`,{d:`M5 12h14`}),p(`path`,{d:`M12 5v14`})]}),trash:m(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[p(`path`,{d:`M3 6h18`}),p(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),p(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`})]}),check:p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:p(`path`,{d:`M20 6 9 17l-5-5`})}),edit:m(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[p(`path`,{d:`M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z`}),p(`path`,{d:`m15 5 4 4`})]}),refresh:m(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[p(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),p(`path`,{d:`M21 3v5h-5`}),p(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),p(`path`,{d:`M8 16H3v5`})]}),send:m(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[p(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),p(`path`,{d:`M22 2 11 13`})]}),list:m(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[p(`line`,{x1:`8`,x2:`21`,y1:`6`,y2:`6`}),p(`line`,{x1:`8`,x2:`21`,y1:`12`,y2:`12`}),p(`line`,{x1:`8`,x2:`21`,y1:`18`,y2:`18`}),p(`line`,{x1:`3`,x2:`3.01`,y1:`6`,y2:`6`}),p(`line`,{x1:`3`,x2:`3.01`,y1:`12`,y2:`12`}),p(`line`,{x1:`3`,x2:`3.01`,y1:`18`,y2:`18`})]}),star:p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:p(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`})}),zap:p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:p(`polygon`,{points:`13 2 3 14 12 14 11 22 21 10 12 10 13 2`})})}[e.toLowerCase()]||null}const Q={DynamicButton:We,DynamicButtonGroup:Ge};function qe(e){return typeof e.id==`string`&&typeof e.label==`string`&&Array.isArray(e.actions)}function Je({className:e}){let{config:t,messages:n,onAction:r}=Ne(),{endUserId:a,availableActions:o}=t,s=ze({storageKey:`mwai-dynamic-ui-${a}`});Be({messages:n,dynamicUI:s});let[c,u]=l(null),d=i(e=>{if(r)for(let t of e)r(t)},[r]),_=i(e=>{if(!s.tree)return;let t=`button-${e}`,n=s.tree.elements[t];n&&n.type===`DynamicButton`&&qe(n.props)&&u(n.props)},[s.tree]),v=i(()=>{u(null)},[]);return s.isLoading||!s.tree?null:m(f,{children:[p(`div`,{"data-slot":`dynamic-ui`,className:E(`flex flex-wrap gap-2`,e),children:p(h,{registry:Q,actionHandlers:{executeButton:({buttonId:e})=>{_(e)}},children:p(g,{tree:s.tree,registry:Q})})}),p(Te,{button:c,availableActions:o,onExecute:d,onClose:v})]})}function Ye({...e}){return p(w.Root,{"data-slot":`drawer`,...e})}function Xe({...e}){return p(w.Trigger,{"data-slot":`drawer-trigger`,...e})}function Ze({...e}){return p(w.Portal,{"data-slot":`drawer-portal`,...e})}function Qe({...e}){return p(w.Close,{"data-slot":`drawer-close`,...e})}function $({className:e,...t}){return p(w.Overlay,{"data-slot":`drawer-overlay`,className:E(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50`,e),...t})}function $e({className:e,children:t,overlay:n=!0,...r}){return m(Ze,{"data-slot":`drawer-portal`,children:[n&&p($,{}),m(w.Content,{"data-slot":`drawer-content`,className:E(`bg-background flex h-auto flex-col text-sm`,`data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t`,`data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r`,`data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l`,`data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b`,`data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm`,`group/drawer-content fixed z-50`,e),...r,children:[p(`div`,{className:`bg-muted mx-auto mt-4 hidden h-1 w-24 shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),t]})]})}function et({className:e,...t}){return p(`div`,{"data-slot":`drawer-header`,className:E(`flex flex-col gap-0.5 p-4`,`group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center`,`group-data-[vaul-drawer-direction=top]/drawer-content:text-center`,`md:gap-0.5 md:text-left`,e),...t})}function tt({className:e,...t}){return p(`div`,{"data-slot":`drawer-footer`,className:E(`mt-auto flex flex-col gap-2 p-4`,e),...t})}function nt({className:e,...t}){return p(w.Title,{"data-slot":`drawer-title`,className:E(`text-foreground text-base font-medium`,e),...t})}function rt({className:e,...t}){return p(w.Description,{"data-slot":`drawer-description`,className:E(`text-muted-foreground text-sm`,e),...t})}function it({className:e,onSubmit:t,children:n,...r}){let i=e=>{e.preventDefault();let n=e.currentTarget,r=new FormData(n).get(`message`)||``;n.reset(),t({text:r},e)};return p(`form`,{"data-slot":`prompt-input`,className:E(`w-full`,e),onSubmit:i,...r,children:p(`div`,{"data-slot":`prompt-input-group`,role:`group`,className:E(`border-input dark:bg-input/30`,`has-[[data-slot=prompt-input-textarea]:focus-visible]:border-ring`,`has-[[data-slot=prompt-input-textarea]:focus-visible]:ring-ring/50`,`has-[[data-slot=prompt-input-textarea]:focus-visible]:ring-[3px]`,`relative flex w-full min-w-0 flex-col overflow-hidden rounded-lg border transition-colors`),children:n})})}function at({onChange:e,className:t,placeholder:n=`What would you like to know?`,...r}){let[i,a]=l(!1),o=e=>{if(e.key===`Enter`){if(i||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let t=e.currentTarget.form;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}};return p(`textarea`,{"data-slot":`prompt-input-textarea`,className:E(`field-sizing-content max-h-48 min-h-16`,`flex-1 resize-none rounded-none border-0 bg-transparent px-3 py-2 text-sm shadow-none ring-0 outline-0`,`placeholder:text-muted-foreground`,`focus-visible:ring-0 focus-visible:outline-none`,`disabled:cursor-not-allowed disabled:opacity-50`,t),name:`message`,onChange:e,onCompositionEnd:()=>a(!1),onCompositionStart:()=>a(!0),onKeyDown:o,placeholder:n,...r})}function ot({className:e,...t}){return p(`div`,{"data-slot":`prompt-input-footer`,className:E(`flex w-full items-center justify-between gap-1 px-2.5 pb-2`,e),...t})}function st({className:e,type:n=`button`,children:r,...i}){let a=t.count(r)>1;return p(`button`,{"data-slot":`prompt-input-button`,type:n,className:E(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors`,`hover:bg-accent hover:text-accent-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`,a?`h-8 px-3`:`size-8`,e),...i,children:r})}function ct({className:e,status:t,icon:n,children:r,...i}){let a=p(y,{className:`size-4`});return t===`submitted`?a=p(b,{className:`size-4 animate-spin`}):t===`streaming`?a=p(S,{className:`size-4`}):t===`error`&&(a=p(ee,{className:`size-4`})),p(`button`,{"data-slot":`prompt-input-submit`,type:`submit`,"aria-label":`Send message`,className:E(`inline-flex size-8 items-center justify-center rounded-md text-sm font-medium transition-colors`,`bg-primary text-primary-foreground shadow`,`hover:bg-primary/90`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`,e),...i,children:r??n??a})}var lt=`/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-500:oklch(63.7% .237 25.331);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-500:oklch(72.3% .219 149.579);--color-green-950:oklch(26.6% .065 152.934);--color-black:#000;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--animate-spin:spin 1s linear infinite;--blur-xs:4px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.z-50{z-index:50}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-auto{margin-top:auto}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-auto{margin-left:auto}.contents{display:contents}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.field-sizing-content{field-sizing:content}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-12{width:calc(var(--spacing)*12);height:calc(var(--spacing)*12)}.size-full{width:100%;height:100%}.h-1{height:calc(var(--spacing)*1)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-auto{height:auto}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing)*48)}.max-h-\\[90vh\\]{max-height:90vh}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\\[60px\\]{min-height:60px}.w-24{width:calc(var(--spacing)*24)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[95\\%\\]{max-width:95%}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-input{border-color:var(--input)}.border-muted{border-color:var(--muted)}.bg-background{background-color:var(--background)}.bg-black\\/10{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.bg-black\\/10{background-color:color-mix(in oklab,var(--color-black)10%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-muted{background-color:var(--muted)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.p-4{padding:calc(var(--spacing)*4)}.p-8{padding:calc(var(--spacing)*8)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-4{padding-top:calc(var(--spacing)*4)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pl-4{padding-left:calc(var(--spacing)*4)}.text-center{text-align:center}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.whitespace-nowrap{white-space:nowrap}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-0{outline-style:var(--tw-outline-style);outline-width:0}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.group-data-\\[state\\=open\\]\\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.group-data-\\[vaul-drawer-direction\\=bottom\\]\\/drawer-content\\:block:is(:where(.group\\/drawer-content)[data-vaul-drawer-direction=bottom] *){display:block}.group-data-\\[vaul-drawer-direction\\=bottom\\]\\/drawer-content\\:text-center:is(:where(.group\\/drawer-content)[data-vaul-drawer-direction=bottom] *),.group-data-\\[vaul-drawer-direction\\=top\\]\\/drawer-content\\:text-center:is(:where(.group\\/drawer-content)[data-vaul-drawer-direction=top] *){text-align:center}.group-\\[\\.is-assistant\\]\\:text-foreground:is(:where(.group).is-assistant *){color:var(--foreground)}.group-\\[\\.is-user\\]\\:ml-auto:is(:where(.group).is-user *){margin-left:auto}.group-\\[\\.is-user\\]\\:rounded-lg:is(:where(.group).is-user *){border-radius:var(--radius)}.group-\\[\\.is-user\\]\\:bg-secondary:is(:where(.group).is-user *){background-color:var(--secondary)}.group-\\[\\.is-user\\]\\:px-4:is(:where(.group).is-user *){padding-inline:calc(var(--spacing)*4)}.group-\\[\\.is-user\\]\\:py-3:is(:where(.group).is-user *){padding-block:calc(var(--spacing)*3)}.group-\\[\\.is-user\\]\\:text-foreground:is(:where(.group).is-user *){color:var(--foreground)}.peer-disabled\\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.placeholder\\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\\:bg-secondary\\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\\:text-foreground:hover{color:var(--foreground)}}.focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:var(--ring)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-slot\\=prompt-input-textarea\\]\\:focus-visible\\]\\:border-ring:has([data-slot=prompt-input-textarea]:focus-visible){border-color:var(--ring)}.has-\\[\\[data-slot\\=prompt-input-textarea\\]\\:focus-visible\\]\\:ring-\\[3px\\]:has([data-slot=prompt-input-textarea]:focus-visible){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.has-\\[\\[data-slot\\=prompt-input-textarea\\]\\:focus-visible\\]\\:ring-ring\\/50:has([data-slot=prompt-input-textarea]:focus-visible){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.has-\\[\\[data-slot\\=prompt-input-textarea\\]\\:focus-visible\\]\\:ring-ring\\/50:has([data-slot=prompt-input-textarea]:focus-visible){--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.data-\\[approved\\=false\\]\\:border-red-500\\/50[data-approved=false]{border-color:#fb2c3680}@supports (color:color-mix(in lab, red, red)){.data-\\[approved\\=false\\]\\:border-red-500\\/50[data-approved=false]{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.data-\\[approved\\=false\\]\\:bg-red-50\\/50[data-approved=false]{background-color:#fef2f280}@supports (color:color-mix(in lab, red, red)){.data-\\[approved\\=false\\]\\:bg-red-50\\/50[data-approved=false]{background-color:color-mix(in oklab,var(--color-red-50)50%,transparent)}}.data-\\[approved\\=true\\]\\:border-green-500\\/50[data-approved=true]{border-color:#00c75880}@supports (color:color-mix(in lab, red, red)){.data-\\[approved\\=true\\]\\:border-green-500\\/50[data-approved=true]{border-color:color-mix(in oklab,var(--color-green-500)50%,transparent)}}.data-\\[approved\\=true\\]\\:bg-green-50\\/50[data-approved=true]{background-color:#f0fdf480}@supports (color:color-mix(in lab, red, red)){.data-\\[approved\\=true\\]\\:bg-green-50\\/50[data-approved=true]{background-color:color-mix(in oklab,var(--color-green-50)50%,transparent)}}.data-\\[state\\=approval-requested\\]\\:border-amber-500\\/50[data-state=approval-requested]{border-color:#f99c0080}@supports (color:color-mix(in lab, red, red)){.data-\\[state\\=approval-requested\\]\\:border-amber-500\\/50[data-state=approval-requested]{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.data-\\[state\\=approval-requested\\]\\:bg-amber-50\\/50[data-state=approval-requested]{background-color:#fffbeb80}@supports (color:color-mix(in lab, red, red)){.data-\\[state\\=approval-requested\\]\\:bg-amber-50\\/50[data-state=approval-requested]{background-color:color-mix(in oklab,var(--color-amber-50)50%,transparent)}}.data-\\[vaul-drawer-direction\\=bottom\\]\\:inset-x-0[data-vaul-drawer-direction=bottom]{inset-inline:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=bottom\\]\\:bottom-0[data-vaul-drawer-direction=bottom]{bottom:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=bottom\\]\\:mt-24[data-vaul-drawer-direction=bottom]{margin-top:calc(var(--spacing)*24)}.data-\\[vaul-drawer-direction\\=bottom\\]\\:max-h-\\[80vh\\][data-vaul-drawer-direction=bottom]{max-height:80vh}.data-\\[vaul-drawer-direction\\=bottom\\]\\:rounded-t-xl[data-vaul-drawer-direction=bottom]{border-top-left-radius:calc(var(--radius) + 4px);border-top-right-radius:calc(var(--radius) + 4px)}.data-\\[vaul-drawer-direction\\=bottom\\]\\:border-t[data-vaul-drawer-direction=bottom]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-\\[vaul-drawer-direction\\=left\\]\\:inset-y-0[data-vaul-drawer-direction=left]{inset-block:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=left\\]\\:left-0[data-vaul-drawer-direction=left]{left:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=left\\]\\:w-3\\/4[data-vaul-drawer-direction=left]{width:75%}.data-\\[vaul-drawer-direction\\=left\\]\\:rounded-r-xl[data-vaul-drawer-direction=left]{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.data-\\[vaul-drawer-direction\\=left\\]\\:border-r[data-vaul-drawer-direction=left]{border-right-style:var(--tw-border-style);border-right-width:1px}.data-\\[vaul-drawer-direction\\=right\\]\\:inset-y-0[data-vaul-drawer-direction=right]{inset-block:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=right\\]\\:right-0[data-vaul-drawer-direction=right]{right:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=right\\]\\:w-3\\/4[data-vaul-drawer-direction=right]{width:75%}.data-\\[vaul-drawer-direction\\=right\\]\\:rounded-l-xl[data-vaul-drawer-direction=right]{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.data-\\[vaul-drawer-direction\\=right\\]\\:border-l[data-vaul-drawer-direction=right]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\\[vaul-drawer-direction\\=top\\]\\:inset-x-0[data-vaul-drawer-direction=top]{inset-inline:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=top\\]\\:top-0[data-vaul-drawer-direction=top]{top:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=top\\]\\:mb-24[data-vaul-drawer-direction=top]{margin-bottom:calc(var(--spacing)*24)}.data-\\[vaul-drawer-direction\\=top\\]\\:max-h-\\[80vh\\][data-vaul-drawer-direction=top]{max-height:80vh}.data-\\[vaul-drawer-direction\\=top\\]\\:rounded-b-xl[data-vaul-drawer-direction=top]{border-bottom-right-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.data-\\[vaul-drawer-direction\\=top\\]\\:border-b[data-vaul-drawer-direction=top]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}@supports ((-webkit-backdrop-filter:var(--tw)) or (backdrop-filter:var(--tw))){.supports-backdrop-filter\\:backdrop-blur-xs{--tw-backdrop-blur:blur(var(--blur-xs));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}}@media (min-width:40rem){.data-\\[vaul-drawer-direction\\=left\\]\\:sm\\:max-w-sm[data-vaul-drawer-direction=left],.data-\\[vaul-drawer-direction\\=right\\]\\:sm\\:max-w-sm[data-vaul-drawer-direction=right]{max-width:var(--container-sm)}}@media (min-width:48rem){.md\\:gap-0\\.5{gap:calc(var(--spacing)*.5)}.md\\:text-left{text-align:left}}.dark\\:bg-input\\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\\:data-\\[approved\\=false\\]\\:bg-red-950\\/20:is(.dark *)[data-approved=false]{background-color:#46080933}@supports (color:color-mix(in lab, red, red)){.dark\\:data-\\[approved\\=false\\]\\:bg-red-950\\/20:is(.dark *)[data-approved=false]{background-color:color-mix(in oklab,var(--color-red-950)20%,transparent)}}.dark\\:data-\\[approved\\=true\\]\\:bg-green-950\\/20:is(.dark *)[data-approved=true]{background-color:#032e1533}@supports (color:color-mix(in lab, red, red)){.dark\\:data-\\[approved\\=true\\]\\:bg-green-950\\/20:is(.dark *)[data-approved=true]{background-color:color-mix(in oklab,var(--color-green-950)20%,transparent)}}.dark\\:data-\\[state\\=approval-requested\\]\\:bg-amber-950\\/20:is(.dark *)[data-state=approval-requested]{background-color:#46190133}@supports (color:color-mix(in lab, red, red)){.dark\\:data-\\[state\\=approval-requested\\]\\:bg-amber-950\\/20:is(.dark *)[data-state=approval-requested]{background-color:color-mix(in oklab,var(--color-amber-950)20%,transparent)}}.\\[\\&\\>\\*\\:first-child\\]\\:mt-0>:first-child{margin-top:calc(var(--spacing)*0)}.\\[\\&\\>\\*\\:last-child\\]\\:mb-0>:last-child{margin-bottom:calc(var(--spacing)*0)}}.assistant-root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background:0 0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;line-height:1.5}.assistant-root.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}`;function ut({children:e,className:t,theme:n,...r}){let i=c(null),[a,s]=l(null),[u,d]=l(`light`);o(()=>{if(n!==void 0)return;let e=()=>{d(document.documentElement.classList.contains(`dark`)?`dark`:`light`)};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[n]),o(()=>{if(i.current&&!i.current.shadowRoot){let e=i.current.attachShadow({mode:`open`}),t=new CSSStyleSheet;t.replaceSync(lt),e.adoptedStyleSheets=[t],s(e)}},[]);let f=n??u;return p(`div`,{ref:i,"data-slot":`assistant-root-host`,className:E(`assistant-root-host`,t),...r,children:a&&ie(p(`div`,{className:E(`assistant-root flex flex-col h-full min-h-0`,f===`dark`&&`dark`),children:e}),a)})}export{P as $,Se as A,K as B,Me as C,Oe as D,ke as E,X as F,B as G,V as H,q as I,L as J,R as K,fe as L,we as M,ye as N,Te as O,J as P,j as Q,Y as R,ze as S,Ae as T,H as U,G as V,U as W,z as X,I as Y,O as Z,Je as _,ct as a,oe as at,Q as b,Qe as c,se as ct,tt as d,N as et,et as f,Xe as g,nt as h,ot as i,E as it,Ce as j,xe as k,$e as l,T as lt,Ze as m,it as n,A as nt,at as o,ae as ot,$ as p,F as q,st as r,k as rt,Ye as s,ce as st,ut as t,M as tt,rt as u,Ge as v,Ne as w,Be as x,We as y,W as z};
|
|
@@ -1,15 +1,60 @@
|
|
|
1
|
-
import { S as UseDynamicUIReturn, a as AssistantConfig, b as UseAssistantTokenOptions, c as DynamicButton, g as ToolAction, l as DynamicButtonGroup, t as ActionDefinition, v as UseAssistantOptions, x as UseAssistantTokenReturn, y as UseAssistantReturn } from "./types-
|
|
1
|
+
import { S as UseDynamicUIReturn, a as AssistantConfig, b as UseAssistantTokenOptions, c as DynamicButton, g as ToolAction, l as DynamicButtonGroup, t as ActionDefinition, v as UseAssistantOptions, x as UseAssistantTokenReturn, y as UseAssistantReturn } from "./types-C7I0JuqF.js";
|
|
2
2
|
import * as React$2 from "react";
|
|
3
3
|
import React$1, { ComponentProps, FormEvent, HTMLAttributes, ReactNode } from "react";
|
|
4
4
|
import { ClassValue } from "clsx";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
6
|
import { ComponentRegistry, ComponentRenderProps } from "@json-render/react";
|
|
7
|
-
import { ChatStatus, ToolUIPart, UIMessage } from "ai";
|
|
8
7
|
import { Streamdown } from "streamdown";
|
|
9
8
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
9
|
+
import { ChatStatus, ToolUIPart, UIMessage } from "ai";
|
|
10
10
|
import { Drawer } from "vaul-base";
|
|
11
11
|
import { UITree } from "@json-render/core";
|
|
12
12
|
|
|
13
|
+
//#region src/assistant/components/assistant-messages.d.ts
|
|
14
|
+
interface AssistantMessagesProps {
|
|
15
|
+
/** The chat messages to render */
|
|
16
|
+
messages: UIMessage[];
|
|
17
|
+
/** Function to send a new message */
|
|
18
|
+
sendMessage: (message: {
|
|
19
|
+
text: string;
|
|
20
|
+
}) => void;
|
|
21
|
+
/** Function to add a tool approval response */
|
|
22
|
+
addToolApprovalResponse: (response: {
|
|
23
|
+
id: string;
|
|
24
|
+
approved: boolean;
|
|
25
|
+
}) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Optional function to get a human-readable description for an action.
|
|
28
|
+
* If not provided, uses action.name as the description.
|
|
29
|
+
*/
|
|
30
|
+
getActionDescription?: (action: ToolAction) => string;
|
|
31
|
+
/** Optional className for the container */
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Renders a list of chat messages with proper handling of all part types:
|
|
36
|
+
* - text: Rendered as markdown via MessageResponse
|
|
37
|
+
* - tool-performActions: Rendered as Confirmation (if approval needed) or Task (if not)
|
|
38
|
+
* - tool-renderUI: Rendered as AssistantFormRenderer (only on last message)
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <AssistantMessages
|
|
43
|
+
* messages={assistant.messages}
|
|
44
|
+
* sendMessage={assistant.sendMessage}
|
|
45
|
+
* addToolApprovalResponse={assistant.addToolApprovalResponse}
|
|
46
|
+
* getActionDescription={(action) => `${ACTION_LABELS[action.name]}: ${action.options?.text}`}
|
|
47
|
+
* />
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
declare function AssistantMessages({
|
|
51
|
+
messages,
|
|
52
|
+
sendMessage,
|
|
53
|
+
addToolApprovalResponse,
|
|
54
|
+
getActionDescription,
|
|
55
|
+
className
|
|
56
|
+
}: AssistantMessagesProps): react_jsx_runtime0.JSX.Element;
|
|
57
|
+
//#endregion
|
|
13
58
|
//#region src/assistant/components/confirmation.d.ts
|
|
14
59
|
/**
|
|
15
60
|
* Approval state for a tool invocation
|
|
@@ -54,7 +99,7 @@ declare function Confirmation({
|
|
|
54
99
|
approval,
|
|
55
100
|
state,
|
|
56
101
|
...props
|
|
57
|
-
}: ConfirmationProps):
|
|
102
|
+
}: ConfirmationProps): react_jsx_runtime0.JSX.Element | null;
|
|
58
103
|
type ConfirmationTitleProps = ComponentProps<"p">;
|
|
59
104
|
/**
|
|
60
105
|
* Title for the confirmation dialog
|
|
@@ -62,7 +107,7 @@ type ConfirmationTitleProps = ComponentProps<"p">;
|
|
|
62
107
|
declare function ConfirmationTitle({
|
|
63
108
|
className,
|
|
64
109
|
...props
|
|
65
|
-
}: ConfirmationTitleProps):
|
|
110
|
+
}: ConfirmationTitleProps): react_jsx_runtime0.JSX.Element;
|
|
66
111
|
type ConfirmationRequestProps = {
|
|
67
112
|
children?: ReactNode;
|
|
68
113
|
};
|
|
@@ -71,7 +116,7 @@ type ConfirmationRequestProps = {
|
|
|
71
116
|
*/
|
|
72
117
|
declare function ConfirmationRequest({
|
|
73
118
|
children
|
|
74
|
-
}: ConfirmationRequestProps):
|
|
119
|
+
}: ConfirmationRequestProps): react_jsx_runtime0.JSX.Element | null;
|
|
75
120
|
type ConfirmationAcceptedProps = {
|
|
76
121
|
children?: ReactNode;
|
|
77
122
|
};
|
|
@@ -80,7 +125,7 @@ type ConfirmationAcceptedProps = {
|
|
|
80
125
|
*/
|
|
81
126
|
declare function ConfirmationAccepted({
|
|
82
127
|
children
|
|
83
|
-
}: ConfirmationAcceptedProps):
|
|
128
|
+
}: ConfirmationAcceptedProps): react_jsx_runtime0.JSX.Element | null;
|
|
84
129
|
type ConfirmationRejectedProps = {
|
|
85
130
|
children?: ReactNode;
|
|
86
131
|
};
|
|
@@ -89,7 +134,7 @@ type ConfirmationRejectedProps = {
|
|
|
89
134
|
*/
|
|
90
135
|
declare function ConfirmationRejected({
|
|
91
136
|
children
|
|
92
|
-
}: ConfirmationRejectedProps):
|
|
137
|
+
}: ConfirmationRejectedProps): react_jsx_runtime0.JSX.Element | null;
|
|
93
138
|
type ConfirmationActionsProps = ComponentProps<"div">;
|
|
94
139
|
/**
|
|
95
140
|
* Container for approve/deny action buttons
|
|
@@ -99,7 +144,7 @@ type ConfirmationActionsProps = ComponentProps<"div">;
|
|
|
99
144
|
declare function ConfirmationActions({
|
|
100
145
|
className,
|
|
101
146
|
...props
|
|
102
|
-
}: ConfirmationActionsProps):
|
|
147
|
+
}: ConfirmationActionsProps): react_jsx_runtime0.JSX.Element | null;
|
|
103
148
|
type ConfirmationActionProps = ComponentProps<"button"> & {
|
|
104
149
|
/** Button variant for styling */variant?: "default" | "outline" | "destructive";
|
|
105
150
|
};
|
|
@@ -122,7 +167,7 @@ declare function ConfirmationAction({
|
|
|
122
167
|
className,
|
|
123
168
|
variant,
|
|
124
169
|
...props
|
|
125
|
-
}: ConfirmationActionProps):
|
|
170
|
+
}: ConfirmationActionProps): react_jsx_runtime0.JSX.Element;
|
|
126
171
|
//#endregion
|
|
127
172
|
//#region src/assistant/components/conversation.d.ts
|
|
128
173
|
type ConversationProps = HTMLAttributes<HTMLDivElement>;
|
|
@@ -151,7 +196,7 @@ declare function Conversation({
|
|
|
151
196
|
className,
|
|
152
197
|
children,
|
|
153
198
|
...props
|
|
154
|
-
}: ConversationProps):
|
|
199
|
+
}: ConversationProps): react_jsx_runtime0.JSX.Element;
|
|
155
200
|
type ConversationContentProps = HTMLAttributes<HTMLDivElement>;
|
|
156
201
|
/**
|
|
157
202
|
* Scrollable content area for messages
|
|
@@ -170,7 +215,7 @@ declare function ConversationContent({
|
|
|
170
215
|
className,
|
|
171
216
|
children,
|
|
172
217
|
...props
|
|
173
|
-
}: ConversationContentProps):
|
|
218
|
+
}: ConversationContentProps): react_jsx_runtime0.JSX.Element;
|
|
174
219
|
type ConversationEmptyStateProps = ComponentProps<"div"> & {
|
|
175
220
|
/** Title text for the empty state */title?: string; /** Description text for the empty state */
|
|
176
221
|
description?: string; /** Icon to display above the title */
|
|
@@ -195,7 +240,7 @@ declare function ConversationEmptyState({
|
|
|
195
240
|
icon,
|
|
196
241
|
children,
|
|
197
242
|
...props
|
|
198
|
-
}: ConversationEmptyStateProps):
|
|
243
|
+
}: ConversationEmptyStateProps): react_jsx_runtime0.JSX.Element;
|
|
199
244
|
type ConversationScrollButtonProps = ComponentProps<"button">;
|
|
200
245
|
/**
|
|
201
246
|
* Button to scroll to the bottom of the conversation
|
|
@@ -234,7 +279,7 @@ declare function DynamicActionModal({
|
|
|
234
279
|
availableActions,
|
|
235
280
|
onExecute,
|
|
236
281
|
onClose
|
|
237
|
-
}: DynamicActionModalProps):
|
|
282
|
+
}: DynamicActionModalProps): react_jsx_runtime0.JSX.Element | null;
|
|
238
283
|
//#endregion
|
|
239
284
|
//#region src/assistant/components/dynamic-ui.d.ts
|
|
240
285
|
interface DynamicUIProps {
|
|
@@ -274,7 +319,7 @@ interface DynamicUIProps {
|
|
|
274
319
|
*/
|
|
275
320
|
declare function DynamicUI({
|
|
276
321
|
className
|
|
277
|
-
}: DynamicUIProps):
|
|
322
|
+
}: DynamicUIProps): react_jsx_runtime0.JSX.Element | null;
|
|
278
323
|
//#endregion
|
|
279
324
|
//#region src/assistant/components/dynamic-ui-components.d.ts
|
|
280
325
|
/**
|
|
@@ -286,7 +331,7 @@ declare function DynamicUI({
|
|
|
286
331
|
declare function DynamicButtonRenderer({
|
|
287
332
|
element,
|
|
288
333
|
onAction
|
|
289
|
-
}: ComponentRenderProps<DynamicButton>):
|
|
334
|
+
}: ComponentRenderProps<DynamicButton>): react_jsx_runtime0.JSX.Element | null;
|
|
290
335
|
/**
|
|
291
336
|
* Renderer for DynamicButtonGroup elements
|
|
292
337
|
*
|
|
@@ -296,7 +341,7 @@ declare function DynamicButtonRenderer({
|
|
|
296
341
|
declare function DynamicButtonGroupRenderer({
|
|
297
342
|
element,
|
|
298
343
|
children
|
|
299
|
-
}: ComponentRenderProps<DynamicButtonGroup>):
|
|
344
|
+
}: ComponentRenderProps<DynamicButtonGroup>): react_jsx_runtime0.JSX.Element;
|
|
300
345
|
/**
|
|
301
346
|
* Component registry for DynamicUI rendering
|
|
302
347
|
*/
|
|
@@ -319,7 +364,7 @@ declare function FormRenderer({
|
|
|
319
364
|
id: string;
|
|
320
365
|
title?: string;
|
|
321
366
|
submitLabel?: string;
|
|
322
|
-
}>):
|
|
367
|
+
}>): react_jsx_runtime0.JSX.Element;
|
|
323
368
|
/**
|
|
324
369
|
* TextField component - renders a labeled input field
|
|
325
370
|
*
|
|
@@ -338,7 +383,7 @@ declare function TextFieldRenderer({
|
|
|
338
383
|
placeholder?: string;
|
|
339
384
|
required?: boolean;
|
|
340
385
|
defaultValue?: string;
|
|
341
|
-
}>):
|
|
386
|
+
}>): react_jsx_runtime0.JSX.Element;
|
|
342
387
|
/**
|
|
343
388
|
* TextArea component - renders a labeled textarea for longer text
|
|
344
389
|
*
|
|
@@ -359,7 +404,7 @@ declare function TextAreaRenderer({
|
|
|
359
404
|
required?: boolean;
|
|
360
405
|
defaultValue?: string;
|
|
361
406
|
rows?: number;
|
|
362
|
-
}>):
|
|
407
|
+
}>): react_jsx_runtime0.JSX.Element;
|
|
363
408
|
/**
|
|
364
409
|
* DateField component - renders a labeled date input
|
|
365
410
|
*
|
|
@@ -380,7 +425,7 @@ declare function DateFieldRenderer({
|
|
|
380
425
|
defaultValue?: string;
|
|
381
426
|
min?: string;
|
|
382
427
|
max?: string;
|
|
383
|
-
}>):
|
|
428
|
+
}>): react_jsx_runtime0.JSX.Element;
|
|
384
429
|
/**
|
|
385
430
|
* Default component registry for form rendering
|
|
386
431
|
*
|
|
@@ -455,7 +500,7 @@ declare function AssistantFormRenderer({
|
|
|
455
500
|
onSubmit,
|
|
456
501
|
onCancel,
|
|
457
502
|
registry
|
|
458
|
-
}: AssistantFormRendererProps):
|
|
503
|
+
}: AssistantFormRendererProps): react_jsx_runtime0.JSX.Element;
|
|
459
504
|
//#endregion
|
|
460
505
|
//#region src/assistant/components/message.d.ts
|
|
461
506
|
type MessageProps = HTMLAttributes<HTMLDivElement> & {
|
|
@@ -484,7 +529,7 @@ declare function Message({
|
|
|
484
529
|
className,
|
|
485
530
|
from,
|
|
486
531
|
...props
|
|
487
|
-
}: MessageProps):
|
|
532
|
+
}: MessageProps): react_jsx_runtime0.JSX.Element;
|
|
488
533
|
type MessageContentProps = HTMLAttributes<HTMLDivElement>;
|
|
489
534
|
/**
|
|
490
535
|
* Content wrapper for message text/elements
|
|
@@ -505,7 +550,7 @@ declare function MessageContent({
|
|
|
505
550
|
children,
|
|
506
551
|
className,
|
|
507
552
|
...props
|
|
508
|
-
}: MessageContentProps):
|
|
553
|
+
}: MessageContentProps): react_jsx_runtime0.JSX.Element;
|
|
509
554
|
type MessageResponseProps = ComponentProps<typeof Streamdown>;
|
|
510
555
|
/**
|
|
511
556
|
* Renders markdown content from the assistant using Streamdown
|
|
@@ -538,13 +583,13 @@ declare const MessageResponse: React$1.MemoExoticComponent<(props: MessageRespon
|
|
|
538
583
|
*/
|
|
539
584
|
declare function Collapsible({
|
|
540
585
|
...props
|
|
541
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>):
|
|
586
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>): react_jsx_runtime0.JSX.Element;
|
|
542
587
|
/**
|
|
543
588
|
* Trigger element that toggles the collapsible content
|
|
544
589
|
*/
|
|
545
590
|
declare function CollapsibleTrigger({
|
|
546
591
|
...props
|
|
547
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>):
|
|
592
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): react_jsx_runtime0.JSX.Element;
|
|
548
593
|
/**
|
|
549
594
|
* Content that is shown/hidden based on the collapsible state
|
|
550
595
|
*
|
|
@@ -552,7 +597,7 @@ declare function CollapsibleTrigger({
|
|
|
552
597
|
*/
|
|
553
598
|
declare function CollapsibleContent({
|
|
554
599
|
...props
|
|
555
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>):
|
|
600
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): react_jsx_runtime0.JSX.Element;
|
|
556
601
|
//#endregion
|
|
557
602
|
//#region src/assistant/components/primitives/drawer.d.ts
|
|
558
603
|
/**
|
|
@@ -577,32 +622,32 @@ declare function CollapsibleContent({
|
|
|
577
622
|
*/
|
|
578
623
|
declare function Drawer$1({
|
|
579
624
|
...props
|
|
580
|
-
}: React$2.ComponentProps<typeof Drawer.Root>):
|
|
625
|
+
}: React$2.ComponentProps<typeof Drawer.Root>): react_jsx_runtime0.JSX.Element;
|
|
581
626
|
/**
|
|
582
627
|
* Trigger element that opens the drawer
|
|
583
628
|
*/
|
|
584
629
|
declare function DrawerTrigger({
|
|
585
630
|
...props
|
|
586
|
-
}: React$2.ComponentProps<typeof Drawer.Trigger>):
|
|
631
|
+
}: React$2.ComponentProps<typeof Drawer.Trigger>): react_jsx_runtime0.JSX.Element;
|
|
587
632
|
/**
|
|
588
633
|
* Portal for rendering drawer content outside the DOM hierarchy
|
|
589
634
|
*/
|
|
590
635
|
declare function DrawerPortal({
|
|
591
636
|
...props
|
|
592
|
-
}: React$2.ComponentProps<typeof Drawer.Portal>):
|
|
637
|
+
}: React$2.ComponentProps<typeof Drawer.Portal>): react_jsx_runtime0.JSX.Element;
|
|
593
638
|
/**
|
|
594
639
|
* Close button element for the drawer
|
|
595
640
|
*/
|
|
596
641
|
declare function DrawerClose({
|
|
597
642
|
...props
|
|
598
|
-
}: React$2.ComponentProps<typeof Drawer.Close>):
|
|
643
|
+
}: React$2.ComponentProps<typeof Drawer.Close>): react_jsx_runtime0.JSX.Element;
|
|
599
644
|
/**
|
|
600
645
|
* Overlay backdrop for the drawer
|
|
601
646
|
*/
|
|
602
647
|
declare function DrawerOverlay({
|
|
603
648
|
className,
|
|
604
649
|
...props
|
|
605
|
-
}: React$2.ComponentProps<typeof Drawer.Overlay>):
|
|
650
|
+
}: React$2.ComponentProps<typeof Drawer.Overlay>): react_jsx_runtime0.JSX.Element;
|
|
606
651
|
interface DrawerContentProps extends React$2.ComponentProps<typeof Drawer.Content> {
|
|
607
652
|
/** Whether to render the overlay (default: true) */
|
|
608
653
|
overlay?: boolean;
|
|
@@ -621,35 +666,35 @@ declare function DrawerContent({
|
|
|
621
666
|
children,
|
|
622
667
|
overlay,
|
|
623
668
|
...props
|
|
624
|
-
}: DrawerContentProps):
|
|
669
|
+
}: DrawerContentProps): react_jsx_runtime0.JSX.Element;
|
|
625
670
|
/**
|
|
626
671
|
* Header section for the drawer
|
|
627
672
|
*/
|
|
628
673
|
declare function DrawerHeader({
|
|
629
674
|
className,
|
|
630
675
|
...props
|
|
631
|
-
}: React$2.ComponentProps<"div">):
|
|
676
|
+
}: React$2.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
|
|
632
677
|
/**
|
|
633
678
|
* Footer section for the drawer
|
|
634
679
|
*/
|
|
635
680
|
declare function DrawerFooter({
|
|
636
681
|
className,
|
|
637
682
|
...props
|
|
638
|
-
}: React$2.ComponentProps<"div">):
|
|
683
|
+
}: React$2.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
|
|
639
684
|
/**
|
|
640
685
|
* Title element for the drawer
|
|
641
686
|
*/
|
|
642
687
|
declare function DrawerTitle({
|
|
643
688
|
className,
|
|
644
689
|
...props
|
|
645
|
-
}: React$2.ComponentProps<typeof Drawer.Title>):
|
|
690
|
+
}: React$2.ComponentProps<typeof Drawer.Title>): react_jsx_runtime0.JSX.Element;
|
|
646
691
|
/**
|
|
647
692
|
* Description element for the drawer
|
|
648
693
|
*/
|
|
649
694
|
declare function DrawerDescription({
|
|
650
695
|
className,
|
|
651
696
|
...props
|
|
652
|
-
}: React$2.ComponentProps<typeof Drawer.Description>):
|
|
697
|
+
}: React$2.ComponentProps<typeof Drawer.Description>): react_jsx_runtime0.JSX.Element;
|
|
653
698
|
//#endregion
|
|
654
699
|
//#region src/assistant/components/prompt-input.d.ts
|
|
655
700
|
type PromptInputMessage = {
|
|
@@ -678,7 +723,7 @@ declare function PromptInput({
|
|
|
678
723
|
onSubmit,
|
|
679
724
|
children,
|
|
680
725
|
...props
|
|
681
|
-
}: PromptInputProps):
|
|
726
|
+
}: PromptInputProps): react_jsx_runtime0.JSX.Element;
|
|
682
727
|
type PromptInputTextareaProps = ComponentProps<"textarea">;
|
|
683
728
|
/**
|
|
684
729
|
* Textarea for entering the chat prompt
|
|
@@ -701,7 +746,7 @@ declare function PromptInputTextarea({
|
|
|
701
746
|
className,
|
|
702
747
|
placeholder,
|
|
703
748
|
...props
|
|
704
|
-
}: PromptInputTextareaProps):
|
|
749
|
+
}: PromptInputTextareaProps): react_jsx_runtime0.JSX.Element;
|
|
705
750
|
type PromptInputFooterProps = ComponentProps<"div">;
|
|
706
751
|
/**
|
|
707
752
|
* Footer section for the prompt input (contains buttons)
|
|
@@ -717,7 +762,7 @@ type PromptInputFooterProps = ComponentProps<"div">;
|
|
|
717
762
|
declare function PromptInputFooter({
|
|
718
763
|
className,
|
|
719
764
|
...props
|
|
720
|
-
}: PromptInputFooterProps):
|
|
765
|
+
}: PromptInputFooterProps): react_jsx_runtime0.JSX.Element;
|
|
721
766
|
type PromptInputButtonProps = ComponentProps<"button">;
|
|
722
767
|
/**
|
|
723
768
|
* Generic button for the prompt input area
|
|
@@ -734,7 +779,7 @@ declare function PromptInputButton({
|
|
|
734
779
|
type,
|
|
735
780
|
children,
|
|
736
781
|
...props
|
|
737
|
-
}: PromptInputButtonProps):
|
|
782
|
+
}: PromptInputButtonProps): react_jsx_runtime0.JSX.Element;
|
|
738
783
|
type PromptInputSubmitProps = ComponentProps<"button"> & {
|
|
739
784
|
/** Current chat status to show appropriate icon */status?: ChatStatus; /** Custom icon to override the default */
|
|
740
785
|
icon?: ReactNode;
|
|
@@ -762,7 +807,7 @@ declare function PromptInputSubmit({
|
|
|
762
807
|
icon,
|
|
763
808
|
children,
|
|
764
809
|
...props
|
|
765
|
-
}: PromptInputSubmitProps):
|
|
810
|
+
}: PromptInputSubmitProps): react_jsx_runtime0.JSX.Element;
|
|
766
811
|
//#endregion
|
|
767
812
|
//#region src/assistant/components/task.d.ts
|
|
768
813
|
type TaskItemFileProps = ComponentProps<"div">;
|
|
@@ -780,7 +825,7 @@ declare function TaskItemFile({
|
|
|
780
825
|
children,
|
|
781
826
|
className,
|
|
782
827
|
...props
|
|
783
|
-
}: TaskItemFileProps):
|
|
828
|
+
}: TaskItemFileProps): react_jsx_runtime0.JSX.Element;
|
|
784
829
|
type TaskItemProps = ComponentProps<"div">;
|
|
785
830
|
/**
|
|
786
831
|
* Individual task/action item within a Task list
|
|
@@ -794,7 +839,7 @@ declare function TaskItem({
|
|
|
794
839
|
children,
|
|
795
840
|
className,
|
|
796
841
|
...props
|
|
797
|
-
}: TaskItemProps):
|
|
842
|
+
}: TaskItemProps): react_jsx_runtime0.JSX.Element;
|
|
798
843
|
type TaskProps = ComponentProps<typeof Collapsible>;
|
|
799
844
|
/**
|
|
800
845
|
* Collapsible container for displaying a list of actions/tasks
|
|
@@ -815,7 +860,7 @@ declare function Task({
|
|
|
815
860
|
defaultOpen,
|
|
816
861
|
className,
|
|
817
862
|
...props
|
|
818
|
-
}: TaskProps):
|
|
863
|
+
}: TaskProps): react_jsx_runtime0.JSX.Element;
|
|
819
864
|
type TaskTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
|
|
820
865
|
/** Title text for the task group */title: string; /** Custom icon (defaults to SearchIcon) */
|
|
821
866
|
icon?: ReactNode;
|
|
@@ -837,7 +882,7 @@ declare function TaskTrigger({
|
|
|
837
882
|
title,
|
|
838
883
|
icon,
|
|
839
884
|
...props
|
|
840
|
-
}: TaskTriggerProps):
|
|
885
|
+
}: TaskTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
841
886
|
type TaskContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
842
887
|
/**
|
|
843
888
|
* Collapsible content area containing the task items
|
|
@@ -848,7 +893,7 @@ declare function TaskContent({
|
|
|
848
893
|
children,
|
|
849
894
|
className,
|
|
850
895
|
...props
|
|
851
|
-
}: TaskContentProps):
|
|
896
|
+
}: TaskContentProps): react_jsx_runtime0.JSX.Element;
|
|
852
897
|
//#endregion
|
|
853
898
|
//#region src/assistant/context.d.ts
|
|
854
899
|
/**
|
|
@@ -921,7 +966,7 @@ declare function AssistantProvider({
|
|
|
921
966
|
getContext,
|
|
922
967
|
onAction,
|
|
923
968
|
onError
|
|
924
|
-
}: AssistantProviderProps):
|
|
969
|
+
}: AssistantProviderProps): react_jsx_runtime0.JSX.Element;
|
|
925
970
|
/**
|
|
926
971
|
* Hook to access the assistant context
|
|
927
972
|
*
|
|
@@ -1201,7 +1246,7 @@ declare function AssistantRoot({
|
|
|
1201
1246
|
className,
|
|
1202
1247
|
theme,
|
|
1203
1248
|
...props
|
|
1204
|
-
}: AssistantRootProps):
|
|
1249
|
+
}: AssistantRootProps): react_jsx_runtime0.JSX.Element;
|
|
1205
1250
|
//#endregion
|
|
1206
1251
|
//#region src/assistant/utils/cn.d.ts
|
|
1207
1252
|
/**
|
|
@@ -1224,4 +1269,4 @@ declare function AssistantRoot({
|
|
|
1224
1269
|
*/
|
|
1225
1270
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1226
1271
|
//#endregion
|
|
1227
|
-
export { MessageContentProps as $, PromptInputFooterProps as A, ConfirmationActions as At, DrawerContentProps as B, TaskProps as C, ConversationScrollButton as Ct, PromptInputButton as D, ConfirmationAcceptedProps as Dt, PromptInput as E, ConfirmationAccepted as Et, PromptInputTextarea as F, ConfirmationRequest as Ft, DrawerPortal as G, DrawerFooter as H, PromptInputTextareaProps as I, ConfirmationRequestProps as It, Collapsible as J, DrawerTitle as K, Drawer$1 as L, ConfirmationTitle as Lt, PromptInputProps as M, ConfirmationProps as Mt, PromptInputSubmit as N, ConfirmationRejected as Nt, PromptInputButtonProps as O, ConfirmationAction as Ot, PromptInputSubmitProps as P, ConfirmationRejectedProps as Pt, MessageContent as Q, DrawerClose as R, ConfirmationTitleProps as Rt, TaskItemProps as S, ConversationProps as St, TaskTriggerProps as T, Confirmation as Tt, DrawerHeader as U, DrawerDescription as V, DrawerOverlay as W, CollapsibleTrigger as X, CollapsibleContent as Y, Message as Z, TaskContent as _, Conversation as _t, useToolExecution as a, DateFieldRenderer as at, TaskItemFile as b, ConversationEmptyState as bt, useDynamicUIToolExecution as c, TextFieldRenderer as ct, useAssistant as d, DynamicButtonRenderer as dt, MessageProps as et, AssistantContextValue as f, dynamicUIRegistry as ft, Task as g, DynamicActionModalProps as gt, useAssistantContext as h, DynamicActionModal as ht, UseToolExecutionOptions as i, AssistantFormRendererProps as it, PromptInputMessage as j, ConfirmationActionsProps as jt, PromptInputFooter as k, ConfirmationActionProps as kt, UseDynamicUIOptions as l, defaultFormRegistry as lt, AssistantProviderProps as m, DynamicUIProps as mt, AssistantRoot as n, MessageResponseProps as nt, useAssistantToken as o, FormRenderer as ot, AssistantProvider as p, DynamicUI as pt, DrawerTrigger as q, AssistantRootProps as r, AssistantFormRenderer as rt, UseDynamicUIToolExecutionOptions as s, TextAreaRenderer as st, cn as t, MessageResponse as tt, useDynamicUI as u, DynamicButtonGroupRenderer as ut, TaskContentProps as v, ConversationContent as vt, TaskTrigger as w, ConversationScrollButtonProps as wt, TaskItemFileProps as x, ConversationEmptyStateProps as xt, TaskItem as y, ConversationContentProps as yt, DrawerContent as z, ToolUIPartApproval as zt };
|
|
1272
|
+
export { MessageContentProps as $, PromptInputFooterProps as A, ConfirmationActions as At, DrawerContentProps as B, AssistantMessages as Bt, TaskProps as C, ConversationScrollButton as Ct, PromptInputButton as D, ConfirmationAcceptedProps as Dt, PromptInput as E, ConfirmationAccepted as Et, PromptInputTextarea as F, ConfirmationRequest as Ft, DrawerPortal as G, DrawerFooter as H, PromptInputTextareaProps as I, ConfirmationRequestProps as It, Collapsible as J, DrawerTitle as K, Drawer$1 as L, ConfirmationTitle as Lt, PromptInputProps as M, ConfirmationProps as Mt, PromptInputSubmit as N, ConfirmationRejected as Nt, PromptInputButtonProps as O, ConfirmationAction as Ot, PromptInputSubmitProps as P, ConfirmationRejectedProps as Pt, MessageContent as Q, DrawerClose as R, ConfirmationTitleProps as Rt, TaskItemProps as S, ConversationProps as St, TaskTriggerProps as T, Confirmation as Tt, DrawerHeader as U, DrawerDescription as V, AssistantMessagesProps as Vt, DrawerOverlay as W, CollapsibleTrigger as X, CollapsibleContent as Y, Message as Z, TaskContent as _, Conversation as _t, useToolExecution as a, DateFieldRenderer as at, TaskItemFile as b, ConversationEmptyState as bt, useDynamicUIToolExecution as c, TextFieldRenderer as ct, useAssistant as d, DynamicButtonRenderer as dt, MessageProps as et, AssistantContextValue as f, dynamicUIRegistry as ft, Task as g, DynamicActionModalProps as gt, useAssistantContext as h, DynamicActionModal as ht, UseToolExecutionOptions as i, AssistantFormRendererProps as it, PromptInputMessage as j, ConfirmationActionsProps as jt, PromptInputFooter as k, ConfirmationActionProps as kt, UseDynamicUIOptions as l, defaultFormRegistry as lt, AssistantProviderProps as m, DynamicUIProps as mt, AssistantRoot as n, MessageResponseProps as nt, useAssistantToken as o, FormRenderer as ot, AssistantProvider as p, DynamicUI as pt, DrawerTrigger as q, AssistantRootProps as r, AssistantFormRenderer as rt, UseDynamicUIToolExecutionOptions as s, TextAreaRenderer as st, cn as t, MessageResponse as tt, useDynamicUI as u, DynamicButtonGroupRenderer as ut, TaskContentProps as v, ConversationContent as vt, TaskTrigger as w, ConversationScrollButtonProps as wt, TaskItemFileProps as x, ConversationEmptyStateProps as xt, TaskItem as y, ConversationContentProps as yt, DrawerContent as z, ToolUIPartApproval as zt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { S as UseDynamicUIReturn, _ as ToolActionSchema, a as AssistantConfig, b as UseAssistantTokenOptions, c as DynamicButton, d as DynamicUITree, f as TokenRequest, g as ToolAction, h as TokenResponseSchema, i as ActionOptionSchema, l as DynamicButtonGroup, m as TokenResponse, n as ActionDefinitionSchema, o as ChatStatus, p as TokenRequestSchema, r as ActionOption, s as CreateAssistantTokenHandlerOptions, t as ActionDefinition, u as DynamicUIElement, v as UseAssistantOptions, x as UseAssistantTokenReturn, y as UseAssistantReturn } from "./types-
|
|
2
|
-
import { $ as MessageContentProps, A as PromptInputFooterProps, At as ConfirmationActions, B as DrawerContentProps, C as TaskProps, Ct as ConversationScrollButton, D as PromptInputButton, Dt as ConfirmationAcceptedProps, E as PromptInput, Et as ConfirmationAccepted, F as PromptInputTextarea, Ft as ConfirmationRequest, G as DrawerPortal, H as DrawerFooter, I as PromptInputTextareaProps, It as ConfirmationRequestProps, J as Collapsible, K as DrawerTitle, L as Drawer, Lt as ConfirmationTitle, M as PromptInputProps, Mt as ConfirmationProps, N as PromptInputSubmit, Nt as ConfirmationRejected, O as PromptInputButtonProps, Ot as ConfirmationAction, P as PromptInputSubmitProps, Pt as ConfirmationRejectedProps, Q as MessageContent, R as DrawerClose, Rt as ConfirmationTitleProps, S as TaskItemProps, St as ConversationProps, T as TaskTriggerProps, Tt as Confirmation, U as DrawerHeader, V as DrawerDescription, W as DrawerOverlay, X as CollapsibleTrigger, Y as CollapsibleContent, Z as Message, _ as TaskContent, _t as Conversation, a as useToolExecution, at as DateFieldRenderer, b as TaskItemFile, bt as ConversationEmptyState, c as useDynamicUIToolExecution, ct as TextFieldRenderer, d as useAssistant, dt as DynamicButtonRenderer, et as MessageProps, f as AssistantContextValue, ft as dynamicUIRegistry, g as Task, gt as DynamicActionModalProps, h as useAssistantContext, ht as DynamicActionModal, i as UseToolExecutionOptions, it as AssistantFormRendererProps, j as PromptInputMessage, jt as ConfirmationActionsProps, k as PromptInputFooter, kt as ConfirmationActionProps, l as UseDynamicUIOptions, lt as defaultFormRegistry, m as AssistantProviderProps, mt as DynamicUIProps, n as AssistantRoot, nt as MessageResponseProps, o as useAssistantToken, ot as FormRenderer, p as AssistantProvider, pt as DynamicUI, q as DrawerTrigger, r as AssistantRootProps, rt as AssistantFormRenderer, s as UseDynamicUIToolExecutionOptions, st as TextAreaRenderer, t as cn, tt as MessageResponse, u as useDynamicUI, ut as DynamicButtonGroupRenderer, v as TaskContentProps, vt as ConversationContent, w as TaskTrigger, wt as ConversationScrollButtonProps, x as TaskItemFileProps, xt as ConversationEmptyStateProps, y as TaskItem, yt as ConversationContentProps, z as DrawerContent, zt as ToolUIPartApproval } from "./index-
|
|
3
|
-
export { ActionDefinition, ActionDefinitionSchema, ActionOption, ActionOptionSchema, AssistantConfig, AssistantContextValue, AssistantFormRenderer, AssistantFormRendererProps, AssistantProvider, AssistantProviderProps, AssistantRoot, AssistantRootProps, ChatStatus, Collapsible, CollapsibleContent, CollapsibleTrigger, Confirmation, ConfirmationAccepted, ConfirmationAcceptedProps, ConfirmationAction, ConfirmationActionProps, ConfirmationActions, ConfirmationActionsProps, ConfirmationProps, ConfirmationRejected, ConfirmationRejectedProps, ConfirmationRequest, ConfirmationRequestProps, ConfirmationTitle, ConfirmationTitleProps, Conversation, ConversationContent, ConversationContentProps, ConversationEmptyState, ConversationEmptyStateProps, ConversationProps, ConversationScrollButton, ConversationScrollButtonProps, CreateAssistantTokenHandlerOptions, DateFieldRenderer, Drawer, DrawerClose, DrawerContent, DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DynamicActionModal, DynamicActionModalProps, DynamicButton, DynamicButtonGroup, DynamicButtonGroupRenderer, DynamicButtonRenderer, DynamicUI, DynamicUIElement, DynamicUIProps, DynamicUITree, FormRenderer, Message, MessageContent, MessageContentProps, MessageProps, MessageResponse, MessageResponseProps, PromptInput, PromptInputButton, PromptInputButtonProps, PromptInputFooter, PromptInputFooterProps, PromptInputMessage, PromptInputProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTextarea, PromptInputTextareaProps, Task, TaskContent, TaskContentProps, TaskItem, TaskItemFile, TaskItemFileProps, TaskItemProps, TaskProps, TaskTrigger, TaskTriggerProps, TextAreaRenderer, TextFieldRenderer, TokenRequest, TokenRequestSchema, TokenResponse, TokenResponseSchema, ToolAction, ToolActionSchema, ToolUIPartApproval, UseAssistantOptions, UseAssistantReturn, UseAssistantTokenOptions, UseAssistantTokenReturn, UseDynamicUIOptions, UseDynamicUIReturn, UseDynamicUIToolExecutionOptions, UseToolExecutionOptions, cn, defaultFormRegistry, dynamicUIRegistry, useAssistant, useAssistantContext, useAssistantToken, useDynamicUI, useDynamicUIToolExecution, useToolExecution };
|
|
1
|
+
import { S as UseDynamicUIReturn, _ as ToolActionSchema, a as AssistantConfig, b as UseAssistantTokenOptions, c as DynamicButton, d as DynamicUITree, f as TokenRequest, g as ToolAction, h as TokenResponseSchema, i as ActionOptionSchema, l as DynamicButtonGroup, m as TokenResponse, n as ActionDefinitionSchema, o as ChatStatus, p as TokenRequestSchema, r as ActionOption, s as CreateAssistantTokenHandlerOptions, t as ActionDefinition, u as DynamicUIElement, v as UseAssistantOptions, x as UseAssistantTokenReturn, y as UseAssistantReturn } from "./types-C7I0JuqF.js";
|
|
2
|
+
import { $ as MessageContentProps, A as PromptInputFooterProps, At as ConfirmationActions, B as DrawerContentProps, Bt as AssistantMessages, C as TaskProps, Ct as ConversationScrollButton, D as PromptInputButton, Dt as ConfirmationAcceptedProps, E as PromptInput, Et as ConfirmationAccepted, F as PromptInputTextarea, Ft as ConfirmationRequest, G as DrawerPortal, H as DrawerFooter, I as PromptInputTextareaProps, It as ConfirmationRequestProps, J as Collapsible, K as DrawerTitle, L as Drawer, Lt as ConfirmationTitle, M as PromptInputProps, Mt as ConfirmationProps, N as PromptInputSubmit, Nt as ConfirmationRejected, O as PromptInputButtonProps, Ot as ConfirmationAction, P as PromptInputSubmitProps, Pt as ConfirmationRejectedProps, Q as MessageContent, R as DrawerClose, Rt as ConfirmationTitleProps, S as TaskItemProps, St as ConversationProps, T as TaskTriggerProps, Tt as Confirmation, U as DrawerHeader, V as DrawerDescription, Vt as AssistantMessagesProps, W as DrawerOverlay, X as CollapsibleTrigger, Y as CollapsibleContent, Z as Message, _ as TaskContent, _t as Conversation, a as useToolExecution, at as DateFieldRenderer, b as TaskItemFile, bt as ConversationEmptyState, c as useDynamicUIToolExecution, ct as TextFieldRenderer, d as useAssistant, dt as DynamicButtonRenderer, et as MessageProps, f as AssistantContextValue, ft as dynamicUIRegistry, g as Task, gt as DynamicActionModalProps, h as useAssistantContext, ht as DynamicActionModal, i as UseToolExecutionOptions, it as AssistantFormRendererProps, j as PromptInputMessage, jt as ConfirmationActionsProps, k as PromptInputFooter, kt as ConfirmationActionProps, l as UseDynamicUIOptions, lt as defaultFormRegistry, m as AssistantProviderProps, mt as DynamicUIProps, n as AssistantRoot, nt as MessageResponseProps, o as useAssistantToken, ot as FormRenderer, p as AssistantProvider, pt as DynamicUI, q as DrawerTrigger, r as AssistantRootProps, rt as AssistantFormRenderer, s as UseDynamicUIToolExecutionOptions, st as TextAreaRenderer, t as cn, tt as MessageResponse, u as useDynamicUI, ut as DynamicButtonGroupRenderer, v as TaskContentProps, vt as ConversationContent, w as TaskTrigger, wt as ConversationScrollButtonProps, x as TaskItemFileProps, xt as ConversationEmptyStateProps, y as TaskItem, yt as ConversationContentProps, z as DrawerContent, zt as ToolUIPartApproval } from "./index-B2dmSvFt.js";
|
|
3
|
+
export { ActionDefinition, ActionDefinitionSchema, ActionOption, ActionOptionSchema, AssistantConfig, AssistantContextValue, AssistantFormRenderer, AssistantFormRendererProps, AssistantMessages, AssistantMessagesProps, AssistantProvider, AssistantProviderProps, AssistantRoot, AssistantRootProps, ChatStatus, Collapsible, CollapsibleContent, CollapsibleTrigger, Confirmation, ConfirmationAccepted, ConfirmationAcceptedProps, ConfirmationAction, ConfirmationActionProps, ConfirmationActions, ConfirmationActionsProps, ConfirmationProps, ConfirmationRejected, ConfirmationRejectedProps, ConfirmationRequest, ConfirmationRequestProps, ConfirmationTitle, ConfirmationTitleProps, Conversation, ConversationContent, ConversationContentProps, ConversationEmptyState, ConversationEmptyStateProps, ConversationProps, ConversationScrollButton, ConversationScrollButtonProps, CreateAssistantTokenHandlerOptions, DateFieldRenderer, Drawer, DrawerClose, DrawerContent, DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DynamicActionModal, DynamicActionModalProps, DynamicButton, DynamicButtonGroup, DynamicButtonGroupRenderer, DynamicButtonRenderer, DynamicUI, DynamicUIElement, DynamicUIProps, DynamicUITree, FormRenderer, Message, MessageContent, MessageContentProps, MessageProps, MessageResponse, MessageResponseProps, PromptInput, PromptInputButton, PromptInputButtonProps, PromptInputFooter, PromptInputFooterProps, PromptInputMessage, PromptInputProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTextarea, PromptInputTextareaProps, Task, TaskContent, TaskContentProps, TaskItem, TaskItemFile, TaskItemFileProps, TaskItemProps, TaskProps, TaskTrigger, TaskTriggerProps, TextAreaRenderer, TextFieldRenderer, TokenRequest, TokenRequestSchema, TokenResponse, TokenResponseSchema, ToolAction, ToolActionSchema, ToolUIPartApproval, UseAssistantOptions, UseAssistantReturn, UseAssistantTokenOptions, UseAssistantTokenReturn, UseDynamicUIOptions, UseDynamicUIReturn, UseDynamicUIToolExecutionOptions, UseToolExecutionOptions, cn, defaultFormRegistry, dynamicUIRegistry, useAssistant, useAssistantContext, useAssistantToken, useDynamicUI, useDynamicUIToolExecution, useToolExecution };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as D,a as O,at as k,b as A,c as j,ct as M,d as N,et as P,f as F,g as I,h as L,i as R,it as z,j as B,k as V,l as H,
|
|
1
|
+
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as D,a as O,at as k,b as A,c as j,ct as M,d as N,et as P,f as F,g as I,h as L,i as R,it as z,j as B,k as V,l as H,lt as U,m as W,n as G,nt as K,o as q,ot as J,p as Y,q as X,r as Z,rt as Q,s as $,st as ee,t as te,tt as ne,u as re,v as ie,w as ae,x as oe,y as se,z as ce}from"./assistant-7f9B_gWg.js";export{k as ActionDefinitionSchema,J as ActionOptionSchema,s as AssistantFormRenderer,m as AssistantMessages,r as AssistantProvider,te as AssistantRoot,ce as Collapsible,n as CollapsibleContent,S as CollapsibleTrigger,E as Confirmation,_ as ConfirmationAccepted,e as ConfirmationAction,P as ConfirmationActions,ne as ConfirmationRejected,K as ConfirmationRequest,Q as ConfirmationTitle,V as Conversation,t as ConversationContent,B as ConversationEmptyState,p as ConversationScrollButton,d as DateFieldRenderer,$ as Drawer,j as DrawerClose,H as DrawerContent,re as DrawerDescription,N as DrawerFooter,F as DrawerHeader,Y as DrawerOverlay,W as DrawerPortal,L as DrawerTitle,I as DrawerTrigger,h as DynamicActionModal,ie as DynamicButtonGroupRenderer,se as DynamicButtonRenderer,D as DynamicUI,X as FormRenderer,c as Message,x as MessageContent,C as MessageResponse,G as PromptInput,Z as PromptInputButton,R as PromptInputFooter,O as PromptInputSubmit,q as PromptInputTextarea,g as Task,o as TaskContent,l as TaskItem,f as TaskItemFile,v as TaskTrigger,u as TextAreaRenderer,T as TextFieldRenderer,ee as TokenRequestSchema,M as TokenResponseSchema,U as ToolActionSchema,z as cn,w as defaultFormRegistry,A as dynamicUIRegistry,b as useAssistant,ae as useAssistantContext,i as useAssistantToken,y as useDynamicUI,oe as useDynamicUIToolExecution,a as useToolExecution};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modifywithai",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/assistant/index.tsx",
|
|
6
6
|
"exports": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"dist",
|
|
16
16
|
"AGENTS.md"
|
|
17
17
|
],
|
|
18
|
+
"sideEffects": false,
|
|
18
19
|
"scripts": {
|
|
19
20
|
"build:css": "bun run scripts/build-shadow-css.ts",
|
|
20
21
|
"build": "bun run build:css && bun run --bun tsdown",
|
|
@@ -24,15 +25,15 @@
|
|
|
24
25
|
"@bosh-code/tsdown-plugin-tailwindcss": "^1.0.1",
|
|
25
26
|
"@tailwindcss/node": "^4.1.18",
|
|
26
27
|
"@tailwindcss/oxide": "^4.1.18",
|
|
27
|
-
"@types/bun": "^1.3.
|
|
28
|
-
"@types/react": "^19.2.
|
|
28
|
+
"@types/bun": "^1.3.8",
|
|
29
|
+
"@types/react": "^19.2.10",
|
|
29
30
|
"@types/react-dom": "^19.2.3",
|
|
30
31
|
"tailwindcss": "^4.1.18",
|
|
31
32
|
"tsdown": "0.20.0",
|
|
32
33
|
"typescript": "^5.9.2"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
35
|
-
"react": "^
|
|
36
|
+
"react": "^19.2.4",
|
|
36
37
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
37
38
|
"next": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
38
39
|
"@remix-run/node": "^2.0.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Children as e,createContext as t,memo as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{clsx as l}from"clsx";import{twMerge as u}from"tailwind-merge";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{JSONUIProvider as m,Renderer as h}from"@json-render/react";import{useChat as g}from"@ai-sdk/react";import{DefaultChatTransport as _,lastAssistantMessageIsCompleteWithApprovalResponses as v}from"ai";import{Streamdown as y}from"streamdown";import*as b from"@radix-ui/react-collapsible";import{Drawer as x}from"vaul-base";import{ChevronDownIcon as S,CornerDownLeftIcon as C,Loader2Icon as ee,SearchIcon as te,SquareIcon as ne,XIcon as re}from"lucide-react";import{createPortal as ie}from"react-dom";import{z as w}from"zod";function T(...e){return u(l(e))}const E=t(null);function D(){let e=i(E);if(!e)throw Error(`Confirmation components must be used within Confirmation`);return e}function ae({className:e,approval:t,state:n,...r}){return!t||n===`input-streaming`||n===`input-available`?null:f(E.Provider,{value:{approval:t,state:n},children:f(`div`,{"data-slot":`confirmation`,"data-state":n,"data-approved":t?.approved,role:`alertdialog`,"aria-labelledby":`confirmation-title`,className:T(`flex flex-col gap-2 rounded-lg border p-4`,`data-[state=approval-requested]:border-amber-500/50 data-[state=approval-requested]:bg-amber-50/50 dark:data-[state=approval-requested]:bg-amber-950/20`,`data-[approved=true]:border-green-500/50 data-[approved=true]:bg-green-50/50 dark:data-[approved=true]:bg-green-950/20`,`data-[approved=false]:border-red-500/50 data-[approved=false]:bg-red-50/50 dark:data-[approved=false]:bg-red-950/20`,e),...r})})}function oe({className:e,...t}){return f(`p`,{id:`confirmation-title`,"data-slot":`confirmation-title`,className:T(`text-sm font-medium`,e),...t})}function se({children:e}){let{state:t}=D();return t===`approval-requested`?f(`div`,{"data-slot":`confirmation-request`,children:e}):null}function ce({children:e}){let{approval:t,state:n}=D();return!t?.approved||n!==`approval-responded`&&n!==`output-denied`&&n!==`output-available`?null:f(`div`,{"data-slot":`confirmation-accepted`,children:e})}function le({children:e}){let{approval:t,state:n}=D();return t?.approved!==!1||n!==`approval-responded`&&n!==`output-denied`&&n!==`output-available`?null:f(`div`,{"data-slot":`confirmation-rejected`,children:e})}function ue({className:e,...t}){let{state:n}=D();return n===`approval-requested`?f(`div`,{"data-slot":`confirmation-actions`,className:T(`flex items-center justify-end gap-2 self-end`,e),...t}):null}function de({className:e,variant:t=`default`,...n}){return f(`button`,{"data-slot":`confirmation-action`,"data-variant":t,type:`button`,className:T(`inline-flex h-8 items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-sm font-medium 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`,t===`default`&&`bg-primary text-primary-foreground shadow hover:bg-primary/90`,t===`outline`&&`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,t===`destructive`&&`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,e),...n})}function fe({className:e,children:t,...n}){return f(`div`,{"data-slot":`conversation`,className:T(`relative flex-1 overflow-y-hidden min-h-0`,e),role:`log`,"aria-label":`Chat messages`,...n,children:t})}function pe({className:e,children:t,...n}){let r=s(null);return a(()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight)},[t]),f(`div`,{ref:r,"data-slot":`conversation-content`,className:T(`flex h-full flex-col gap-8 overflow-y-auto p-4`,e),...n,children:t})}function me({className:e,title:t=`No messages yet`,description:n=`Start a conversation to see messages here`,icon:r,children:i,...a}){return f(`div`,{"data-slot":`conversation-empty-state`,className:T(`flex size-full flex-col items-center justify-center gap-3 p-8 text-center`,e),...a,children:i??p(d,{children:[r&&f(`div`,{className:`text-muted-foreground`,children:r}),p(`div`,{className:`space-y-1`,children:[f(`h3`,{className:`text-sm font-medium`,children:t}),n&&f(`p`,{className:`text-muted-foreground text-sm`,children:n})]})]})})}function he({className:e,...t}){return null}function O({element:e,children:t,onAction:n}){let{id:r=`form`,title:i,submitLabel:a=`Submit`}=e.props??{},o=e=>{e.preventDefault();let t=new FormData(e.currentTarget),i={};t.forEach((e,t)=>{typeof e==`string`&&(i[t]=e)}),n?.({name:`submit`,params:{formId:r,data:i}})};return p(`div`,{"data-slot":`form-card`,className:T(`w-full rounded-lg border bg-card text-card-foreground shadow-sm`),children:[i&&f(`div`,{className:`flex flex-col space-y-1.5 p-4 pb-3`,children:f(`h3`,{className:`text-base font-semibold leading-none tracking-tight`,children:i})}),f(`div`,{className:T(`p-4`,i?``:`pt-4`),children:p(`form`,{onSubmit:o,className:`space-y-4`,children:[t,p(`div`,{className:`flex justify-end gap-2 pt-2`,children:[f(`button`,{type:`button`,className:T(`inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors`,`hover:bg-accent hover:text-accent-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`),onClick:()=>n?.({name:`cancel`,params:{formId:r}}),children:`Cancel`}),f(`button`,{type:`submit`,className:T(`inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors`,`hover:bg-primary/90`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`),children:a})]})]})})]})}function k({element:e}){let{name:t=`field`,label:n=`Field`,placeholder:r,required:i,defaultValue:a}=e.props??{};return p(`div`,{className:`space-y-1.5`,children:[p(`label`,{htmlFor:t,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[n,i&&f(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),f(`input`,{id:t,name:t,type:`text`,placeholder:r,required:i,defaultValue:a,autoComplete:`off`,className:T(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors`,`placeholder:text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}function A({element:e}){let{name:t=`field`,label:n=`Field`,placeholder:r,required:i,defaultValue:a,rows:o=3}=e.props??{};return p(`div`,{className:`space-y-1.5`,children:[p(`label`,{htmlFor:t,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[n,i&&f(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),f(`textarea`,{id:t,name:t,placeholder:r,required:i,defaultValue:a,rows:o,className:T(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors`,`placeholder:text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}function j({element:e}){let{name:t=`date`,label:n=`Date`,required:r,defaultValue:i,min:a,max:o}=e.props??{};return p(`div`,{className:`space-y-1.5`,children:[p(`label`,{htmlFor:t,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[n,r&&f(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),f(`input`,{type:`date`,id:t,name:t,required:r,defaultValue:i,min:a,max:o,className:T(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}const M={Form:O,TextField:k,TextArea:A,DateField:j};function N({ui:e,context:t,onSubmit:n,onCancel:r,registry:i=M}){return f(m,{registry:i,initialData:t,actionHandlers:{submit:({formId:e,data:t})=>{n(e,t)},cancel:({formId:e})=>{r?.(e)}},children:f(h,{tree:e,registry:i})})}function P({button:e,availableActions:t,onExecute:n,onClose:i}){let[o,s]=c(null),[l,u]=c({}),d=r(()=>{if(!e||!t)return!1;for(let n of e.actions){let e=t.find(e=>e.name===n.name);if(e?.options){for(let[t,r]of Object.entries(e.options))if(r.required&&!n.options?.[t])return!0}}return!1},[e,t]),m=r(()=>!e||!t?!1:e.actions.some(e=>t.find(t=>t.name===e.name)?.approvalRequired===!0),[e,t]),h=r(()=>{if(!e||!t)return null;let n=[];for(let r of e.actions){let e=t.find(e=>e.name===r.name);if(e?.options){for(let[t,i]of Object.entries(e.options))if(i.required&&!r.options?.[t]){let e=`${r.name}_${t}`;n.push({key:e,type:(i.type,`TextField`),props:{name:e,label:i.description||t,required:!0}})}}}if(n.length===0)return null;let r={form:{key:`form`,type:`Form`,props:{id:`dynamic-action-${e.id}`,title:e.label,submitLabel:`Continue`},children:n.map(e=>e.key)}};for(let e of n)r[e.key]={key:e.key,type:e.type,props:e.props,parentKey:`form`};return{root:`form`,elements:r}},[e,t]),g=r(r=>{e&&(n(e.actions.map(e=>{let n={...e.options},i=t?.find(t=>t.name===e.name);for(let[t,a]of Object.entries(r)){let r=t.split(`_`),o=r[0],s=r.slice(1).join(`_`);if(o===e.name&&s){let e=i?.options?.[s],t=a;e?.type===`number`?t=Number(a):e?.type===`boolean`&&(t=a===`true`),n[s]=t}}return{...e,options:n}})),i())},[e,t,n,i]);a(()=>{if(!e){s(null),u({});return}if(d()){s(`input`);return}if(m()){s(`approval`);return}n(e.actions),i()},[e,d,m,n,i]);let _=r((e,t)=>{u(t),m()?s(`approval`):g(t)},[m,g]),v=r(()=>{Object.keys(l).length>0?g(l):e&&(n(e.actions),i())},[l,e,n,i,g]);if(!e||o===null)return null;let y=h();return p(ge,{onClose:i,children:[o===`input`&&y&&f(N,{ui:y,onSubmit:_,onCancel:i}),o===`approval`&&f(_e,{button:e,availableActions:t,onApprove:v,onDeny:i})]})}function ge({children:e,onClose:t}){return f(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-8`,onClick:e=>{e.target===e.currentTarget&&t()},children:f(`div`,{className:`max-h-[90vh] w-full max-w-md overflow-auto`,onClick:e=>e.stopPropagation(),children:e})})}function _e({button:e,availableActions:t,onApprove:n,onDeny:r}){return f(`div`,{className:`rounded-lg border bg-card text-card-foreground shadow-sm p-4`,children:p(`div`,{className:`flex flex-col gap-4`,children:[p(`div`,{className:`flex flex-col gap-2`,children:[f(`h3`,{className:`text-lg font-semibold`,children:`Confirm Action`}),f(`p`,{className:`text-sm text-muted-foreground`,children:`This will execute the following actions:`})]}),f(`ul`,{className:`list-inside list-disc space-y-1 text-sm`,children:e.actions.map((e,n)=>{let r=t?.find(t=>t.name===e.name);return p(`li`,{children:[f(`span`,{className:`font-medium`,children:e.name}),r?.description&&p(`span`,{className:`text-muted-foreground`,children:[` `,`- `,r.description]})]},n)})}),p(`div`,{className:`flex justify-end gap-2 pt-2`,children:[f(`button`,{type:`button`,onClick:r,className:T(`inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors`,`hover:bg-accent hover:text-accent-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`),children:`Cancel`}),f(`button`,{type:`button`,onClick:n,className:T(`inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors`,`hover:bg-primary/90`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`),children:`Confirm`})]})]})})}function F({tokenEndpoint:e,endUserId:t,availableActions:n,autoFetch:i=!0,refreshBuffer:o=3e4}){let[l,u]=c(null),[d,f]=c(null),[p,m]=c(!1),[h,g]=c(null),_=s(!0),v=s(n);v.current=n;let y=r(async()=>{if(_.current){m(!0),g(null);try{let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({endUserId:t,availableActions:v.current})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Failed to get token: ${n.status}`)}let r=await n.json();if(!_.current)return;u(r.token),f(r.expiresAt)}catch(e){if(!_.current)return;g(e instanceof Error?e.message:`Failed to get token`),console.error(`Token fetch error:`,e)}finally{_.current&&m(!1)}}},[e,t]);return a(()=>{i&&y()},[i,y]),a(()=>{if(!d)return;let e=d-Date.now()-o;if(e<=0){y();return}let t=setTimeout(y,e);return()=>clearTimeout(t)},[d,o,y]),a(()=>(_.current=!0,()=>{_.current=!1}),[]),{token:l,expiresAt:d,isLoading:p,error:h,fetchToken:y}}function I({messages:e,onAction:t}){let n=s(new Set);a(()=>{if(t){for(let r of e)if(r.role===`assistant`){for(let e of r.parts)if(e.type===`tool-performActions`&&`state`in e&&e.state===`output-available`&&`output`in e){let r=e.toolCallId;if(n.current.has(r))continue;let i=e.output;if(i?.actions)for(let e of i.actions)t(e);n.current.add(r)}}}},[e,t])}function L({tokenEndpoint:e=`/api/mwai/token`,apiUrl:t=`https://api.modifywithai.com`,endUserId:n,availableActions:i,getContext:a,onAction:l,onError:u}){let[d,f]=c(``),{token:p,isLoading:m,error:h,fetchToken:y}=F({tokenEndpoint:e,endUserId:n,availableActions:i,autoFetch:!0}),b=s(a);b.current=a;let x=g({transport:o(()=>p?new _({api:`${t}/api/assistant`,headers:{Authorization:`Bearer ${p}`},body:()=>({context:b.current?.()??{}})}):null,[p,t])??void 0,sendAutomaticallyWhen:v,onError:u});I({messages:x.messages,onAction:l});let S=r(e=>{x.sendMessage(e)},[x]),C=r(e=>{e?.preventDefault(),d.trim()&&(S({text:d}),f(``))},[d,S]);return{messages:x.messages,sendMessage:S,status:x.status,error:x.error??null,input:d,setInput:f,handleSubmit:C,addToolApprovalResponse:x.addToolApprovalResponse,isReady:!!p&&!m,tokenError:h,refreshToken:y}}const R=t(null);function ve({children:e,tokenEndpoint:t,apiUrl:n,endUserId:r,availableActions:i,getContext:a,onAction:s,onError:c}){let l=L({tokenEndpoint:t,apiUrl:n,endUserId:r,availableActions:i,getContext:a,onAction:s,onError:c}),u=o(()=>({tokenEndpoint:t,apiUrl:n,endUserId:r,availableActions:i}),[t,n,r,i]),d=o(()=>({...l,config:u,onAction:s}),[l,u,s]);return f(R.Provider,{value:d,children:e})}function z(){let e=i(R);if(!e)throw Error(`useAssistantContext must be used within an AssistantProvider`);return e}function B(e,t,n){return{key:e,type:`DynamicButton`,props:{...t},parentKey:n}}function V(e,t,n=[],r){return{key:e,type:`DynamicButtonGroup`,props:{...t},children:n,parentKey:r}}function H({storageKey:e}){let[t,n]=c(null),[i,o]=c(!0);return a(()=>{try{let t=localStorage.getItem(e);t&&n(JSON.parse(t))}catch(e){console.error(`Failed to load DynamicUI state:`,e)}finally{o(!1)}},[e]),a(()=>{if(!i)try{t?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}catch(e){console.error(`Failed to save DynamicUI state:`,e)}},[t,e,i]),{tree:t,isLoading:i,addButton:r((e,t)=>{n(n=>{let r=`button-${e.id}`;if(!n){let t=`root-group`;return{root:t,elements:{[t]:V(t,{id:`root`,direction:`horizontal`},[r]),[r]:B(r,e,t)}}}if(n.elements[r])return console.warn(`Button with id "${e.id}" already exists`),n;let i=t?`group-${t}`:n.root,a=n.elements[i];a||console.warn(`Parent "${i}" not found, using root`);let o=a?i:n.root,s=n.elements[o];if(!s)return console.warn(`Parent element "${o}" not found`),n;let c={...n.elements,[o]:{key:s.key,type:s.type,props:s.props,children:[...s.children||[],r],parentKey:s.parentKey},[r]:B(r,e,o)};return{root:n.root,elements:c}})},[]),removeButton:r(e=>{n(t=>{if(!t)return t;let n=`button-${e}`,r=t.elements[n];if(!r)return console.warn(`Button "${e}" not found`),t;let i={};for(let[e,a]of Object.entries(t.elements))e!==n&&(r.parentKey&&e===r.parentKey?i[e]={key:a.key,type:a.type,props:a.props,children:a.children?.filter(e=>e!==n),parentKey:a.parentKey}:i[e]=a);return Object.values(i).some(e=>e.type===`DynamicButton`)?{root:t.root,elements:i}:null})},[]),updateButton:r((e,t)=>{n(n=>{if(!n)return n;let r=`button-${e}`,i=n.elements[r];if(!i||i.type!==`DynamicButton`)return console.warn(`Button "${e}" not found`),n;let a=i.props,o={...n.elements,[r]:{key:i.key,type:i.type,props:{...a,...t},children:i.children,parentKey:i.parentKey}};return{root:n.root,elements:o}})},[]),addGroup:r(e=>{n(t=>{let n=`group-${e.id}`;if(!t)return{root:n,elements:{[n]:V(n,e,[])}};if(t.elements[n])return console.warn(`Group with id "${e.id}" already exists`),t;let r=t.elements[t.root];if(!r)return console.warn(`Root element "${t.root}" not found`),t;let i={...t.elements,[t.root]:{key:r.key,type:r.type,props:r.props,children:[...r.children||[],n],parentKey:r.parentKey},[n]:V(n,e,[],t.root)};return{root:t.root,elements:i}})},[]),removeGroup:r(e=>{n(t=>{if(!t)return t;let n=`group-${e}`,r=t.elements[n];if(!r||r.type!==`DynamicButtonGroup`)return console.warn(`Group "${e}" not found`),t;if(t.root===n)return console.warn(`Cannot remove root group`),t;let i=new Set([n]),a=e=>{let n=t.elements[e];if(n?.children)for(let e of n.children)i.add(e),a(e)};a(n);let o={};for(let[e,a]of Object.entries(t.elements))i.has(e)||(r.parentKey&&e===r.parentKey?o[e]={key:a.key,type:a.type,props:a.props,children:a.children?.filter(e=>e!==n),parentKey:a.parentKey}:o[e]=a);return Object.values(o).some(e=>e.type===`DynamicButton`)?{root:t.root,elements:o}:null})},[]),clearAll:r(()=>{n(null)},[])}}function U({messages:e,dynamicUI:t}){let n=s(new Set);a(()=>{for(let r of e)if(r.role===`assistant`){for(let e of r.parts)if(e.type===`tool-manageDynamicUI`&&`state`in e&&e.state===`output-available`&&`output`in e){let r=e.toolCallId;if(n.current.has(r))continue;let i=e.output;i&&ye(i,t),n.current.add(r)}}},[e,t])}function ye(e,t){let{operation:n,button:r,buttonId:i,updates:a,group:o,groupId:s}=e;switch(n){case`addButton`:if(r){let{parentGroupId:e,...n}=r;t.addButton(n,e)}break;case`removeButton`:i&&t.removeButton(i);break;case`updateButton`:i&&a&&t.updateButton(i,a);break;case`addGroup`:o&&t.addGroup(o);break;case`removeGroup`:s&&t.removeGroup(s);break;case`clearAll`:t.clearAll();break;default:console.warn(`Unknown DynamicUI operation: ${n}`)}}function W({element:e,onAction:t}){let{id:n,label:r,variant:i=`default`,icon:a}=e.props??{},o=()=>{t?.({name:`executeButton`,params:{buttonId:n}})};return p(`button`,{type:`button`,"data-slot":`dynamic-button`,"data-button-id":n,"data-variant":i,onClick:o,className:T(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium 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`,i===`default`&&`bg-primary text-primary-foreground shadow hover:bg-primary/90`,i===`secondary`&&`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,i===`outline`&&`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,i===`ghost`&&`hover:bg-accent hover:text-accent-foreground`,i===`destructive`&&`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`),children:[a&&f(be,{name:a,className:`size-4 shrink-0`}),r]})}function G({element:e,children:t}){let{direction:n=`horizontal`,label:r}=e.props??{};return r?p(`div`,{"data-slot":`dynamic-button-group`,"data-direction":n,className:T(`flex gap-2`,n===`vertical`?`flex-col`:`flex-row flex-wrap`),children:[f(`span`,{className:`text-sm font-medium text-muted-foreground`,children:r}),t]}):f(d,{children:t})}function be({name:e,className:t}){return{plus:p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[f(`path`,{d:`M5 12h14`}),f(`path`,{d:`M12 5v14`})]}),trash:p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[f(`path`,{d:`M3 6h18`}),f(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),f(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`})]}),check:f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:f(`path`,{d:`M20 6 9 17l-5-5`})}),edit:p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[f(`path`,{d:`M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z`}),f(`path`,{d:`m15 5 4 4`})]}),refresh:p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[f(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),f(`path`,{d:`M21 3v5h-5`}),f(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),f(`path`,{d:`M8 16H3v5`})]}),send:p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[f(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),f(`path`,{d:`M22 2 11 13`})]}),list:p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:[f(`line`,{x1:`8`,x2:`21`,y1:`6`,y2:`6`}),f(`line`,{x1:`8`,x2:`21`,y1:`12`,y2:`12`}),f(`line`,{x1:`8`,x2:`21`,y1:`18`,y2:`18`}),f(`line`,{x1:`3`,x2:`3.01`,y1:`6`,y2:`6`}),f(`line`,{x1:`3`,x2:`3.01`,y1:`12`,y2:`12`}),f(`line`,{x1:`3`,x2:`3.01`,y1:`18`,y2:`18`})]}),star:f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:f(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`})}),zap:f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:f(`polygon`,{points:`13 2 3 14 12 14 11 22 21 10 12 10 13 2`})})}[e.toLowerCase()]||null}const K={DynamicButton:W,DynamicButtonGroup:G};function xe(e){return typeof e.id==`string`&&typeof e.label==`string`&&Array.isArray(e.actions)}function Se({className:e}){let{config:t,messages:n,onAction:i}=z(),{endUserId:a,availableActions:o}=t,s=H({storageKey:`mwai-dynamic-ui-${a}`});U({messages:n,dynamicUI:s});let[l,u]=c(null),g=r(e=>{if(i)for(let t of e)i(t)},[i]),_=r(e=>{if(!s.tree)return;let t=`button-${e}`,n=s.tree.elements[t];n&&n.type===`DynamicButton`&&xe(n.props)&&u(n.props)},[s.tree]),v=r(()=>{u(null)},[]);return s.isLoading||!s.tree?null:p(d,{children:[f(`div`,{"data-slot":`dynamic-ui`,className:T(`flex flex-wrap gap-2`,e),children:f(m,{registry:K,actionHandlers:{executeButton:({buttonId:e})=>{_(e)}},children:f(h,{tree:s.tree,registry:K})})}),f(P,{button:l,availableActions:o,onExecute:g,onClose:v})]})}function Ce({className:e,from:t,...n}){return f(`div`,{"data-slot":`message`,"data-from":t,className:T(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant`,e),...n})}function we({children:e,className:t,...n}){return f(`div`,{"data-slot":`message-content`,className:T(`flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg 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`,t),...n,children:e})}const Te=n(function({className:e,...t}){return f(y,{"data-slot":`message-response`,className:T(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),...t})},(e,t)=>e.children===t.children);function q({...e}){return f(b.Root,{"data-slot":`collapsible`,...e})}function J({...e}){return f(b.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...e})}function Y({...e}){return f(b.CollapsibleContent,{"data-slot":`collapsible-content`,...e})}function Ee({...e}){return f(x.Root,{"data-slot":`drawer`,...e})}function De({...e}){return f(x.Trigger,{"data-slot":`drawer-trigger`,...e})}function X({...e}){return f(x.Portal,{"data-slot":`drawer-portal`,...e})}function Oe({...e}){return f(x.Close,{"data-slot":`drawer-close`,...e})}function Z({className:e,...t}){return f(x.Overlay,{"data-slot":`drawer-overlay`,className:T(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50`,e),...t})}function ke({className:e,children:t,overlay:n=!0,...r}){return p(X,{"data-slot":`drawer-portal`,children:[n&&f(Z,{}),p(x.Content,{"data-slot":`drawer-content`,className:T(`bg-background flex h-auto flex-col text-sm`,`data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t`,`data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r`,`data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l`,`data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b`,`data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm`,`group/drawer-content fixed z-50`,e),...r,children:[f(`div`,{className:`bg-muted mx-auto mt-4 hidden h-1 w-24 shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),t]})]})}function Ae({className:e,...t}){return f(`div`,{"data-slot":`drawer-header`,className:T(`flex flex-col gap-0.5 p-4`,`group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center`,`group-data-[vaul-drawer-direction=top]/drawer-content:text-center`,`md:gap-0.5 md:text-left`,e),...t})}function je({className:e,...t}){return f(`div`,{"data-slot":`drawer-footer`,className:T(`mt-auto flex flex-col gap-2 p-4`,e),...t})}function Me({className:e,...t}){return f(x.Title,{"data-slot":`drawer-title`,className:T(`text-foreground text-base font-medium`,e),...t})}function Ne({className:e,...t}){return f(x.Description,{"data-slot":`drawer-description`,className:T(`text-muted-foreground text-sm`,e),...t})}function Pe({className:e,onSubmit:t,children:n,...r}){let i=e=>{e.preventDefault();let n=e.currentTarget,r=new FormData(n).get(`message`)||``;n.reset(),t({text:r},e)};return f(`form`,{"data-slot":`prompt-input`,className:T(`w-full`,e),onSubmit:i,...r,children:f(`div`,{"data-slot":`prompt-input-group`,role:`group`,className:T(`border-input dark:bg-input/30`,`has-[[data-slot=prompt-input-textarea]:focus-visible]:border-ring`,`has-[[data-slot=prompt-input-textarea]:focus-visible]:ring-ring/50`,`has-[[data-slot=prompt-input-textarea]:focus-visible]:ring-[3px]`,`relative flex w-full min-w-0 flex-col overflow-hidden rounded-lg border transition-colors`),children:n})})}function Fe({onChange:e,className:t,placeholder:n=`What would you like to know?`,...r}){let[i,a]=c(!1),o=e=>{if(e.key===`Enter`){if(i||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let t=e.currentTarget.form;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}};return f(`textarea`,{"data-slot":`prompt-input-textarea`,className:T(`field-sizing-content max-h-48 min-h-16`,`flex-1 resize-none rounded-none border-0 bg-transparent px-3 py-2 text-sm shadow-none ring-0 outline-0`,`placeholder:text-muted-foreground`,`focus-visible:ring-0 focus-visible:outline-none`,`disabled:cursor-not-allowed disabled:opacity-50`,t),name:`message`,onChange:e,onCompositionEnd:()=>a(!1),onCompositionStart:()=>a(!0),onKeyDown:o,placeholder:n,...r})}function Ie({className:e,...t}){return f(`div`,{"data-slot":`prompt-input-footer`,className:T(`flex w-full items-center justify-between gap-1 px-2.5 pb-2`,e),...t})}function Le({className:t,type:n=`button`,children:r,...i}){let a=e.count(r)>1;return f(`button`,{"data-slot":`prompt-input-button`,type:n,className:T(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors`,`hover:bg-accent hover:text-accent-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`,a?`h-8 px-3`:`size-8`,t),...i,children:r})}function Re({className:e,status:t,icon:n,children:r,...i}){let a=f(C,{className:`size-4`});return t===`submitted`?a=f(ee,{className:`size-4 animate-spin`}):t===`streaming`?a=f(ne,{className:`size-4`}):t===`error`&&(a=f(re,{className:`size-4`})),f(`button`,{"data-slot":`prompt-input-submit`,type:`submit`,"aria-label":`Send message`,className:T(`inline-flex size-8 items-center justify-center rounded-md text-sm font-medium transition-colors`,`bg-primary text-primary-foreground shadow`,`hover:bg-primary/90`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`,e),...i,children:r??n??a})}function ze({children:e,className:t,...n}){return f(`div`,{"data-slot":`task-item-file`,className:T(`inline-flex items-center gap-1 rounded-md border bg-secondary px-1.5 py-0.5 text-xs text-foreground`,t),...n,children:e})}function Be({children:e,className:t,...n}){return f(`div`,{"data-slot":`task-item`,className:T(`text-sm text-muted-foreground`,t),...n,children:e})}function Ve({defaultOpen:e=!0,className:t,...n}){return f(q,{"data-slot":`task`,className:T(t),defaultOpen:e,...n})}function He({children:e,className:t,title:n,icon:r,...i}){return f(J,{asChild:!0,className:T(`group`,t),...i,children:e??p(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:[r??f(te,{className:`size-4`}),f(`p`,{className:`text-sm`,children:n}),f(S,{className:`size-4 transition-transform group-data-[state=open]:rotate-180`})]})})}function Ue({children:e,className:t,...n}){return f(Y,{"data-slot":`task-content`,className:T(`text-popover-foreground outline-none`,`data-[state=closed]:animate-out data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2`,t),...n,children:f(`div`,{className:`mt-4 space-y-2 border-l-2 border-muted pl-4`,children:e})})}var We=`/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-500:oklch(63.7% .237 25.331);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-500:oklch(72.3% .219 149.579);--color-green-950:oklch(26.6% .065 152.934);--color-black:#000;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--animate-spin:spin 1s linear infinite;--blur-xs:4px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.z-50{z-index:50}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-auto{margin-top:auto}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-auto{margin-left:auto}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.field-sizing-content{field-sizing:content}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-12{width:calc(var(--spacing)*12);height:calc(var(--spacing)*12)}.size-full{width:100%;height:100%}.h-1{height:calc(var(--spacing)*1)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-auto{height:auto}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing)*48)}.max-h-\\[90vh\\]{max-height:90vh}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\\[60px\\]{min-height:60px}.w-24{width:calc(var(--spacing)*24)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[95\\%\\]{max-width:95%}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-input{border-color:var(--input)}.border-muted{border-color:var(--muted)}.bg-background{background-color:var(--background)}.bg-black\\/10{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.bg-black\\/10{background-color:color-mix(in oklab,var(--color-black)10%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-muted{background-color:var(--muted)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.p-4{padding:calc(var(--spacing)*4)}.p-8{padding:calc(var(--spacing)*8)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-4{padding-top:calc(var(--spacing)*4)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pl-4{padding-left:calc(var(--spacing)*4)}.text-center{text-align:center}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.whitespace-nowrap{white-space:nowrap}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-0{outline-style:var(--tw-outline-style);outline-width:0}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.group-data-\\[state\\=open\\]\\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.group-data-\\[vaul-drawer-direction\\=bottom\\]\\/drawer-content\\:block:is(:where(.group\\/drawer-content)[data-vaul-drawer-direction=bottom] *){display:block}.group-data-\\[vaul-drawer-direction\\=bottom\\]\\/drawer-content\\:text-center:is(:where(.group\\/drawer-content)[data-vaul-drawer-direction=bottom] *),.group-data-\\[vaul-drawer-direction\\=top\\]\\/drawer-content\\:text-center:is(:where(.group\\/drawer-content)[data-vaul-drawer-direction=top] *){text-align:center}.group-\\[\\.is-assistant\\]\\:text-foreground:is(:where(.group).is-assistant *){color:var(--foreground)}.group-\\[\\.is-user\\]\\:ml-auto:is(:where(.group).is-user *){margin-left:auto}.group-\\[\\.is-user\\]\\:rounded-lg:is(:where(.group).is-user *){border-radius:var(--radius)}.group-\\[\\.is-user\\]\\:bg-secondary:is(:where(.group).is-user *){background-color:var(--secondary)}.group-\\[\\.is-user\\]\\:px-4:is(:where(.group).is-user *){padding-inline:calc(var(--spacing)*4)}.group-\\[\\.is-user\\]\\:py-3:is(:where(.group).is-user *){padding-block:calc(var(--spacing)*3)}.group-\\[\\.is-user\\]\\:text-foreground:is(:where(.group).is-user *){color:var(--foreground)}.peer-disabled\\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.placeholder\\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\\:bg-secondary\\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\\:text-foreground:hover{color:var(--foreground)}}.focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:var(--ring)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-slot\\=prompt-input-textarea\\]\\:focus-visible\\]\\:border-ring:has([data-slot=prompt-input-textarea]:focus-visible){border-color:var(--ring)}.has-\\[\\[data-slot\\=prompt-input-textarea\\]\\:focus-visible\\]\\:ring-\\[3px\\]:has([data-slot=prompt-input-textarea]:focus-visible){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.has-\\[\\[data-slot\\=prompt-input-textarea\\]\\:focus-visible\\]\\:ring-ring\\/50:has([data-slot=prompt-input-textarea]:focus-visible){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.has-\\[\\[data-slot\\=prompt-input-textarea\\]\\:focus-visible\\]\\:ring-ring\\/50:has([data-slot=prompt-input-textarea]:focus-visible){--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.data-\\[approved\\=false\\]\\:border-red-500\\/50[data-approved=false]{border-color:#fb2c3680}@supports (color:color-mix(in lab, red, red)){.data-\\[approved\\=false\\]\\:border-red-500\\/50[data-approved=false]{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.data-\\[approved\\=false\\]\\:bg-red-50\\/50[data-approved=false]{background-color:#fef2f280}@supports (color:color-mix(in lab, red, red)){.data-\\[approved\\=false\\]\\:bg-red-50\\/50[data-approved=false]{background-color:color-mix(in oklab,var(--color-red-50)50%,transparent)}}.data-\\[approved\\=true\\]\\:border-green-500\\/50[data-approved=true]{border-color:#00c75880}@supports (color:color-mix(in lab, red, red)){.data-\\[approved\\=true\\]\\:border-green-500\\/50[data-approved=true]{border-color:color-mix(in oklab,var(--color-green-500)50%,transparent)}}.data-\\[approved\\=true\\]\\:bg-green-50\\/50[data-approved=true]{background-color:#f0fdf480}@supports (color:color-mix(in lab, red, red)){.data-\\[approved\\=true\\]\\:bg-green-50\\/50[data-approved=true]{background-color:color-mix(in oklab,var(--color-green-50)50%,transparent)}}.data-\\[state\\=approval-requested\\]\\:border-amber-500\\/50[data-state=approval-requested]{border-color:#f99c0080}@supports (color:color-mix(in lab, red, red)){.data-\\[state\\=approval-requested\\]\\:border-amber-500\\/50[data-state=approval-requested]{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.data-\\[state\\=approval-requested\\]\\:bg-amber-50\\/50[data-state=approval-requested]{background-color:#fffbeb80}@supports (color:color-mix(in lab, red, red)){.data-\\[state\\=approval-requested\\]\\:bg-amber-50\\/50[data-state=approval-requested]{background-color:color-mix(in oklab,var(--color-amber-50)50%,transparent)}}.data-\\[vaul-drawer-direction\\=bottom\\]\\:inset-x-0[data-vaul-drawer-direction=bottom]{inset-inline:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=bottom\\]\\:bottom-0[data-vaul-drawer-direction=bottom]{bottom:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=bottom\\]\\:mt-24[data-vaul-drawer-direction=bottom]{margin-top:calc(var(--spacing)*24)}.data-\\[vaul-drawer-direction\\=bottom\\]\\:max-h-\\[80vh\\][data-vaul-drawer-direction=bottom]{max-height:80vh}.data-\\[vaul-drawer-direction\\=bottom\\]\\:rounded-t-xl[data-vaul-drawer-direction=bottom]{border-top-left-radius:calc(var(--radius) + 4px);border-top-right-radius:calc(var(--radius) + 4px)}.data-\\[vaul-drawer-direction\\=bottom\\]\\:border-t[data-vaul-drawer-direction=bottom]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-\\[vaul-drawer-direction\\=left\\]\\:inset-y-0[data-vaul-drawer-direction=left]{inset-block:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=left\\]\\:left-0[data-vaul-drawer-direction=left]{left:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=left\\]\\:w-3\\/4[data-vaul-drawer-direction=left]{width:75%}.data-\\[vaul-drawer-direction\\=left\\]\\:rounded-r-xl[data-vaul-drawer-direction=left]{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.data-\\[vaul-drawer-direction\\=left\\]\\:border-r[data-vaul-drawer-direction=left]{border-right-style:var(--tw-border-style);border-right-width:1px}.data-\\[vaul-drawer-direction\\=right\\]\\:inset-y-0[data-vaul-drawer-direction=right]{inset-block:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=right\\]\\:right-0[data-vaul-drawer-direction=right]{right:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=right\\]\\:w-3\\/4[data-vaul-drawer-direction=right]{width:75%}.data-\\[vaul-drawer-direction\\=right\\]\\:rounded-l-xl[data-vaul-drawer-direction=right]{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.data-\\[vaul-drawer-direction\\=right\\]\\:border-l[data-vaul-drawer-direction=right]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\\[vaul-drawer-direction\\=top\\]\\:inset-x-0[data-vaul-drawer-direction=top]{inset-inline:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=top\\]\\:top-0[data-vaul-drawer-direction=top]{top:calc(var(--spacing)*0)}.data-\\[vaul-drawer-direction\\=top\\]\\:mb-24[data-vaul-drawer-direction=top]{margin-bottom:calc(var(--spacing)*24)}.data-\\[vaul-drawer-direction\\=top\\]\\:max-h-\\[80vh\\][data-vaul-drawer-direction=top]{max-height:80vh}.data-\\[vaul-drawer-direction\\=top\\]\\:rounded-b-xl[data-vaul-drawer-direction=top]{border-bottom-right-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.data-\\[vaul-drawer-direction\\=top\\]\\:border-b[data-vaul-drawer-direction=top]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}@supports ((-webkit-backdrop-filter:var(--tw)) or (backdrop-filter:var(--tw))){.supports-backdrop-filter\\:backdrop-blur-xs{--tw-backdrop-blur:blur(var(--blur-xs));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}}@media (min-width:40rem){.data-\\[vaul-drawer-direction\\=left\\]\\:sm\\:max-w-sm[data-vaul-drawer-direction=left],.data-\\[vaul-drawer-direction\\=right\\]\\:sm\\:max-w-sm[data-vaul-drawer-direction=right]{max-width:var(--container-sm)}}@media (min-width:48rem){.md\\:gap-0\\.5{gap:calc(var(--spacing)*.5)}.md\\:text-left{text-align:left}}.dark\\:bg-input\\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\\:data-\\[approved\\=false\\]\\:bg-red-950\\/20:is(.dark *)[data-approved=false]{background-color:#46080933}@supports (color:color-mix(in lab, red, red)){.dark\\:data-\\[approved\\=false\\]\\:bg-red-950\\/20:is(.dark *)[data-approved=false]{background-color:color-mix(in oklab,var(--color-red-950)20%,transparent)}}.dark\\:data-\\[approved\\=true\\]\\:bg-green-950\\/20:is(.dark *)[data-approved=true]{background-color:#032e1533}@supports (color:color-mix(in lab, red, red)){.dark\\:data-\\[approved\\=true\\]\\:bg-green-950\\/20:is(.dark *)[data-approved=true]{background-color:color-mix(in oklab,var(--color-green-950)20%,transparent)}}.dark\\:data-\\[state\\=approval-requested\\]\\:bg-amber-950\\/20:is(.dark *)[data-state=approval-requested]{background-color:#46190133}@supports (color:color-mix(in lab, red, red)){.dark\\:data-\\[state\\=approval-requested\\]\\:bg-amber-950\\/20:is(.dark *)[data-state=approval-requested]{background-color:color-mix(in oklab,var(--color-amber-950)20%,transparent)}}.\\[\\&\\>\\*\\:first-child\\]\\:mt-0>:first-child{margin-top:calc(var(--spacing)*0)}.\\[\\&\\>\\*\\:last-child\\]\\:mb-0>:last-child{margin-bottom:calc(var(--spacing)*0)}}.assistant-root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background:0 0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;line-height:1.5}.assistant-root.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}`;function Ge({children:e,className:t,theme:n,...r}){let i=s(null),[o,l]=c(null),[u,d]=c(`light`);a(()=>{if(n!==void 0)return;let e=()=>{d(document.documentElement.classList.contains(`dark`)?`dark`:`light`)};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[n]),a(()=>{if(i.current&&!i.current.shadowRoot){let e=i.current.attachShadow({mode:`open`}),t=new CSSStyleSheet;t.replaceSync(We),e.adoptedStyleSheets=[t],l(e)}},[]);let p=n??u;return f(`div`,{ref:i,"data-slot":`assistant-root-host`,className:T(`assistant-root-host`,t),...r,children:o&&ie(f(`div`,{className:T(`assistant-root flex flex-col h-full min-h-0`,p===`dark`&&`dark`),children:e}),o)})}const Q=w.object({type:w.string(),description:w.string().optional(),required:w.boolean().optional()}),$=w.object({name:w.string(),description:w.string(),options:w.record(w.string(),Q).optional(),approvalRequired:w.boolean().optional()}),Ke=w.object({name:w.string(),options:w.record(w.string(),w.unknown()).optional()}),qe=w.object({token:w.string(),expiresAt:w.number()}),Je=w.object({endUserId:w.string(),availableActions:w.array($),context:w.record(w.string(),w.unknown()).optional()});export{me as $,Ce as A,z as B,Z as C,q as D,De as E,W as F,N as G,I as H,K as I,A as J,j as K,U as L,Te as M,Se as N,Y as O,G as P,pe as Q,H as R,Ae as S,Me as T,F as U,L as V,P as W,M as X,k as Y,fe as Z,Ee as _,Ke as a,le as at,Ne as b,Ue as c,T as ct,He as d,he as et,Pe as f,Fe as g,Re as h,qe as i,ue as it,we as j,J as k,Be as l,Ie as m,Q as n,ce as nt,Ge as o,se as ot,Le as p,O as q,Je as r,de as rt,Ve as s,oe as st,$ as t,ae as tt,ze as u,Oe as v,X as w,je as x,ke as y,ve as z};
|