@nswds/app 4.0.4 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { twMerge } from 'tailwind-merge';
5
5
  import { cva } from 'class-variance-authority';
6
6
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
7
7
  import * as React5 from 'react';
8
- import React5__default, { forwardRef, useEffect, createContext, useState, useContext, memo, useRef, Suspense, useMemo, Fragment as Fragment$1, useCallback, useId, useLayoutEffect, Children, useSyncExternalStore } from 'react';
8
+ import React5__default, { forwardRef, useEffect, createContext, useState, useContext, useRef, Suspense, useMemo, Fragment as Fragment$1, useCallback, useId, useLayoutEffect } from 'react';
9
9
  import * as Headless4 from '@headlessui/react';
10
10
  import { PopoverGroup, Popover as Popover$1, PopoverButton, PopoverPanel, Dialog as Dialog$1, DialogPanel } from '@headlessui/react';
11
11
  import Link14 from 'next/link';
@@ -21,7 +21,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
21
21
  import { DropdownMenuTrigger as DropdownMenuTrigger$1 } from '@radix-ui/react-dropdown-menu';
22
22
  import { getDefaultClassNames, DayPicker } from 'react-day-picker';
23
23
  import useEmblaCarousel from 'embla-carousel-react';
24
- import { BrainIcon, ChevronDownIcon, DotIcon, ArrowLeft, ArrowRight, CircleIcon, MinusIcon, Layers, Hash, ChevronLeftIcon, ChevronRightIcon, CheckIcon, CopyIcon, ArrowDownIcon, ExternalLinkIcon, PaperclipIcon, XIcon, ImageIcon, PlusIcon, BookIcon, SearchIcon, WrenchIcon, SendIcon, Loader2Icon, SquareIcon, MessageCircleIcon, XCircleIcon, ClockIcon } from 'lucide-react';
24
+ import { ArrowLeft, ArrowRight, CircleIcon, MinusIcon, Layers, Hash } from 'lucide-react';
25
25
  import * as TooltipPrimitives from '@radix-ui/react-tooltip';
26
26
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
27
27
  import { useTheme, ThemeProvider as ThemeProvider$1 } from 'next-themes';
@@ -62,14 +62,6 @@ import * as ProgressPrimitive from '@radix-ui/react-progress';
62
62
  import { tv } from 'tailwind-variants';
63
63
  import * as ResizablePrimitive from 'react-resizable-panels';
64
64
  import * as SliderPrimitive from '@radix-ui/react-slider';
65
- import { useControllableState } from '@radix-ui/react-use-controllable-state';
66
- import { Prism as Prism$1 } from 'react-syntax-highlighter';
67
- import oneDark from 'react-syntax-highlighter/dist/esm/styles/prism/one-dark';
68
- import oneLight from 'react-syntax-highlighter/dist/esm/styles/prism/one-light';
69
- import { estimateCost } from 'tokenlens';
70
- import { StickToBottom, useStickToBottomContext } from 'use-stick-to-bottom';
71
- import { nanoid } from 'nanoid';
72
- import { Streamdown } from 'streamdown';
73
65
  import { slugifyWithCounter } from '@sindresorhus/slugify';
74
66
  import { create } from 'zustand';
75
67
  import { persist, createJSONStorage } from 'zustand/middleware';
@@ -14437,7 +14429,7 @@ function FormatToggle({ format, setFormat }) {
14437
14429
 
14438
14430
  // package.json
14439
14431
  var package_default = {
14440
- version: "4.0.4"};
14432
+ version: "5.0.0"};
14441
14433
  var SluggerContext = React5__default.createContext(null);
14442
14434
  function flattenText(nodes) {
14443
14435
  if (nodes == null || typeof nodes === "boolean") return "";
@@ -20549,2480 +20541,6 @@ var Tracker = React5__default.forwardRef(
20549
20541
  }
20550
20542
  );
20551
20543
  Tracker.displayName = "Tracker";
