import{t as Q,d as X,L as Y,g as V,e as W,F as O,c as Z,m as ee,a2 as se,S as ae,o as te,f,G as M,a3 as re}from"./index-BfMm4PRv.js";import{j as x,h as m}from"./codemirror-core-vkcnXJgD.js";import{l as oe,n as le,k as de,i as ne}from"./react-dom-CwaHFgt6.js";var S=Q({slots:{base:["flex","flex-col","relative","overflow-hidden","h-auto","outline-none","text-foreground","box-border","bg-content1",...X],header:["flex","p-3","z-10","w-full","justify-start","items-center","shrink-0","overflow-inherit","color-inherit","subpixel-antialiased"],body:["relative","flex","flex-1","w-full","p-3","flex-auto","flex-col","place-content-inherit","align-items-inherit","h-auto","break-words","text-left","overflow-y-auto","subpixel-antialiased"],footer:["p-3","h-auto","flex","w-full","items-center","overflow-hidden","color-inherit","subpixel-antialiased"]},variants:{shadow:{none:{base:"shadow-none"},sm:{base:"shadow-small"},md:{base:"shadow-medium"},lg:{base:"shadow-large"}},radius:{none:{base:"rounded-none",header:"rounded-none",footer:"rounded-none"},sm:{base:"rounded-small",header:"rounded-t-small",footer:"rounded-b-small"},md:{base:"rounded-medium",header:"rounded-t-medium",footer:"rounded-b-medium"},lg:{base:"rounded-large",header:"rounded-t-large",footer:"rounded-b-large"}},fullWidth:{true:{base:"w-full"}},isHoverable:{true:{base:"data-[hover=true]:bg-content2 dark:data-[hover=true]:bg-content2"}},isPressable:{true:{base:"cursor-pointer"}},isBlurred:{true:{base:["bg-background/80","dark:bg-background/20","backdrop-blur-md","backdrop-saturate-150"]}},isFooterBlurred:{true:{footer:["bg-background/10","backdrop-blur","backdrop-saturate-150"]}},isDisabled:{true:{base:"opacity-disabled cursor-not-allowed"}},disableAnimation:{true:"",false:{base:"transition-transform-background motion-reduce:transition-none"}}},compoundVariants:[{isPressable:!0,class:"data-[pressed=true]:scale-[0.97] tap-highlight-transparent"}],defaultVariants:{radius:"lg",shadow:"md",fullWidth:!1,isHoverable:!1,isPressable:!1,isDisabled:!1,isFooterBlurred:!1}}),[ie,ue]=Y({name:"CardContext",strict:!0,errorMessage:"useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"}),I=V((e,o)=>{var a;const{as:l,className:d,children:s,...u}=e,n=l||"div",b=W(o),{slots:t,classNames:p}=ue(),C=O(p==null?void 0:p.body,d);return x.jsx(n,{ref:b,className:(a=t.body)==null?void 0:a.call(t,{class:C}),...u,children:s})});I.displayName="HeroUI.CardBody";var pe=I;function be(e){var o,a,l,d;const s=Z(),[u,n]=ee(e,S.variantKeys),{ref:b,as:t,children:p,onClick:C,onPress:E,autoFocus:U,className:z,classNames:c,allowTextSelectionOnPress:G=!0,...h}=u,i=W(b),P=t||(e.isPressable?"button":"div"),$=typeof P=="string",r=(a=(o=e.disableAnimation)!=null?o:s==null?void 0:s.disableAnimation)!=null?a:!1,w=(d=(l=e.disableRipple)!=null?l:s==null?void 0:s.disableRipple)!=null?d:!1,F=O(c==null?void 0:c.base,z),{onClear:H,onPress:g,ripples:B}=se(),_=m.useCallback(D=>{w||r||i.current&&g(D)},[w,r,i,g]),{buttonProps:j,isPressed:y}=ae({onPress:oe(E,_),elementType:t,isDisabled:!e.isPressable,onClick:C,allowTextSelectionOnPress:G,...h},i),{hoverProps:N,isHovered:k}=le({isDisabled:!e.isHoverable,...h}),{isFocusVisible:R,isFocused:K,focusProps:A}=de({autoFocus:U}),v=m.useMemo(()=>S({...n,disableAnimation:r}),[te(n),r]),L=m.useMemo(()=>({slots:v,classNames:c,disableAnimation:r,isDisabled:e.isDisabled,isFooterBlurred:e.isFooterBlurred,fullWidth:e.fullWidth}),[v,c,e.isDisabled,e.isFooterBlurred,r,e.fullWidth]),q=m.useCallback((D={})=>({ref:i,className:v.base({class:F}),tabIndex:e.isPressable?0:-1,"data-hover":f(k),"data-pressed":f(y),"data-focus":f(K),"data-focus-visible":f(R),"data-disabled":f(e.isDisabled),...ne(e.isPressable?{...j,...A,role:"button"}:{},e.isHoverable?N:{},M(h,{enabled:$}),M(D))}),[i,v,F,$,e.isPressable,e.isHoverable,e.isDisabled,k,y,R,j,A,N,h]),J=m.useCallback(()=>({ripples:B,onClear:H}),[B,H]);return{context:L,domRef:i,Component:P,classNames:c,children:p,isHovered:k,isPressed:y,disableAnimation:r,isPressable:e.isPressable,isHoverable:e.isHoverable,disableRipple:w,handlePress:_,isFocusVisible:R,getCardProps:q,getRippleProps:J}}var T=V((e,o)=>{const{children:a,context:l,Component:d,isPressable:s,disableAnimation:u,disableRipple:n,getCardProps:b,getRippleProps:t}=be({...e,ref:o});return x.jsxs(d,{...b(),children:[x.jsx(ie,{value:l,children:a}),s&&!u&&!n&&x.jsx(re,{...t()})]})});T.displayName="HeroUI.Card";var he=T;export{he as a,pe as c,ue as u};
