import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{l as t}from"./vendor-map-UawGledW.js";import{t as n}from"./vendor-react-Botiei7A.js";import{t as r}from"./useTranslation-8J697w9K.js";var i=e(t()),a=n(),o={primary:`bg-primary-600 hover:bg-primary-700 text-white`,danger:`bg-red-600 hover:bg-red-700 text-white`};function s({open:e,onConfirm:t,onCancel:n,title:s,message:c,confirmLabel:l,cancelLabel:u,variant:d=`primary`}){let{t:f}=r(),p=(0,i.useRef)(null),m=l??f(`ui.confirmDialog.confirm`),h=u??f(`ui.confirmDialog.cancel`);return(0,i.useEffect)(()=>{e&&p.current?.focus()},[e]),(0,i.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,n]),e?(0,a.jsx)(`div`,{className:`fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50`,onClick:n,children:(0,a.jsxs)(`div`,{className:`bg-white rounded-xl max-w-sm w-full shadow-strong animate-scale-in`,onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)(`div`,{className:`p-6`,children:[(0,a.jsx)(`h3`,{className:`text-lg font-bold text-gray-900 font-LeagueSpartan mb-2`,children:s}),(0,a.jsx)(`p`,{className:`text-sm text-gray-600 font-Montserrat`,children:c})]}),(0,a.jsxs)(`div`,{className:`flex gap-3 px-6 pb-6`,children:[(0,a.jsx)(`button`,{type:`button`,onClick:n,className:`flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2.5 px-4 rounded-lg font-medium transition-colors`,children:h}),(0,a.jsx)(`button`,{ref:p,type:`button`,onClick:t,className:`flex-1 py-2.5 px-4 rounded-lg font-medium transition-colors ${o[d]}`,children:m})]})]})}):null}export{s as t};