20552
- var buttonVariants5 = cva(
20553
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
20554
- {
20555
- variants: {
20556
- variant: {
20557
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
20558
- destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
20559
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
20560
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
20561
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
20562
- link: "text-primary underline-offset-4 hover:underline"
20563
- },
20564
- size: {
20565
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
20566
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
20567
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
20568
- icon: "size-9"
20569
- }
20570
- },
20571
- defaultVariants: {
20572
- variant: "default",
20573
- size: "default"
20574
- }
20575
- }
20576
- );
20577
- function Button7({
20578
- className,
20579
- variant,
20580
- size,
20581
- asChild = false,
20582
- ...props
20583
- }) {
20584
- const Comp = asChild ? Slot : "button";
20585
- return /* @__PURE__ */ jsx(
20586
- Comp,
20587
- {
20588
- "data-slot": "button",
20589
- className: cn(buttonVariants5({ variant, size, className })),
20590
- ...props
20591
- }
20592
- );
20593
- }
20594
- function TooltipProvider2({
20595
- delayDuration = 0,
20596
- ...props
20597
- }) {
20598
- return /* @__PURE__ */ jsx(
20599
- TooltipPrimitives.Provider,
20600
- {
20601
- "data-slot": "tooltip-provider",
20602
- delayDuration,
20603
- ...props
20604
- }
20605
- );
20606
- }
20607
- function Tooltip9({ ...props }) {
20608
- return /* @__PURE__ */ jsx(TooltipProvider2, { children: /* @__PURE__ */ jsx(TooltipPrimitives.Root, { "data-slot": "tooltip", ...props }) });
20609
- }
20610
- function TooltipTrigger2({ ...props }) {
20611
- return /* @__PURE__ */ jsx(TooltipPrimitives.Trigger, { "data-slot": "tooltip-trigger", ...props });
20612
- }
20613
- function TooltipContent2({
20614
- className,
20615
- sideOffset = 0,
20616
- children,
20617
- ...props
20618
- }) {
20619
- return /* @__PURE__ */ jsx(TooltipPrimitives.Portal, { children: /* @__PURE__ */ jsxs(
20620
- TooltipPrimitives.Content,
20621
- {
20622
- "data-slot": "tooltip-content",
20623
- sideOffset,
20624
- className: cn(
20625
- "z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md bg-primary px-3 py-1.5 text-xs text-balance text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
20626
- className
20627
- ),
20628
- ...props,
20629
- children: [
20630
- children,
20631
- /* @__PURE__ */ jsx(TooltipPrimitives.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary" })
20632
- ]
20633
- }
20634
- ) });
20635
- }
20636
- var Actions = ({ className, children, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-1", className), ...props, children });
20637
- var Action2 = ({
20638
- tooltip,
20639
- children,
20640
- label,
20641
- className,
20642
- variant = "ghost",
20643
- size = "sm",
20644
- ...props
20645
- }) => {
20646
- const button = /* @__PURE__ */ jsxs(
20647
- Button7,
20648
- {
20649
- className: cn("relative size-9 p-1.5 text-muted-foreground hover:text-foreground", className),
20650
- size,
20651
- type: "button",
20652
- variant,
20653
- ...props,
20654
- children: [
20655
- children,
20656
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: label || tooltip })
20657
- ]
20658
- }
20659
- );
20660
- if (tooltip) {
20661
- return /* @__PURE__ */ jsx(TooltipProvider2, { children: /* @__PURE__ */ jsxs(Tooltip9, { children: [
20662
- /* @__PURE__ */ jsx(TooltipTrigger2, { asChild: true, children: button }),
20663
- /* @__PURE__ */ jsx(TooltipContent2, { children: /* @__PURE__ */ jsx("p", { children: tooltip }) })
20664
- ] }) });
20665
- }
20666
- return button;
20667
- };
20668
- var Artifact = ({ className, ...props }) => /* @__PURE__ */ jsx(
20669
- "div",
20670
- {
20671
- className: cn(
20672
- "flex flex-col overflow-hidden rounded-sm border bg-background shadow-sm",
20673
- className
20674
- ),
20675
- ...props
20676
- }
20677
- );
20678
- var ArtifactHeader = ({ className, ...props }) => /* @__PURE__ */ jsx(
20679
- "div",
20680
- {
20681
- className: cn("flex items-center justify-between border-b bg-muted/50 px-4 py-3", className),
20682
- ...props
20683
- }
20684
- );
20685
- var ArtifactTitle = ({ className, ...props }) => /* @__PURE__ */ jsx("p", { className: cn("text-sm font-medium text-foreground", className), ...props });
20686
- var ArtifactDescription = ({ className, ...props }) => /* @__PURE__ */ jsx("p", { className: cn("text-sm text-muted-foreground", className), ...props });
20687
- var ArtifactActions = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-1", className), ...props });
20688
- var ArtifactAction = ({
20689
- tooltip,
20690
- label,
20691
- icon: Icon2,
20692
- children,
20693
- className,
20694
- size = "sm",
20695
- variant = "ghost",
20696
- ...props
20697
- }) => {
20698
- const button = /* @__PURE__ */ jsxs(
20699
- Button7,
20700
- {
20701
- className: cn("size-8 p-0 text-muted-foreground hover:text-foreground", className),
20702
- size,
20703
- type: "button",
20704
- variant,
20705
- ...props,
20706
- children: [
20707
- Icon2 ? /* @__PURE__ */ jsx(Icon2, { className: "size-4" }) : children,
20708
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: label || tooltip })
20709
- ]
20710
- }
20711
- );
20712
- if (tooltip) {
20713
- return /* @__PURE__ */ jsx(TooltipProvider2, { children: /* @__PURE__ */ jsxs(Tooltip9, { children: [
20714
- /* @__PURE__ */ jsx(TooltipTrigger2, { asChild: true, children: button }),
20715
- /* @__PURE__ */ jsx(TooltipContent2, { children: /* @__PURE__ */ jsx("p", { children: tooltip }) })
20716
- ] }) });
20717
- }
20718
- return button;
20719
- };
20720
- var ArtifactContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-auto p-4", className), ...props });
20721
- var BranchContext = createContext(null);
20722
- var useBranch = () => {
20723
- const context = useContext(BranchContext);
20724
- if (!context) {
20725
- throw new Error("Branch components must be used within Branch");
20726
- }
20727
- return context;
20728
- };
20729
- var Branch = ({ defaultBranch = 0, onBranchChange, className, ...props }) => {
20730
- const [currentBranch, setCurrentBranch] = useState(defaultBranch);
20731
- const [branches, setBranches] = useState([]);
20732
- const handleBranchChange = (newBranch) => {
20733
- setCurrentBranch(newBranch);
20734
- onBranchChange?.(newBranch);
20735
- };
20736
- const goToPrevious = () => {
20737
- const newBranch = currentBranch > 0 ? currentBranch - 1 : branches.length - 1;
20738
- handleBranchChange(newBranch);
20739
- };
20740
- const goToNext = () => {
20741
- const newBranch = currentBranch < branches.length - 1 ? currentBranch + 1 : 0;
20742
- handleBranchChange(newBranch);
20743
- };
20744
- const contextValue = {
20745
- currentBranch,
20746
- totalBranches: branches.length,
20747
- goToPrevious,
20748
- goToNext,
20749
- branches,
20750
- setBranches
20751
- };
20752
- return /* @__PURE__ */ jsx(BranchContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { className: cn("grid w-full gap-2 [&>div]:pb-0", className), ...props }) });
20753
- };
20754
- var BranchMessages = ({ children, ...props }) => {
20755
- const { currentBranch, setBranches, branches } = useBranch();
20756
- const childrenArray = useMemo(() => Array.isArray(children) ? children : [children], [children]);
20757
- useEffect(() => {
20758
- if (branches.length !== childrenArray.length) {
20759
- setBranches(childrenArray);
20760
- }
20761
- }, [childrenArray, branches, setBranches]);
20762
- return childrenArray.map((branch, index) => /* @__PURE__ */ jsx(
20763
- "div",
20764
- {
20765
- className: cn(
20766
- "grid gap-2 overflow-hidden [&>div]:pb-0",
20767
- index === currentBranch ? "block" : "hidden"
20768
- ),
20769
- ...props,
20770
- children: branch
20771
- },
20772
- branch.key
20773
- ));
20774
- };
20775
- var BranchSelector = ({ className, from, ...props }) => {
20776
- const { totalBranches } = useBranch();
20777
- if (totalBranches <= 1) {
20778
- return null;
20779
- }
20780
- return /* @__PURE__ */ jsx(
20781
- "div",
20782
- {
20783
- className: cn(
20784
- "flex items-center gap-2 self-end px-10",
20785
- from === "assistant" ? "justify-start" : "justify-end",
20786
- className
20787
- ),
20788
- ...props
20789
- }
20790
- );
20791
- };
20792
- var BranchPrevious = ({ className, children, ...props }) => {
20793
- const { goToPrevious, totalBranches } = useBranch();
20794
- return /* @__PURE__ */ jsx(
20795
- Button7,
20796
- {
20797
- "aria-label": "Previous branch",
20798
- className: cn(
20799
- "size-7 shrink-0 rounded-full text-muted-foreground transition-colors",
20800
- "hover:bg-accent hover:text-foreground",
20801
- "disabled:pointer-events-none disabled:opacity-50",
20802
- className
20803
- ),
20804
- disabled: totalBranches <= 1,
20805
- onClick: goToPrevious,
20806
- size: "icon",
20807
- type: "button",
20808
- variant: "ghost",
20809
- ...props,
20810
- children: children ?? /* @__PURE__ */ jsx(ChevronLeftIcon, { size: 14 })
20811
- }
20812
- );
20813
- };
20814
- var BranchNext = ({ className, children, ...props }) => {
20815
- const { goToNext, totalBranches } = useBranch();
20816
- return /* @__PURE__ */ jsx(
20817
- Button7,
20818
- {
20819
- "aria-label": "Next branch",
20820
- className: cn(
20821
- "size-7 shrink-0 rounded-full text-muted-foreground transition-colors",
20822
- "hover:bg-accent hover:text-foreground",
20823
- "disabled:pointer-events-none disabled:opacity-50",
20824
- className
20825
- ),
20826
- disabled: totalBranches <= 1,
20827
- onClick: goToNext,
20828
- size: "icon",
20829
- type: "button",
20830
- variant: "ghost",
20831
- ...props,
20832
- children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, { size: 14 })
20833
- }
20834
- );
20835
- };
20836
- var BranchPage = ({ className, ...props }) => {
20837
- const { currentBranch, totalBranches } = useBranch();
20838
- return /* @__PURE__ */ jsxs(
20839
- "span",
20840
- {
20841
- className: cn("text-xs font-medium text-muted-foreground tabular-nums", className),
20842
- ...props,
20843
- children: [
20844
- currentBranch + 1,
20845
- " of ",
20846
- totalBranches
20847
- ]
20848
- }
20849
- );
20850
- };
20851
- var badgeVariants2 = cva(
20852
- "inline-flex items-center justify-center rounded-sm border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
20853
- {
20854
- variants: {
20855
- variant: {
20856
- default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
20857
- secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
20858
- destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
20859
- outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
20860
- }
20861
- },
20862
- defaultVariants: {
20863
- variant: "default"
20864
- }
20865
- }
20866
- );
20867
- function Badge2({
20868
- className,
20869
- variant,
20870
- asChild = false,
20871
- ...props
20872
- }) {
20873
- const Comp = asChild ? Slot : "span";
20874
- return /* @__PURE__ */ jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants2({ variant }), className), ...props });
20875
- }
20876
- function Collapsible2({ ...props }) {
20877
- return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
20878
- }
20879
- function CollapsibleTrigger4({
20880
- ...props
20881
- }) {
20882
- return /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props });
20883
- }
20884
- function CollapsibleContent4({
20885
- ...props
20886
- }) {
20887
- return /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleContent, { "data-slot": "collapsible-content", ...props });
20888
- }
20889
- var ChainOfThoughtContext = createContext(null);
20890
- var useChainOfThought = () => {
20891
- const context = useContext(ChainOfThoughtContext);
20892
- if (!context) {
20893
- throw new Error("ChainOfThought components must be used within ChainOfThought");
20894
- }
20895
- return context;
20896
- };
20897
- var ChainOfThought = memo(
20898
- ({
20899
- className,
20900
- open,
20901
- defaultOpen = false,
20902
- onOpenChange,
20903
- children,
20904
- ...props
20905
- }) => {
20906
- const [isOpen, setIsOpen] = useControllableState({
20907
- prop: open,
20908
- defaultProp: defaultOpen,
20909
- onChange: onOpenChange
20910
- });
20911
- return /* @__PURE__ */ jsx(ChainOfThoughtContext.Provider, { value: { isOpen, setIsOpen }, children: /* @__PURE__ */ jsx("div", { className: cn("not-prose max-w-prose space-y-4", className), ...props, children }) });
20912
- }
20913
- );
20914
- var ChainOfThoughtHeader = memo(
20915
- ({ className, children, ...props }) => {
20916
- const { isOpen, setIsOpen } = useChainOfThought();
20917
- return /* @__PURE__ */ jsx(Collapsible2, { onOpenChange: setIsOpen, open: isOpen, children: /* @__PURE__ */ jsxs(
20918
- CollapsibleTrigger4,
20919
- {
20920
- className: cn(
20921
- "flex w-full items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground",
20922
- className
20923
- ),
20924
- ...props,
20925
- children: [
20926
- /* @__PURE__ */ jsx(BrainIcon, { className: "size-4" }),
20927
- /* @__PURE__ */ jsx("span", { className: "flex-1 text-left", children: children ?? "Chain of Thought" }),
20928
- /* @__PURE__ */ jsx(
20929
- ChevronDownIcon,
20930
- {
20931
- className: cn("size-4 transition-transform", isOpen ? "rotate-180" : "rotate-0")
20932
- }
20933
- )
20934
- ]
20935
- }
20936
- ) });
20937
- }
20938
- );
20939
- var ChainOfThoughtStep = memo(
20940
- ({
20941
- className,
20942
- icon: Icon2 = DotIcon,
20943
- label,
20944
- description,
20945
- status = "complete",
20946
- children,
20947
- ...props
20948
- }) => {
20949
- const statusStyles = {
20950
- complete: "text-muted-foreground",
20951
- active: "text-foreground",
20952
- pending: "text-muted-foreground/50"
20953
- };
20954
- return /* @__PURE__ */ jsxs(
20955
- "div",
20956
- {
20957
- className: cn(
20958
- "flex gap-2 text-sm",
20959
- statusStyles[status],
20960
- "animate-in fade-in-0 slide-in-from-top-2",
20961
- className
20962
- ),
20963
- ...props,
20964
- children: [
20965
- /* @__PURE__ */ jsxs("div", { className: "relative mt-0.5", children: [
20966
- /* @__PURE__ */ jsx(Icon2, { className: "size-4" }),
20967
- /* @__PURE__ */ jsx("div", { className: "absolute top-7 bottom-0 left-1/2 -mx-px w-px bg-border" })
20968
- ] }),
20969
- /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
20970
- /* @__PURE__ */ jsx("div", { children: label }),
20971
- description && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: description }),
20972
- children
20973
- ] })
20974
- ]
20975
- }
20976
- );
20977
- }
20978
- );
20979
- var ChainOfThoughtSearchResults = memo(
20980
- ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-2", className), ...props })
20981
- );
20982
- var ChainOfThoughtSearchResult = memo(
20983
- ({ className, children, ...props }) => /* @__PURE__ */ jsx(
20984
- Badge2,
20985
- {
20986
- className: cn("gap-1 px-2 py-0.5 text-xs font-normal", className),
20987
- variant: "secondary",
20988
- ...props,
20989
- children
20990
- }
20991
- )
20992
- );
20993
- var ChainOfThoughtContent = memo(
20994
- ({ className, children, ...props }) => {
20995
- const { isOpen } = useChainOfThought();
20996
- return /* @__PURE__ */ jsx(Collapsible2, { open: isOpen, children: /* @__PURE__ */ jsx(
20997
- CollapsibleContent4,
20998
- {
20999
- className: cn(
21000
- "mt-2 space-y-3",
21001
- "text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:animate-in data-[state=open]:slide-in-from-top-2",
21002
- className
21003
- ),
21004
- ...props,
21005
- children
21006
- }
21007
- ) });
21008
- }
21009
- );
21010
- var ChainOfThoughtImage = memo(
21011
- ({ className, children, caption, ...props }) => /* @__PURE__ */ jsxs("div", { className: cn("mt-2 space-y-2", className), ...props, children: [
21012
- /* @__PURE__ */ jsx("div", { className: "relative flex max-h-[22rem] items-center justify-center overflow-hidden rounded-lg bg-muted p-3", children }),
21013
- caption && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: caption })
21014
- ] })
21015
- );
21016
- ChainOfThought.displayName = "ChainOfThought";
21017
- ChainOfThoughtHeader.displayName = "ChainOfThoughtHeader";
21018
- ChainOfThoughtStep.displayName = "ChainOfThoughtStep";
21019
- ChainOfThoughtSearchResults.displayName = "ChainOfThoughtSearchResults";
21020
- ChainOfThoughtSearchResult.displayName = "ChainOfThoughtSearchResult";
21021
- ChainOfThoughtContent.displayName = "ChainOfThoughtContent";
21022
- ChainOfThoughtImage.displayName = "ChainOfThoughtImage";
21023
- var CodeBlockContext = createContext({
21024
- code: ""
21025
- });
21026
- var CodeBlock = ({
21027
- code,
21028
- language,
21029
- showLineNumbers = false,
21030
- className,
21031
- children,
21032
- ...props
21033
- }) => /* @__PURE__ */ jsx(CodeBlockContext.Provider, { value: { code }, children: /* @__PURE__ */ jsx(
21034
- "div",
21035
- {
21036
- className: cn(
21037
- "relative w-full overflow-hidden rounded-sm border bg-background text-foreground",
21038
- className
21039
- ),
21040
- ...props,
21041
- children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
21042
- /* @__PURE__ */ jsx(
21043
- Prism$1,
21044
- {
21045
- className: "overflow-hidden dark:hidden",
21046
- codeTagProps: {
21047
- className: "font-mono text-sm"
21048
- },
21049
- customStyle: {
21050
- margin: 0,
21051
- padding: "1rem",
21052
- fontSize: "0.875rem",
21053
- background: "var(--background)",
21054
- color: "var(--foreground)"
21055
- },
21056
- language,
21057
- lineNumberStyle: {
21058
- color: "var(--muted-foreground)",
21059
- paddingRight: "1rem",
21060
- minWidth: "2.5rem"
21061
- },
21062
- showLineNumbers,
21063
- style: oneLight,
21064
- children: code
21065
- }
21066
- ),
21067
- /* @__PURE__ */ jsx(
21068
- Prism$1,
21069
- {
21070
- className: "hidden overflow-hidden dark:block",
21071
- codeTagProps: {
21072
- className: "font-mono text-sm"
21073
- },
21074
- customStyle: {
21075
- margin: 0,
21076
- padding: "1rem",
21077
- fontSize: "0.875rem",
21078
- background: "var(--background)",
21079
- color: "var(--foreground)"
21080
- },
21081
- language,
21082
- lineNumberStyle: {
21083
- color: "var(--muted-foreground)",
21084
- paddingRight: "1rem",
21085
- minWidth: "2.5rem"
21086
- },
21087
- showLineNumbers,
21088
- style: oneDark,
21089
- children: code
21090
- }
21091
- ),
21092
- children && /* @__PURE__ */ jsx("div", { className: "absolute top-2 right-2 flex items-center gap-2", children })
21093
- ] })
21094
- }
21095
- ) });
21096
- var CodeBlockCopyButton = ({
21097
- onCopy,
21098
- onError,
21099
- timeout = 2e3,
21100
- children,
21101
- className,
21102
- ...props
21103
- }) => {
21104
- const [isCopied, setIsCopied] = useState(false);
21105
- const { code } = useContext(CodeBlockContext);
21106
- const copyToClipboard = async () => {
21107
- if (typeof window === "undefined" || !navigator.clipboard.writeText) {
21108
- onError?.(new Error("Clipboard API not available"));
21109
- return;
21110
- }
21111
- try {
21112
- await navigator.clipboard.writeText(code);
21113
- setIsCopied(true);
21114
- onCopy?.();
21115
- setTimeout(() => setIsCopied(false), timeout);
21116
- } catch (error) {
21117
- onError?.(error);
21118
- }
21119
- };
21120
- const Icon2 = isCopied ? CheckIcon : CopyIcon;
21121
- return /* @__PURE__ */ jsx(
21122
- Button7,
21123
- {
21124
- className: cn("shrink-0", className),
21125
- onClick: copyToClipboard,
21126
- size: "icon",
21127
- variant: "ghost",
21128
- ...props,
21129
- children: children ?? /* @__PURE__ */ jsx(Icon2, { size: 14 })
21130
- }
21131
- );
21132
- };
21133
- function HoverCard2({ ...props }) {
21134
- return /* @__PURE__ */ jsx(HoverCardPrimitive.Root, { "data-slot": "hover-card", ...props });
21135
- }
21136
- function HoverCardTrigger2({ ...props }) {
21137
- return /* @__PURE__ */ jsx(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props });
21138
- }
21139
- function HoverCardContent2({
21140
- className,
21141
- align = "center",
21142
- sideOffset = 4,
21143
- ...props
21144
- }) {
21145
- return /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(
21146
- HoverCardPrimitive.Content,
21147
- {
21148
- "data-slot": "hover-card-content",
21149
- align,
21150
- sideOffset,
21151
- className: cn(
21152
- "z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-sm border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
21153
- className
21154
- ),
21155
- ...props
21156
- }
21157
- ) });
21158
- }
21159
- function Progress2({
21160
- className,
21161
- value,
21162
- ...props
21163
- }) {
21164
- return /* @__PURE__ */ jsx(
21165
- ProgressPrimitive.Root,
21166
- {
21167
- "data-slot": "progress",
21168
- className: cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className),
21169
- ...props,
21170
- children: /* @__PURE__ */ jsx(
21171
- ProgressPrimitive.Indicator,
21172
- {
21173
- "data-slot": "progress-indicator",
21174
- className: "h-full w-full flex-1 bg-primary transition-all",
21175
- style: { transform: `translateX(-${100 - (value || 0)}%)` }
21176
- }
21177
- )
21178
- }
21179
- );
21180
- }
21181
- var PERCENT_MAX = 100;
21182
- var ICON_RADIUS = 10;
21183
- var ICON_VIEWBOX = 24;
21184
- var ICON_CENTER = 12;
21185
- var ICON_STROKE_WIDTH = 2;
21186
- var ContextContext = createContext(null);
21187
- var useContextValue = () => {
21188
- const context = useContext(ContextContext);
21189
- if (!context) {
21190
- throw new Error("Context components must be used within Context");
21191
- }
21192
- return context;
21193
- };
21194
- var Context = ({ usedTokens, maxTokens, usage, modelId, ...props }) => /* @__PURE__ */ jsx(
21195
- ContextContext.Provider,
21196
- {
21197
- value: {
21198
- usedTokens,
21199
- maxTokens,
21200
- usage,
21201
- modelId
21202
- },
21203
- children: /* @__PURE__ */ jsx(HoverCard2, { closeDelay: 0, openDelay: 0, ...props })
21204
- }
21205
- );
21206
- var ContextIcon = () => {
21207
- const { usedTokens, maxTokens } = useContextValue();
21208
- const circumference = 2 * Math.PI * ICON_RADIUS;
21209
- const usedPercent = usedTokens / maxTokens;
21210
- const dashOffset = circumference * (1 - usedPercent);
21211
- return /* @__PURE__ */ jsxs(
21212
- "svg",
21213
- {
21214
- "aria-label": "Model context usage",
21215
- height: "20",
21216
- role: "img",
21217
- style: { color: "currentcolor" },
21218
- viewBox: `0 0 ${ICON_VIEWBOX} ${ICON_VIEWBOX}`,
21219
- width: "20",
21220
- children: [
21221
- /* @__PURE__ */ jsx(
21222
- "circle",
21223
- {
21224
- cx: ICON_CENTER,
21225
- cy: ICON_CENTER,
21226
- fill: "none",
21227
- opacity: "0.25",
21228
- r: ICON_RADIUS,
21229
- stroke: "currentColor",
21230
- strokeWidth: ICON_STROKE_WIDTH
21231
- }
21232
- ),
21233
- /* @__PURE__ */ jsx(
21234
- "circle",
21235
- {
21236
- cx: ICON_CENTER,
21237
- cy: ICON_CENTER,
21238
- fill: "none",
21239
- opacity: "0.7",
21240
- r: ICON_RADIUS,
21241
- stroke: "currentColor",
21242
- strokeDasharray: `${circumference} ${circumference}`,
21243
- strokeDashoffset: dashOffset,
21244
- strokeLinecap: "round",
21245
- strokeWidth: ICON_STROKE_WIDTH,
21246
- style: { transformOrigin: "center", transform: "rotate(-90deg)" }
21247
- }
21248
- )
21249
- ]
21250
- }
21251
- );
21252
- };
21253
- var ContextTrigger = ({ children, ...props }) => {
21254
- const { usedTokens, maxTokens } = useContextValue();
21255
- const usedPercent = usedTokens / maxTokens;
21256
- const renderedPercent = new Intl.NumberFormat("en-US", {
21257
- style: "percent",
21258
- maximumFractionDigits: 1
21259
- }).format(usedPercent);
21260
- return /* @__PURE__ */ jsx(HoverCardTrigger2, { asChild: true, children: children ?? /* @__PURE__ */ jsxs(Button7, { type: "button", variant: "ghost", ...props, children: [
21261
- /* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground", children: renderedPercent }),
21262
- /* @__PURE__ */ jsx(ContextIcon, {})
21263
- ] }) });
21264
- };
21265
- var ContextContent = ({ className, ...props }) => /* @__PURE__ */ jsx(
21266
- HoverCardContent2,
21267
- {
21268
- className: cn("min-w-[240px] divide-y overflow-hidden p-0", className),
21269
- ...props
21270
- }
21271
- );
21272
- var ContextContentHeader = ({ children, className, ...props }) => {
21273
- const { usedTokens, maxTokens } = useContextValue();
21274
- const usedPercent = usedTokens / maxTokens;
21275
- const displayPct = new Intl.NumberFormat("en-US", {
21276
- style: "percent",
21277
- maximumFractionDigits: 1
21278
- }).format(usedPercent);
21279
- const used = new Intl.NumberFormat("en-US", {
21280
- notation: "compact"
21281
- }).format(usedTokens);
21282
- const total = new Intl.NumberFormat("en-US", {
21283
- notation: "compact"
21284
- }).format(maxTokens);
21285
- return /* @__PURE__ */ jsx("div", { className: cn("w-full space-y-2 p-3", className), ...props, children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
21286
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 text-xs", children: [
21287
- /* @__PURE__ */ jsx("p", { children: displayPct }),
21288
- /* @__PURE__ */ jsxs("p", { className: "font-mono text-muted-foreground", children: [
21289
- used,
21290
- " / ",
21291
- total
21292
- ] })
21293
- ] }),
21294
- /* @__PURE__ */ jsx("div", { className: "space-y-2", children: /* @__PURE__ */ jsx(Progress2, { className: "bg-muted", value: usedPercent * PERCENT_MAX }) })
21295
- ] }) });
21296
- };
21297
- var ContextContentBody = ({ children, className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("w-full p-3", className), ...props, children });
21298
- var ContextContentFooter = ({ children, className, ...props }) => {
21299
- const { modelId, usage } = useContextValue();
21300
- const costUSD = modelId ? estimateCost({
21301
- modelId,
21302
- usage: {
21303
- input: usage?.inputTokens ?? 0,
21304
- output: usage?.outputTokens ?? 0
21305
- }
21306
- }).totalUSD : void 0;
21307
- const totalCost = new Intl.NumberFormat("en-US", {
21308
- style: "currency",
21309
- currency: "USD"
21310
- }).format(costUSD ?? 0);
21311
- return /* @__PURE__ */ jsx(
21312
- "div",
21313
- {
21314
- className: cn(
21315
- "flex w-full items-center justify-between gap-3 bg-secondary p-3 text-xs",
21316
- className
21317
- ),
21318
- ...props,
21319
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
21320
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Total cost" }),
21321
- /* @__PURE__ */ jsx("span", { children: totalCost })
21322
- ] })
21323
- }
21324
- );
21325
- };
21326
- var ContextInputUsage = ({ className, children, ...props }) => {
21327
- const { usage, modelId } = useContextValue();
21328
- const inputTokens = usage?.inputTokens ?? 0;
21329
- if (children) {
21330
- return children;
21331
- }
21332
- if (!inputTokens) {
21333
- return null;
21334
- }
21335
- const inputCost = modelId ? estimateCost({
21336
- modelId,
21337
- usage: { input: inputTokens, output: 0 }
21338
- }).totalUSD : void 0;
21339
- const inputCostText = new Intl.NumberFormat("en-US", {
21340
- style: "currency",
21341
- currency: "USD"
21342
- }).format(inputCost ?? 0);
21343
- return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between text-xs", className), ...props, children: [
21344
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Input" }),
21345
- /* @__PURE__ */ jsx(TokensWithCost, { costText: inputCostText, tokens: inputTokens })
21346
- ] });
21347
- };
21348
- var ContextOutputUsage = ({ className, children, ...props }) => {
21349
- const { usage, modelId } = useContextValue();
21350
- const outputTokens = usage?.outputTokens ?? 0;
21351
- if (children) {
21352
- return children;
21353
- }
21354
- if (!outputTokens) {
21355
- return null;
21356
- }
21357
- const outputCost = modelId ? estimateCost({
21358
- modelId,
21359
- usage: { input: 0, output: outputTokens }
21360
- }).totalUSD : void 0;
21361
- const outputCostText = new Intl.NumberFormat("en-US", {
21362
- style: "currency",
21363
- currency: "USD"
21364
- }).format(outputCost ?? 0);
21365
- return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between text-xs", className), ...props, children: [
21366
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Output" }),
21367
- /* @__PURE__ */ jsx(TokensWithCost, { costText: outputCostText, tokens: outputTokens })
21368
- ] });
21369
- };
21370
- var ContextReasoningUsage = ({
21371
- className,
21372
- children,
21373
- ...props
21374
- }) => {
21375
- const { usage, modelId } = useContextValue();
21376
- const reasoningTokens = usage?.outputTokenDetails?.reasoningTokens ?? 0;
21377
- if (children) {
21378
- return children;
21379
- }
21380
- if (!reasoningTokens) {
21381
- return null;
21382
- }
21383
- const reasoningCost = modelId ? estimateCost({
21384
- modelId,
21385
- usage: { reasoningTokens }
21386
- }).totalUSD : void 0;
21387
- const reasoningCostText = new Intl.NumberFormat("en-US", {
21388
- style: "currency",
21389
- currency: "USD"
21390
- }).format(reasoningCost ?? 0);
21391
- return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between text-xs", className), ...props, children: [
21392
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Reasoning" }),
21393
- /* @__PURE__ */ jsx(TokensWithCost, { costText: reasoningCostText, tokens: reasoningTokens })
21394
- ] });
21395
- };
21396
- var ContextCacheUsage = ({ className, children, ...props }) => {
21397
- const { usage, modelId } = useContextValue();
21398
- const cacheTokens = usage?.inputTokenDetails?.cacheReadTokens ?? 0;
21399
- if (children) {
21400
- return children;
21401
- }
21402
- if (!cacheTokens) {
21403
- return null;
21404
- }
21405
- const cacheCost = modelId ? estimateCost({
21406
- modelId,
21407
- usage: { cacheReads: cacheTokens, input: 0, output: 0 }
21408
- }).totalUSD : void 0;
21409
- const cacheCostText = new Intl.NumberFormat("en-US", {
21410
- style: "currency",
21411
- currency: "USD"
21412
- }).format(cacheCost ?? 0);
21413
- return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between text-xs", className), ...props, children: [
21414
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Cache" }),
21415
- /* @__PURE__ */ jsx(TokensWithCost, { costText: cacheCostText, tokens: cacheTokens })
21416
- ] });
21417
- };
21418
- var TokensWithCost = ({ tokens, costText }) => /* @__PURE__ */ jsxs("span", { children: [
21419
- tokens === void 0 ? "\u2014" : new Intl.NumberFormat("en-US", {
21420
- notation: "compact"
21421
- }).format(tokens),
21422
- costText ? /* @__PURE__ */ jsxs("span", { className: "ml-2 text-muted-foreground", children: [
21423
- "\u2022 ",
21424
- costText
21425
- ] }) : null
21426
- ] });
21427
- var Conversation = ({ className, ...props }) => /* @__PURE__ */ jsx(
21428
- StickToBottom,
21429
- {
21430
- className: cn("relative flex-1 overflow-y-auto", className),
21431
- initial: "smooth",
21432
- resize: "smooth",
21433
- role: "log",
21434
- ...props
21435
- }
21436
- );
21437
- var ConversationContent = ({ className, ...props }) => /* @__PURE__ */ jsx(StickToBottom.Content, { className: cn("p-4", className), ...props });
21438
- var ConversationEmptyState = ({
21439
- className,
21440
- title = "No messages yet",
21441
- description = "Start a conversation to see messages here",
21442
- icon,
21443
- children,
21444
- ...props
21445
- }) => /* @__PURE__ */ jsx(
21446
- "div",
21447
- {
21448
- className: cn(
21449
- "flex size-full flex-col items-center justify-center gap-3 p-8 text-center",
21450
- className
21451
- ),
21452
- ...props,
21453
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
21454
- icon && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: icon }),
21455
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
21456
- /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium", children: title }),
21457
- description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description })
21458
- ] })
21459
- ] })
21460
- }
21461
- );
21462
- var ConversationScrollButton = ({
21463
- className,
21464
- ...props
21465
- }) => {
21466
- const { isAtBottom, scrollToBottom } = useStickToBottomContext();
21467
- const handleScrollToBottom = useCallback(() => {
21468
- scrollToBottom();
21469
- }, [scrollToBottom]);
21470
- return !isAtBottom && /* @__PURE__ */ jsx(
21471
- Button7,
21472
- {
21473
- className: cn("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full", className),
21474
- onClick: handleScrollToBottom,
21475
- size: "icon",
21476
- type: "button",
21477
- variant: "outline",
21478
- ...props,
21479
- children: /* @__PURE__ */ jsx(ArrowDownIcon, { className: "size-4" })
21480
- }
21481
- );
21482
- };
21483
- var Image4 = ({ base64, uint8Array, mediaType, ...props }) => (/* @__PURE__ */ jsx(
21484
- "img",
21485
- {
21486
- ...props,
21487
- alt: props.alt,
21488
- className: cn("h-auto max-w-full overflow-hidden rounded-md", props.className),
21489
- src: `data:${mediaType};base64,${base64}`
21490
- }
21491
- ));
21492
- var CarouselContext2 = React5.createContext(null);
21493
- function useCarousel2() {
21494
- const context = React5.useContext(CarouselContext2);
21495
- if (!context) {
21496
- throw new Error("useCarousel must be used within a <Carousel />");
21497
- }
21498
- return context;
21499
- }
21500
- function Carousel2({
21501
- orientation = "horizontal",
21502
- opts,
21503
- setApi,
21504
- plugins,
21505
- className,
21506
- children,
21507
- ...props
21508
- }) {
21509
- const [carouselRef, api] = useEmblaCarousel(
21510
- {
21511
- ...opts,
21512
- axis: orientation === "horizontal" ? "x" : "y"
21513
- },
21514
- plugins
21515
- );
21516
- const [canScrollPrev, setCanScrollPrev] = React5.useState(false);
21517
- const [canScrollNext, setCanScrollNext] = React5.useState(false);
21518
- const onSelect = React5.useCallback((api2) => {
21519
- if (!api2) return;
21520
- setCanScrollPrev(api2.canScrollPrev());
21521
- setCanScrollNext(api2.canScrollNext());
21522
- }, []);
21523
- const scrollPrev = React5.useCallback(() => {
21524
- api?.scrollPrev();
21525
- }, [api]);
21526
- const scrollNext = React5.useCallback(() => {
21527
- api?.scrollNext();
21528
- }, [api]);
21529
- const handleKeyDown = React5.useCallback(
21530
- (event) => {
21531
- if (event.key === "ArrowLeft") {
21532
- event.preventDefault();
21533
- scrollPrev();
21534
- } else if (event.key === "ArrowRight") {
21535
- event.preventDefault();
21536
- scrollNext();
21537
- }
21538
- },
21539
- [scrollPrev, scrollNext]
21540
- );
21541
- React5.useEffect(() => {
21542
- if (!api || !setApi) return;
21543
- setApi(api);
21544
- }, [api, setApi]);
21545
- React5.useEffect(() => {
21546
- if (!api) return;
21547
- onSelect(api);
21548
- api.on("reInit", onSelect);
21549
- api.on("select", onSelect);
21550
- return () => {
21551
- api?.off("select", onSelect);
21552
- };
21553
- }, [api, onSelect]);
21554
- return /* @__PURE__ */ jsx(
21555
- CarouselContext2.Provider,
21556
- {
21557
- value: {
21558
- carouselRef,
21559
- api,
21560
- opts,
21561
- orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
21562
- scrollPrev,
21563
- scrollNext,
21564
- canScrollPrev,
21565
- canScrollNext
21566
- },
21567
- children: /* @__PURE__ */ jsx(
21568
- "div",
21569
- {
21570
- onKeyDownCapture: handleKeyDown,
21571
- className: cn("relative", className),
21572
- role: "region",
21573
- "aria-roledescription": "carousel",
21574
- "data-slot": "carousel",
21575
- ...props,
21576
- children
21577
- }
21578
- )
21579
- }
21580
- );
21581
- }
21582
- function CarouselContent2({ className, ...props }) {
21583
- const { carouselRef, orientation } = useCarousel2();
21584
- return /* @__PURE__ */ jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: /* @__PURE__ */ jsx(
21585
- "div",
21586
- {
21587
- className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
21588
- ...props
21589
- }
21590
- ) });
21591
- }
21592
- function CarouselItem2({ className, ...props }) {
21593
- const { orientation } = useCarousel2();
21594
- return /* @__PURE__ */ jsx(
21595
- "div",
21596
- {
21597
- role: "group",
21598
- "aria-roledescription": "slide",
21599
- "data-slot": "carousel-item",
21600
- className: cn(
21601
- "min-w-0 shrink-0 grow-0 basis-full",
21602
- orientation === "horizontal" ? "pl-4" : "pt-4",
21603
- className
21604
- ),
21605
- ...props
21606
- }
21607
- );
21608
- }
21609
- var InlineCitation = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { className: cn("group inline items-center gap-1", className), ...props });
21610
- var InlineCitationText = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { className: cn("transition-colors group-hover:bg-accent", className), ...props });
21611
- var InlineCitationCard = (props) => /* @__PURE__ */ jsx(HoverCard2, { closeDelay: 0, openDelay: 0, ...props });
21612
- var InlineCitationCardTrigger = ({
21613
- sources,
21614
- className,
21615
- ...props
21616
- }) => /* @__PURE__ */ jsx(HoverCardTrigger2, { asChild: true, children: /* @__PURE__ */ jsx(Badge2, { className: cn("ml-1 rounded-full", className), variant: "secondary", ...props, children: sources.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
21617
- new URL(sources[0]).hostname,
21618
- " ",
21619
- sources.length > 1 && `+${sources.length - 1}`
21620
- ] }) : "unknown" }) });
21621
- var InlineCitationCardBody = ({ className, ...props }) => /* @__PURE__ */ jsx(HoverCardContent2, { className: cn("relative w-80 p-0", className), ...props });
21622
- var CarouselApiContext = createContext(void 0);
21623
- var useCarouselApi = () => {
21624
- const context = useContext(CarouselApiContext);
21625
- return context;
21626
- };
21627
- var InlineCitationCarousel = ({
21628
- className,
21629
- children,
21630
- ...props
21631
- }) => {
21632
- const [api, setApi] = useState();
21633
- return /* @__PURE__ */ jsx(CarouselApiContext.Provider, { value: api, children: /* @__PURE__ */ jsx(Carousel2, { className: cn("w-full", className), setApi, ...props, children }) });
21634
- };
21635
- var InlineCitationCarouselContent = (props) => /* @__PURE__ */ jsx(CarouselContent2, { ...props });
21636
- var InlineCitationCarouselItem = ({
21637
- className,
21638
- ...props
21639
- }) => /* @__PURE__ */ jsx(CarouselItem2, { className: cn("w-full space-y-2 p-4 pl-8", className), ...props });
21640
- var InlineCitationCarouselHeader = ({
21641
- className,
21642
- ...props
21643
- }) => /* @__PURE__ */ jsx(
21644
- "div",
21645
- {
21646
- className: cn(
21647
- "flex items-center justify-between gap-2 rounded-t-md bg-secondary p-2",
21648
- className
21649
- ),
21650
- ...props
21651
- }
21652
- );
21653
- var useCarouselIndex = () => {
21654
- const api = useCarouselApi();
21655
- const subscribe = useCallback(
21656
- (callback) => {
21657
- if (!api) {
21658
- return () => {
21659
- };
21660
- }
21661
- api.on("select", callback);
21662
- api.on("reInit", callback);
21663
- return () => {
21664
- api.off("select", callback);
21665
- api.off("reInit", callback);
21666
- };
21667
- },
21668
- [api]
21669
- );
21670
- const getSnapshot = useCallback(() => {
21671
- if (!api) {
21672
- return { current: 0, count: 0 };
21673
- }
21674
- return {
21675
- current: api.selectedScrollSnap() + 1,
21676
- count: api.scrollSnapList().length
21677
- };
21678
- }, [api]);
21679
- const { current, count } = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
21680
- return { current, count };
21681
- };
21682
- var InlineCitationCarouselIndex = ({
21683
- children,
21684
- className,
21685
- ...props
21686
- }) => {
21687
- const { current, count } = useCarouselIndex();
21688
- return /* @__PURE__ */ jsx(
21689
- "div",
21690
- {
21691
- className: cn(
21692
- "flex flex-1 items-center justify-end px-3 py-1 text-xs text-muted-foreground",
21693
- className
21694
- ),
21695
- ...props,
21696
- children: children ?? `${current}/${count}`
21697
- }
21698
- );
21699
- };
21700
- var InlineCitationSource = ({
21701
- title,
21702
- url,
21703
- description,
21704
- className,
21705
- children,
21706
- ...props
21707
- }) => /* @__PURE__ */ jsxs("div", { className: cn("space-y-1", className), ...props, children: [
21708
- title && /* @__PURE__ */ jsx("h4", { className: "truncate text-sm leading-tight font-medium", children: title }),
21709
- url && /* @__PURE__ */ jsx("p", { className: "truncate text-xs break-all text-muted-foreground", children: url }),
21710
- description && /* @__PURE__ */ jsx("p", { className: "line-clamp-3 text-sm leading-relaxed text-muted-foreground", children: description }),
21711
- children
21712
- ] });
21713
- var LoaderIcon = ({ size = 16 }) => /* @__PURE__ */ jsxs(
21714
- "svg",
21715
- {
21716
- height: size,
21717
- strokeLinejoin: "round",
21718
- style: { color: "currentcolor" },
21719
- viewBox: "0 0 16 16",
21720
- width: size,
21721
- children: [
21722
- /* @__PURE__ */ jsx("title", { children: "Loader" }),
21723
- /* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_2393_1490)", children: [
21724
- /* @__PURE__ */ jsx("path", { d: "M8 0V4", stroke: "currentColor", strokeWidth: "1.5" }),
21725
- /* @__PURE__ */ jsx("path", { d: "M8 16V12", opacity: "0.5", stroke: "currentColor", strokeWidth: "1.5" }),
21726
- /* @__PURE__ */ jsx(
21727
- "path",
21728
- {
21729
- d: "M3.29773 1.52783L5.64887 4.7639",
21730
- opacity: "0.9",
21731
- stroke: "currentColor",
21732
- strokeWidth: "1.5"
21733
- }
21734
- ),
21735
- /* @__PURE__ */ jsx(
21736
- "path",
21737
- {
21738
- d: "M12.7023 1.52783L10.3511 4.7639",
21739
- opacity: "0.1",
21740
- stroke: "currentColor",
21741
- strokeWidth: "1.5"
21742
- }
21743
- ),
21744
- /* @__PURE__ */ jsx(
21745
- "path",
21746
- {
21747
- d: "M12.7023 14.472L10.3511 11.236",
21748
- opacity: "0.4",
21749
- stroke: "currentColor",
21750
- strokeWidth: "1.5"
21751
- }
21752
- ),
21753
- /* @__PURE__ */ jsx(
21754
- "path",
21755
- {
21756
- d: "M3.29773 14.472L5.64887 11.236",
21757
- opacity: "0.6",
21758
- stroke: "currentColor",
21759
- strokeWidth: "1.5"
21760
- }
21761
- ),
21762
- /* @__PURE__ */ jsx(
21763
- "path",
21764
- {
21765
- d: "M15.6085 5.52783L11.8043 6.7639",
21766
- opacity: "0.2",
21767
- stroke: "currentColor",
21768
- strokeWidth: "1.5"
21769
- }
21770
- ),
21771
- /* @__PURE__ */ jsx(
21772
- "path",
21773
- {
21774
- d: "M0.391602 10.472L4.19583 9.23598",
21775
- opacity: "0.7",
21776
- stroke: "currentColor",
21777
- strokeWidth: "1.5"
21778
- }
21779
- ),
21780
- /* @__PURE__ */ jsx(
21781
- "path",
21782
- {
21783
- d: "M15.6085 10.4722L11.8043 9.2361",
21784
- opacity: "0.3",
21785
- stroke: "currentColor",
21786
- strokeWidth: "1.5"
21787
- }
21788
- ),
21789
- /* @__PURE__ */ jsx(
21790
- "path",
21791
- {
21792
- d: "M0.391602 5.52783L4.19583 6.7639",
21793
- opacity: "0.8",
21794
- stroke: "currentColor",
21795
- strokeWidth: "1.5"
21796
- }
21797
- )
21798
- ] }),
21799
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_2393_1490", children: /* @__PURE__ */ jsx("rect", { fill: "white", height: "16", width: "16" }) }) })
21800
- ]
21801
- }
21802
- );
21803
- var Loader = ({ className, size = 16, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("inline-flex animate-spin items-center justify-center", className), ...props, children: /* @__PURE__ */ jsx(LoaderIcon, { size }) });
21804
- var Message = ({ className, from, ...props }) => /* @__PURE__ */ jsx(
21805
- "div",
21806
- {
21807
- className: cn(
21808
- "group flex w-full items-end justify-end gap-2 py-4",
21809
- from === "user" ? "is-user" : "is-assistant flex-row-reverse justify-end",
21810
- className
21811
- ),
21812
- ...props
21813
- }
21814
- );
21815
- var messageContentVariants = cva(
21816
- "is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",
21817
- {
21818
- variants: {
21819
- variant: {
21820
- contained: [
21821
- "max-w-[80%] px-4 py-3",
21822
- "group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground",
21823
- "group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"
21824
- ],
21825
- flat: [
21826
- "group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground",
21827
- "group-[.is-assistant]:text-foreground"
21828
- ]
21829
- }
21830
- },
21831
- defaultVariants: {
21832
- variant: "contained"
21833
- }
21834
- }
21835
- );
21836
- var MessageContent = ({ children, className, variant, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(messageContentVariants({ variant, className })), ...props, children });
21837
- function DropdownMenu2({ ...props }) {
21838
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
21839
- }
21840
- function DropdownMenuTrigger3({
21841
- ...props
21842
- }) {
21843
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
21844
- }
21845
- function DropdownMenuContent2({
21846
- className,
21847
- sideOffset = 4,
21848
- ...props
21849
- }) {
21850
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
21851
- DropdownMenuPrimitive.Content,
21852
- {
21853
- "data-slot": "dropdown-menu-content",
21854
- sideOffset,
21855
- className: cn(
21856
- "z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-sm border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
21857
- className
21858
- ),
21859
- ...props
21860
- }
21861
- ) });
21862
- }
21863
- function DropdownMenuItem2({
21864
- className,
21865
- inset,
21866
- variant = "default",
21867
- ...props
21868
- }) {
21869
- return /* @__PURE__ */ jsx(
21870
- DropdownMenuPrimitive.Item,
21871
- {
21872
- "data-slot": "dropdown-menu-item",
21873
- "data-inset": inset,
21874
- "data-variant": variant,
21875
- className: cn(
21876
- "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:!text-destructive",
21877
- className
21878
- ),
21879
- ...props
21880
- }
21881
- );
21882
- }
21883
- var providers = {
21884
- scira: {
21885
- title: "Open in Scira",
21886
- createUrl: (q) => `https://scira.ai/?${new URLSearchParams({
21887
- q
21888
- })}`,
21889
- icon: /* @__PURE__ */ jsxs(
21890
- "svg",
21891
- {
21892
- fill: "none",
21893
- height: "934",
21894
- viewBox: "0 0 910 934",
21895
- width: "910",
21896
- xmlns: "http://www.w3.org/2000/svg",
21897
- children: [
21898
- /* @__PURE__ */ jsx("title", { children: "Scira AI" }),
21899
- /* @__PURE__ */ jsx(
21900
- "path",
21901
- {
21902
- d: "M647.664 197.775C569.13 189.049 525.5 145.419 516.774 66.8849C508.048 145.419 464.418 189.049 385.884 197.775C464.418 206.501 508.048 250.131 516.774 328.665C525.5 250.131 569.13 206.501 647.664 197.775Z",
21903
- fill: "currentColor",
21904
- stroke: "currentColor",
21905
- strokeLinejoin: "round",
21906
- strokeWidth: "8"
21907
- }
21908
- ),
21909
- /* @__PURE__ */ jsx(
21910
- "path",
21911
- {
21912
- d: "M516.774 304.217C510.299 275.491 498.208 252.087 480.335 234.214C462.462 216.341 439.058 204.251 410.333 197.775C439.059 191.3 462.462 179.209 480.335 161.336C498.208 143.463 510.299 120.06 516.774 91.334C523.25 120.059 535.34 143.463 553.213 161.336C571.086 179.209 594.49 191.3 623.216 197.775C594.49 204.251 571.086 216.341 553.213 234.214C535.34 252.087 523.25 275.491 516.774 304.217Z",
21913
- fill: "currentColor",
21914
- stroke: "currentColor",
21915
- strokeLinejoin: "round",
21916
- strokeWidth: "8"
21917
- }
21918
- ),
21919
- /* @__PURE__ */ jsx(
21920
- "path",
21921
- {
21922
- d: "M857.5 508.116C763.259 497.644 710.903 445.288 700.432 351.047C689.961 445.288 637.605 497.644 543.364 508.116C637.605 518.587 689.961 570.943 700.432 665.184C710.903 570.943 763.259 518.587 857.5 508.116Z",
21923
- stroke: "currentColor",
21924
- strokeLinejoin: "round",
21925
- strokeWidth: "20"
21926
- }
21927
- ),
21928
- /* @__PURE__ */ jsx(
21929
- "path",
21930
- {
21931
- d: "M700.432 615.957C691.848 589.05 678.575 566.357 660.383 548.165C642.191 529.973 619.499 516.7 592.593 508.116C619.499 499.533 642.191 486.258 660.383 468.066C678.575 449.874 691.848 427.181 700.432 400.274C709.015 427.181 722.289 449.874 740.481 468.066C758.673 486.258 781.365 499.533 808.271 508.116C781.365 516.7 758.673 529.973 740.481 548.165C722.289 566.357 709.015 589.05 700.432 615.957Z",
21932
- stroke: "currentColor",
21933
- strokeLinejoin: "round",
21934
- strokeWidth: "20"
21935
- }
21936
- ),
21937
- /* @__PURE__ */ jsx(
21938
- "path",
21939
- {
21940
- d: "M889.949 121.237C831.049 114.692 798.326 81.9698 791.782 23.0692C785.237 81.9698 752.515 114.692 693.614 121.237C752.515 127.781 785.237 160.504 791.782 219.404C798.326 160.504 831.049 127.781 889.949 121.237Z",
21941
- fill: "currentColor",
21942
- stroke: "currentColor",
21943
- strokeLinejoin: "round",
21944
- strokeWidth: "8"
21945
- }
21946
- ),
21947
- /* @__PURE__ */ jsx(
21948
- "path",
21949
- {
21950
- d: "M791.782 196.795C786.697 176.937 777.869 160.567 765.16 147.858C752.452 135.15 736.082 126.322 716.226 121.237C736.082 116.152 752.452 107.324 765.16 94.6152C777.869 81.9065 786.697 65.5368 791.782 45.6797C796.867 65.5367 805.695 81.9066 818.403 94.6152C831.112 107.324 847.481 116.152 867.338 121.237C847.481 126.322 831.112 135.15 818.403 147.858C805.694 160.567 796.867 176.937 791.782 196.795Z",
21951
- fill: "currentColor",
21952
- stroke: "currentColor",
21953
- strokeLinejoin: "round",
21954
- strokeWidth: "8"
21955
- }
21956
- ),
21957
- /* @__PURE__ */ jsx(
21958
- "path",
21959
- {
21960
- d: "M760.632 764.337C720.719 814.616 669.835 855.1 611.872 882.692C553.91 910.285 490.404 924.255 426.213 923.533C362.022 922.812 298.846 907.419 241.518 878.531C184.19 849.643 134.228 808.026 95.4548 756.863C56.6815 705.7 30.1238 646.346 17.8129 583.343C5.50207 520.339 7.76433 455.354 24.4266 393.359C41.089 331.364 71.7099 274.001 113.947 225.658C156.184 177.315 208.919 139.273 268.117 114.442",
21961
- stroke: "currentColor",
21962
- strokeLinecap: "round",
21963
- strokeLinejoin: "round",
21964
- strokeWidth: "30"
21965
- }
21966
- )
21967
- ]
21968
- }
21969
- )
21970
- },
21971
- chatgpt: {
21972
- title: "Open in ChatGPT",
21973
- createUrl: (q) => `https://chatgpt.com/?${new URLSearchParams({
21974
- hints: "search",
21975
- q
21976
- })}`,
21977
- icon: /* @__PURE__ */ jsxs("svg", { fill: "currentColor", role: "img", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [
21978
- /* @__PURE__ */ jsx("title", { children: "OpenAI" }),
21979
- /* @__PURE__ */ jsx("path", { d: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" })
21980
- ] })
21981
- },
21982
- claude: {
21983
- title: "Open in Claude",
21984
- createUrl: (q) => `https://claude.ai/new?${new URLSearchParams({
21985
- q
21986
- })}`,
21987
- icon: /* @__PURE__ */ jsxs("svg", { fill: "currentColor", role: "img", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [
21988
- /* @__PURE__ */ jsx("title", { children: "Anthropic" }),
21989
- /* @__PURE__ */ jsx("path", { d: "M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z" })
21990
- ] })
21991
- },
21992
- t3: {
21993
- title: "Open in T3 Chat",
21994
- createUrl: (q) => `https://t3.chat/new?${new URLSearchParams({
21995
- q
21996
- })}`,
21997
- icon: /* @__PURE__ */ jsx(MessageCircleIcon, {})
21998
- },
21999
- v0: {
22000
- title: "Open in V0",
22001
- createUrl: (q) => `https://v0.app?${new URLSearchParams({
22002
- q
22003
- })}`,
22004
- icon: /* @__PURE__ */ jsxs("svg", { fill: "currentColor", viewBox: "0 0 147 70", xmlns: "http://www.w3.org/2000/svg", children: [
22005
- /* @__PURE__ */ jsx("title", { children: "V0" }),
22006
- /* @__PURE__ */ jsx("path", { d: "M56 50.2031V14H70V60.1562C70 65.5928 65.5928 70 60.1562 70C57.5605 70 54.9982 68.9992 53.1562 67.1573L0 14H19.7969L56 50.2031Z" }),
22007
- /* @__PURE__ */ jsx("path", { d: "M147 56H133V23.9531L100.953 56H133V70H96.6875C85.8144 70 77 61.1856 77 50.3125V14H91V46.1562L123.156 14H91V0H127.312C138.186 0 147 8.81439 147 19.6875V56Z" })
22008
- ] })
22009
- }
22010
- };
22011
- var OpenInContext = createContext(void 0);
22012
- var useOpenInContext = () => {
22013
- const context = useContext(OpenInContext);
22014
- if (!context) {
22015
- throw new Error("OpenIn components must be used within an OpenIn provider");
22016
- }
22017
- return context;
22018
- };
22019
- var OpenIn = ({ query, ...props }) => /* @__PURE__ */ jsx(OpenInContext.Provider, { value: { query }, children: /* @__PURE__ */ jsx(DropdownMenu2, { ...props }) });
22020
- var OpenInContent = ({ className, ...props }) => /* @__PURE__ */ jsx(DropdownMenuContent2, { align: "start", className: cn("w-[240px]", className), ...props });
22021
- var OpenInTrigger = ({ children, ...props }) => /* @__PURE__ */ jsx(DropdownMenuTrigger3, { ...props, asChild: true, children: children ?? /* @__PURE__ */ jsxs(Button7, { type: "button", variant: "outline", children: [
22022
- "Open in chat",
22023
- /* @__PURE__ */ jsx(ChevronDownIcon, { className: "ml-2 size-4" })
22024
- ] }) });
22025
- var OpenInChatGPT = (props) => {
22026
- const { query } = useOpenInContext();
22027
- return /* @__PURE__ */ jsx(DropdownMenuItem2, { asChild: true, ...props, children: /* @__PURE__ */ jsxs(
22028
- "a",
22029
- {
22030
- className: "flex items-center gap-2",
22031
- href: providers.chatgpt.createUrl(query),
22032
- rel: "noopener",
22033
- target: "_blank",
22034
- children: [
22035
- /* @__PURE__ */ jsx("span", { className: "shrink-0", children: providers.chatgpt.icon }),
22036
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: providers.chatgpt.title }),
22037
- /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "size-4 shrink-0" })
22038
- ]
22039
- }
22040
- ) });
22041
- };
22042
- var OpenInClaude = (props) => {
22043
- const { query } = useOpenInContext();
22044
- return /* @__PURE__ */ jsx(DropdownMenuItem2, { asChild: true, ...props, children: /* @__PURE__ */ jsxs(
22045
- "a",
22046
- {
22047
- className: "flex items-center gap-2",
22048
- href: providers.claude.createUrl(query),
22049
- rel: "noopener",
22050
- target: "_blank",
22051
- children: [
22052
- /* @__PURE__ */ jsx("span", { className: "shrink-0", children: providers.claude.icon }),
22053
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: providers.claude.title }),
22054
- /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "size-4 shrink-0" })
22055
- ]
22056
- }
22057
- ) });
22058
- };
22059
- var OpenInT3 = (props) => {
22060
- const { query } = useOpenInContext();
22061
- return /* @__PURE__ */ jsx(DropdownMenuItem2, { asChild: true, ...props, children: /* @__PURE__ */ jsxs(
22062
- "a",
22063
- {
22064
- className: "flex items-center gap-2",
22065
- href: providers.t3.createUrl(query),
22066
- rel: "noopener",
22067
- target: "_blank",
22068
- children: [
22069
- /* @__PURE__ */ jsx("span", { className: "shrink-0", children: providers.t3.icon }),
22070
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: providers.t3.title }),
22071
- /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "size-4 shrink-0" })
22072
- ]
22073
- }
22074
- ) });
22075
- };
22076
- var OpenInScira = (props) => {
22077
- const { query } = useOpenInContext();
22078
- return /* @__PURE__ */ jsx(DropdownMenuItem2, { asChild: true, ...props, children: /* @__PURE__ */ jsxs(
22079
- "a",
22080
- {
22081
- className: "flex items-center gap-2",
22082
- href: providers.scira.createUrl(query),
22083
- rel: "noopener",
22084
- target: "_blank",
22085
- children: [
22086
- /* @__PURE__ */ jsx("span", { className: "shrink-0", children: providers.scira.icon }),
22087
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: providers.scira.title }),
22088
- /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "size-4 shrink-0" })
22089
- ]
22090
- }
22091
- ) });
22092
- };
22093
- var OpenInv0 = (props) => {
22094
- const { query } = useOpenInContext();
22095
- return /* @__PURE__ */ jsx(DropdownMenuItem2, { asChild: true, ...props, children: /* @__PURE__ */ jsxs(
22096
- "a",
22097
- {
22098
- className: "flex items-center gap-2",
22099
- href: providers.v0.createUrl(query),
22100
- rel: "noopener",
22101
- target: "_blank",
22102
- children: [
22103
- /* @__PURE__ */ jsx("span", { className: "shrink-0", children: providers.v0.icon }),
22104
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: providers.v0.title }),
22105
- /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "size-4 shrink-0" })
22106
- ]
22107
- }
22108
- ) });
22109
- };
22110
- function Textarea2({ className, ...props }) {
22111
- return /* @__PURE__ */ jsx(
22112
- "textarea",
22113
- {
22114
- "data-slot": "textarea",
22115
- className: cn(
22116
- "flex field-sizing-content min-h-16 w-full rounded-sm border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
22117
- className
22118
- ),
22119
- ...props
22120
- }
22121
- );
22122
- }
22123
- var AttachmentsContext = createContext(null);
22124
- var usePromptInputAttachments = () => {
22125
- const context = useContext(AttachmentsContext);
22126
- if (!context) {
22127
- throw new Error("usePromptInputAttachments must be used within a PromptInput");
22128
- }
22129
- return context;
22130
- };
22131
- function PromptInputAttachment({ data, className, ...props }) {
22132
- const attachments = usePromptInputAttachments();
22133
- return /* @__PURE__ */ jsxs(
22134
- "div",
22135
- {
22136
- className: cn("group relative h-14 w-14 rounded-sm border", className),
22137
- ...props,
22138
- children: [
22139
- data.mediaType?.startsWith("image/") && data.url ? /* @__PURE__ */ jsx(
22140
- "img",
22141
- {
22142
- alt: data.filename || "attachment",
22143
- className: "size-full rounded-md object-cover",
22144
- height: 56,
22145
- src: data.url,
22146
- width: 56
22147
- }
22148
- ) : /* @__PURE__ */ jsx("div", { className: "flex size-full items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsx(PaperclipIcon, { className: "size-4" }) }),
22149
- /* @__PURE__ */ jsx(
22150
- Button7,
22151
- {
22152
- "aria-label": "Remove attachment",
22153
- className: "absolute -top-1.5 -right-1.5 h-6 w-6 rounded-full opacity-0 group-hover:opacity-100",
22154
- onClick: () => attachments.remove(data.id),
22155
- size: "icon",
22156
- type: "button",
22157
- variant: "outline",
22158
- children: /* @__PURE__ */ jsx(XIcon, { className: "h-3 w-3" })
22159
- }
22160
- )
22161
- ]
22162
- },
22163
- data.id
22164
- );
22165
- }
22166
- function PromptInputAttachments({
22167
- className,
22168
- children,
22169
- ...props
22170
- }) {
22171
- const attachments = usePromptInputAttachments();
22172
- const [height, setHeight] = useState(0);
22173
- const contentRef = useRef(null);
22174
- useLayoutEffect(() => {
22175
- const el = contentRef.current;
22176
- if (!el) {
22177
- return;
22178
- }
22179
- const ro = new ResizeObserver(() => {
22180
- setHeight(el.getBoundingClientRect().height);
22181
- });
22182
- ro.observe(el);
22183
- setHeight(el.getBoundingClientRect().height);
22184
- return () => ro.disconnect();
22185
- }, []);
22186
- return /* @__PURE__ */ jsx(
22187
- "div",
22188
- {
22189
- "aria-live": "polite",
22190
- className: cn("overflow-hidden transition-[height] duration-200 ease-out", className),
22191
- style: { height: attachments.files.length ? height : 0 },
22192
- ...props,
22193
- children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 p-3 pt-3", ref: contentRef, children: attachments.files.map((file) => /* @__PURE__ */ jsx(Fragment$1, { children: children(file) }, file.id)) })
22194
- }
22195
- );
22196
- }
22197
- var PromptInputActionAddAttachments = ({
22198
- label = "Add photos or files",
22199
- ...props
22200
- }) => {
22201
- const attachments = usePromptInputAttachments();
22202
- return /* @__PURE__ */ jsxs(
22203
- DropdownMenuItem2,
22204
- {
22205
- ...props,
22206
- onSelect: (e) => {
22207
- e.preventDefault();
22208
- attachments.openFileDialog();
22209
- },
22210
- children: [
22211
- /* @__PURE__ */ jsx(ImageIcon, { className: "mr-2 size-4" }),
22212
- " ",
22213
- label
22214
- ]
22215
- }
22216
- );
22217
- };
22218
- var PromptInput = ({
22219
- className,
22220
- accept,
22221
- multiple,
22222
- globalDrop,
22223
- syncHiddenInput,
22224
- maxFiles,
22225
- maxFileSize,
22226
- onError,
22227
- onSubmit,
22228
- ...props
22229
- }) => {
22230
- const [items, setItems] = useState([]);
22231
- const inputRef = useRef(null);
22232
- const anchorRef = useRef(null);
22233
- const formRef = useRef(null);
22234
- useEffect(() => {
22235
- const root = anchorRef.current?.closest("form");
22236
- if (root instanceof HTMLFormElement) {
22237
- formRef.current = root;
22238
- }
22239
- }, []);
22240
- const openFileDialog = useCallback(() => {
22241
- inputRef.current?.click();
22242
- }, []);
22243
- const matchesAccept = useCallback(
22244
- (f) => {
22245
- if (!accept || accept.trim() === "") {
22246
- return true;
22247
- }
22248
- if (accept.includes("image/*")) {
22249
- return f.type.startsWith("image/");
22250
- }
22251
- return true;
22252
- },
22253
- [accept]
22254
- );
22255
- const add = useCallback(
22256
- (files) => {
22257
- const incoming = Array.from(files);
22258
- const accepted = incoming.filter((f) => matchesAccept(f));
22259
- if (accepted.length === 0) {
22260
- onError?.({
22261
- code: "accept",
22262
- message: "No files match the accepted types."
22263
- });
22264
- return;
22265
- }
22266
- const withinSize = (f) => maxFileSize ? f.size <= maxFileSize : true;
22267
- const sized = accepted.filter(withinSize);
22268
- if (sized.length === 0 && accepted.length > 0) {
22269
- onError?.({
22270
- code: "max_file_size",
22271
- message: "All files exceed the maximum size."
22272
- });
22273
- return;
22274
- }
22275
- setItems((prev) => {
22276
- const capacity = typeof maxFiles === "number" ? Math.max(0, maxFiles - prev.length) : void 0;
22277
- const capped = typeof capacity === "number" ? sized.slice(0, capacity) : sized;
22278
- if (typeof capacity === "number" && sized.length > capacity) {
22279
- onError?.({
22280
- code: "max_files",
22281
- message: "Too many files. Some were not added."
22282
- });
22283
- }
22284
- const next = [];
22285
- for (const file of capped) {
22286
- next.push({
22287
- id: nanoid(),
22288
- type: "file",
22289
- url: URL.createObjectURL(file),
22290
- mediaType: file.type,
22291
- filename: file.name
22292
- });
22293
- }
22294
- return prev.concat(next);
22295
- });
22296
- },
22297
- [matchesAccept, maxFiles, maxFileSize, onError]
22298
- );
22299
- const remove = useCallback((id) => {
22300
- setItems((prev) => {
22301
- const found = prev.find((file) => file.id === id);
22302
- if (found?.url) {
22303
- URL.revokeObjectURL(found.url);
22304
- }
22305
- return prev.filter((file) => file.id !== id);
22306
- });
22307
- }, []);
22308
- const clear = useCallback(() => {
22309
- setItems((prev) => {
22310
- for (const file of prev) {
22311
- if (file.url) {
22312
- URL.revokeObjectURL(file.url);
22313
- }
22314
- }
22315
- return [];
22316
- });
22317
- }, []);
22318
- useEffect(() => {
22319
- if (syncHiddenInput && inputRef.current) {
22320
- if (items.length === 0) {
22321
- inputRef.current.value = "";
22322
- }
22323
- }
22324
- }, [items, syncHiddenInput]);
22325
- useEffect(() => {
22326
- const form = formRef.current;
22327
- if (!form) {
22328
- return;
22329
- }
22330
- const onDragOver = (e) => {
22331
- if (e.dataTransfer?.types?.includes("Files")) {
22332
- e.preventDefault();
22333
- }
22334
- };
22335
- const onDrop = (e) => {
22336
- if (e.dataTransfer?.types?.includes("Files")) {
22337
- e.preventDefault();
22338
- }
22339
- if (e.dataTransfer?.files && e.dataTransfer.files.length > 0) {
22340
- add(e.dataTransfer.files);
22341
- }
22342
- };
22343
- form.addEventListener("dragover", onDragOver);
22344
- form.addEventListener("drop", onDrop);
22345
- return () => {
22346
- form.removeEventListener("dragover", onDragOver);
22347
- form.removeEventListener("drop", onDrop);
22348
- };
22349
- }, [add]);
22350
- useEffect(() => {
22351
- if (!globalDrop) {
22352
- return;
22353
- }
22354
- const onDragOver = (e) => {
22355
- if (e.dataTransfer?.types?.includes("Files")) {
22356
- e.preventDefault();
22357
- }
22358
- };
22359
- const onDrop = (e) => {
22360
- if (e.dataTransfer?.types?.includes("Files")) {
22361
- e.preventDefault();
22362
- }
22363
- if (e.dataTransfer?.files && e.dataTransfer.files.length > 0) {
22364
- add(e.dataTransfer.files);
22365
- }
22366
- };
22367
- document.addEventListener("dragover", onDragOver);
22368
- document.addEventListener("drop", onDrop);
22369
- return () => {
22370
- document.removeEventListener("dragover", onDragOver);
22371
- document.removeEventListener("drop", onDrop);
22372
- };
22373
- }, [add, globalDrop]);
22374
- const handleChange = (event) => {
22375
- if (event.currentTarget.files) {
22376
- add(event.currentTarget.files);
22377
- }
22378
- };
22379
- const handleSubmit = (event) => {
22380
- event.preventDefault();
22381
- const files = items.map(({ ...item }) => ({
22382
- ...item
22383
- }));
22384
- onSubmit({ text: event.currentTarget.message.value, files }, event);
22385
- };
22386
- const ctx = useMemo(
22387
- () => ({
22388
- files: items.map((item) => ({ ...item, id: item.id })),
22389
- add,
22390
- remove,
22391
- clear,
22392
- openFileDialog,
22393
- fileInputRef: inputRef
22394
- }),
22395
- [items, add, remove, clear, openFileDialog]
22396
- );
22397
- return /* @__PURE__ */ jsxs(AttachmentsContext.Provider, { value: ctx, children: [
22398
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "hidden", ref: anchorRef }),
22399
- /* @__PURE__ */ jsx(
22400
- "input",
22401
- {
22402
- accept,
22403
- className: "hidden",
22404
- multiple,
22405
- onChange: handleChange,
22406
- ref: inputRef,
22407
- type: "file"
22408
- }
22409
- ),
22410
- /* @__PURE__ */ jsx(
22411
- "form",
22412
- {
22413
- className: cn(
22414
- "w-full divide-y overflow-hidden rounded-sm border bg-background shadow-sm",
22415
- className
22416
- ),
22417
- onSubmit: handleSubmit,
22418
- ...props
22419
- }
22420
- )
22421
- ] });
22422
- };
22423
- var PromptInputBody = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(className, "flex flex-col"), ...props });
22424
- var PromptInputTextarea = ({
22425
- onChange,
22426
- className,
22427
- placeholder = "What would you like to know?",
22428
- ...props
22429
- }) => {
22430
- const handleKeyDown = (e) => {
22431
- if (e.key === "Enter") {
22432
- if (e.nativeEvent.isComposing) {
22433
- return;
22434
- }
22435
- if (e.shiftKey) {
22436
- return;
22437
- }
22438
- e.preventDefault();
22439
- const form = e.currentTarget.form;
22440
- if (form) {
22441
- form.requestSubmit();
22442
- }
22443
- }
22444
- };
22445
- return /* @__PURE__ */ jsx(
22446
- Textarea2,
22447
- {
22448
- className: cn(
22449
- "w-full resize-none rounded-none border-none p-3 shadow-none ring-0 outline-none",
22450
- "field-sizing-content bg-transparent dark:bg-transparent",
22451
- "max-h-48 min-h-16",
22452
- "focus-visible:ring-0",
22453
- className
22454
- ),
22455
- name: "message",
22456
- onChange: (e) => {
22457
- onChange?.(e);
22458
- },
22459
- onKeyDown: handleKeyDown,
22460
- placeholder,
22461
- ...props
22462
- }
22463
- );
22464
- };
22465
- var PromptInputToolbar = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-between p-1", className), ...props });
22466
- var PromptInputTools = ({ className, ...props }) => /* @__PURE__ */ jsx(
22467
- "div",
22468
- {
22469
- className: cn("flex items-center gap-1", "[&_button:first-child]:rounded-bl-xl", className),
22470
- ...props
22471
- }
22472
- );
22473
- var PromptInputButton = ({
22474
- variant = "ghost",
22475
- className,
22476
- size,
22477
- ...props
22478
- }) => {
22479
- const newSize = size ?? Children.count(props.children) > 1 ? "default" : "icon";
22480
- return /* @__PURE__ */ jsx(
22481
- Button7,
22482
- {
22483
- className: cn(
22484
- "shrink-0 gap-1.5 rounded-lg",
22485
- variant === "ghost" && "text-muted-foreground",
22486
- newSize === "default" && "px-3",
22487
- className
22488
- ),
22489
- size: newSize,
22490
- type: "button",
22491
- variant,
22492
- ...props
22493
- }
22494
- );
22495
- };
22496
- var PromptInputActionMenu = (props) => /* @__PURE__ */ jsx(DropdownMenu2, { ...props });
22497
- var PromptInputActionMenuTrigger = ({
22498
- className,
22499
- children,
22500
- ...props
22501
- }) => /* @__PURE__ */ jsx(DropdownMenuTrigger3, { asChild: true, children: /* @__PURE__ */ jsx(PromptInputButton, { className, ...props, children: children ?? /* @__PURE__ */ jsx(PlusIcon, { className: "size-4" }) }) });
22502
- var PromptInputActionMenuContent = ({
22503
- className,
22504
- ...props
22505
- }) => /* @__PURE__ */ jsx(DropdownMenuContent2, { align: "start", className: cn(className), ...props });
22506
- var PromptInputActionMenuItem = ({
22507
- className,
22508
- ...props
22509
- }) => /* @__PURE__ */ jsx(DropdownMenuItem2, { className: cn(className), ...props });
22510
- var PromptInputSubmit = ({
22511
- className,
22512
- variant = "default",
22513
- size = "icon",
22514
- status,
22515
- children,
22516
- ...props
22517
- }) => {
22518
- let Icon2 = /* @__PURE__ */ jsx(SendIcon, { className: "size-4" });
22519
- if (status === "submitted") {
22520
- Icon2 = /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin" });
22521
- } else if (status === "streaming") {
22522
- Icon2 = /* @__PURE__ */ jsx(SquareIcon, { className: "size-4" });
22523
- } else if (status === "error") {
22524
- Icon2 = /* @__PURE__ */ jsx(XIcon, { className: "size-4" });
22525
- }
22526
- return /* @__PURE__ */ jsx(
22527
- Button7,
22528
- {
22529
- className: cn("gap-1.5 rounded-lg", className),
22530
- size,
22531
- type: "submit",
22532
- variant,
22533
- ...props,
22534
- children: children ?? Icon2
22535
- }
22536
- );
22537
- };
22538
- var Response = memo(
22539
- ({ className, ...props }) => /* @__PURE__ */ jsx(
22540
- Streamdown,
22541
- {
22542
- className: cn("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className),
22543
- ...props
22544
- }
22545
- ),
22546
- (prevProps, nextProps) => prevProps.children === nextProps.children
22547
- );
22548
- Response.displayName = "Response";
22549
- var ReasoningContext = createContext(null);
22550
- var useReasoning = () => {
22551
- const context = useContext(ReasoningContext);
22552
- if (!context) {
22553
- throw new Error("Reasoning components must be used within Reasoning");
22554
- }
22555
- return context;
22556
- };
22557
- var AUTO_CLOSE_DELAY = 1e3;
22558
- var MS_IN_S = 1e3;
22559
- var Reasoning = memo(
22560
- ({
22561
- className,
22562
- isStreaming = false,
22563
- open,
22564
- defaultOpen = true,
22565
- onOpenChange,
22566
- duration: durationProp,
22567
- children,
22568
- ...props
22569
- }) => {
22570
- const [isOpen, setIsOpen] = useControllableState({
22571
- prop: open,
22572
- defaultProp: defaultOpen,
22573
- onChange: onOpenChange
22574
- });
22575
- const [duration, setDuration] = useControllableState({
22576
- prop: durationProp,
22577
- defaultProp: 0
22578
- });
22579
- const [hasAutoClosed, setHasAutoClosed] = useState(false);
22580
- const startTimeRef = useRef(null);
22581
- useEffect(() => {
22582
- if (isStreaming) {
22583
- if (startTimeRef.current === null) {
22584
- startTimeRef.current = Date.now();
22585
- }
22586
- } else if (startTimeRef.current !== null) {
22587
- const elapsedSeconds = Math.ceil((Date.now() - startTimeRef.current) / MS_IN_S);
22588
- setDuration(elapsedSeconds);
22589
- startTimeRef.current = null;
22590
- }
22591
- }, [isStreaming, setDuration]);
22592
- useEffect(() => {
22593
- if (defaultOpen && !isStreaming && isOpen && !hasAutoClosed) {
22594
- const timer = setTimeout(() => {
22595
- setIsOpen(false);
22596
- setHasAutoClosed(true);
22597
- }, AUTO_CLOSE_DELAY);
22598
- return () => clearTimeout(timer);
22599
- }
22600
- return () => {
22601
- };
22602
- }, [isStreaming, isOpen, defaultOpen, setIsOpen, hasAutoClosed]);
22603
- const handleOpenChange = (newOpen) => {
22604
- setIsOpen(newOpen);
22605
- };
22606
- return /* @__PURE__ */ jsx(ReasoningContext.Provider, { value: { isStreaming, isOpen, setIsOpen, duration }, children: /* @__PURE__ */ jsx(
22607
- Collapsible2,
22608
- {
22609
- className: cn("not-prose mb-4", className),
22610
- onOpenChange: handleOpenChange,
22611
- open: isOpen,
22612
- ...props,
22613
- children
22614
- }
22615
- ) });
22616
- }
22617
- );
22618
- var getThinkingMessage = (isStreaming, duration) => {
22619
- if (isStreaming || duration === 0) {
22620
- return /* @__PURE__ */ jsx("p", { children: "Thinking..." });
22621
- }
22622
- if (duration === void 0) {
22623
- return /* @__PURE__ */ jsx("p", { children: "Thought for a few seconds" });
22624
- }
22625
- return /* @__PURE__ */ jsxs("p", { children: [
22626
- "Thought for ",
22627
- duration,
22628
- " seconds"
22629
- ] });
22630
- };
22631
- var ReasoningTrigger = memo(({ className, children, ...props }) => {
22632
- const { isStreaming, isOpen, duration } = useReasoning();
22633
- return /* @__PURE__ */ jsx(
22634
- CollapsibleTrigger4,
22635
- {
22636
- className: cn(
22637
- "flex w-full items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground",
22638
- className
22639
- ),
22640
- ...props,
22641
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
22642
- /* @__PURE__ */ jsx(BrainIcon, { className: "size-4" }),
22643
- getThinkingMessage(isStreaming, duration),
22644
- /* @__PURE__ */ jsx(
22645
- ChevronDownIcon,
22646
- {
22647
- className: cn("size-4 transition-transform", isOpen ? "rotate-180" : "rotate-0")
22648
- }
22649
- )
22650
- ] })
22651
- }
22652
- );
22653
- });
22654
- var ReasoningContent = memo(({ className, children, ...props }) => /* @__PURE__ */ jsx(
22655
- CollapsibleContent4,
22656
- {
22657
- className: cn(
22658
- "mt-4 text-sm",
22659
- "text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:animate-in data-[state=open]:slide-in-from-top-2",
22660
- className
22661
- ),
22662
- ...props,
22663
- children: /* @__PURE__ */ jsx(Response, { className: "grid gap-2", children })
22664
- }
22665
- ));
22666
- Reasoning.displayName = "Reasoning";
22667
- ReasoningTrigger.displayName = "ReasoningTrigger";
22668
- ReasoningContent.displayName = "ReasoningContent";
22669
- var Sources = ({ className, ...props }) => /* @__PURE__ */ jsx(Collapsible2, { className: cn("not-prose mb-4 text-xs text-primary", className), ...props });
22670
- var SourcesTrigger = ({ className, count, children, ...props }) => /* @__PURE__ */ jsx(CollapsibleTrigger4, { className: cn("flex items-center gap-2", className), ...props, children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
22671
- /* @__PURE__ */ jsxs("p", { className: "font-medium", children: [
22672
- "Used ",
22673
- count,
22674
- " sources"
22675
- ] }),
22676
- /* @__PURE__ */ jsx(ChevronDownIcon, { className: "h-4 w-4" })
22677
- ] }) });
22678
- var SourcesContent = ({ className, ...props }) => /* @__PURE__ */ jsx(
22679
- CollapsibleContent4,
22680
- {
22681
- className: cn(
22682
- "mt-3 flex w-fit flex-col gap-2",
22683
- "outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:animate-in data-[state=open]:slide-in-from-top-2",
22684
- className
22685
- ),
22686
- ...props
22687
- }
22688
- );
22689
- var Source = ({ href, title, children, ...props }) => /* @__PURE__ */ jsx("a", { className: "flex items-center gap-2", href, rel: "noreferrer", target: "_blank", ...props, children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
22690
- /* @__PURE__ */ jsx(BookIcon, { className: "h-4 w-4" }),
22691
- /* @__PURE__ */ jsx("span", { className: "block font-medium", children: title })
22692
- ] }) });
22693
- function ScrollArea2({
22694
- className,
22695
- children,
22696
- ...props
22697
- }) {
22698
- return /* @__PURE__ */ jsxs(
22699
- ScrollAreaPrimitive.Root,
22700
- {
22701
- "data-slot": "scroll-area",
22702
- className: cn("relative", className),
22703
- ...props,
22704
- children: [
22705
- /* @__PURE__ */ jsx(
22706
- ScrollAreaPrimitive.Viewport,
22707
- {
22708
- "data-slot": "scroll-area-viewport",
22709
- className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",
22710
- children
22711
- }
22712
- ),
22713
- /* @__PURE__ */ jsx(ScrollBar2, {}),
22714
- /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
22715
- ]
22716
- }
22717
- );
22718
- }
22719
- function ScrollBar2({
22720
- className,
22721
- orientation = "vertical",
22722
- ...props
22723
- }) {
22724
- return /* @__PURE__ */ jsx(
22725
- ScrollAreaPrimitive.ScrollAreaScrollbar,
22726
- {
22727
- "data-slot": "scroll-area-scrollbar",
22728
- orientation,
22729
- className: cn(
22730
- "flex touch-none p-px transition-colors select-none",
22731
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
22732
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
22733
- className
22734
- ),
22735
- ...props,
22736
- children: /* @__PURE__ */ jsx(
22737
- ScrollAreaPrimitive.ScrollAreaThumb,
22738
- {
22739
- "data-slot": "scroll-area-thumb",
22740
- className: "relative flex-1 rounded-full bg-border"
22741
- }
22742
- )
22743
- }
22744
- );
22745
- }
22746
- var Suggestions = ({ className, children, ...props }) => /* @__PURE__ */ jsxs(ScrollArea2, { className: "w-full overflow-x-auto whitespace-nowrap", ...props, children: [
22747
- /* @__PURE__ */ jsx("div", { className: cn("flex w-max flex-nowrap items-center gap-2", className), children }),
22748
- /* @__PURE__ */ jsx(ScrollBar2, { className: "hidden", orientation: "horizontal" })
22749
- ] });
22750
- var Suggestion = ({
22751
- suggestion,
22752
- onClick,
22753
- className,
22754
- variant = "outline",
22755
- size = "sm",
22756
- children,
22757
- ...props
22758
- }) => {
22759
- const handleClick = () => {
22760
- onClick?.(suggestion);
22761
- };
22762
- return /* @__PURE__ */ jsx(
22763
- Button7,
22764
- {
22765
- className: cn("cursor-pointer rounded-full px-4", className),
22766
- onClick: handleClick,
22767
- size,
22768
- type: "button",
22769
- variant,
22770
- ...props,
22771
- children: children || suggestion
22772
- }
22773
- );
22774
- };
22775
- var TaskItemFile = ({ children, className, ...props }) => /* @__PURE__ */ jsx(
22776
- "div",
22777
- {
22778
- className: cn(
22779
- "inline-flex items-center gap-1 rounded-sm border bg-secondary px-1.5 py-0.5 text-xs text-foreground",
22780
- className
22781
- ),
22782
- ...props,
22783
- children
22784
- }
22785
- );
22786
- var TaskItem = ({ children, className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("text-sm text-muted-foreground", className), ...props, children });
22787
- var Task = ({ defaultOpen = true, className, ...props }) => /* @__PURE__ */ jsx(
22788
- Collapsible2,
22789
- {
22790
- className: cn(
22791
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:animate-in data-[state=open]:slide-in-from-top-2",
22792
- className
22793
- ),
22794
- defaultOpen,
22795
- ...props
22796
- }
22797
- );
22798
- var TaskTrigger = ({ children, className, title, ...props }) => /* @__PURE__ */ jsx(CollapsibleTrigger4, { asChild: true, className: cn("group", className), ...props, children: children ?? /* @__PURE__ */ jsxs("div", { className: "flex w-full cursor-pointer items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground", children: [
22799
- /* @__PURE__ */ jsx(SearchIcon, { className: "size-4" }),
22800
- /* @__PURE__ */ jsx("p", { className: "text-sm", children: title }),
22801
- /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 transition-transform group-data-[state=open]:rotate-180" })
22802
- ] }) });
22803
- var TaskContent = ({ children, className, ...props }) => /* @__PURE__ */ jsx(
22804
- CollapsibleContent4,
22805
- {
22806
- className: cn(
22807
- "text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:animate-in data-[state=open]:slide-in-from-top-2",
22808
- className
22809
- ),
22810
- ...props,
22811
- children: /* @__PURE__ */ jsx("div", { className: "mt-4 space-y-2 border-l-2 border-muted pl-4", children })
22812
- }
22813
- );
22814
- var Tool = ({ className, ...props }) => /* @__PURE__ */ jsx(Collapsible2, { className: cn("not-prose mb-4 w-full rounded-sm border", className), ...props });
22815
- var getStatusBadge = (status) => {
22816
- const labels = {
22817
- "input-streaming": "Pending",
22818
- "input-available": "Running",
22819
- "approval-requested": "Awaiting approval",
22820
- "approval-responded": "Approval response received",
22821
- "output-available": "Completed",
22822
- "output-error": "Error",
22823
- "output-denied": "Denied"
22824
- };
22825
- const icons = {
22826
- "input-streaming": /* @__PURE__ */ jsx(CircleIcon, { className: "size-4" }),
22827
- "input-available": /* @__PURE__ */ jsx(ClockIcon, { className: "size-4 animate-pulse" }),
22828
- "approval-requested": /* @__PURE__ */ jsx(ClockIcon, { className: "size-4 animate-pulse" }),
22829
- "approval-responded": /* @__PURE__ */ jsx(CircleIcon, { className: "size-4" }),
22830
- "output-available": /* @__PURE__ */ jsx(Icons.check_circle, { className: "size-4 text-green-600" }),
22831
- "output-error": /* @__PURE__ */ jsx(XCircleIcon, { className: "size-4 text-red-600" }),
22832
- "output-denied": /* @__PURE__ */ jsx(XCircleIcon, { className: "size-4 text-red-600" })
22833
- };
22834
- return /* @__PURE__ */ jsxs(Badge2, { className: "gap-1.5 rounded-full text-xs", variant: "secondary", children: [
22835
- icons[status],
22836
- labels[status]
22837
- ] });
22838
- };
22839
- var ToolHeader = ({ className, type, state, ...props }) => /* @__PURE__ */ jsxs(
22840
- CollapsibleTrigger4,
22841
- {
22842
- className: cn("flex w-full items-center justify-between gap-4 p-3", className),
22843
- ...props,
22844
- children: [
22845
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
22846
- /* @__PURE__ */ jsx(WrenchIcon, { className: "size-4 text-muted-foreground" }),
22847
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: type }),
22848
- getStatusBadge(state)
22849
- ] }),
22850
- /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" })
22851
- ]
22852
- }
22853
- );
22854
- var ToolContent = ({ className, ...props }) => /* @__PURE__ */ jsx(
22855
- CollapsibleContent4,
22856
- {
22857
- className: cn(
22858
- "text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:animate-in data-[state=open]:slide-in-from-top-2",
22859
- className
22860
- ),
22861
- ...props
22862
- }
22863
- );
22864
- var ToolInput = ({ className, input, ...props }) => /* @__PURE__ */ jsxs("div", { className: cn("space-y-2 overflow-hidden p-4", className), ...props, children: [
22865
- /* @__PURE__ */ jsx("h4", { className: "text-xs font-medium tracking-wide text-muted-foreground uppercase", children: "Parameters" }),
22866
- /* @__PURE__ */ jsx("div", { className: "rounded-md bg-muted/50", children: /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(input, null, 2), language: "json" }) })
22867
- ] });
22868
- var ToolOutput = ({ className, output, errorText, ...props }) => {
22869
- if (!(output || errorText)) {
22870
- return null;
22871
- }
22872
- let Output = /* @__PURE__ */ jsx("div", { children: output });
22873
- if (typeof output === "object") {
22874
- Output = /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(output, null, 2), language: "json" });
22875
- } else if (typeof output === "string") {
22876
- Output = /* @__PURE__ */ jsx(CodeBlock, { code: output, language: "json" });
22877
- }
22878
- return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2 p-4", className), ...props, children: [
22879
- /* @__PURE__ */ jsx("h4", { className: "text-xs font-medium tracking-wide text-muted-foreground uppercase", children: errorText ? "Error" : "Result" }),
22880
- /* @__PURE__ */ jsxs(
22881
- "div",
22882
- {
22883
- className: cn(
22884
- "overflow-x-auto rounded-md text-xs [&_table]:w-full",
22885
- errorText ? "bg-destructive/10 text-destructive" : "bg-muted/50 text-foreground"
22886
- ),
22887
- children: [
22888
- errorText && /* @__PURE__ */ jsx("div", { children: errorText }),
22889
- Output
22890
- ]
22891
- }
22892
- )
22893
- ] });
22894
- };
22895
- function Input2({ className, type, ...props }) {
22896
- return /* @__PURE__ */ jsx(
22897
- "input",
22898
- {
22899
- type,
22900
- "data-slot": "input",
22901
- className: cn(
22902
- "h-9 w-full min-w-0 rounded-sm border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30",
22903
- "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
22904
- "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
22905
- className
22906
- ),
22907
- ...props
22908
- }
22909
- );
22910
- }
22911
- var sanitizePreviewUrl = (value) => {
22912
- if (!value) return void 0;
22913
- const trimmed = value.trim();
22914
- if (!trimmed) return void 0;
22915
- const baseOrigin = typeof window !== "undefined" ? window.location.origin : "http://localhost";
22916
- const hasExplicitScheme = /^[a-zA-Z][a-zA-Z\d+.-]*:/.test(trimmed);
22917
- const isRelativeUrl = trimmed.startsWith("/") || trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("?") || trimmed.startsWith("#");
22918
- const isBareHostname = !hasExplicitScheme && !isRelativeUrl && /^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+([/:?#].*)?$/.test(trimmed);
22919
- try {
22920
- const parsed = hasExplicitScheme ? new URL(trimmed) : isBareHostname ? new URL(`https://${trimmed}`) : new URL(trimmed, baseOrigin);
22921
- if (parsed.protocol === "http:" || parsed.protocol === "https:") {
22922
- return parsed.toString();
22923
- }
22924
- } catch {
22925
- }
22926
- return void 0;
22927
- };
22928
- var WebPreviewContext = createContext(null);
22929
- var useWebPreview = () => {
22930
- const context = useContext(WebPreviewContext);
22931
- if (!context) {
22932
- throw new Error("WebPreview components must be used within a WebPreview");
22933
- }
22934
- return context;
22935
- };
22936
- var WebPreview = ({
22937
- className,
22938
- children,
22939
- defaultUrl = "",
22940
- onUrlChange,
22941
- ...props
22942
- }) => {
22943
- const initialUrl = sanitizePreviewUrl(defaultUrl) ?? "";
22944
- const [url, setUrl] = useState(initialUrl);
22945
- const [consoleOpen, setConsoleOpen] = useState(false);
22946
- const handleUrlChange = (newUrl) => {
22947
- if (!newUrl.trim()) {
22948
- setUrl("");
22949
- onUrlChange?.("");
22950
- return;
22951
- }
22952
- const safeUrl = sanitizePreviewUrl(newUrl);
22953
- if (safeUrl === void 0) {
22954
- return;
22955
- }
22956
- setUrl(safeUrl);
22957
- onUrlChange?.(safeUrl);
22958
- };
22959
- const contextValue = {
22960
- url,
22961
- setUrl: handleUrlChange,
22962
- consoleOpen,
22963
- setConsoleOpen
22964
- };
22965
- return /* @__PURE__ */ jsx(WebPreviewContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
22966
- "div",
22967
- {
22968
- className: cn("flex size-full flex-col rounded-sm border bg-card", className),
22969
- ...props,
22970
- children
22971
- }
22972
- ) });
22973
- };
22974
- var WebPreviewNavigation = ({
22975
- className,
22976
- children,
22977
- ...props
22978
- }) => /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-1 border-b p-2", className), ...props, children });
22979
- var WebPreviewUrl = ({ value, onChange, onKeyDown, ...props }) => {
22980
- const { url, setUrl } = useWebPreview();
22981
- const handleKeyDown = (event) => {
22982
- if (event.key === "Enter") {
22983
- const target = event.target;
22984
- setUrl(target.value);
22985
- }
22986
- onKeyDown?.(event);
22987
- };
22988
- return /* @__PURE__ */ jsx(
22989
- Input2,
22990
- {
22991
- className: "h-8 flex-1 text-sm",
22992
- onChange,
22993
- onKeyDown: handleKeyDown,
22994
- placeholder: "Enter URL...",
22995
- value: value ?? url,
22996
- ...props
22997
- }
22998
- );
22999
- };
23000
- var WebPreviewBody = ({
23001
- className,
23002
- loading,
23003
- loadingFallback,
23004
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
23005
- sandbox: _sandbox,
23006
- src,
23007
- ...props
23008
- }) => {
23009
- const { url } = useWebPreview();
23010
- const safeSrc = sanitizePreviewUrl(src ?? url);
23011
- const resolvedLoadingFallback = loadingFallback ?? loading;
23012
- return /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
23013
- /* @__PURE__ */ jsx(
23014
- "iframe",
23015
- {
23016
- className: cn("size-full", className),
23017
- sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-presentation",
23018
- src: safeSrc,
23019
- title: "Preview",
23020
- ...props
23021
- }
23022
- ),
23023
- resolvedLoadingFallback
23024
- ] });
23025
- };
23026
20544
  var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
