import { jsx } from 'react/jsx-runtime';
import * as React from 'react';
import { T as Toaster$2, O as OctagonX, C as CircleCheck } from '../index-CDo_esrR.js';
import { L as LoaderCircle } from '../loader-circle-DycHUAWN.js';
import { T as TriangleAlert } from '../triangle-alert-C434HydH.js';
import { I as Info } from '../info-BlwkmMZr.js';
import '../createLucideIcon-C8ycilSN.js';
import 'react-dom';

var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x=React.createContext(void 0),U={setTheme:e=>{},themes:[]},z=()=>{var e;return (e=React.useContext(x))!=null?e:U};React.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return React.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})});

const Toaster$1 = ({ ...props }) => {
  const { theme = "system" } = z();
  return /* @__PURE__ */ jsx(
    Toaster$2,
    {
      theme,
      className: "toaster group",
      icons: {
        success: /* @__PURE__ */ jsx(CircleCheck, { className: "size-4" }),
        info: /* @__PURE__ */ jsx(Info, { className: "size-4" }),
        warning: /* @__PURE__ */ jsx(TriangleAlert, { className: "size-4" }),
        error: /* @__PURE__ */ jsx(OctagonX, { className: "size-4" }),
        loading: /* @__PURE__ */ jsx(LoaderCircle, { className: "size-4 animate-spin" })
      },
      style: {
        "--normal-bg": "var(--popover)",
        "--normal-text": "var(--popover-foreground)",
        "--normal-border": "var(--border)",
        "--border-radius": "var(--radius)"
      },
      toastOptions: {
        classNames: {
          toast: "cn-toast"
        }
      },
      ...props
    }
  );
};

const Toaster = (props) => /* @__PURE__ */ jsx(
  Toaster$1,
  {
    toastOptions: {
      classNames: {
        toast: "cn-toast",
        success: "!bg-success-solid !text-success-solid-foreground !border-success-solid/30",
        error: "!bg-error-solid !text-error-solid-foreground !border-error-solid/30",
        warning: "!bg-warning-solid !text-warning-solid-foreground !border-warning-solid/30",
        info: "!bg-info-solid !text-info-solid-foreground !border-info-solid/30"
      }
    },
    ...props
  }
);

export { Toaster };
//# sourceMappingURL=Sonner.js.map
