import{r as qt,a as Zt,b as pr}from"./vendor-D8-FJEVI.js";function hr(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Ke={exports:{}},ge={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Rt;function vr(){if(Rt)return ge;Rt=1;var e=qt(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(s,f,l){var u,d={},h=null,p=null;l!==void 0&&(h=""+l),f.key!==void 0&&(h=""+f.key),f.ref!==void 0&&(p=f.ref);for(u in f)r.call(f,u)&&!i.hasOwnProperty(u)&&(d[u]=f[u]);if(s&&s.defaultProps)for(u in f=s.defaultProps,f)d[u]===void 0&&(d[u]=f[u]);return{$$typeof:t,type:s,key:h,ref:p,props:d,_owner:o.current}}return ge.Fragment=n,ge.jsx=c,ge.jsxs=c,ge}var At;function gr(){return At||(At=1,Ke.exports=vr()),Ke.exports}var S=gr(),a=qt();const ee=Zt(a),Jt=hr({__proto__:null,default:ee},[a]);var lt=pr();const yr=Zt(lt);function j(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Pt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qt(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Pt(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{const{children:c,...s}=i,f=a.useMemo(()=>s,Object.values(s));return S.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function o(i){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function We(e,t=[]){let n=[];function r(i,c){const s=a.createContext(c),f=n.length;n=[...n,c];const l=d=>{const{scope:h,children:p,...y}=d,m=h?.[e]?.[f]||s,v=a.useMemo(()=>y,Object.values(y));return S.jsx(m.Provider,{value:v,children:p})};l.displayName=i+"Provider";function u(d,h){const p=h?.[e]?.[f]||s,y=a.useContext(p);if(y)return y;if(c!==void 0)return c;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,u]}const o=()=>{const i=n.map(c=>a.createContext(c));return function(s){const f=s?.[e]||i;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:f}}),[s,f])}};return o.scopeName=e,[r,xr(o,...t)]}function xr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const c=r.reduce((s,{useScope:f,scopeName:l})=>{const d=f(i)[`__scope${l}`];return{...s,...d}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function ye(e){const t=br(e),n=a.forwardRef((r,o)=>{const{children:i,...c}=r,s=a.Children.toArray(i),f=s.find(Er);if(f){const l=f.props.children,u=s.map(d=>d===f?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:d);return S.jsx(t,{...c,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,u):null})}return S.jsx(t,{...c,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var Ps=ye("Slot");function br(e){const t=a.forwardRef((n,r)=>{const{children:o,...i}=n;if(a.isValidElement(o)){const c=Sr(o),s=Cr(i,o.props);return o.type!==a.Fragment&&(s.ref=r?Qt(r,c):c),a.cloneElement(o,s)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var en=Symbol("radix.slottable");function Os(e){const t=({children:n})=>S.jsx(S.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=en,t}function Er(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===en}function Cr(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const f=i(...s);return o(...s),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Sr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Rr(e){const t=e+"CollectionProvider",[n,r]=We(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=m=>{const{scope:v,children:g}=m,b=ee.useRef(null),w=ee.useRef(new Map).current;return S.jsx(o,{scope:v,itemMap:w,collectionRef:b,children:g})};c.displayName=t;const s=e+"CollectionSlot",f=ye(s),l=ee.forwardRef((m,v)=>{const{scope:g,children:b}=m,w=i(s,g),x=H(v,w.collectionRef);return S.jsx(f,{ref:x,children:b})});l.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=ye(u),p=ee.forwardRef((m,v)=>{const{scope:g,children:b,...w}=m,x=ee.useRef(null),E=H(v,x),R=i(u,g);return ee.useEffect(()=>(R.itemMap.set(x,{ref:x,...w}),()=>void R.itemMap.delete(x))),S.jsx(h,{[d]:"",ref:E,children:b})});p.displayName=u;function y(m){const v=i(e+"CollectionConsumer",m);return ee.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((R,C)=>w.indexOf(R.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:c,Slot:l,ItemSlot:p},y,r]}var Ar=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=Ar.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=a.forwardRef((o,i)=>{const{asChild:c,...s}=o,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(f,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Pr(e,t){e&<.flushSync(()=>e.dispatchEvent(t))}function ie(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}function Or(e,t=globalThis?.document){const n=ie(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Dr="DismissableLayer",rt="dismissableLayer.update",Tr="dismissableLayer.pointerDownOutside",Nr="dismissableLayer.focusOutside",Ot,tn=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ut=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...f}=e,l=a.useContext(tn),[u,d]=a.useState(null),h=u?.ownerDocument??globalThis?.document,[,p]=a.useState({}),y=H(t,C=>d(C)),m=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(v),b=u?m.indexOf(u):-1,w=l.layersWithOutsidePointerEventsDisabled.size>0,x=b>=g,E=_r(C=>{const A=C.target,T=[...l.branches].some(D=>D.contains(A));!x||T||(o?.(C),c?.(C),C.defaultPrevented||s?.())},h),R=Mr(C=>{const A=C.target;[...l.branches].some(D=>D.contains(A))||(i?.(C),c?.(C),C.defaultPrevented||s?.())},h);return Or(C=>{b===l.layers.size-1&&(r?.(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))},h),a.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ot=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Dt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ot)}},[u,h,n,l]),a.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Dt())},[u,l]),a.useEffect(()=>{const C=()=>p({});return document.addEventListener(rt,C),()=>document.removeEventListener(rt,C)},[]),S.jsx(W.div,{...f,ref:y,style:{pointerEvents:w?x?"auto":"none":void 0,...e.style},onFocusCapture:j(e.onFocusCapture,R.onFocusCapture),onBlurCapture:j(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,E.onPointerDownCapture)})});ut.displayName=Dr;var Ir="DismissableLayerBranch",nn=a.forwardRef((e,t)=>{const n=a.useContext(tn),r=a.useRef(null),o=H(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),S.jsx(W.div,{...e,ref:o})});nn.displayName=Ir;function _r(e,t=globalThis?.document){const n=ie(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let f=function(){rn(Tr,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Mr(e,t=globalThis?.document){const n=ie(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&rn(Nr,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Dt(){const e=new CustomEvent(rt);document.dispatchEvent(e)}function rn(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Pr(o,i):o.dispatchEvent(i)}var Ds=ut,Ts=nn,ne=globalThis?.document?a.useLayoutEffect:()=>{},Fr="Portal",on=a.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=a.useState(!1);ne(()=>i(!0),[]);const c=n||o&&globalThis?.document?.body;return c?yr.createPortal(S.jsx(W.div,{...r,ref:t}),c):null});on.displayName=Fr;function Lr(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var $e=e=>{const{present:t,children:n}=e,r=kr(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),i=H(r.ref,jr(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:i}):null};$e.displayName="Presence";function kr(e){const[t,n]=a.useState(),r=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),c=e?"mounted":"unmounted",[s,f]=Lr(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const l=Se(r.current);i.current=s==="mounted"?l:"none"},[s]),ne(()=>{const l=r.current,u=o.current;if(u!==e){const h=i.current,p=Se(l);e?f("MOUNT"):p==="none"||l?.display==="none"?f("UNMOUNT"):f(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),ne(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=p=>{const m=Se(r.current).includes(p.animationName);if(p.target===t&&m&&(f("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=p=>{p.target===t&&(i.current=Se(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Se(e){return e?.animationName||"none"}function jr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wr=Jt[" useInsertionEffect ".trim().toString()]||ne;function sn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,c]=$r({defaultProp:t,onChange:n}),s=e!==void 0,f=s?e:o;{const u=a.useRef(e!==void 0);a.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const l=a.useCallback(u=>{if(s){const d=Br(u)?u(e):u;d!==e&&c.current?.(d)}else i(u)},[s,e,i,c]);return[f,l]}function $r({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),i=a.useRef(t);return Wr(()=>{i.current=t},[t]),a.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function Br(e){return typeof e=="function"}var Hr=Jt[" useId ".trim().toString()]||(()=>{}),Ur=0;function Te(e){const[t,n]=a.useState(Hr());return ne(()=>{n(r=>r??String(Ur++))},[e]),t?`radix-${t}`:""}const Vr=["top","right","bottom","left"],re=Math.min,$=Math.max,Me=Math.round,Re=Math.floor,X=e=>({x:e,y:e}),zr={left:"right",right:"left",bottom:"top",top:"bottom"},Kr={start:"end",end:"start"};function ot(e,t,n){return $(e,re(t,n))}function J(e,t){return typeof e=="function"?e(t):e}function Q(e){return e.split("-")[0]}function pe(e){return e.split("-")[1]}function ft(e){return e==="x"?"y":"x"}function dt(e){return e==="y"?"height":"width"}const Yr=new Set(["top","bottom"]);function G(e){return Yr.has(Q(e))?"y":"x"}function mt(e){return ft(G(e))}function Gr(e,t,n){n===void 0&&(n=!1);const r=pe(e),o=mt(e),i=dt(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=Fe(c)),[c,Fe(c)]}function Xr(e){const t=Fe(e);return[it(e),t,it(t)]}function it(e){return e.replace(/start|end/g,t=>Kr[t])}const Tt=["left","right"],Nt=["right","left"],qr=["top","bottom"],Zr=["bottom","top"];function Jr(e,t,n){switch(e){case"top":case"bottom":return n?t?Nt:Tt:t?Tt:Nt;case"left":case"right":return t?qr:Zr;default:return[]}}function Qr(e,t,n,r){const o=pe(e);let i=Jr(Q(e),n==="start",r);return o&&(i=i.map(c=>c+"-"+o),t&&(i=i.concat(i.map(it)))),i}function Fe(e){return e.replace(/left|right|bottom|top/g,t=>zr[t])}function eo(e){return{top:0,right:0,bottom:0,left:0,...e}}function cn(e){return typeof e!="number"?eo(e):{top:e,right:e,bottom:e,left:e}}function Le(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function It(e,t,n){let{reference:r,floating:o}=e;const i=G(t),c=mt(t),s=dt(c),f=Q(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let p;switch(f){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(pe(t)){case"start":p[c]-=h*(n&&l?-1:1);break;case"end":p[c]+=h*(n&&l?-1:1);break}return p}const to=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:c}=n,s=i.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let l=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=It(l,r,f),h=r,p={},y=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:c,elements:s,middlewareData:f}=t,{element:l,padding:u=0}=J(e,t)||{};if(l==null)return{};const d=cn(u),h={x:n,y:r},p=mt(o),y=dt(p),m=await c.getDimensions(l),v=p==="y",g=v?"top":"left",b=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=i.reference[y]+i.reference[p]-h[p]-i.floating[y],E=h[p]-i.reference[p],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(l));let C=R?R[w]:0;(!C||!await(c.isElement==null?void 0:c.isElement(R)))&&(C=s.floating[w]||i.floating[y]);const A=x/2-E/2,T=C/2-m[y]/2-1,D=re(d[g],T),_=re(d[b],T),F=D,I=C-m[y]-_,N=C/2-m[y]/2+A,k=ot(F,N,I),O=!f.arrow&&pe(o)!=null&&N!==k&&i.reference[y]/2-(NN<=0)){var _,F;const N=(((_=i.flip)==null?void 0:_.index)||0)+1,k=C[N];if(k&&(!(d==="alignment"?b!==G(k):!1)||D.every(P=>P.overflows[0]>0&&G(P.placement)===b)))return{data:{index:N,overflows:D},reset:{placement:k}};let O=(F=D.filter(M=>M.overflows[0]<=0).sort((M,P)=>M.overflows[1]-P.overflows[1])[0])==null?void 0:F.placement;if(!O)switch(p){case"bestFit":{var I;const M=(I=D.filter(P=>{if(R){const L=G(P.placement);return L===b||L==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(L=>L>0).reduce((L,K)=>L+K,0)]).sort((P,L)=>P[1]-L[1])[0])==null?void 0:I[0];M&&(O=M);break}case"initialPlacement":O=s;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function _t(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Mt(e){return Vr.some(t=>e[t]>=0)}const oo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=J(e,t);switch(r){case"referenceHidden":{const i=await we(t,{...o,elementContext:"reference"}),c=_t(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Mt(c)}}}case"escaped":{const i=await we(t,{...o,altBoundary:!0}),c=_t(i,n.floating);return{data:{escapedOffsets:c,escaped:Mt(c)}}}default:return{}}}}},an=new Set(["left","top"]);async function io(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Q(n),s=pe(n),f=G(n)==="y",l=an.has(c)?-1:1,u=i&&f?-1:1,d=J(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof y=="number"&&(p=s==="end"?y*-1:y),f?{x:p*u,y:h*l}:{x:h*l,y:p*u}}const so=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:c,middlewareData:s}=t,f=await io(t,e);return c===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:i+f.y,data:{...f,placement:c}}}}},co=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:s={fn:v=>{let{x:g,y:b}=v;return{x:g,y:b}}},...f}=J(e,t),l={x:n,y:r},u=await we(t,f),d=G(Q(o)),h=ft(d);let p=l[h],y=l[d];if(i){const v=h==="y"?"top":"left",g=h==="y"?"bottom":"right",b=p+u[v],w=p-u[g];p=ot(b,p,w)}if(c){const v=d==="y"?"top":"left",g=d==="y"?"bottom":"right",b=y+u[v],w=y-u[g];y=ot(b,y,w)}const m=s.fn({...t,[h]:p,[d]:y});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[d]:c}}}}}},ao=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:c}=t,{offset:s=0,mainAxis:f=!0,crossAxis:l=!0}=J(e,t),u={x:n,y:r},d=G(o),h=ft(d);let p=u[h],y=u[d];const m=J(s,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(f){const w=h==="y"?"height":"width",x=i.reference[h]-i.floating[w]+v.mainAxis,E=i.reference[h]+i.reference[w]-v.mainAxis;pE&&(p=E)}if(l){var g,b;const w=h==="y"?"width":"height",x=an.has(Q(o)),E=i.reference[d]-i.floating[w]+(x&&((g=c.offset)==null?void 0:g[d])||0)+(x?0:v.crossAxis),R=i.reference[d]+i.reference[w]+(x?0:((b=c.offset)==null?void 0:b[d])||0)-(x?v.crossAxis:0);yR&&(y=R)}return{[h]:p,[d]:y}}}},lo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:c,elements:s}=t,{apply:f=()=>{},...l}=J(e,t),u=await we(t,l),d=Q(o),h=pe(o),p=G(o)==="y",{width:y,height:m}=i.floating;let v,g;d==="top"||d==="bottom"?(v=d,g=h===(await(c.isRTL==null?void 0:c.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,v=h==="end"?"top":"bottom");const b=m-u.top-u.bottom,w=y-u.left-u.right,x=re(m-u[v],b),E=re(y-u[g],w),R=!t.middlewareData.shift;let C=x,A=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=b),R&&!h){const D=$(u.left,0),_=$(u.right,0),F=$(u.top,0),I=$(u.bottom,0);p?A=y-2*(D!==0||_!==0?D+_:$(u.left,u.right)):C=m-2*(F!==0||I!==0?F+I:$(u.top,u.bottom))}await f({...t,availableWidth:A,availableHeight:C});const T=await c.getDimensions(s.floating);return y!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function Be(){return typeof window<"u"}function he(e){return ln(e)?(e.nodeName||"").toLowerCase():"#document"}function B(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Z(e){var t;return(t=(ln(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ln(e){return Be()?e instanceof Node||e instanceof B(e).Node:!1}function U(e){return Be()?e instanceof Element||e instanceof B(e).Element:!1}function q(e){return Be()?e instanceof HTMLElement||e instanceof B(e).HTMLElement:!1}function Ft(e){return!Be()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof B(e).ShadowRoot}const uo=new Set(["inline","contents"]);function be(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=V(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!uo.has(o)}const fo=new Set(["table","td","th"]);function mo(e){return fo.has(he(e))}const po=[":popover-open",":modal"];function He(e){return po.some(t=>{try{return e.matches(t)}catch{return!1}})}const ho=["transform","translate","scale","rotate","perspective"],vo=["transform","translate","scale","rotate","perspective","filter"],go=["paint","layout","strict","content"];function pt(e){const t=ht(),n=U(e)?V(e):e;return ho.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||vo.some(r=>(n.willChange||"").includes(r))||go.some(r=>(n.contain||"").includes(r))}function yo(e){let t=oe(e);for(;q(t)&&!me(t);){if(pt(t))return t;if(He(t))return null;t=oe(t)}return null}function ht(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wo=new Set(["html","body","#document"]);function me(e){return wo.has(he(e))}function V(e){return B(e).getComputedStyle(e)}function Ue(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oe(e){if(he(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ft(e)&&e.host||Z(e);return Ft(t)?t.host:t}function un(e){const t=oe(e);return me(t)?e.ownerDocument?e.ownerDocument.body:e.body:q(t)&&be(t)?t:un(t)}function xe(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=un(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),c=B(o);if(i){const s=st(c);return t.concat(c,c.visualViewport||[],be(o)?o:[],s&&n?xe(s):[])}return t.concat(o,xe(o,[],n))}function st(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fn(e){const t=V(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=q(e),i=o?e.offsetWidth:n,c=o?e.offsetHeight:r,s=Me(n)!==i||Me(r)!==c;return s&&(n=i,r=c),{width:n,height:r,$:s}}function vt(e){return U(e)?e:e.contextElement}function fe(e){const t=vt(e);if(!q(t))return X(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=fn(t);let c=(i?Me(n.width):n.width)/r,s=(i?Me(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!s||!Number.isFinite(s))&&(s=1),{x:c,y:s}}const xo=X(0);function dn(e){const t=B(e);return!ht()||!t.visualViewport?xo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==B(e)?!1:t}function se(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=vt(e);let c=X(1);t&&(r?U(r)&&(c=fe(r)):c=fe(e));const s=bo(i,n,r)?dn(i):X(0);let f=(o.left+s.x)/c.x,l=(o.top+s.y)/c.y,u=o.width/c.x,d=o.height/c.y;if(i){const h=B(i),p=r&&U(r)?B(r):r;let y=h,m=st(y);for(;m&&r&&p!==y;){const v=fe(m),g=m.getBoundingClientRect(),b=V(m),w=g.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,x=g.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;f*=v.x,l*=v.y,u*=v.x,d*=v.y,f+=w,l+=x,y=B(m),m=st(y)}}return Le({width:u,height:d,x:f,y:l})}function gt(e,t){const n=Ue(e).scrollLeft;return t?t.left+n:se(Z(e)).left+n}function mn(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:gt(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Eo(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",c=Z(r),s=t?He(t.floating):!1;if(r===c||s&&i)return n;let f={scrollLeft:0,scrollTop:0},l=X(1);const u=X(0),d=q(r);if((d||!d&&!i)&&((he(r)!=="body"||be(c))&&(f=Ue(r)),q(r))){const p=se(r);l=fe(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const h=c&&!d&&!i?mn(c,f,!0):X(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-f.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-f.scrollTop*l.y+u.y+h.y}}function Co(e){return Array.from(e.getClientRects())}function So(e){const t=Z(e),n=Ue(e),r=e.ownerDocument.body,o=$(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=$(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+gt(e);const s=-n.scrollTop;return V(r).direction==="rtl"&&(c+=$(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:c,y:s}}function Ro(e,t){const n=B(e),r=Z(e),o=n.visualViewport;let i=r.clientWidth,c=r.clientHeight,s=0,f=0;if(o){i=o.width,c=o.height;const l=ht();(!l||l&&t==="fixed")&&(s=o.offsetLeft,f=o.offsetTop)}return{width:i,height:c,x:s,y:f}}const Ao=new Set(["absolute","fixed"]);function Po(e,t){const n=se(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=q(e)?fe(e):X(1),c=e.clientWidth*i.x,s=e.clientHeight*i.y,f=o*i.x,l=r*i.y;return{width:c,height:s,x:f,y:l}}function Lt(e,t,n){let r;if(t==="viewport")r=Ro(e,n);else if(t==="document")r=So(Z(e));else if(U(t))r=Po(t,n);else{const o=dn(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Le(r)}function pn(e,t){const n=oe(e);return n===t||!U(n)||me(n)?!1:V(n).position==="fixed"||pn(n,t)}function Oo(e,t){const n=t.get(e);if(n)return n;let r=xe(e,[],!1).filter(s=>U(s)&&he(s)!=="body"),o=null;const i=V(e).position==="fixed";let c=i?oe(e):e;for(;U(c)&&!me(c);){const s=V(c),f=pt(c);!f&&s.position==="fixed"&&(o=null),(i?!f&&!o:!f&&s.position==="static"&&!!o&&Ao.has(o.position)||be(c)&&!f&&pn(e,c))?r=r.filter(u=>u!==c):o=s,c=oe(c)}return t.set(e,r),r}function Do(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?He(t)?[]:Oo(t,this._c):[].concat(n),r],s=c[0],f=c.reduce((l,u)=>{const d=Lt(t,u,o);return l.top=$(d.top,l.top),l.right=re(d.right,l.right),l.bottom=re(d.bottom,l.bottom),l.left=$(d.left,l.left),l},Lt(t,s,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function To(e){const{width:t,height:n}=fn(e);return{width:t,height:n}}function No(e,t,n){const r=q(t),o=Z(t),i=n==="fixed",c=se(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const f=X(0);function l(){f.x=gt(o)}if(r||!r&&!i)if((he(t)!=="body"||be(o))&&(s=Ue(t)),r){const p=se(t,!0,i,t);f.x=p.x+t.clientLeft,f.y=p.y+t.clientTop}else o&&l();i&&!r&&o&&l();const u=o&&!r&&!i?mn(o,s):X(0),d=c.left+s.scrollLeft-f.x-u.x,h=c.top+s.scrollTop-f.y-u.y;return{x:d,y:h,width:c.width,height:c.height}}function Ye(e){return V(e).position==="static"}function kt(e,t){if(!q(e)||V(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Z(e)===n&&(n=n.ownerDocument.body),n}function hn(e,t){const n=B(e);if(He(e))return n;if(!q(e)){let o=oe(e);for(;o&&!me(o);){if(U(o)&&!Ye(o))return o;o=oe(o)}return n}let r=kt(e,t);for(;r&&mo(r)&&Ye(r);)r=kt(r,t);return r&&me(r)&&Ye(r)&&!pt(r)?n:r||yo(e)||n}const Io=async function(e){const t=this.getOffsetParent||hn,n=this.getDimensions,r=await n(e.floating);return{reference:No(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _o(e){return V(e).direction==="rtl"}const Mo={convertOffsetParentRelativeRectToViewportRelativeRect:Eo,getDocumentElement:Z,getClippingRect:Do,getOffsetParent:hn,getElementRects:Io,getClientRects:Co,getDimensions:To,getScale:fe,isElement:U,isRTL:_o};function vn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fo(e,t){let n=null,r;const o=Z(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function c(s,f){s===void 0&&(s=!1),f===void 0&&(f=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=l;if(s||t(),!h||!p)return;const y=Re(d),m=Re(o.clientWidth-(u+h)),v=Re(o.clientHeight-(d+p)),g=Re(u),w={rootMargin:-y+"px "+-m+"px "+-v+"px "+-g+"px",threshold:$(0,re(1,f))||1};let x=!0;function E(R){const C=R[0].intersectionRatio;if(C!==f){if(!x)return c();C?c(!1,C):r=setTimeout(()=>{c(!1,1e-7)},1e3)}C===1&&!vn(l,e.getBoundingClientRect())&&c(),x=!1}try{n=new IntersectionObserver(E,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,w)}n.observe(e)}return c(!0),i}function Lo(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,l=vt(e),u=o||i?[...l?xe(l):[],...xe(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const d=l&&s?Fo(l,n):null;let h=-1,p=null;c&&(p=new ResizeObserver(g=>{let[b]=g;b&&b.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),l&&!f&&p.observe(l),p.observe(t));let y,m=f?se(e):null;f&&v();function v(){const g=se(e);m&&!vn(m,g)&&n(),m=g,y=requestAnimationFrame(v)}return n(),()=>{var g;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(g=p)==null||g.disconnect(),p=null,f&&cancelAnimationFrame(y)}}const ko=so,jo=co,Wo=ro,$o=lo,Bo=oo,jt=no,Ho=ao,Uo=(e,t,n)=>{const r=new Map,o={platform:Mo,...n},i={...o.platform,_c:r};return to(e,t,{...o,platform:i})};var Vo=typeof document<"u",zo=function(){},Ne=Vo?a.useLayoutEffect:zo;function ke(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ke(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ke(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function gn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wt(e,t){const n=gn(e);return Math.round(t*n)/n}function Ge(e){const t=a.useRef(e);return Ne(()=>{t.current=e}),t}function Ko(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:c}={},transform:s=!0,whileElementsMounted:f,open:l}=e,[u,d]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=a.useState(r);ke(h,r)||p(r);const[y,m]=a.useState(null),[v,g]=a.useState(null),b=a.useCallback(P=>{P!==R.current&&(R.current=P,m(P))},[]),w=a.useCallback(P=>{P!==C.current&&(C.current=P,g(P))},[]),x=i||y,E=c||v,R=a.useRef(null),C=a.useRef(null),A=a.useRef(u),T=f!=null,D=Ge(f),_=Ge(o),F=Ge(l),I=a.useCallback(()=>{if(!R.current||!C.current)return;const P={placement:t,strategy:n,middleware:h};_.current&&(P.platform=_.current),Uo(R.current,C.current,P).then(L=>{const K={...L,isPositioned:F.current!==!1};N.current&&!ke(A.current,K)&&(A.current=K,lt.flushSync(()=>{d(K)}))})},[h,t,n,_,F]);Ne(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[l]);const N=a.useRef(!1);Ne(()=>(N.current=!0,()=>{N.current=!1}),[]),Ne(()=>{if(x&&(R.current=x),E&&(C.current=E),x&&E){if(D.current)return D.current(x,E,I);I()}},[x,E,I,D,T]);const k=a.useMemo(()=>({reference:R,floating:C,setReference:b,setFloating:w}),[b,w]),O=a.useMemo(()=>({reference:x,floating:E}),[x,E]),M=a.useMemo(()=>{const P={position:n,left:0,top:0};if(!O.floating)return P;const L=Wt(O.floating,u.x),K=Wt(O.floating,u.y);return s?{...P,transform:"translate("+L+"px, "+K+"px)",...gn(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:K}},[n,s,O.floating,u.x,u.y]);return a.useMemo(()=>({...u,update:I,refs:k,elements:O,floatingStyles:M}),[u,I,k,O,M])}const Yo=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?jt({element:r.current,padding:o}).fn(n):{}:r?jt({element:r,padding:o}).fn(n):{}}}},Go=(e,t)=>({...ko(e),options:[e,t]}),Xo=(e,t)=>({...jo(e),options:[e,t]}),qo=(e,t)=>({...Ho(e),options:[e,t]}),Zo=(e,t)=>({...Wo(e),options:[e,t]}),Jo=(e,t)=>({...$o(e),options:[e,t]}),Qo=(e,t)=>({...Bo(e),options:[e,t]}),ei=(e,t)=>({...Yo(e),options:[e,t]});var ti="Arrow",yn=a.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return S.jsx(W.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});yn.displayName=ti;var ni=yn;function ri(e){const[t,n]=a.useState(void 0);return ne(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let c,s;if("borderBoxSize"in i){const f=i.borderBoxSize,l=Array.isArray(f)?f[0]:f;c=l.inlineSize,s=l.blockSize}else c=e.offsetWidth,s=e.offsetHeight;n({width:c,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var yt="Popper",[wn,Ns]=We(yt),[oi,xn]=wn(yt),bn=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.useState(null);return S.jsx(oi,{scope:t,anchor:r,onAnchorChange:o,children:n})};bn.displayName=yt;var En="PopperAnchor",Cn=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=xn(En,n),c=a.useRef(null),s=H(t,c);return a.useEffect(()=>{i.onAnchorChange(r?.current||c.current)}),r?null:S.jsx(W.div,{...o,ref:s})});Cn.displayName=En;var wt="PopperContent",[ii,si]=wn(wt),Sn=a.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:c=0,arrowPadding:s=0,avoidCollisions:f=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:y,...m}=e,v=xn(wt,n),[g,b]=a.useState(null),w=H(t,ve=>b(ve)),[x,E]=a.useState(null),R=ri(x),C=R?.width??0,A=R?.height??0,T=r+(i!=="center"?"-"+i:""),D=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},_=Array.isArray(l)?l:[l],F=_.length>0,I={padding:D,boundary:_.filter(ai),altBoundary:F},{refs:N,floatingStyles:k,placement:O,isPositioned:M,middlewareData:P}=Ko({strategy:"fixed",placement:T,whileElementsMounted:(...ve)=>Lo(...ve,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Go({mainAxis:o+A,alignmentAxis:c}),f&&Xo({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?qo():void 0,...I}),f&&Zo({...I}),Jo({...I,apply:({elements:ve,rects:St,availableWidth:ur,availableHeight:fr})=>{const{width:dr,height:mr}=St.reference,Ce=ve.floating.style;Ce.setProperty("--radix-popper-available-width",`${ur}px`),Ce.setProperty("--radix-popper-available-height",`${fr}px`),Ce.setProperty("--radix-popper-anchor-width",`${dr}px`),Ce.setProperty("--radix-popper-anchor-height",`${mr}px`)}}),x&&ei({element:x,padding:s}),li({arrowWidth:C,arrowHeight:A}),h&&Qo({strategy:"referenceHidden",...I})]}),[L,K]=Pn(O),Ct=ie(y);ne(()=>{M&&Ct?.()},[M,Ct]);const ir=P.arrow?.x,sr=P.arrow?.y,cr=P.arrow?.centerOffset!==0,[ar,lr]=a.useState();return ne(()=>{g&&lr(window.getComputedStyle(g).zIndex)},[g]),S.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:M?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ar,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(ii,{scope:n,placedSide:L,onArrowChange:E,arrowX:ir,arrowY:sr,shouldHideArrow:cr,children:S.jsx(W.div,{"data-side":L,"data-align":K,...m,ref:w,style:{...m.style,animation:M?void 0:"none"}})})})});Sn.displayName=wt;var Rn="PopperArrow",ci={top:"bottom",right:"left",bottom:"top",left:"right"},An=a.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=si(Rn,r),c=ci[i.placedSide];return S.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:S.jsx(ni,{...o,ref:n,style:{...o.style,display:"block"}})})});An.displayName=Rn;function ai(e){return e!==null}var li=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,c=o.arrow?.centerOffset!==0,s=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[l,u]=Pn(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(o.arrow?.x??0)+s/2,p=(o.arrow?.y??0)+f/2;let y="",m="";return l==="bottom"?(y=c?d:`${h}px`,m=`${-f}px`):l==="top"?(y=c?d:`${h}px`,m=`${r.floating.height+f}px`):l==="right"?(y=`${-f}px`,m=c?d:`${p}px`):l==="left"&&(y=`${r.floating.width+f}px`,m=c?d:`${p}px`),{data:{x:y,y:m}}}});function Pn(e){const[t,n="center"]=e.split("-");return[t,n]}var Is=bn,_s=Cn,Ms=Sn,Fs=An,ui=a.createContext(void 0);function fi(e){const t=a.useContext(ui);return e||t||"ltr"}var Xe="rovingFocusGroup.onEntryFocus",di={bubbles:!1,cancelable:!0},Ee="RovingFocusGroup",[ct,On,mi]=Rr(Ee),[pi,Ls]=We(Ee,[mi]),[hi,vi]=pi(Ee),Dn=a.forwardRef((e,t)=>S.jsx(ct.Provider,{scope:e.__scopeRovingFocusGroup,children:S.jsx(ct.Slot,{scope:e.__scopeRovingFocusGroup,children:S.jsx(gi,{...e,ref:t})})}));Dn.displayName=Ee;var gi=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:c,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:f,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,h=a.useRef(null),p=H(t,h),y=fi(i),[m,v]=sn({prop:c,defaultProp:s??null,onChange:f,caller:Ee}),[g,b]=a.useState(!1),w=ie(l),x=On(n),E=a.useRef(!1),[R,C]=a.useState(0);return a.useEffect(()=>{const A=h.current;if(A)return A.addEventListener(Xe,w),()=>A.removeEventListener(Xe,w)},[w]),S.jsx(hi,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:m,onItemFocus:a.useCallback(A=>v(A),[v]),onItemShiftTab:a.useCallback(()=>b(!0),[]),onFocusableItemAdd:a.useCallback(()=>C(A=>A+1),[]),onFocusableItemRemove:a.useCallback(()=>C(A=>A-1),[]),children:S.jsx(W.div,{tabIndex:g||R===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:j(e.onMouseDown,()=>{E.current=!0}),onFocus:j(e.onFocus,A=>{const T=!E.current;if(A.target===A.currentTarget&&T&&!g){const D=new CustomEvent(Xe,di);if(A.currentTarget.dispatchEvent(D),!D.defaultPrevented){const _=x().filter(O=>O.focusable),F=_.find(O=>O.active),I=_.find(O=>O.id===m),k=[F,I,..._].filter(Boolean).map(O=>O.ref.current);In(k,u)}}E.current=!1}),onBlur:j(e.onBlur,()=>b(!1))})})}),Tn="RovingFocusGroupItem",Nn=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:c,...s}=e,f=Te(),l=i||f,u=vi(Tn,n),d=u.currentTabStopId===l,h=On(n),{onFocusableItemAdd:p,onFocusableItemRemove:y,currentTabStopId:m}=u;return a.useEffect(()=>{if(r)return p(),()=>y()},[r,p,y]),S.jsx(ct.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:S.jsx(W.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:j(e.onMouseDown,v=>{r?u.onItemFocus(l):v.preventDefault()}),onFocus:j(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:j(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const g=xi(v,u.orientation,u.dir);if(g!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=h().filter(x=>x.focusable).map(x=>x.ref.current);if(g==="last")w.reverse();else if(g==="prev"||g==="next"){g==="prev"&&w.reverse();const x=w.indexOf(v.currentTarget);w=u.loop?bi(w,x+1):w.slice(x+1)}setTimeout(()=>In(w))}}),children:typeof c=="function"?c({isCurrentTabStop:d,hasTabStop:m!=null}):c})})});Nn.displayName=Tn;var yi={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wi(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function xi(e,t,n){const r=wi(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return yi[r]}function In(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bi(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ks=Dn,js=Nn,qe=0;function Ei(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$t()),document.body.insertAdjacentElement("beforeend",e[1]??$t()),qe++,()=>{qe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qe--}},[])}function $t(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ze="focusScope.autoFocusOnMount",Je="focusScope.autoFocusOnUnmount",Bt={bubbles:!1,cancelable:!0},Ci="FocusScope",_n=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...c}=e,[s,f]=a.useState(null),l=ie(o),u=ie(i),d=a.useRef(null),h=H(t,m=>f(m)),p=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let m=function(w){if(p.paused||!s)return;const x=w.target;s.contains(x)?d.current=x:te(d.current,{select:!0})},v=function(w){if(p.paused||!s)return;const x=w.relatedTarget;x!==null&&(s.contains(x)||te(d.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&te(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(g);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[r,s,p.paused]),a.useEffect(()=>{if(s){Ut.add(p);const m=document.activeElement;if(!s.contains(m)){const g=new CustomEvent(Ze,Bt);s.addEventListener(Ze,l),s.dispatchEvent(g),g.defaultPrevented||(Si(Di(Mn(s)),{select:!0}),document.activeElement===m&&te(s))}return()=>{s.removeEventListener(Ze,l),setTimeout(()=>{const g=new CustomEvent(Je,Bt);s.addEventListener(Je,u),s.dispatchEvent(g),g.defaultPrevented||te(m??document.body,{select:!0}),s.removeEventListener(Je,u),Ut.remove(p)},0)}}},[s,l,u,p]);const y=a.useCallback(m=>{if(!n&&!r||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(v&&g){const b=m.currentTarget,[w,x]=Ri(b);w&&x?!m.shiftKey&&g===x?(m.preventDefault(),n&&te(w,{select:!0})):m.shiftKey&&g===w&&(m.preventDefault(),n&&te(x,{select:!0})):g===b&&m.preventDefault()}},[n,r,p.paused]);return S.jsx(W.div,{tabIndex:-1,...c,ref:h,onKeyDown:y})});_n.displayName=Ci;function Si(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(te(r,{select:t}),document.activeElement!==n)return}function Ri(e){const t=Mn(e),n=Ht(t,e),r=Ht(t.reverse(),e);return[n,r]}function Mn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ht(e,t){for(const n of e)if(!Ai(n,{upTo:t}))return n}function Ai(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Pi(e){return e instanceof HTMLInputElement&&"select"in e}function te(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Pi(e)&&t&&e.select()}}var Ut=Oi();function Oi(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Vt(e,t),e.unshift(t)},remove(t){e=Vt(e,t),e[0]?.resume()}}}function Vt(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Di(e){return e.filter(t=>t.tagName!=="A")}var Ti=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ae=new WeakMap,Ae=new WeakMap,Pe={},Qe=0,Fn=function(e){return e&&(e.host||Fn(e.parentNode))},Ni=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Fn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ii=function(e,t,n,r){var o=Ni(t,Array.isArray(e)?e:[e]);Pe[n]||(Pe[n]=new WeakMap);var i=Pe[n],c=[],s=new Set,f=new Set(o),l=function(d){!d||s.has(d)||(s.add(d),l(d.parentNode))};o.forEach(l);var u=function(d){!d||f.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))u(h);else try{var p=h.getAttribute(r),y=p!==null&&p!=="false",m=(ae.get(h)||0)+1,v=(i.get(h)||0)+1;ae.set(h,m),i.set(h,v),c.push(h),m===1&&y&&Ae.set(h,!0),v===1&&h.setAttribute(n,"true"),y||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return u(t),s.clear(),Qe++,function(){c.forEach(function(d){var h=ae.get(d)-1,p=i.get(d)-1;ae.set(d,h),i.set(d,p),h||(Ae.has(d)||d.removeAttribute(r),Ae.delete(d)),p||d.removeAttribute(n)}),Qe--,Qe||(ae=new WeakMap,ae=new WeakMap,Ae=new WeakMap,Pe={})}},_i=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Ti(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Ii(r,o,n,"aria-hidden")):function(){return null}},Y=function(){return Y=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return qi;var t=Zi(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Qi=Wn(),de="data-scroll-locked",es=function(e,t,n,r){var o=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(Fi,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; } body[`).concat(de,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(o,`px; padding-top: `).concat(i,`px; padding-right: `).concat(c,`px; margin-left:0; margin-top:0; margin-right: `).concat(s,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(Ie,` { right: `).concat(s,"px ").concat(r,`; } .`).concat(_e,` { margin-right: `).concat(s,"px ").concat(r,`; } .`).concat(Ie," .").concat(Ie,` { right: 0 `).concat(r,`; } .`).concat(_e," .").concat(_e,` { margin-right: 0 `).concat(r,`; } body[`).concat(de,`] { `).concat(Li,": ").concat(s,`px; } `)},Kt=function(){var e=parseInt(document.body.getAttribute(de)||"0",10);return isFinite(e)?e:0},ts=function(){a.useEffect(function(){return document.body.setAttribute(de,(Kt()+1).toString()),function(){var e=Kt()-1;e<=0?document.body.removeAttribute(de):document.body.setAttribute(de,e.toString())}},[])},ns=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ts();var i=a.useMemo(function(){return Ji(o)},[o]);return a.createElement(Qi,{styles:es(i,!t,o,n?"":"!important")})},at=!1;if(typeof window<"u")try{var Oe=Object.defineProperty({},"passive",{get:function(){return at=!0,!0}});window.addEventListener("test",Oe,Oe),window.removeEventListener("test",Oe,Oe)}catch{at=!1}var le=at?{passive:!1}:!1,rs=function(e){return e.tagName==="TEXTAREA"},$n=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!rs(e)&&n[t]==="visible")},os=function(e){return $n(e,"overflowY")},is=function(e){return $n(e,"overflowX")},Yt=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Bn(e,r);if(o){var i=Hn(e,r),c=i[1],s=i[2];if(c>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ss=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cs=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Bn=function(e,t){return e==="v"?os(t):is(t)},Hn=function(e,t){return e==="v"?ss(t):cs(t)},as=function(e,t){return e==="h"&&t==="rtl"?-1:1},ls=function(e,t,n,r,o){var i=as(e,window.getComputedStyle(t).direction),c=i*r,s=n.target,f=t.contains(s),l=!1,u=c>0,d=0,h=0;do{if(!s)break;var p=Hn(e,s),y=p[0],m=p[1],v=p[2],g=m-v-i*y;(y||g)&&Bn(e,s)&&(d+=g,h+=y);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!f&&s!==document.body||f&&(t.contains(s)||t===s));return(u&&Math.abs(d)<1||!u&&Math.abs(h)<1)&&(l=!0),l},De=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gt=function(e){return[e.deltaX,e.deltaY]},Xt=function(e){return e&&"current"in e?e.current:e},us=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fs=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},ds=0,ue=[];function ms(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(ds++)[0],i=a.useState(Wn)[0],c=a.useRef(e);a.useEffect(function(){c.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Mi([e.lockRef.current],(e.shards||[]).map(Xt),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=a.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!c.current.allowPinchZoom;var g=De(m),b=n.current,w="deltaX"in m?m.deltaX:b[0]-g[0],x="deltaY"in m?m.deltaY:b[1]-g[1],E,R=m.target,C=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in m&&C==="h"&&R.type==="range")return!1;var A=Yt(C,R);if(!A)return!0;if(A?E=C:(E=C==="v"?"h":"v",A=Yt(C,R)),!A)return!1;if(!r.current&&"changedTouches"in m&&(w||x)&&(r.current=E),!E)return!0;var T=r.current||E;return ls(T,v,m,T==="h"?w:x)},[]),f=a.useCallback(function(m){var v=m;if(!(!ue.length||ue[ue.length-1]!==i)){var g="deltaY"in v?Gt(v):De(v),b=t.current.filter(function(E){return E.name===v.type&&(E.target===v.target||v.target===E.shadowParent)&&us(E.delta,g)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var w=(c.current.shards||[]).map(Xt).filter(Boolean).filter(function(E){return E.contains(v.target)}),x=w.length>0?s(v,w[0]):!c.current.noIsolation;x&&v.cancelable&&v.preventDefault()}}},[]),l=a.useCallback(function(m,v,g,b){var w={name:m,delta:v,target:g,should:b,shadowParent:ps(g)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(x){return x!==w})},1)},[]),u=a.useCallback(function(m){n.current=De(m),r.current=void 0},[]),d=a.useCallback(function(m){l(m.type,Gt(m),m.target,s(m,e.lockRef.current))},[]),h=a.useCallback(function(m){l(m.type,De(m),m.target,s(m,e.lockRef.current))},[]);a.useEffect(function(){return ue.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",f,le),document.addEventListener("touchmove",f,le),document.addEventListener("touchstart",u,le),function(){ue=ue.filter(function(m){return m!==i}),document.removeEventListener("wheel",f,le),document.removeEventListener("touchmove",f,le),document.removeEventListener("touchstart",u,le)}},[]);var p=e.removeScrollBar,y=e.inert;return a.createElement(a.Fragment,null,y?a.createElement(i,{styles:fs(o)}):null,p?a.createElement(ns,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ps(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hs=Ui(jn,ms);var Un=a.forwardRef(function(e,t){return a.createElement(Ve,Y({},e,{ref:t,sideCar:hs}))});Un.classNames=Ve.classNames;var ze="Dialog",[Vn]=We(ze),[vs,z]=Vn(ze),zn=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:c=!0}=e,s=a.useRef(null),f=a.useRef(null),[l,u]=sn({prop:r,defaultProp:o??!1,onChange:i,caller:ze});return S.jsx(vs,{scope:t,triggerRef:s,contentRef:f,contentId:Te(),titleId:Te(),descriptionId:Te(),open:l,onOpenChange:u,onOpenToggle:a.useCallback(()=>u(d=>!d),[u]),modal:c,children:n})};zn.displayName=ze;var Kn="DialogTrigger",gs=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(Kn,n),i=H(t,o.triggerRef);return S.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Et(o.open),...r,ref:i,onClick:j(e.onClick,o.onOpenToggle)})});gs.displayName=Kn;var xt="DialogPortal",[ys,Yn]=Vn(xt,{forceMount:void 0}),Gn=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=z(xt,t);return S.jsx(ys,{scope:t,forceMount:n,children:a.Children.map(r,c=>S.jsx($e,{present:n||i.open,children:S.jsx(on,{asChild:!0,container:o,children:c})}))})};Gn.displayName=xt;var je="DialogOverlay",Xn=a.forwardRef((e,t)=>{const n=Yn(je,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=z(je,e.__scopeDialog);return i.modal?S.jsx($e,{present:r||i.open,children:S.jsx(xs,{...o,ref:t})}):null});Xn.displayName=je;var ws=ye("DialogOverlay.RemoveScroll"),xs=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(je,n);return S.jsx(Un,{as:ws,allowPinchZoom:!0,shards:[o.contentRef],children:S.jsx(W.div,{"data-state":Et(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ce="DialogContent",qn=a.forwardRef((e,t)=>{const n=Yn(ce,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=z(ce,e.__scopeDialog);return S.jsx($e,{present:r||i.open,children:i.modal?S.jsx(bs,{...o,ref:t}):S.jsx(Es,{...o,ref:t})})});qn.displayName=ce;var bs=a.forwardRef((e,t)=>{const n=z(ce,e.__scopeDialog),r=a.useRef(null),o=H(t,n.contentRef,r);return a.useEffect(()=>{const i=r.current;if(i)return _i(i)},[]),S.jsx(Zn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,s=c.button===0&&c.ctrlKey===!0;(c.button===2||s)&&i.preventDefault()}),onFocusOutside:j(e.onFocusOutside,i=>i.preventDefault())})}),Es=a.forwardRef((e,t)=>{const n=z(ce,e.__scopeDialog),r=a.useRef(!1),o=a.useRef(!1);return S.jsx(Zn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=i.target;n.triggerRef.current?.contains(c)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Zn=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...c}=e,s=z(ce,n),f=a.useRef(null),l=H(t,f);return Ei(),S.jsxs(S.Fragment,{children:[S.jsx(_n,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:S.jsx(ut,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Et(s.open),...c,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(Cs,{titleId:s.titleId}),S.jsx(Rs,{contentRef:f,descriptionId:s.descriptionId})]})]})}),bt="DialogTitle",Jn=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(bt,n);return S.jsx(W.h2,{id:o.titleId,...r,ref:t})});Jn.displayName=bt;var Qn="DialogDescription",er=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(Qn,n);return S.jsx(W.p,{id:o.descriptionId,...r,ref:t})});er.displayName=Qn;var tr="DialogClose",nr=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(tr,n);return S.jsx(W.button,{type:"button",...r,ref:t,onClick:j(e.onClick,()=>o.onOpenChange(!1))})});nr.displayName=tr;function Et(e){return e?"open":"closed"}var rr="DialogTitleWarning",[Ws,or]=wr(rr,{contentName:ce,titleName:bt,docsSlug:"dialog"}),Cs=({titleId:e})=>{const t=or(rr),n=`\`${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 a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ss="DialogDescriptionWarning",Rs=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${or(Ss).contentName}}.`;return a.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},$s=zn,Bs=Gn,Hs=Xn,Us=qn,Vs=Jn,zs=er,Ks=nr;export{_s as A,Ts as B,Ms as C,ut as D,ye as E,_n as F,Is as G,ri as H,js as I,Bs as J,Us as K,Ks as L,zs as M,$s as N,Hs as O,W as P,Ds as R,Ps as S,Vs as T,Rr as a,sn as b,We as c,$e as d,j as e,ie as f,lt as g,on as h,ne as i,S as j,Pr as k,Ns as l,Os as m,Fs as n,ee as o,Jt as p,Ls as q,a as r,ks as s,fi as t,H as u,yr as v,Te as w,_i as x,Ei as y,Un as z};