23027
20545
  function useDisableToc() {
23028
20546
  const { setToc } = useToc();
@@ -23237,6 +20755,6 @@ var languages = [
23237
20755
  "html"
23238
20756
  ];
23239
20757
 
23240
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Action2 as Action, Actions, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AreaChart, Artifact, ArtifactAction, ArtifactActions, ArtifactContent, ArtifactDescription, ArtifactHeader, ArtifactTitle, AspectRatio, AuthLayout, AvailableChartColors, Avatar, AvatarFallback, AvatarImage, Badge, BadgeButton, BarChart, BarList, BaseColorSwatches, Branch, BranchMessages, BranchNext, BranchPage, BranchPrevious, BranchSelector, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, Button2 as Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CategoryBar, ChainOfThought, ChainOfThoughtContent, ChainOfThoughtHeader, ChainOfThoughtImage, ChainOfThoughtSearchResult, ChainOfThoughtSearchResults, ChainOfThoughtStep, ChartContainer, ChartLegend3 as ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip3 as ChartTooltip, ChartTooltipContent, Checkbox, CheckboxSmall, Code, CodeBlock, CodeBlockCopyButton, CodeDemo, CodeHighlight, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorCard, ColorPairingTool, ColorSwatches, ColourScale, ComboChart, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Context, ContextCacheUsage, ContextContent, ContextContentBody, ContextContentFooter, ContextContentHeader, ContextInputUsage, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextOutputUsage, ContextReasoningUsage, ContextTrigger, Conversation, ConversationContent, ConversationEmptyState, ConversationScrollButton, DataTable, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableToolbar, DataTableViewOptions, Description4 as Description, DescriptionDetails, DescriptionList, DescriptionTerm, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChart, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicFavicon, ErrorMessage, ExpandableSearch, ExpandableSearchField, Field2 as Field, FieldGroup, FieldLabel, Fieldset2 as Fieldset, Footer, FooterAcknowledgement, FooterLegalLinks, FooterSmallPrint, FooterSocialLink, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatToggle, GenerateInterpolatedColors, Header2 as Header, Heading, HeroBannerSimple, HeroBannerSupportingImage, HoverCard, HoverCardContent, HoverCardTrigger, Icons, Image4 as Image, InlineCitation, InlineCitationCard, InlineCitationCardBody, InlineCitationCardTrigger, InlineCitationCarousel, InlineCitationCarouselContent, InlineCitationCarouselHeader, InlineCitationCarouselIndex, InlineCitationCarouselItem, InlineCitationSource, InlineCitationText, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label5 as Label, Legend6 as Legend, LineChart, Link, _List as List, Listbox2 as Listbox, ListboxDescription, ListboxLabel, ListboxOption2 as ListboxOption, Loader, Loading, Logo, MainNavigation, Masthead, MegaMenu, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageContent, MobileHeader, MobileSearch, MultiLevelPushMenu, NSWCard, NSWCardArrow, NSWCardDescription, NSWCardIcon, NSWCardImg, NSWCardTitle, Navbar, NavbarDivider, NavbarItem, NavbarLabel, NavbarSection, NavbarSpacer, Navigation, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuMainNavigation, NavigationMenuTrigger, NavigationMenuViewport, NotFound, OpenIn, OpenInChatGPT, OpenInClaude, OpenInContent, OpenInScira, OpenInT3, OpenInTrigger, OpenInv0, PageHeading, Pagination, PaginationGap, PaginationList, PaginationNext, PaginationPage, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PreWithCopy, PrevNextLinks, PrevNextLinksPageLink, Progress, ProgressBar, ProgressCircle, PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputSubmit, PromptInputTextarea, PromptInputToolbar, PromptInputTools, Prose, RadioGroup2 as RadioGroup, RadioGroupItem, Reasoning, ReasoningContent, ReasoningTrigger, ResizableHandle, ResizablePanel, ResizablePanelGroup, Response, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator4 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLink, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarNavigation, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteSearch, Skeleton, Slider, Social, Source, Sources, SourcesContent, SourcesTrigger, SparkAreaChart, SparkBarChart, SparkLineChart, Spinner, StepIndicator, StepNavigation, Strong, SubmitButton, Suggestion, Suggestions, Switch2 as Switch, SwitchField, SwitchGroup, TabNavigation, TabNavigationLink, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, Tabs2 as Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskContent, TaskItem, TaskItemFile, TaskTrigger, Text, TextLink, Textarea, ThemeColorPalette, ThemeProvider, ThemeSelector, ThemeSwitcher, Toaster, TocContext, TocProvider, Toggle, ToggleGroup, ToggleGroupItem, Tool, ToolContent, ToolHeader, ToolInput, ToolOutput, Tooltip5 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopLevel, TouchTarget, Tracker, Tooltip3 as TremorTooltip, ViewToggle, WebPreview, WebPreviewBody, WebPreviewNavigation, WebPreviewUrl, Wrapper, aboriginal, addStartStopToColorArray, allPalettes, badgeVariants, brand, buttonVariants, camelCase, chartColors, cn, colorDataArray, colorThemes, colors, constructCategoryColors, createColorArray, createColorData, createFormStore, darkenColor, dataTableFeatures, diverging, domToSimple, focusInput, focusRing, generateColorThemes, generateDataVisColors, getColorClassName, getColorValue, getHeadings, getNodeText, getSurroundingColors, getYAxisDomain, hasErrorInput, hasOnlyOneValueForKey, humaniseVariant, interpolateColors, isLightColor, kebabCase, languages, lightenColor, navigationMenuTriggerStyle, oklchConverter, progressBarVariants, renderColorOutput, renderColorOutputToDTFM, semantic, sequential, shades, themeIndices, themeTokens, toggleVariants, truncate, useActiveSectionObserver, useDisableToc, useFormField, useIsMobile, useOnWindowResize, usePageHeadings, usePromptInputAttachments, useSelectorHeight, useSidebar, useStickyOffset, useToc };
20758
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AreaChart, AspectRatio, AuthLayout, AvailableChartColors, Avatar, AvatarFallback, AvatarImage, Badge, BadgeButton, BarChart, BarList, BaseColorSwatches, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, Button2 as Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CategoryBar, ChartContainer, ChartLegend3 as ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip3 as ChartTooltip, ChartTooltipContent, Checkbox, CheckboxSmall, Code, CodeDemo, CodeHighlight, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorCard, ColorPairingTool, ColorSwatches, ColourScale, ComboChart, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableToolbar, DataTableViewOptions, Description4 as Description, DescriptionDetails, DescriptionList, DescriptionTerm, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChart, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicFavicon, ErrorMessage, ExpandableSearch, ExpandableSearchField, Field2 as Field, FieldGroup, FieldLabel, Fieldset2 as Fieldset, Footer, FooterAcknowledgement, FooterLegalLinks, FooterSmallPrint, FooterSocialLink, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatToggle, GenerateInterpolatedColors, Header2 as Header, Heading, HeroBannerSimple, HeroBannerSupportingImage, HoverCard, HoverCardContent, HoverCardTrigger, Icons, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label5 as Label, Legend6 as Legend, LineChart, Link, _List as List, Listbox2 as Listbox, ListboxDescription, ListboxLabel, ListboxOption2 as ListboxOption, Loading, Logo, MainNavigation, Masthead, MegaMenu, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MobileHeader, MobileSearch, MultiLevelPushMenu, NSWCard, NSWCardArrow, NSWCardDescription, NSWCardIcon, NSWCardImg, NSWCardTitle, Navbar, NavbarDivider, NavbarItem, NavbarLabel, NavbarSection, NavbarSpacer, Navigation, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuMainNavigation, NavigationMenuTrigger, NavigationMenuViewport, NotFound, PageHeading, Pagination, PaginationGap, PaginationList, PaginationNext, PaginationPage, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PreWithCopy, PrevNextLinks, PrevNextLinksPageLink, Progress, ProgressBar, ProgressCircle, Prose, RadioGroup2 as RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator4 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLink, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarNavigation, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteSearch, Skeleton, Slider, Social, SparkAreaChart, SparkBarChart, SparkLineChart, Spinner, StepIndicator, StepNavigation, Strong, SubmitButton, Switch2 as Switch, SwitchField, SwitchGroup, TabNavigation, TabNavigationLink, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, Tabs2 as Tabs, TabsContent, TabsList, TabsTrigger, Text, TextLink, Textarea, ThemeColorPalette, ThemeProvider, ThemeSelector, ThemeSwitcher, Toaster, TocContext, TocProvider, Toggle, ToggleGroup, ToggleGroupItem, Tooltip5 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopLevel, TouchTarget, Tracker, Tooltip3 as TremorTooltip, ViewToggle, Wrapper, aboriginal, addStartStopToColorArray, allPalettes, badgeVariants, brand, buttonVariants, camelCase, chartColors, cn, colorDataArray, colorThemes, colors, constructCategoryColors, createColorArray, createColorData, createFormStore, darkenColor, dataTableFeatures, diverging, domToSimple, focusInput, focusRing, generateColorThemes, generateDataVisColors, getColorClassName, getColorValue, getHeadings, getNodeText, getSurroundingColors, getYAxisDomain, hasErrorInput, hasOnlyOneValueForKey, humaniseVariant, interpolateColors, isLightColor, kebabCase, languages, lightenColor, navigationMenuTriggerStyle, oklchConverter, progressBarVariants, renderColorOutput, renderColorOutputToDTFM, semantic, sequential, shades, themeIndices, themeTokens, toggleVariants, truncate, useActiveSectionObserver, useDisableToc, useFormField, useIsMobile, useOnWindowResize, usePageHeadings, useSelectorHeight, useSidebar, useStickyOffset, useToc };
23241
20759
  //# sourceMappingURL=index.js.map
23242
20760
  //# sourceMappingURL=index.js.map