import{v as _,x as $,D as Z,bJ as T,p as g,q as ee,n as se,H as ae,i as te,r as m,t as U}from"./react-dom-C0IJc3nR.js";import{q as oe,d as P,c as re,A as le,z as de,C as ne}from"./index-DiFbo-KR.js";import{j as C,h as v}from"./codemirror-core-DIzFijqu.js";var[ce,W]=oe({name:"CardContext",strict:!0,errorMessage:"useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"}),q=_((e,o)=>{var s;const{as:r,className:l,children:a,...n}=e,d=r||"div",c=P(o),{slots:t,classNames:i}=W(),f=$(i==null?void 0:i.body,l);return C.jsx(d,{ref:c,className:(s=t.body)==null?void 0:s.call(t,{class:f}),...n,children:a})});q.displayName="HeroUI.CardBody";var pe=q,E=_((e,o)=>{var s;const{as:r,className:l,children:a,...n}=e,d=r||"div",c=P(o),{slots:t,classNames:i}=W(),f=$(i==null?void 0:i.header,l);return C.jsx(d,{ref:c,className:(s=t.header)==null?void 0:s.call(t,{class:f}),...n,children:a})});E.displayName="HeroUI.CardHeader";var me=E;function ie(e){var o,s,r,l;const a=re(),[n,d]=Z(e,T.variantKeys),{ref:c,as:t,children:i,onClick:f,onPress:z,autoFocus:J,className:K,classNames:p,allowTextSelectionOnPress:G=!0,...x}=n,b=P(c),j=t||(e.isPressable?"button":"div"),A=typeof j=="string",u=(s=(o=e.disableAnimation)!=null?o:a==null?void 0:a.disableAnimation)!=null?s:!1,y=(l=(r=e.disableRipple)!=null?r:a==null?void 0:a.disableRipple)!=null?l:!1,F=$(p==null?void 0:p.base,K),{onClear:B,onPress:M,ripples:S}=le(),k=v.useCallback(N=>{y||u||b.current&&M(N)},[y,u,b,M]),{buttonProps:w,isPressed:R}=de({onPress:g(z,k),elementType:t,isDisabled:!e.isPressable,onClick:f,allowTextSelectionOnPress:G,...x},b),{hoverProps:I,isHovered:H}=ee({isDisabled:!e.isHoverable,...x}),{isFocusVisible:D,isFocused:L,focusProps:O}=se({autoFocus:J}),h=v.useMemo(()=>T({...d,disableAnimation:u}),[ae(d),u]),Q=v.useMemo(()=>({slots:h,classNames:p,disableAnimation:u,isDisabled:e.isDisabled,isFooterBlurred:e.isFooterBlurred,fullWidth:e.fullWidth}),[h,p,e.isDisabled,e.isFooterBlurred,u,e.fullWidth]),X=v.useCallback((N={})=>({ref:b,className:h.base({class:F}),tabIndex:e.isPressable?0:-1,"data-hover":m(H),"data-pressed":m(R),"data-focus":m(L),"data-focus-visible":m(D),"data-disabled":m(e.isDisabled),...te(e.isPressable?{...w,...O,role:"button"}:{},e.isHoverable?I:{},U(x,{enabled:A}),U(N))}),[b,h,F,A,e.isPressable,e.isHoverable,e.isDisabled,H,R,D,w,O,I,x]),Y=v.useCallback(()=>({ripples:S,onClear:B}),[S,B]);return{context:Q,domRef:b,Component:j,classNames:p,children:i,isHovered:H,isPressed:R,disableAnimation:u,isPressable:e.isPressable,isHoverable:e.isHoverable,disableRipple:y,handlePress:k,isFocusVisible:D,getCardProps:X,getRippleProps:Y}}var V=_((e,o)=>{const{children:s,context:r,Component:l,isPressable:a,disableAnimation:n,disableRipple:d,getCardProps:c,getRippleProps:t}=ie({...e,ref:o});return C.jsxs(l,{...c(),children:[C.jsx(ce,{value:r,children:s}),a&&!n&&!d&&C.jsx(ne,{...t()})]})});V.displayName="HeroUI.Card";var ve=V;export{pe as a,ve as b,me as c,W as u};
