"use client"
import{a as c}from"./chunk-WHJZ5S6U.mjs";import{c as s}from"./chunk-QMDEODYC.mjs";import{cva as p}from"class-variance-authority";import{createContext as C,useContext as g,useEffect as h,useRef as x,useState as b}from"react";import{jsx as i}from"react/jsx-runtime";var L=p("w-full group/card border-gray-200 bg-white",{variants:{variant:{compact:"first-of-type:rounded-t-xl last-of-type:rounded-b-xl first-of-type:border-t border-b border-x hover:bg-gray-50 transition-colors",loose:"border rounded-xl transition-[filter] hover:drop-shadow-card-hover"}}}),y="w-full py-2.5 px-4",E=C({hovered:!1});function k({outerClassName:f,innerClassName:u,children:m,onClick:d}){let{variant:v}=g(c),t=x(null),[o,a]=b(!1);return h(()=>{if(!o||!t.current)return;let r=setInterval(()=>{var n;((n=t.current)==null?void 0:n.matches(":hover"))===!1&&a(!1)},1e3);return()=>clearInterval(r)},[o]),i("li",{ref:t,className:s(L({variant:v}),f),onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),children:i("div",{className:s(y,u),onClick:d?r=>{if(!document.getElementById("modal-backdrop")){for(let e=r.target,l=0;e&&e!==r.currentTarget&&l<100;e=e.parentElement,l++)if(["button","a","input","textarea"].includes(e.tagName.toLowerCase()))return;d()}}:void 0,children:i(E.Provider,{value:{hovered:o},children:m})})})}export{E as a,k as b};
