"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/ai-elements/index.ts
var ai_elements_exports = {};
__export(ai_elements_exports, {
  CHAT_STATUS: () => CHAT_STATUS,
  MouseGrid: () => MouseGrid,
  PromptInput: () => PromptInput,
  PromptInputFooter: () => PromptInputFooter,
  PromptInputSubmit: () => PromptInputSubmit,
  PromptInputTextarea: () => PromptInputTextarea,
  PromptInputTools: () => PromptInputTools,
  Suggestion: () => Suggestion,
  Suggestions: () => Suggestions
});
module.exports = __toCommonJS(ai_elements_exports);

// src/components/ai-elements/prompt-input/prompt-input.tsx
var import_react4 = require("react");

// src/lib/utils.ts
var import_clsx = require("clsx");
var import_tailwind_merge = require("tailwind-merge");
function cn(...inputs) {
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
}

// src/components/button/button.tsx
var import_react2 = require("react");

// src/components/icon/icon.tsx
var import_react = require("react");

// src/components/icon/icon-styles.ts
var import_styled_components = __toESM(require("styled-components"), 1);
var STROKE_WIDTH_BY_SIZE = {
  12: 1.4,
  14: 1.4,
  16: 1.8,
  18: 1.8,
  20: 1.8,
  24: 1.8
};
var DEFAULT_STROKE_WIDTH = 1.8;
function getStrokeWidth(size) {
  return STROKE_WIDTH_BY_SIZE[size] ?? DEFAULT_STROKE_WIDTH;
}
var IconWrapper = import_styled_components.default.span`
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: ${({ $color }) => $color ?? "currentColor"};
  flex-shrink: 0;
`;

// src/components/icon/icon.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var DEFAULT_SIZE = 16;
var Icon = (0, import_react.forwardRef)(function Icon2({ icon: IconComponent, size = DEFAULT_SIZE, color, className, "aria-label": ariaLabel }, ref) {
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
    IconWrapper,
    {
      ref,
      className,
      $color: color,
      "aria-label": ariaLabel,
      role: ariaLabel ? "img" : void 0,
      children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconComponent, { width: size, height: size, strokeWidth: getStrokeWidth(size) })
    }
  );
});

// src/components/button/button-styles.ts
var import_styled_components2 = __toESM(require("styled-components"), 1);

// src/tokens/colors.ts
var colors = {
  // White
  white: "#FFFFFF",
  "white-alpha-85": "rgba(255, 255, 255, 0.85)",
  "white-alpha-40": "rgba(255, 255, 255, 0.40)",
  // Brown
  "brown-10": "#FAF9F8",
  "brown-20": "#F5F3F0",
  "brown-30": "#EEEBE5",
  "brown-40": "#E6E2DA",
  "brown-50": "#CFCBC4",
  "brown-60": "#A19E99",
  "brown-70": "#73716D",
  "brown-80": "#5C5A57",
  "brown-90": "#2E2D2C",
  "brown-100": "#171716",
  "brown-alpha-12": "rgba(23, 23, 22, 0.12)",
  "brown-alpha-20": "rgba(23, 23, 22, 0.20)",
  "brown-alpha-55": "rgba(23, 23, 22, 0.55)",
  "brown-alpha-70": "rgba(23, 23, 22, 0.70)",
  "brown-alpha-80": "rgba(23, 23, 22, 0.80)",
  "brown-alpha-90": "rgba(23, 23, 22, 0.90)",
  // Fuchsia
  "fuchsia-50": "#FAF5FF",
  "fuchsia-300": "#F0ABFC",
  "fuchsia-500": "#D946EF",
  "fuchsia-600": "#C026D3",
  "fuchsia-800": "#86198F",
  // Pink
  "pink-50": "#FDF2F8",
  "pink-400": "#F472B6",
  "pink-600": "#DB2777",
  "pink-800": "#9D174D",
  // Violet
  "violet-50": "#F5F3FF",
  "violet-400": "#A78BFA",
  "violet-600": "#7C3AED",
  "violet-800": "#5B21B6",
  // Indigo
  "indigo-50": "#EEF2FF",
  "indigo-400": "#818CF8",
  "indigo-500": "#6366F1",
  "indigo-600": "#4F46E5",
  "indigo-800": "#3730A3",
  // Cyan
  "cyan-50": "#E7FEFF",
  "cyan-300": "#67E8F9",
  "cyan-600": "#0891B2",
  "cyan-900": "#164E63",
  // Teal
  "teal-50": "#EBFDF9",
  "teal-300": "#5EEAD4",
  "teal-600": "#0D9488",
  // Rose
  "rose-400": "#FB7185",
  // Purple
  "purple-400": "#C084FC",
  // Blue
  "blue-50": "#EFF6FF",
  "blue-100": "#DBEAFE",
  "blue-300": "#93C5FD",
  "blue-400": "#60A5FA",
  "blue-600": "#2563EB",
  "blue-800": "#1E40AF",
  // Sky
  "sky-300": "#7DD3FC",
  // Green
  "green-50": "#ECF9F0",
  "green-100": "#D4F1D9",
  "green-400": "#3DC269",
  "green-700": "#277C43",
  "green-800": "#1C5930",
  // Orange
  "orange-50": "#FFF7ED",
  "orange-100": "#FFEDD5",
  "orange-200": "#FED7AA",
  "orange-500": "#F97316",
  "orange-600": "#EA580C",
  // Red
  "red-50": "#FEF2F2",
  "red-100": "#FEE2E2",
  "red-200": "#FECACA",
  "red-400": "#F7776C",
  "red-500": "#EF4444",
  "red-600": "#DC2626"
};

