"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cn = exports.cva = exports.Tooltip = exports.DropdownMenu = exports.Collapsible = exports.Tabs = exports.Switch = exports.RadioGroup = exports.Checkbox = exports.Select = exports.Toast = exports.AlertDialog = exports.Dialog = exports.ModernAgentDashboard = exports.CardFooter = exports.CardContent = exports.CardDescription = exports.CardTitle = exports.CardHeader = exports.Card = exports.ToastComponent = exports.ToastProvider = exports.Modal = exports.ModernSelect = exports.Input = exports.Button = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
/**
 * Modern Component System - Radix UI + Tailwind CSS
 * Zero runtime overhead, superior performance, enterprise-grade accessibility
 */
const react_1 = __importDefault(require("react"));
const Dialog = __importStar(require("@radix-ui/react-dialog"));
exports.Dialog = Dialog;
const AlertDialog = __importStar(require("@radix-ui/react-alert-dialog"));
exports.AlertDialog = AlertDialog;
const Toast = __importStar(require("@radix-ui/react-toast"));
exports.Toast = Toast;
const Select = __importStar(require("@radix-ui/react-select"));
exports.Select = Select;
const Checkbox = __importStar(require("@radix-ui/react-checkbox"));
exports.Checkbox = Checkbox;
const RadioGroup = __importStar(require("@radix-ui/react-radio-group"));
exports.RadioGroup = RadioGroup;
const Switch = __importStar(require("@radix-ui/react-switch"));
exports.Switch = Switch;
const Tabs = __importStar(require("@radix-ui/react-tabs"));
exports.Tabs = Tabs;
const Collapsible = __importStar(require("@radix-ui/react-collapsible"));
exports.Collapsible = Collapsible;
const DropdownMenu = __importStar(require("@radix-ui/react-dropdown-menu"));
exports.DropdownMenu = DropdownMenu;
const Tooltip = __importStar(require("@radix-ui/react-tooltip"));
exports.Tooltip = Tooltip;
const class_variance_authority_1 = require("class-variance-authority");
Object.defineProperty(exports, "cva", { enumerable: true, get: function () { return class_variance_authority_1.cva; } });
const cn_js_1 = require("../utils/cn.js");
Object.defineProperty(exports, "cn", { enumerable: true, get: function () { return cn_js_1.cn; } });
// Simple logger implementation
class Logger {
    constructor(config) { this.config = config; }
    info(msg, data) { console.info(`[${this.config.context}] ${msg}`, data); }
    debug(msg, data) { console.debug(`[${this.config.context}] ${msg}`, data); }
    warn(msg, data) { console.warn(`[${this.config.context}] ${msg}`, data); }
    error(msg, data) { console.error(`[${this.config.context}] ${msg}`, data); }
}
// Modern button component with CVA for variant management
const buttonVariants = (0, class_variance_authority_1.cva)(
// Base styles
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", {
    variants: {
        variant: {
            default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
            destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
            outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
            secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
            ghost: "hover:bg-accent hover:text-accent-foreground",
            link: "text-primary underline-offset-4 hover:underline",
        },
        size: {
            default: "h-9 px-4 py-2",
            sm: "h-8 rounded-md px-3 text-xs",
            lg: "h-10 rounded-md px-8",
            icon: "h-9 w-9",
        },
    },
    defaultVariants: {
        variant: "default",
        size: "default",
    },
});
exports.Button = react_1.default.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
    return ((0, jsx_runtime_1.jsx)("button", { className: (0, cn_js_1.cn)(buttonVariants({ variant, size, className })), ref: ref, ...props }));
});
exports.Button.displayName = "Button";
exports.Input = react_1.default.forwardRef(({ className, type, label, error, helperText, ...props }, ref) => {
    const inputId = react_1.default.useId();
    return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [label && ((0, jsx_runtime_1.jsx)("label", { htmlFor: inputId, className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: label })), (0, jsx_runtime_1.jsx)("input", { type: type, id: inputId, className: (0, cn_js_1.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", error && "border-destructive focus-visible:ring-destructive", className), ref: ref, ...props }), error && ((0, jsx_runtime_1.jsx)("p", { className: "text-sm text-destructive", children: error })), helperText && !error && ((0, jsx_runtime_1.jsx)("p", { className: "text-sm text-muted-foreground", children: helperText }))] }));
});
exports.Input.displayName = "Input";
exports.ModernSelect = react_1.default.forwardRef(({ placeholder, options, value, onValueChange, label, error, ...props }, ref) => {
    const selectId = react_1.default.useId();
    return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [label && ((0, jsx_runtime_1.jsx)("label", { htmlFor: selectId, className: "text-sm font-medium leading-none", children: label })), (0, jsx_runtime_1.jsxs)(Select.Root, { value: value, onValueChange: onValueChange, children: [(0, jsx_runtime_1.jsxs)(Select.Trigger, { ref: ref, className: (0, cn_js_1.cn)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", error && "border-destructive focus:ring-destructive"), ...props, children: [(0, jsx_runtime_1.jsx)(Select.Value, { placeholder: placeholder }), (0, jsx_runtime_1.jsx)(Select.Icon, { className: "h-4 w-4 opacity-50", children: (0, jsx_runtime_1.jsx)("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "m4.93179 5.43179c.20264-.20264.53117-.20264.73381 0l2.33440 2.33440 2.3344-2.33440c.2026-.20264.5312-.20264.7338 0 .2027.20264.2027.53117 0 .73381l-2.6663 2.66630c-.2026.2027-.5312.2027-.7338 0l-2.66630-2.66630c-.20264-.20264-.20264-.53117 0-.73381z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }) })] }), (0, jsx_runtime_1.jsx)(Select.Portal, { children: (0, jsx_runtime_1.jsx)(Select.Content, { className: "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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", children: (0, jsx_runtime_1.jsx)(Select.Viewport, { className: "p-1", children: options.map((option) => ((0, jsx_runtime_1.jsxs)(Select.Item, { value: option.value, disabled: option.disabled, className: "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", children: [(0, jsx_runtime_1.jsx)(Select.ItemText, { children: option.label }), (0, jsx_runtime_1.jsx)(Select.ItemIndicator, { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: (0, jsx_runtime_1.jsx)("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "m11.4669 3.72684c.2626.2626.2626.6884 0 .9511l-6.34577 6.34583c-.26266.2626-.68843.2626-.9511 0l-2.81733-2.8173c-.26267-.2627-.26267-.6885 0-.9511s.68841-.2627.95108 0l2.34177 2.3418 5.87017-5.87017c.2626-.26267.6884-.26267.9511 0z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }) })] }, option.value))) }) }) })] }), error && ((0, jsx_runtime_1.jsx)("p", { className: "text-sm text-destructive", children: error }))] }));
});
exports.ModernSelect.displayName = "ModernSelect";
const Modal = ({ open, onOpenChange, title, description, children, trigger, }) => {
    return ((0, jsx_runtime_1.jsxs)(Dialog.Root, { open: open, onOpenChange: onOpenChange, children: [trigger && (0, jsx_runtime_1.jsx)(Dialog.Trigger, { asChild: true, children: trigger }), (0, jsx_runtime_1.jsxs)(Dialog.Portal, { children: [(0, jsx_runtime_1.jsx)(Dialog.Overlay, { className: "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }), (0, jsx_runtime_1.jsxs)(Dialog.Content, { className: "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", children: [title && ((0, jsx_runtime_1.jsx)(Dialog.Title, { className: "text-lg font-semibold leading-none tracking-tight", children: title })), description && ((0, jsx_runtime_1.jsx)(Dialog.Description, { className: "text-sm text-muted-foreground", children: description })), children, (0, jsx_runtime_1.jsxs)(Dialog.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [(0, jsx_runtime_1.jsx)("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "m11.7816 4.03157c.0824.07677.0824.20118 0 .27795l-2.7849 2.78493 2.7849 2.7849c.0824.0768.0824.2012 0 .2780-.0768.0824-.2012.0824-.2780 0l-2.7849-2.7849-2.78493 2.7849c-.07677.0824-.20118.0824-.27795 0-.08236-.0768-.08236-.2012 0-.2780l2.78493-2.7849-2.78493-2.78493c-.08236-.07677-.08236-.20118 0-.27795.07677-.08236.20118-.08236.27795 0l2.78493 2.78493 2.7849-2.78493c.0768-.08236.2012-.08236.2780 0z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Close" })] })] })] })] }));
};
exports.Modal = Modal;
const ToastProvider = ({ children }) => {
    return ((0, jsx_runtime_1.jsxs)(Toast.Provider, { swipeDirection: "right", children: [children, (0, jsx_runtime_1.jsx)(Toast.Viewport, { className: "fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]" })] }));
};
exports.ToastProvider = ToastProvider;
exports.ToastComponent = react_1.default.forwardRef(({ title, description, type = 'default', ...props }, ref) => {
    const toastVariants = (0, class_variance_authority_1.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full", {
        variants: {
            variant: {
                default: "border bg-background text-foreground",
                success: "border-green-500 bg-green-50 text-green-900",
                error: "border-red-500 bg-red-50 text-red-900",
                warning: "border-yellow-500 bg-yellow-50 text-yellow-900",
            },
        },
        defaultVariants: {
            variant: "default",
        },
    });
    return ((0, jsx_runtime_1.jsxs)(Toast.Root, { ref: ref, className: (0, cn_js_1.cn)(toastVariants({ variant: type })), ...props, children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid gap-1", children: [title && ((0, jsx_runtime_1.jsx)(Toast.Title, { className: "text-sm font-semibold [&+div]:text-xs", children: title })), description && ((0, jsx_runtime_1.jsx)(Toast.Description, { className: "text-sm opacity-90", children: description }))] }), (0, jsx_runtime_1.jsx)(Toast.Close, { className: "absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100", children: (0, jsx_runtime_1.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "m11.7816 4.03157c.0824.07677.0824.20118 0 .27795l-2.7849 2.78493 2.7849 2.7849c.0824.0768.0824.2012 0 .2780-.0768.0824-.2012.0824-.2780 0l-2.7849-2.7849-2.78493 2.7849c-.07677.0824-.20118.0824-.27795 0-.08236-.0768-.08236-.2012 0-.2780l2.78493-2.7849-2.78493-2.78493c-.08236-.07677-.08236-.20118 0-.27795.07677-.08236.20118-.08236.27795 0l2.78493 2.78493 2.7849-2.78493c.0768-.08236.2012-.08236.2780 0z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }) })] }));
});
exports.ToastComponent.displayName = "ToastComponent";
exports.Card = react_1.default.forwardRef(({ className, variant = 'default', ...props }, ref) => {
    const cardVariants = (0, class_variance_authority_1.cva)("rounded-lg border text-card-foreground", {
        variants: {
            variant: {
                default: "bg-card shadow-sm",
                elevated: "bg-card shadow-lg",
                outlined: "bg-transparent border-2",
            },
        },
        defaultVariants: {
            variant: "default",
        },
    });
    return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, cn_js_1.cn)(cardVariants({ variant }), className), ...props }));
});
exports.Card.displayName = "Card";
exports.CardHeader = react_1.default.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, cn_js_1.cn)("flex flex-col space-y-1.5 p-6", className), ...props })));
exports.CardHeader.displayName = "CardHeader";
exports.CardTitle = react_1.default.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("h3", { ref: ref, className: (0, cn_js_1.cn)("font-semibold leading-none tracking-tight", className), ...props })));
exports.CardTitle.displayName = "CardTitle";
exports.CardDescription = react_1.default.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("p", { ref: ref, className: (0, cn_js_1.cn)("text-sm text-muted-foreground", className), ...props })));
exports.CardDescription.displayName = "CardDescription";
exports.CardContent = react_1.default.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, cn_js_1.cn)("p-6 pt-0", className), ...props })));
exports.CardContent.displayName = "CardContent";
exports.CardFooter = react_1.default.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, cn_js_1.cn)("flex items-center p-6 pt-0", className), ...props })));
exports.CardFooter.displayName = "CardFooter";
const ModernAgentDashboard = ({ agents, onAgentSelect, }) => {
    const logger = new Logger({ context: 'modern-agent-dashboard' });
    react_1.default.useEffect(() => {
        logger.info('Modern Agent Dashboard initialized', {
            agentCount: agents.length,
            performance: 'Zero runtime CSS overhead with Radix UI'
        });
    }, [agents.length, logger]);
    return ((0, jsx_runtime_1.jsx)("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-3", children: agents.map((agent) => ((0, jsx_runtime_1.jsxs)(exports.Card, { className: "cursor-pointer transition-colors hover:bg-muted/50", onClick: () => onAgentSelect?.(agent.id), children: [(0, jsx_runtime_1.jsxs)(exports.CardHeader, { className: "pb-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)(exports.CardTitle, { className: "text-base", children: agent.name }), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_js_1.cn)("h-2 w-2 rounded-full", agent.status === 'active' && "bg-green-500", agent.status === 'inactive' && "bg-gray-400", agent.status === 'error' && "bg-red-500") })] }), (0, jsx_runtime_1.jsxs)(exports.CardDescription, { children: ["Status: ", agent.status.charAt(0).toUpperCase() + agent.status.slice(1)] })] }), (0, jsx_runtime_1.jsx)(exports.CardContent, { children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-muted-foreground", children: "Requests:" }), (0, jsx_runtime_1.jsx)("span", { className: "font-medium", children: agent.metrics.requests.toLocaleString() })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-muted-foreground", children: "Success Rate:" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-medium", children: [agent.metrics.successRate, "%"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-muted-foreground", children: "Avg Response:" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-medium", children: [agent.metrics.avgResponseTime, "ms"] })] })] }) })] }, agent.id))) }));
};
exports.ModernAgentDashboard = ModernAgentDashboard;
//# sourceMappingURL=ModernComponentSystem.js.map