"use client";
import{b as d}from"./chunk-YRWXX56Q.js";import{a as s,b as T}from"./chunk-QB3RHMEP.js";import{e as n}from"./chunk-TERSEXPI.js";import{a as c,m as u}from"./chunk-QKAMOL6D.js";import{s as t}from"./chunk-KEPQUAOX.js";import{forwardRef as B,useCallback as E,useEffect as w,useState as I}from"react";import{faClose as N}from"@fortawesome/free-solid-svg-icons";import{FontAwesomeIcon as W}from"@fortawesome/react-fontawesome";import g from"clsx";var k=c("EulToast",["root","alert","compact"]),x=o=>n("EulToast",{alert:["alert"],compact:["compact"],root:[o.variant,"root"]}),a=k;import{css as v}from"@emotion/react";var C=u(t)(({theme:o})=>v`
    position: fixed;
    top: ${o.spacing(4)};
    right: ${o.spacing(4)};
    z-index: ${o.zIndex.modal};
    display: flex;
    flex-direction: column;
    gap: ${o.spacing(1)};
    align-items: flex-end;
    width: ${o.spacing(75)};

    .${a.alert} {
      background: ${o.palette.background[400]};
    }

    &.${a.compact} {
      .${s.title}, .${s.description}, .${s.action} {
        font-size: ${o.spacing(3)};
      }
    }
  `);import{jsx as r,jsxs as F}from"react/jsx-runtime";var e=B(({alert:o,className:$,dismiss:y,duration:p=3e3,onDismiss:l,variant:P},S)=>{let i=x({variant:P}),[b,m]=I(!0),f=E(()=>{m(!1),l?.()},[m,l]);return w(()=>{p!==0&&setTimeout(()=>{f()},p)},[]),b?F(C,{className:g($,i.root),ref:S,children:[y?r(d,{onClick:f,size:"small",startIcon:r(W,{icon:N}),variant:"ghost"}):null,r(t,{className:g(i.alert),children:r(T,{...o})})]}):null});e.defaultProps={variant:"normal"};e.displayName="Toast";var A=e;export{a,A as b};