// src/tokens/typography.ts
var fontFamilies = {
  /** Geist — primary UI font for body text, labels, headings, and display. */
  GEIST: "Geist",
  /** Crimson Pro — editorial/serif font, mostly italic. Used for decorative headings and pull quotes. */
  CRIMSON_PRO: "Crimson Pro"
};
var typographyTypes = {
  // Geist Label Caption (12px)
  GEIST_LABEL_CAPTION_REGULAR: "GEIST_LABEL_CAPTION_REGULAR",
  GEIST_LABEL_CAPTION_MEDIUM: "GEIST_LABEL_CAPTION_MEDIUM",
  GEIST_LABEL_CAPTION_SEMI_BOLD: "GEIST_LABEL_CAPTION_SEMI_BOLD",
  // Geist Body Extra Small (14px)
  GEIST_BODY_XS_REGULAR: "GEIST_BODY_XS_REGULAR",
  GEIST_BODY_XS_MEDIUM: "GEIST_BODY_XS_MEDIUM",
  GEIST_BODY_XS_BOLD: "GEIST_BODY_XS_BOLD",
  // Geist Body Small (16px)
  GEIST_BODY_S_REGULAR: "GEIST_BODY_S_REGULAR",
  GEIST_BODY_S_MEDIUM: "GEIST_BODY_S_MEDIUM",
  GEIST_BODY_S_SEMI_BOLD: "GEIST_BODY_S_SEMI_BOLD",
  GEIST_BODY_S_BOLD: "GEIST_BODY_S_BOLD",
  // Geist Body Medium (18px)
  GEIST_BODY_M_LIGHT: "GEIST_BODY_M_LIGHT",
  GEIST_BODY_M_REGULAR: "GEIST_BODY_M_REGULAR",
  GEIST_BODY_M_MEDIUM: "GEIST_BODY_M_MEDIUM",
  GEIST_BODY_M_SEMI_BOLD: "GEIST_BODY_M_SEMI_BOLD",
  // Geist Body Large (20px)
  GEIST_BODY_L_REGULAR: "GEIST_BODY_L_REGULAR",
  GEIST_BODY_L_MEDIUM: "GEIST_BODY_L_MEDIUM",
  GEIST_BODY_L_SEMI_BOLD: "GEIST_BODY_L_SEMI_BOLD",
  GEIST_BODY_L_BOLD: "GEIST_BODY_L_BOLD",
  // Geist Heading Small (24px)
  GEIST_HEADING_S_REGULAR: "GEIST_HEADING_S_REGULAR",
  GEIST_HEADING_S_MEDIUM: "GEIST_HEADING_S_MEDIUM",
  GEIST_HEADING_S_BOLD: "GEIST_HEADING_S_BOLD",
  // Geist Heading Medium (28px)
  GEIST_HEADING_M_BOLD: "GEIST_HEADING_M_BOLD",
  // Geist Heading Large (32px)
  GEIST_HEADING_L_REGULAR: "GEIST_HEADING_L_REGULAR",
  GEIST_HEADING_L_MEDIUM: "GEIST_HEADING_L_MEDIUM",
  GEIST_HEADING_L_SEMI_BOLD: "GEIST_HEADING_L_SEMI_BOLD",
  GEIST_HEADING_L_BOLD: "GEIST_HEADING_L_BOLD",
  // Geist Display Large (36px)
  GEIST_DISPLAY_L_MEDIUM: "GEIST_DISPLAY_L_MEDIUM",
  // Crimson Pro Body Small (16px, italic)
  CRIMSON_PRO_BODY_S_LIGHT_ITALIC: "CRIMSON_PRO_BODY_S_LIGHT_ITALIC",
  // Crimson Pro Body Medium (18px, italic)
  CRIMSON_PRO_BODY_M_LIGHT_ITALIC: "CRIMSON_PRO_BODY_M_LIGHT_ITALIC",
  // Crimson Pro Heading Medium (24px, italic)
  CRIMSON_PRO_HEADING_M_MEDIUM_ITALIC: "CRIMSON_PRO_HEADING_M_MEDIUM_ITALIC",
  // Crimson Pro Display Large (40px, upright)
  CRIMSON_PRO_DISPLAY_L_REGULAR: "CRIMSON_PRO_DISPLAY_L_REGULAR",
  // Crimson Pro Display Extra Large (46px, italic)
  CRIMSON_PRO_DISPLAY_XL_REGULAR_ITALIC: "CRIMSON_PRO_DISPLAY_XL_REGULAR_ITALIC"
};
var typographyStyles = {
  // Geist Label Caption (12px)
  [typographyTypes.GEIST_LABEL_CAPTION_REGULAR]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 12,
    fontWeight: 400,
    lineHeight: 16
  },
  [typographyTypes.GEIST_LABEL_CAPTION_MEDIUM]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 12,
    fontWeight: 500,
    lineHeight: 16
  },
  [typographyTypes.GEIST_LABEL_CAPTION_SEMI_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 12,
    fontWeight: 600,
    lineHeight: 16
  },
  // Geist Body Extra Small (14px)
  [typographyTypes.GEIST_BODY_XS_REGULAR]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 14,
    fontWeight: 400,
    lineHeight: 20
  },
  [typographyTypes.GEIST_BODY_XS_MEDIUM]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 14,
    fontWeight: 500,
    lineHeight: 20
  },
  [typographyTypes.GEIST_BODY_XS_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 14,
    fontWeight: 600,
    lineHeight: 20
  },
  // Geist Body Small (16px)
  [typographyTypes.GEIST_BODY_S_REGULAR]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 16,
    fontWeight: 400,
    lineHeight: 24,
    letterSpacing: -0.08
  },
  [typographyTypes.GEIST_BODY_S_MEDIUM]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 16,
    fontWeight: 500,
    lineHeight: 24,
    letterSpacing: -0.08
  },
  [typographyTypes.GEIST_BODY_S_SEMI_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 16,
    fontWeight: 600,
    lineHeight: 24,
    letterSpacing: -0.08
  },
  [typographyTypes.GEIST_BODY_S_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 16,
    fontWeight: 700,
    lineHeight: 24,
    letterSpacing: -0.08
  },
  // Geist Body Medium (18px)
  [typographyTypes.GEIST_BODY_M_LIGHT]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 18,
    fontWeight: 300,
    lineHeight: 28,
    letterSpacing: -0.09
  },
  [typographyTypes.GEIST_BODY_M_REGULAR]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 18,
    fontWeight: 400,
    lineHeight: 28,
    letterSpacing: -0.09
  },
  [typographyTypes.GEIST_BODY_M_MEDIUM]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 18,
    fontWeight: 500,
    lineHeight: 28,
    letterSpacing: -0.09
  },
  [typographyTypes.GEIST_BODY_M_SEMI_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 18,
    fontWeight: 600,
    lineHeight: 28,
    letterSpacing: -0.09
  },
  // Geist Body Large (20px)
  [typographyTypes.GEIST_BODY_L_REGULAR]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 20,
    fontWeight: 400,
    lineHeight: 30,
    letterSpacing: -0.2
  },
  [typographyTypes.GEIST_BODY_L_MEDIUM]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 20,
    fontWeight: 500,
    lineHeight: 30,
    letterSpacing: -0.2
  },
  [typographyTypes.GEIST_BODY_L_SEMI_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 20,
    fontWeight: 600,
    lineHeight: 30,
    letterSpacing: -0.2
  },
  [typographyTypes.GEIST_BODY_L_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 20,
    fontWeight: 700,
    lineHeight: 30,
    letterSpacing: -0.2
  },
  // Geist Heading Small (24px)
  [typographyTypes.GEIST_HEADING_S_REGULAR]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 24,
    fontWeight: 400,
    lineHeight: 32,
    letterSpacing: -0.48
  },
  [typographyTypes.GEIST_HEADING_S_MEDIUM]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 24,
    fontWeight: 500,
    lineHeight: 32,
    letterSpacing: -0.48
  },
  [typographyTypes.GEIST_HEADING_S_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 24,
    fontWeight: 700,
    lineHeight: 32,
    letterSpacing: -0.48
  },
  // Geist Heading Medium (28px)
  [typographyTypes.GEIST_HEADING_M_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 28,
    fontWeight: 700,
    lineHeight: 36,
    letterSpacing: -0.6
  },
  // Geist Heading Large (32px)
  [typographyTypes.GEIST_HEADING_L_REGULAR]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 32,
    fontWeight: 400,
    lineHeight: 40,
    letterSpacing: -0.64
  },
  [typographyTypes.GEIST_HEADING_L_MEDIUM]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 32,
    fontWeight: 500,
    lineHeight: 40,
    letterSpacing: -0.64
  },
  [typographyTypes.GEIST_HEADING_L_SEMI_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 32,
    fontWeight: 600,
    lineHeight: 40,
    letterSpacing: -0.64
  },
  [typographyTypes.GEIST_HEADING_L_BOLD]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 32,
    fontWeight: 700,
    lineHeight: 40,
    letterSpacing: -0.64
  },
  // Geist Display Large (36px)
  [typographyTypes.GEIST_DISPLAY_L_MEDIUM]: {
    fontFamily: fontFamilies.GEIST,
    fontSize: 36,
    fontWeight: 500,
    lineHeight: 44,
    letterSpacing: -0.72
  },
  // Crimson Pro Body Small (16px, italic)
  [typographyTypes.CRIMSON_PRO_BODY_S_LIGHT_ITALIC]: {
    fontFamily: fontFamilies.CRIMSON_PRO,
    fontSize: 16,
    fontWeight: 300,
    lineHeight: 20,
    letterSpacing: -0.32,
    fontStyle: "italic"
  },
  // Crimson Pro Body Medium (18px, italic)
  [typographyTypes.CRIMSON_PRO_BODY_M_LIGHT_ITALIC]: {
    fontFamily: fontFamilies.CRIMSON_PRO,
    fontSize: 18,
    fontWeight: 300,
    lineHeight: 28,
    letterSpacing: 0,
    fontStyle: "italic"
  },
  // Crimson Pro Heading Medium (24px, italic)
  [typographyTypes.CRIMSON_PRO_HEADING_M_MEDIUM_ITALIC]: {
    fontFamily: fontFamilies.CRIMSON_PRO,
    fontSize: 24,
    fontWeight: 400,
    lineHeight: 32,
    letterSpacing: -0.48,
    fontStyle: "italic"
  },
  // Crimson Pro Display Large (40px, upright)
  [typographyTypes.CRIMSON_PRO_DISPLAY_L_REGULAR]: {
    fontFamily: fontFamilies.CRIMSON_PRO,
    fontSize: 40,
    fontWeight: 300,
    lineHeight: 48,
    letterSpacing: -1.6
  },
  // Crimson Pro Display Extra Large (46px, italic)
  [typographyTypes.CRIMSON_PRO_DISPLAY_XL_REGULAR_ITALIC]: {
    fontFamily: fontFamilies.CRIMSON_PRO,
    fontSize: 46,
    fontWeight: 400,
    lineHeight: 54,
    letterSpacing: -1.38,
    fontStyle: "italic"
  }
};
function typographyMixin(type) {
  const style = typographyStyles[type];
  return [
    `font-family: "${style.fontFamily}", sans-serif`,
    `font-size: ${style.fontSize}px`,
    `font-weight: ${style.fontWeight}`,
    `line-height: ${style.lineHeight}px`,
    `letter-spacing: ${style.letterSpacing != null ? `${style.letterSpacing}px` : "inherit"}`,
    `font-style: ${style.fontStyle ?? "normal"}`
  ].join(";\n  ");
}

