import{h as u,j as w}from"./codemirror-core-vkcnXJgD.js";import{t as U,c as q,m as G,e as J,o as Q,F as B,f as L,g as X}from"./index-BfMm4PRv.js";import{u as Y}from"./index-ckqvMWAF.js";var R=U({slots:{wrapper:"relative shadow-black/5",zoomedWrapper:"relative overflow-hidden rounded-inherit",img:"relative z-10 opacity-0 shadow-black/5 data-[loaded=true]:opacity-100",blurredImg:["absolute","z-0","inset-0","w-full","h-full","object-cover","filter","blur-lg","scale-105","saturate-150","opacity-30","translate-y-1"]},variants:{radius:{none:{},sm:{},md:{},lg:{},full:{}},shadow:{none:{wrapper:"shadow-none",img:"shadow-none"},sm:{wrapper:"shadow-small",img:"shadow-small"},md:{wrapper:"shadow-medium",img:"shadow-medium"},lg:{wrapper:"shadow-large",img:"shadow-large"}},isZoomed:{true:{img:["object-cover","transform","hover:scale-125"]}},showSkeleton:{true:{wrapper:["group","relative","overflow-hidden","bg-content3 dark:bg-content2"],img:"opacity-0"}},disableAnimation:{true:{img:"transition-none"},false:{img:"transition-transform-opacity motion-reduce:transition-none !duration-300"}}},defaultVariants:{radius:"lg",shadow:"none",isZoomed:!1,isBlurred:!1,showSkeleton:!1},compoundVariants:[{showSkeleton:!0,disableAnimation:!1,class:{wrapper:["before:opacity-100","before:absolute","before:inset-0","before:-translate-x-full","before:animate-[shimmer_2s_infinite]","before:border-t","before:border-content4/30","before:bg-gradient-to-r","before:from-transparent","before:via-content4","dark:before:via-default-700/10","before:to-transparent","after:opacity-100","after:absolute","after:inset-0","after:-z-10","after:bg-content3","dark:after:bg-content2"]}}],compoundSlots:[{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"none",class:"rounded-none"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"full",class:"rounded-full"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"sm",class:"rounded-small"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"md",class:"rounded-md"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"lg",class:"rounded-large"}]});function ee(l){var c,p;const g=q(),[e,n]=G(l,R.variantKeys),{ref:v,as:i,src:o,className:I,classNames:r,loading:f,isBlurred:b,fallbackSrc:s,isLoading:a,disableSkeleton:d=!!s,removeWrapper:_=!1,onError:E,onLoad:$,srcSet:k,sizes:y,crossOrigin:x,...h}=e,S=Y({src:o,loading:f,onError:E,onLoad:$,ignoreFallback:!1,srcSet:k,sizes:y,crossOrigin:x}),z=(p=(c=l.disableAnimation)!=null?c:g==null?void 0:g.disableAnimation)!=null?p:!1,W=S==="loaded"&&!a,j=S==="loading"||a,F=l.isZoomed,M=i||"img",N=J(v),{w:P,h:V}=u.useMemo(()=>({w:e.width?typeof e.width=="number"?`${e.width}px`:e.width:"fit-content",h:e.height?typeof e.height=="number"?`${e.height}px`:e.height:"auto"}),[e==null?void 0:e.width,e==null?void 0:e.height]),A=(!o||!W)&&!!s,C=j&&!d,t=u.useMemo(()=>R({...n,disableAnimation:z,showSkeleton:C}),[Q(n),z,C]),D=B(I,r==null?void 0:r.img),O=(m={})=>{const T=B(D,m==null?void 0:m.className);return{src:o,ref:N,"data-loaded":L(W),className:t.img({class:T}),loading:f,srcSet:k,sizes:y,crossOrigin:x,...h,style:{...(h==null?void 0:h.height)&&{height:V},...m.style,...h.style}}},H=u.useCallback(()=>{const m=A?{backgroundImage:`url(${s})`}:{};return{className:t.wrapper({class:r==null?void 0:r.wrapper}),style:{...m,maxWidth:P}}},[t,A,s,r==null?void 0:r.wrapper,P]),K=u.useCallback(()=>({src:o,"aria-hidden":L(!0),className:t.blurredImg({class:r==null?void 0:r.blurredImg})}),[t,o,r==null?void 0:r.blurredImg]);return{Component:M,domRef:N,slots:t,classNames:r,isBlurred:b,disableSkeleton:d,fallbackSrc:s,removeWrapper:_,isZoomed:F,isLoading:j,getImgProps:O,getWrapperProps:H,getBlurredImgProps:K}}var Z=X((l,c)=>{const{Component:p,domRef:g,slots:e,classNames:n,isBlurred:v,isZoomed:i,fallbackSrc:o,removeWrapper:I,disableSkeleton:r,getImgProps:f,getWrapperProps:b,getBlurredImgProps:s}=ee({...l,ref:c}),a=w.jsx(p,{ref:g,...f()});if(I)return a;const d=w.jsx("div",{className:e.zoomedWrapper({class:n==null?void 0:n.zoomedWrapper}),children:a});return v?w.jsxs("div",{...b(),children:[i?d:a,u.cloneElement(a,s())]}):i||!r||o?w.jsxs("div",{...b(),children:[" ",i?d:a]}):a});Z.displayName="HeroUI.Image";var se=Z;export{se as i};
