import{j as a}from"./jsx-runtime-CbGirg_M.js";import{r as i}from"./index-BoRhKTB8.js";import{u as K,c as U,d as N,e as h,P as m,f as p,g as C,h as Z,i as J,D as Q,j as X}from"./tooltip-DpaM3OdK.js";import{h as ee,R as te,u as oe,F as ne}from"./index-CbOKl9-x.js";import{c as f,I as ae}from"./misc-D4V-U9nd.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"28ce3948dcef68c9e8b5be7c5619a3bd17c18150"}}catch{}})();var D="Dialog",[_]=U(D),[re,d]=_(D),j=e=>{const{__scopeDialog:t,children:o,open:r,defaultOpen:s,onOpenChange:n,modal:c=!0}=e,l=i.useRef(null),g=i.useRef(null),[v,y]=K({prop:r,defaultProp:s??!1,onChange:n,caller:D});return a.jsx(re,{scope:t,triggerRef:l,contentRef:g,contentId:N(),titleId:N(),descriptionId:N(),open:v,onOpenChange:y,onOpenToggle:i.useCallback(()=>y(q=>!q),[y]),modal:c,children:o})};j.displayName=D;var P="DialogTrigger",I=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=d(P,o),n=h(t,s.triggerRef);return a.jsx(m.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":E(s.open),...r,ref:n,onClick:p(e.onClick,s.onOpenToggle)})});I.displayName=P;var R="DialogPortal",[se,O]=_(R,{forceMount:void 0}),T=e=>{const{__scopeDialog:t,forceMount:o,children:r,container:s}=e,n=d(R,t);return a.jsx(se,{scope:t,forceMount:o,children:i.Children.map(r,c=>a.jsx(C,{present:o||n.open,children:a.jsx(Z,{asChild:!0,container:s,children:c})}))})};T.displayName=R;var x="DialogOverlay",w=i.forwardRef((e,t)=>{const o=O(x,e.__scopeDialog),{forceMount:r=o.forceMount,...s}=e,n=d(x,e.__scopeDialog);return n.modal?a.jsx(C,{present:r||n.open,children:a.jsx(le,{...s,ref:t})}):null});w.displayName=x;var ie=J("DialogOverlay.RemoveScroll"),le=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=d(x,o);return a.jsx(te,{as:ie,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(m.div,{"data-state":E(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),u="DialogContent",A=i.forwardRef((e,t)=>{const o=O(u,e.__scopeDialog),{forceMount:r=o.forceMount,...s}=e,n=d(u,e.__scopeDialog);return a.jsx(C,{present:r||n.open,children:n.modal?a.jsx(ce,{...s,ref:t}):a.jsx(de,{...s,ref:t})})});A.displayName=u;var ce=i.forwardRef((e,t)=>{const o=d(u,e.__scopeDialog),r=i.useRef(null),s=h(t,o.contentRef,r);return i.useEffect(()=>{const n=r.current;if(n)return ee(n)},[]),a.jsx(M,{...e,ref:s,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:p(e.onCloseAutoFocus,n=>{n.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:p(e.onPointerDownOutside,n=>{const c=n.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&n.preventDefault()}),onFocusOutside:p(e.onFocusOutside,n=>n.preventDefault())})}),de=i.forwardRef((e,t)=>{const o=d(u,e.__scopeDialog),r=i.useRef(!1),s=i.useRef(!1);return a.jsx(M,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{e.onCloseAutoFocus?.(n),n.defaultPrevented||(r.current||o.triggerRef.current?.focus(),n.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:n=>{e.onInteractOutside?.(n),n.defaultPrevented||(r.current=!0,n.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=n.target;o.triggerRef.current?.contains(c)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&s.current&&n.preventDefault()}})}),M=i.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:n,...c}=e,l=d(u,o),g=i.useRef(null),v=h(t,g);return oe(),a.jsxs(a.Fragment,{children:[a.jsx(ne,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:n,children:a.jsx(Q,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":E(l.open),...c,ref:v,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(ue,{titleId:l.titleId}),a.jsx(ge,{contentRef:g,descriptionId:l.descriptionId})]})]})}),b="DialogTitle",F=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=d(b,o);return a.jsx(m.h2,{id:s.titleId,...r,ref:t})});F.displayName=b;var S="DialogDescription",k=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=d(S,o);return a.jsx(m.p,{id:s.descriptionId,...r,ref:t})});k.displayName=S;var $="DialogClose",W=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=d($,o);return a.jsx(m.button,{type:"button",...r,ref:t,onClick:p(e.onClick,()=>s.onOpenChange(!1))})});W.displayName=$;function E(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=X(L,{contentName:u,titleName:b,docsSlug:"dialog"}),ue=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},fe="DialogDescriptionWarning",ge=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(fe).contentName}}.`;return i.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},pe=j,me=I,xe=T,z=w,H=A,B=F,V=k,De=W;const Oe=pe,Te=me,ve=xe;function Y({className:e,ref:t,...o}){return a.jsx(z,{ref:t,className:f("bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm",e),...o})}Y.displayName=z.displayName;function ye({className:e,children:t,ref:o,...r}){return a.jsxs(ve,{children:[a.jsx(Y,{}),a.jsxs(H,{ref:o,className:f("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg md:w-full",e),...r,children:[t,a.jsxs(De,{className:"ring-offset-background data-[state=open]:bg-accent data-[state=open]:text-muted-foreground focus:ring-ring absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[a.jsx(ae,{name:"Close"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}ye.displayName=H.displayName;function Ne({className:e,...t}){return a.jsx("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}Ne.displayName="DialogHeader";function he({className:e,...t}){return a.jsx("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}he.displayName="DialogFooter";function Ce({className:e,ref:t,...o}){return a.jsx(B,{ref:t,className:f("text-lg leading-none font-semibold tracking-tight",e),...o})}Ce.displayName=B.displayName;function Re({className:e,ref:t,...o}){return a.jsx(V,{ref:t,className:f("text-muted-foreground text-sm",e),...o})}Re.displayName=V.displayName;export{Oe as D,ye as a,Ne as b,Ce as c,Re as d,he as e,Te as f};
//# sourceMappingURL=dialog-Bi-NzIqO.js.map