// src/components/button/constants.ts
var BUTTON_VARIANT = {
  SOLID: "solid",
  OUTLINE: "outline",
  GHOST: "ghost"
};
var BUTTON_SIZE = {
  XS: "xs",
  S: "s",
  M: "m"
};
var BUTTON_INTENT = {
  PRIMARY: "primary",
  ERROR: "error"
};
var ICON_POSITION = {
  LEADING: "leading",
  TRAILING: "trailing"
};

// src/components/button/button-styles.ts
var intentColors = {
  [BUTTON_INTENT.PRIMARY]: {
    base: colors["brown-100"],
    hover: colors["brown-90"],
    disabledBg: colors["brown-20"],
    disabledText: colors["brown-50"],
    subtleHover: colors["brown-20"],
    border: colors["brown-40"],
    disabledBorder: colors["brown-20"]
  },
  [BUTTON_INTENT.ERROR]: {
    base: colors["red-500"],
    hover: colors["red-600"],
    disabledBg: colors["red-100"],
    disabledText: colors["red-200"],
    subtleHover: colors["red-50"],
    border: colors["red-200"],
    disabledBorder: colors["red-100"]
  }
};
var sizeValues = {
  [BUTTON_SIZE.XS]: { padding: "6px 10px", borderRadius: "8px", gap: "4px" },
  [BUTTON_SIZE.S]: { padding: "8px 12px", borderRadius: "10px", gap: "6px" },
  [BUTTON_SIZE.M]: { padding: "10px 14px", borderRadius: "10px", gap: "6px" }
};
function sizeMixin({ $size }) {
  const s = sizeValues[$size];
  return import_styled_components2.css`
    padding: ${s.padding};
    border-radius: ${s.borderRadius};
    gap: ${s.gap};
  `;
}
var variantColorMap = {
  [BUTTON_VARIANT.SOLID]: (c) => ({
    background: c.base,
    color: colors.white,
    border: "none",
    hoverBg: c.hover,
    disabledBg: c.disabledBg,
    disabledColor: c.disabledText
  }),
  [BUTTON_VARIANT.OUTLINE]: (c) => ({
    background: colors.white,
    color: c.base,
    border: `1px solid ${c.border}`,
    hoverBg: c.subtleHover,
    disabledColor: c.disabledText,
    disabledBorder: c.disabledBorder
  }),
  [BUTTON_VARIANT.GHOST]: (c) => ({
    background: "transparent",
    color: c.base,
    border: "none",
    hoverBg: c.subtleHover,
    disabledColor: c.disabledText
  })
};
function variantMixin({
  $variant,
  $intent
}) {
  const v = variantColorMap[$variant](intentColors[$intent]);
  return import_styled_components2.css`
    background: ${v.background};
    color: ${v.color};
    border: ${v.border};

    &:hover:not(:disabled) {
      background: ${v.hoverBg};
    }

    &:disabled {
      color: ${v.disabledColor};
      ${v.disabledBg ? `background: ${v.disabledBg};` : ""}
      ${v.disabledBorder ? `border-color: ${v.disabledBorder};` : ""}
    }
  `;
}
var StyledButton = import_styled_components2.default.button`
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  ${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;

  &:disabled {
    cursor: not-allowed;
  }

  ${sizeMixin}
  ${variantMixin}
`;

