const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-dom-C0IJc3nR.js","assets/codemirror-core-DIzFijqu.js","assets/react-dom-Cfkhaq8h.css"])))=>i.map(i=>d[i]);
import{q as H,_ as S,T as h,z as U,b as w}from"./index-DiFbo-KR.js";import{h as s,j as e}from"./codemirror-core-DIzFijqu.js";import{z,B as j,L as b,m as C,i as _,bf as L,v as F,A as V,J as q}from"./react-dom-C0IJc3nR.js";import{a as J}from"./chunk-WQVQ7P2I-De41EkH8.js";import{c as G}from"./chunk-KVDW62ZT-D3Q7mIBo.js";var[K,$]=H({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),y=()=>S(()=>import("./react-dom-C0IJc3nR.js").then(t=>t.cj),__vite__mapDeps([0,1,2])).then(t=>t.default),A=t=>{const{as:a,children:i,className:p,...o}=t,{Component:l,placement:r,backdrop:n,motionProps:f,disableAnimation:c,getPopoverProps:m,getDialogProps:d,getBackdropProps:v,getContentProps:u,isNonModal:I,onClose:x}=$(),P=s.useRef(null),{dialogProps:N,titleProps:M}=z({},P),O=d({ref:P,...N,...o}),D=a||l||"div",g=e.jsxs(e.Fragment,{children:[!I&&e.jsx(j,{onDismiss:x}),e.jsx(D,{...O,children:e.jsx("div",{...u({className:p}),children:typeof i=="function"?i(M):i})}),e.jsx(j,{onDismiss:x})]}),E=s.useMemo(()=>n==="transparent"?null:c?e.jsx("div",{...v()}):e.jsx(b,{features:y,children:e.jsx(C.div,{animate:"enter",exit:"exit",initial:"exit",variants:h.fade,...v()})}),[n,c,v]),k=r?J(r==="center"?"top":r):void 0,B=e.jsx(e.Fragment,{children:c?g:e.jsx(b,{features:y,children:e.jsx(C.div,{animate:"enter",exit:"exit",initial:"initial",style:k,variants:h.scaleSpringOpacity,...f,children:g})})});return e.jsxs("div",{...m(),children:[E,B]})};A.displayName="HeroUI.PopoverContent";var ee=A,R=t=>{var a;const{triggerRef:i,getTriggerProps:p}=$(),{children:o,...l}=t,r=s.useMemo(()=>typeof o=="string"?e.jsx("p",{children:o}):s.Children.only(o),[o]),n=(a=r.props.ref)!=null?a:r.ref,{onPress:f,isDisabled:c,...m}=s.useMemo(()=>p(_(l,r.props),n),[p,r.props,l,n]),[,d]=L(o,w),{buttonProps:v}=U({onPress:f,isDisabled:c},i),u=s.useMemo(()=>(d==null?void 0:d[0])!==void 0,[d]);return s.cloneElement(r,_(m,u?{onPress:f,isDisabled:c}:v))};R.displayName="HeroUI.PopoverTrigger";var oe=R,T=F((t,a)=>{const{children:i,...p}=t,o=G({...p,ref:a}),[l,r]=s.Children.toArray(i),n=e.jsx(q,{portalContainer:o.portalContainer,children:r});return e.jsxs(K,{value:o,children:[l,o.disableAnimation&&o.isOpen?n:e.jsx(V,{children:o.isOpen?n:null})]})});T.displayName="HeroUI.Popover";var re=T;export{oe as a,ee as b,re as p};