// src/components/button/button.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var Button = (0, import_react2.forwardRef)(function Button2({
  children,
  variant = BUTTON_VARIANT.SOLID,
  intent = BUTTON_INTENT.PRIMARY,
  size = BUTTON_SIZE.M,
  icon,
  iconPosition = ICON_POSITION.LEADING,
  disabled = false,
  onClick,
  className,
  "aria-label": ariaLabel
}, ref) {
  const iconElement = icon ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { icon, size: 16 }) : null;
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
    StyledButton,
    {
      ref,
      type: "button",
      $variant: variant,
      $intent: intent,
      $size: size,
      disabled,
      onClick: disabled ? void 0 : onClick,
      className,
      "aria-label": ariaLabel,
      children: [
        iconPosition === ICON_POSITION.LEADING && iconElement,
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children }),
        iconPosition === ICON_POSITION.TRAILING && iconElement
      ]
    }
  );
});

// src/components/text-area/text-area.tsx
var import_react3 = require("react");

// src/utils/merge-refs.ts
function mergeRefs(...refs) {
  return (node) => {
    for (const ref of refs) {
      if (typeof ref === "function") {
        ref(node);
      } else if (ref) {
        ref.current = node;
      }
    }
  };
}

// src/components/text-area/text-area-styles.ts
var import_styled_components3 = __toESM(require("styled-components"), 1);
var StyledTextArea = import_styled_components3.default.textarea`
  ${typographyMixin(typographyTypes.GEIST_BODY_S_REGULAR)};
  color: ${colors["brown-100"]};
  border: none;
  outline: none;
  resize: none;
  width: 100%;
  background: transparent;
  vertical-align: bottom;
  max-height: ${({ $maxHeight }) => $maxHeight ? `${$maxHeight}px` : "none"};
  overflow-y: ${({ $maxHeight }) => $maxHeight ? "auto" : "hidden"};

  &::placeholder {
    color: ${colors["brown-50"]};
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
`;

// src/components/text-area/text-area.tsx
var import_jsx_runtime3 = require("react/jsx-runtime");
var TextArea = (0, import_react3.forwardRef)(function TextArea2({ value, onChange, placeholder, maxHeight, rows = 1, autoFocus, onKeyDown, disabled, className }, externalRef) {
  const internalRef = (0, import_react3.useRef)(null);
  (0, import_react3.useLayoutEffect)(() => {
    const el = internalRef.current;
    if (el) {
      el.style.height = "auto";
      el.style.height = `${el.scrollHeight}px`;
    }
  }, [value]);
  const handleChange = (0, import_react3.useCallback)(
    (e) => {
      onChange(e.target.value);
    },
    [onChange]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
    StyledTextArea,
    {
      ref: mergeRefs(internalRef, externalRef),
      value,
      onChange: handleChange,
      placeholder,
      $maxHeight: maxHeight,
      rows,
      autoFocus,
      onKeyDown,
      disabled,
      className
    }
  );
});

// src/components/ai-elements/prompt-input/types.ts
var CHAT_STATUS = {
  /** Idle / ready to submit. */
  READY: "ready",
  /** The last submission errored — the button shows a retry affordance. */
  ERROR: "error"
};

// src/components/ai-elements/prompt-input/prompt-input.tsx
var import_jsx_runtime4 = require("react/jsx-runtime");
var PromptInput = ({ className, onSubmit, disabled, children, ...props }) => {
  const handleSubmit = (0, import_react4.useCallback)(
    (event) => {
      event.preventDefault();
      if (disabled) {
        return;
      }
      const textarea = event.currentTarget.querySelector("textarea");
      const text = textarea?.value ?? "";
      if (!text.trim()) {
        return;
      }
      onSubmit({ text }, event);
    },
    [disabled, onSubmit]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
    "form",
    {
      className: cn(
        "flex w-full flex-col overflow-hidden rounded-xl border bg-background shadow-lg shadow-foreground/5",
        className
      ),
      onSubmit: handleSubmit,
      ...props,
      children
    }
  );
};
var PromptInputTextarea = (0, import_react4.forwardRef)(
  function PromptInputTextarea2({ className, onKeyDown, placeholder = "What would you like to know?", ...props }, ref) {
    const handleKeyDown = (0, import_react4.useCallback)(
      (event) => {
        onKeyDown?.(event);
        if (event.defaultPrevented) {
          return;
        }
        if (event.key === "Enter" && !event.shiftKey && !event.nativeEvent.isComposing) {
          event.preventDefault();
          event.currentTarget.form?.requestSubmit();
        }
      },
      [onKeyDown]
    );
    return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cn("py-3", className), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TextArea, { ref, className: "px-4", onKeyDown: handleKeyDown, placeholder, ...props }) });
  }
);
var PromptInputFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cn("flex items-center justify-between gap-1 px-4 pb-3", className), ...props });
var PromptInputTools = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cn("flex min-w-0 items-center gap-1", className), ...props });
var PromptInputSubmit = ({
  label = "Submit",
  status = CHAT_STATUS.READY,
  disabled,
  className
}) => {
  const handleClick = (0, import_react4.useCallback)((event) => {
    event.currentTarget.form?.requestSubmit();
  }, []);
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
    Button,
    {
      intent: status === CHAT_STATUS.ERROR ? BUTTON_INTENT.ERROR : BUTTON_INTENT.PRIMARY,
      size: BUTTON_SIZE.XS,
      className,
      disabled,
      onClick: handleClick,
      children: label
    }
  );
};

// src/components/ai-elements/mouse-grid/mouse-grid.tsx
var import_react5 = require("react");

// src/utils/prefers-reduced-motion.ts
function prefersReducedMotion() {
  return typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
}

// src/components/ai-elements/mouse-grid/mouse-grid.tsx
var import_jsx_runtime5 = require("react/jsx-runtime");
function MouseGrid({ glowColor, colorCycleMs = 4e3, autoDrift = false } = {}) {
  const layerRef = (0, import_react5.useRef)(null);
  const glowRef = (0, import_react5.useRef)(null);
  (0, import_react5.useEffect)(() => {
    const driftEnabled = autoDrift && !prefersReducedMotion();
    let raf = 0;
    let driftRaf = 0;
    let lastDriftTime = 0;
    let clientX = 0;
    let clientY = 0;
    let pointerInside = false;
    let centerX = 0;
    let centerY = 0;
    let hasCenter = false;
    function setCenter(x, y) {
      const layer = layerRef.current;
      if (!layer) {
        return;
      }
      centerX = x;
      centerY = y;
      hasCenter = true;
      layer.style.setProperty("--vibe-mx", `${x}px`);
      layer.style.setProperty("--vibe-my", `${y}px`);
    }
    function flush() {
      raf = 0;
      const layer = layerRef.current;
      if (!layer) {
        return;
      }
      if (driftEnabled && !pointerInside) {
        return;
      }
      const rect = layer.getBoundingClientRect();
      setCenter(clientX - rect.left, clientY - rect.top);
    }
    function onMove(event) {
      clientX = event.clientX;
      clientY = event.clientY;
      const layer = layerRef.current;
      if (layer) {
        const rect = layer.getBoundingClientRect();
        pointerInside = clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;
      }
      if (pointerInside) {
        stopDrift();
      } else {
        startDrift();
      }
      if (raf) {
        return;
      }
      raf = requestAnimationFrame(flush);
    }
    function onPointerLeave() {
      pointerInside = false;
      startDrift();
    }
    function drift(time) {
      const delta = lastDriftTime ? time - lastDriftTime : 16.67;
      lastDriftTime = time;
      driftRaf = requestAnimationFrame(drift);
      const layer = layerRef.current;
      if (!layer) {
        return;
      }
      const { width, height } = layer.getBoundingClientRect();
      if (!hasCenter) {
        centerX = width / 2;
        centerY = height / 2;
      }
      const targetX = width * (0.5 + 0.32 * Math.sin(time * 37e-5) + 0.12 * Math.sin(time * 91e-5));
      const targetY = height * (0.5 + 0.32 * Math.cos(time * 41e-5) + 0.12 * Math.sin(time * 11e-4));
      const alpha = 1 - Math.exp(-25e-4 * delta);
      setCenter(centerX + (targetX - centerX) * alpha, centerY + (targetY - centerY) * alpha);
    }
    function startDrift() {
      if (!driftEnabled || driftRaf) {
        return;
      }
      lastDriftTime = 0;
      driftRaf = requestAnimationFrame(drift);
    }
    function stopDrift() {
      if (driftRaf) {
        cancelAnimationFrame(driftRaf);
        driftRaf = 0;
      }
    }
    window.addEventListener("mousemove", onMove, { passive: true });
    document.documentElement.addEventListener("mouseleave", onPointerLeave);
    startDrift();
    return () => {
      window.removeEventListener("mousemove", onMove);
      document.documentElement.removeEventListener("mouseleave", onPointerLeave);
      if (raf) {
        cancelAnimationFrame(raf);
      }
      stopDrift();
    };
  }, [autoDrift]);
  const colorList = Array.isArray(glowColor) ? glowColor : glowColor != null ? [glowColor] : [];
  const glowColorsKey = JSON.stringify(colorList);
  (0, import_react5.useEffect)(() => {
    const glow = glowRef.current;
    if (!glow) {
      return;
    }
    const colors2 = JSON.parse(glowColorsKey).filter(Boolean);
    const staticColor = colors2[0];
    if (staticColor) {
      glow.style.setProperty("--vibe-glow-color", staticColor);
    }
    const clearColor = () => glow.style.removeProperty("--vibe-glow-color");
    if (colors2.length < 2 || prefersReducedMotion()) {
      return staticColor ? clearColor : void 0;
    }
    let index = 0;
    const raf = requestAnimationFrame(() => glow.style.setProperty("--vibe-glow-cycle", `${colorCycleMs}ms`));
    const timer = setInterval(() => {
      index = (index + 1) % colors2.length;
      glow.style.setProperty("--vibe-glow-color", colors2[index]);
    }, colorCycleMs);
    return () => {
      cancelAnimationFrame(raf);
      clearInterval(timer);
      glow.style.removeProperty("--vibe-glow-cycle");
      clearColor();
    };
  }, [glowColorsKey, colorCycleMs]);
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref: layerRef, "aria-hidden": "true", className: "vibe-mouse-grid-layer", children: [
    /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "vibe-mouse-grid" }),
    /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref: glowRef, className: "vibe-mouse-glow" })
  ] });
}

// src/components/ai-elements/suggestion/suggestion.tsx
var import_react6 = require("react");
var import_jsx_runtime6 = require("react/jsx-runtime");
var Suggestions = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn("flex flex-wrap items-center justify-center gap-3", className), ...props });
var Suggestion = ({ suggestion, onClick, className, children, ...props }) => {
  const handleClick = (0, import_react6.useCallback)(() => onClick?.(suggestion), [onClick, suggestion]);
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
    "button",
    {
      type: "button",
      onClick: handleClick,
      className: cn(
        "cursor-pointer whitespace-nowrap rounded-[12px] border border-brown-30 bg-white px-4 py-2 text-sm text-brown-100 transition-colors hover:bg-brown-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brown-40",
        className
      ),
      ...props,
      children: children ?? suggestion
    }
  );
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  CHAT_STATUS,
  MouseGrid,
  PromptInput,
  PromptInputFooter,
  PromptInputSubmit,
  PromptInputTextarea,
  PromptInputTools,
  Suggestion,
  Suggestions
});
//# sourceMappingURL=ai-elements.cjs.map