import{c as yn,j as se,f as he,P as ee,e as Me,m as wn,b as bn,o as Ve}from"./createLucideIcon-W0Ra_zwb.js";import{r as m,j as B,e as xn,f as En}from"./index-gX9iSPDQ.js";import{u as Cn}from"./index-DmVJm5MZ.js";/**
 * @license lucide-react v0.476.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sn=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_o=yn("Check",Sn);function An(e,t=globalThis==null?void 0:globalThis.document){const n=se(e);m.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 Pn="DismissableLayer",ze="dismissableLayer.update",Rn="dismissableLayer.pointerDownOutside",On="dismissableLayer.focusOutside",ft,Dt=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ln=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...d}=e,l=m.useContext(Dt),[u,f]=m.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=m.useState({}),y=he(t,C=>f(C)),a=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),g=a.indexOf(v),x=u?a.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,w=x>=g,E=kn(C=>{const P=C.target,L=[...l.branches].some(R=>R.contains(P));!w||L||(o==null||o(C),s==null||s(C),C.defaultPrevented||c==null||c())},p),S=Mn(C=>{const P=C.target;[...l.branches].some(R=>R.contains(P))||(i==null||i(C),s==null||s(C),C.defaultPrevented||c==null||c())},p);return An(C=>{x===l.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&c&&(C.preventDefault(),c()))},p),m.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(ft=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),dt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=ft)}},[u,p,n,l]),m.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),dt())},[u,l]),m.useEffect(()=>{const C=()=>h({});return document.addEventListener(ze,C),()=>document.removeEventListener(ze,C)},[]),B.jsx(ee.div,{...d,ref:y,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:Me(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Me(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Me(e.onPointerDownCapture,E.onPointerDownCapture)})});Ln.displayName=Pn;var Tn="DismissableLayerBranch",Dn=m.forwardRef((e,t)=>{const n=m.useContext(Dt),r=m.useRef(null),o=he(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),B.jsx(ee.div,{...e,ref:o})});Dn.displayName=Tn;function kn(e,t=globalThis==null?void 0:globalThis.document){const n=se(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){kt(Rn,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Mn(e,t=globalThis==null?void 0:globalThis.document){const n=se(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&kt(On,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(ze);document.dispatchEvent(e)}function kt(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?wn(o,i):o.dispatchEvent(i)}var Ne=0;function Ho(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ht()),document.body.insertAdjacentElement("beforeend",e[1]??ht()),Ne++,()=>{Ne===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ne--}},[])}function ht(){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 Fe="focusScope.autoFocusOnMount",We="focusScope.autoFocusOnUnmount",mt={bubbles:!1,cancelable:!0},Nn="FocusScope",Fn=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[c,d]=m.useState(null),l=se(o),u=se(i),f=m.useRef(null),p=he(t,a=>d(a)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let a=function(b){if(h.paused||!c)return;const w=b.target;c.contains(w)?f.current=w:q(f.current,{select:!0})},v=function(b){if(h.paused||!c)return;const w=b.relatedTarget;w!==null&&(c.contains(w)||q(f.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const E of b)E.removedNodes.length>0&&q(c)};document.addEventListener("focusin",a),document.addEventListener("focusout",v);const x=new MutationObserver(g);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",v),x.disconnect()}}},[r,c,h.paused]),m.useEffect(()=>{if(c){vt.add(h);const a=document.activeElement;if(!c.contains(a)){const g=new CustomEvent(Fe,mt);c.addEventListener(Fe,l),c.dispatchEvent(g),g.defaultPrevented||(Wn($n(Mt(c)),{select:!0}),document.activeElement===a&&q(c))}return()=>{c.removeEventListener(Fe,l),setTimeout(()=>{const g=new CustomEvent(We,mt);c.addEventListener(We,u),c.dispatchEvent(g),g.defaultPrevented||q(a??document.body,{select:!0}),c.removeEventListener(We,u),vt.remove(h)},0)}}},[c,l,u,h]);const y=m.useCallback(a=>{if(!n&&!r||h.paused)return;const v=a.key==="Tab"&&!a.altKey&&!a.ctrlKey&&!a.metaKey,g=document.activeElement;if(v&&g){const x=a.currentTarget,[b,w]=Bn(x);b&&w?!a.shiftKey&&g===w?(a.preventDefault(),n&&q(b,{select:!0})):a.shiftKey&&g===b&&(a.preventDefault(),n&&q(w,{select:!0})):g===x&&a.preventDefault()}},[n,r,h.paused]);return B.jsx(ee.div,{tabIndex:-1,...s,ref:p,onKeyDown:y})});Fn.displayName=Nn;function Wn(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(q(r,{select:t}),document.activeElement!==n)return}function Bn(e){const t=Mt(e),n=pt(t,e),r=pt(t.reverse(),e);return[n,r]}function Mt(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 pt(e,t){for(const n of e)if(!In(n,{upTo:t}))return n}function In(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 _n(e){return e instanceof HTMLInputElement&&"select"in e}function q(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&_n(e)&&t&&e.select()}}var vt=Hn();function Hn(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=gt(e,t),e.unshift(t)},remove(t){var n;e=gt(e,t),(n=e[0])==null||n.resume()}}}function gt(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $n(e){return e.filter(t=>t.tagName!=="A")}const jn=["top","right","bottom","left"],Z=Math.min,W=Math.max,Ae=Math.round,ge=Math.floor,z=e=>({x:e,y:e}),Vn={left:"right",right:"left",bottom:"top",top:"bottom"},zn={start:"end",end:"start"};function Ye(e,t,n){return W(e,Z(t,n))}function X(e,t){return typeof e=="function"?e(t):e}function K(e){return e.split("-")[0]}function ae(e){return e.split("-")[1]}function qe(e){return e==="x"?"y":"x"}function Ze(e){return e==="y"?"height":"width"}function G(e){return["top","bottom"].includes(K(e))?"y":"x"}function Ge(e){return qe(G(e))}function Yn(e,t,n){n===void 0&&(n=!1);const r=ae(e),o=Ge(e),i=Ze(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Pe(s)),[s,Pe(s)]}function Un(e){const t=Pe(e);return[Ue(e),t,Ue(t)]}function Ue(e){return e.replace(/start|end/g,t=>zn[t])}function Xn(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Kn(e,t,n,r){const o=ae(e);let i=Xn(K(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ue)))),i}function Pe(e){return e.replace(/left|right|bottom|top/g,t=>Vn[t])}function qn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nt(e){return typeof e!="number"?qn(e):{top:e,right:e,bottom:e,left:e}}function Re(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 yt(e,t,n){let{reference:r,floating:o}=e;const i=G(t),s=Ge(t),c=Ze(s),d=K(t),l=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let h;switch(d){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(ae(t)){case"start":h[s]-=p*(n&&l?-1:1);break;case"end":h[s]+=p*(n&&l?-1:1);break}return h}const Zn=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=yt(l,r,d),p=r,h={},y=0;for(let a=0;a<c.length;a++){const{name:v,fn:g}=c[a],{x,y:b,data:w,reset:E}=await g({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:l,platform:s,elements:{reference:e,floating:t}});u=x??u,f=b??f,h={...h,[v]:{...h[v],...w}},E&&y<=50&&(y++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(l=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:f}=yt(l,p,d)),a=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:h}};async function fe(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:c,strategy:d}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=X(t,e),y=Nt(h),v=c[p?f==="floating"?"reference":"floating":f],g=Re(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:d})),x=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),w=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},E=Re(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:b,strategy:d}):x);return{top:(g.top-E.top+y.top)/w.y,bottom:(E.bottom-g.bottom+y.bottom)/w.y,left:(g.left-E.left+y.left)/w.x,right:(E.right-g.right+y.right)/w.x}}const Gn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:c,middlewareData:d}=t,{element:l,padding:u=0}=X(e,t)||{};if(l==null)return{};const f=Nt(u),p={x:n,y:r},h=Ge(o),y=Ze(h),a=await s.getDimensions(l),v=h==="y",g=v?"top":"left",x=v?"bottom":"right",b=v?"clientHeight":"clientWidth",w=i.reference[y]+i.reference[h]-p[h]-i.floating[y],E=p[h]-i.reference[h],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let C=S?S[b]:0;(!C||!await(s.isElement==null?void 0:s.isElement(S)))&&(C=c.floating[b]||i.floating[y]);const P=w/2-E/2,L=C/2-a[y]/2-1,R=Z(f[g],L),N=Z(f[x],L),F=R,T=C-a[y]-N,O=C/2-a[y]/2+P,_=Ye(F,O,T),D=!d.arrow&&ae(o)!=null&&O!==_&&i.reference[y]/2-(O<F?R:N)-a[y]/2<0,k=D?O<F?O-F:O-T:0;return{[h]:p[h]+k,data:{[h]:_,centerOffset:O-_-k,...D&&{alignmentOffset:k}},reset:D}}}),Qn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:c,platform:d,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:a=!0,...v}=X(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=K(o),x=G(c),b=K(c)===c,w=await(d.isRTL==null?void 0:d.isRTL(l.floating)),E=p||(b||!a?[Pe(c)]:Un(c)),S=y!=="none";!p&&S&&E.push(...Kn(c,a,y,w));const C=[c,...E],P=await fe(t,v),L=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&L.push(P[g]),f){const O=Yn(o,s,w);L.push(P[O[0]],P[O[1]])}if(R=[...R,{placement:o,overflows:L}],!L.every(O=>O<=0)){var N,F;const O=(((N=i.flip)==null?void 0:N.index)||0)+1,_=C[O];if(_)return{data:{index:O,overflows:R},reset:{placement:_}};let D=(F=R.filter(k=>k.overflows[0]<=0).sort((k,A)=>k.overflows[1]-A.overflows[1])[0])==null?void 0:F.placement;if(!D)switch(h){case"bestFit":{var T;const k=(T=R.filter(A=>{if(S){const M=G(A.placement);return M===x||M==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(M=>M>0).reduce((M,j)=>M+j,0)]).sort((A,M)=>A[1]-M[1])[0])==null?void 0:T[0];k&&(D=k);break}case"initialPlacement":D=c;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function wt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bt(e){return jn.some(t=>e[t]>=0)}const Jn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=X(e,t);switch(r){case"referenceHidden":{const i=await fe(t,{...o,elementContext:"reference"}),s=wt(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:bt(s)}}}case"escaped":{const i=await fe(t,{...o,altBoundary:!0}),s=wt(i,n.floating);return{data:{escapedOffsets:s,escaped:bt(s)}}}default:return{}}}}};async function er(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=K(n),c=ae(n),d=G(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&d?-1:1,f=X(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof y=="number"&&(h=c==="end"?y*-1:y),d?{x:h*u,y:p*l}:{x:p*l,y:h*u}}const tr=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:c}=t,d=await er(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+d.x,y:i+d.y,data:{...d,placement:s}}}}},nr=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:s=!1,limiter:c={fn:v=>{let{x:g,y:x}=v;return{x:g,y:x}}},...d}=X(e,t),l={x:n,y:r},u=await fe(t,d),f=G(K(o)),p=qe(f);let h=l[p],y=l[f];if(i){const v=p==="y"?"top":"left",g=p==="y"?"bottom":"right",x=h+u[v],b=h-u[g];h=Ye(x,h,b)}if(s){const v=f==="y"?"top":"left",g=f==="y"?"bottom":"right",x=y+u[v],b=y-u[g];y=Ye(x,y,b)}const a=c.fn({...t,[p]:h,[f]:y});return{...a,data:{x:a.x-n,y:a.y-r,enabled:{[p]:i,[f]:s}}}}}},rr=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:d=!0,crossAxis:l=!0}=X(e,t),u={x:n,y:r},f=G(o),p=qe(f);let h=u[p],y=u[f];const a=X(c,t),v=typeof a=="number"?{mainAxis:a,crossAxis:0}:{mainAxis:0,crossAxis:0,...a};if(d){const b=p==="y"?"height":"width",w=i.reference[p]-i.floating[b]+v.mainAxis,E=i.reference[p]+i.reference[b]-v.mainAxis;h<w?h=w:h>E&&(h=E)}if(l){var g,x;const b=p==="y"?"width":"height",w=["top","left"].includes(K(o)),E=i.reference[f]-i.floating[b]+(w&&((g=s.offset)==null?void 0:g[f])||0)+(w?0:v.crossAxis),S=i.reference[f]+i.reference[b]+(w?0:((x=s.offset)==null?void 0:x[f])||0)-(w?v.crossAxis:0);y<E?y=E:y>S&&(y=S)}return{[p]:h,[f]:y}}}},or=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:c}=t,{apply:d=()=>{},...l}=X(e,t),u=await fe(t,l),f=K(o),p=ae(o),h=G(o)==="y",{width:y,height:a}=i.floating;let v,g;f==="top"||f==="bottom"?(v=f,g=p===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(g=f,v=p==="end"?"top":"bottom");const x=a-u.top-u.bottom,b=y-u.left-u.right,w=Z(a-u[v],x),E=Z(y-u[g],b),S=!t.middlewareData.shift;let C=w,P=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=x),S&&!p){const R=W(u.left,0),N=W(u.right,0),F=W(u.top,0),T=W(u.bottom,0);h?P=y-2*(R!==0||N!==0?R+N:W(u.left,u.right)):C=a-2*(F!==0||T!==0?F+T:W(u.top,u.bottom))}await d({...t,availableWidth:P,availableHeight:C});const L=await s.getDimensions(c.floating);return y!==L.width||a!==L.height?{reset:{rects:!0}}:{}}}};function Le(){return typeof window<"u"}function le(e){return Ft(e)?(e.nodeName||"").toLowerCase():"#document"}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){var t;return(t=(Ft(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ft(e){return Le()?e instanceof Node||e instanceof I(e).Node:!1}function H(e){return Le()?e instanceof Element||e instanceof I(e).Element:!1}function Y(e){return Le()?e instanceof HTMLElement||e instanceof I(e).HTMLElement:!1}function xt(e){return!Le()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function me(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ir(e){return["table","td","th"].includes(le(e))}function Te(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Qe(e){const t=Je(),n=H(e)?$(e):e;return["transform","translate","scale","rotate","perspective"].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)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function sr(e){let t=Q(e);for(;Y(t)&&!ce(t);){if(Qe(t))return t;if(Te(t))return null;t=Q(t)}return null}function Je(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ce(e){return["html","body","#document"].includes(le(e))}function $(e){return I(e).getComputedStyle(e)}function De(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q(e){if(le(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xt(e)&&e.host||U(e);return xt(t)?t.host:t}function Wt(e){const t=Q(e);return ce(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y(t)&&me(t)?t:Wt(t)}function de(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Wt(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=I(o);if(i){const c=Xe(s);return t.concat(s,s.visualViewport||[],me(o)?o:[],c&&n?de(c):[])}return t.concat(o,de(o,[],n))}function Xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bt(e){const t=$(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Y(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,c=Ae(n)!==i||Ae(r)!==s;return c&&(n=i,r=s),{width:n,height:r,$:c}}function et(e){return H(e)?e:e.contextElement}function oe(e){const t=et(e);if(!Y(t))return z(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Bt(t);let s=(i?Ae(n.width):n.width)/r,c=(i?Ae(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const cr=z(0);function It(e){const t=I(e);return!Je()||!t.visualViewport?cr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ar(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==I(e)?!1:t}function J(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=et(e);let s=z(1);t&&(r?H(r)&&(s=oe(r)):s=oe(e));const c=ar(i,n,r)?It(i):z(0);let d=(o.left+c.x)/s.x,l=(o.top+c.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const p=I(i),h=r&&H(r)?I(r):r;let y=p,a=Xe(y);for(;a&&r&&h!==y;){const v=oe(a),g=a.getBoundingClientRect(),x=$(a),b=g.left+(a.clientLeft+parseFloat(x.paddingLeft))*v.x,w=g.top+(a.clientTop+parseFloat(x.paddingTop))*v.y;d*=v.x,l*=v.y,u*=v.x,f*=v.y,d+=b,l+=w,y=I(a),a=Xe(y)}}return Re({width:u,height:f,x:d,y:l})}function tt(e,t){const n=De(e).scrollLeft;return t?t.left+n:J(U(e)).left+n}function _t(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:tt(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function lr(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=U(r),c=t?Te(t.floating):!1;if(r===s||c&&i)return n;let d={scrollLeft:0,scrollTop:0},l=z(1);const u=z(0),f=Y(r);if((f||!f&&!i)&&((le(r)!=="body"||me(s))&&(d=De(r)),Y(r))){const h=J(r);l=oe(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const p=s&&!f&&!i?_t(s,d,!0):z(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-d.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-d.scrollTop*l.y+u.y+p.y}}function ur(e){return Array.from(e.getClientRects())}function fr(e){const t=U(e),n=De(e),r=e.ownerDocument.body,o=W(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=W(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+tt(e);const c=-n.scrollTop;return $(r).direction==="rtl"&&(s+=W(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:c}}function dr(e,t){const n=I(e),r=U(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,c=0,d=0;if(o){i=o.width,s=o.height;const l=Je();(!l||l&&t==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}return{width:i,height:s,x:c,y:d}}function hr(e,t){const n=J(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Y(e)?oe(e):z(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,d=o*i.x,l=r*i.y;return{width:s,height:c,x:d,y:l}}function Et(e,t,n){let r;if(t==="viewport")r=dr(e,n);else if(t==="document")r=fr(U(e));else if(H(t))r=hr(t,n);else{const o=It(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Re(r)}function Ht(e,t){const n=Q(e);return n===t||!H(n)||ce(n)?!1:$(n).position==="fixed"||Ht(n,t)}function mr(e,t){const n=t.get(e);if(n)return n;let r=de(e,[],!1).filter(c=>H(c)&&le(c)!=="body"),o=null;const i=$(e).position==="fixed";let s=i?Q(e):e;for(;H(s)&&!ce(s);){const c=$(s),d=Qe(s);!d&&c.position==="fixed"&&(o=null),(i?!d&&!o:!d&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||me(s)&&!d&&Ht(e,s))?r=r.filter(u=>u!==s):o=c,s=Q(s)}return t.set(e,r),r}function pr(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Te(t)?[]:mr(t,this._c):[].concat(n),r],c=s[0],d=s.reduce((l,u)=>{const f=Et(t,u,o);return l.top=W(f.top,l.top),l.right=Z(f.right,l.right),l.bottom=Z(f.bottom,l.bottom),l.left=W(f.left,l.left),l},Et(t,c,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function vr(e){const{width:t,height:n}=Bt(e);return{width:t,height:n}}function gr(e,t,n){const r=Y(t),o=U(t),i=n==="fixed",s=J(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=z(0);if(r||!r&&!i)if((le(t)!=="body"||me(o))&&(c=De(t)),r){const p=J(t,!0,i,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else o&&(d.x=tt(o));const l=o&&!r&&!i?_t(o,c):z(0),u=s.left+c.scrollLeft-d.x-l.x,f=s.top+c.scrollTop-d.y-l.y;return{x:u,y:f,width:s.width,height:s.height}}function Be(e){return $(e).position==="static"}function Ct(e,t){if(!Y(e)||$(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function $t(e,t){const n=I(e);if(Te(e))return n;if(!Y(e)){let o=Q(e);for(;o&&!ce(o);){if(H(o)&&!Be(o))return o;o=Q(o)}return n}let r=Ct(e,t);for(;r&&ir(r)&&Be(r);)r=Ct(r,t);return r&&ce(r)&&Be(r)&&!Qe(r)?n:r||sr(e)||n}const yr=async function(e){const t=this.getOffsetParent||$t,n=this.getDimensions,r=await n(e.floating);return{reference:gr(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wr(e){return $(e).direction==="rtl"}const br={convertOffsetParentRelativeRectToViewportRelativeRect:lr,getDocumentElement:U,getClippingRect:pr,getOffsetParent:$t,getElementRects:yr,getClientRects:ur,getDimensions:vr,getScale:oe,isElement:H,isRTL:wr};function jt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xr(e,t){let n=null,r;const o=U(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function s(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:h}=l;if(c||t(),!p||!h)return;const y=ge(f),a=ge(o.clientWidth-(u+p)),v=ge(o.clientHeight-(f+h)),g=ge(u),b={rootMargin:-y+"px "+-a+"px "+-v+"px "+-g+"px",threshold:W(0,Z(1,d))||1};let w=!0;function E(S){const C=S[0].intersectionRatio;if(C!==d){if(!w)return s();C?s(!1,C):r=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!jt(l,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return s(!0),i}function Er(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,l=et(e),u=o||i?[...l?de(l):[],...de(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const f=l&&c?xr(l,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(g=>{let[x]=g;x&&x.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),l&&!d&&h.observe(l),h.observe(t));let y,a=d?J(e):null;d&&v();function v(){const g=J(e);a&&!jt(a,g)&&n(),a=g,y=requestAnimationFrame(v)}return n(),()=>{var g;u.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,d&&cancelAnimationFrame(y)}}const Cr=tr,Sr=nr,Ar=Qn,Pr=or,Rr=Jn,St=Gn,Or=rr,Lr=(e,t,n)=>{const r=new Map,o={platform:br,...n},i={...o.platform,_c:r};return Zn(e,t,{...o,platform:i})};var Ee=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Oe(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(!Oe(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)&&!Oe(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Vt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function At(e,t){const n=Vt(e);return Math.round(t*n)/n}function Ie(e){const t=m.useRef(e);return Ee(()=>{t.current=e}),t}function Tr(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:d,open:l}=e,[u,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=m.useState(r);Oe(p,r)||h(r);const[y,a]=m.useState(null),[v,g]=m.useState(null),x=m.useCallback(A=>{A!==S.current&&(S.current=A,a(A))},[]),b=m.useCallback(A=>{A!==C.current&&(C.current=A,g(A))},[]),w=i||y,E=s||v,S=m.useRef(null),C=m.useRef(null),P=m.useRef(u),L=d!=null,R=Ie(d),N=Ie(o),F=Ie(l),T=m.useCallback(()=>{if(!S.current||!C.current)return;const A={placement:t,strategy:n,middleware:p};N.current&&(A.platform=N.current),Lr(S.current,C.current,A).then(M=>{const j={...M,isPositioned:F.current!==!1};O.current&&!Oe(P.current,j)&&(P.current=j,xn.flushSync(()=>{f(j)}))})},[p,t,n,N,F]);Ee(()=>{l===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[l]);const O=m.useRef(!1);Ee(()=>(O.current=!0,()=>{O.current=!1}),[]),Ee(()=>{if(w&&(S.current=w),E&&(C.current=E),w&&E){if(R.current)return R.current(w,E,T);T()}},[w,E,T,R,L]);const _=m.useMemo(()=>({reference:S,floating:C,setReference:x,setFloating:b}),[x,b]),D=m.useMemo(()=>({reference:w,floating:E}),[w,E]),k=m.useMemo(()=>{const A={position:n,left:0,top:0};if(!D.floating)return A;const M=At(D.floating,u.x),j=At(D.floating,u.y);return c?{...A,transform:"translate("+M+"px, "+j+"px)",...Vt(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:j}},[n,c,D.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:T,refs:_,elements:D,floatingStyles:k}),[u,T,_,D,k])}const Dr=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?St({element:r.current,padding:o}).fn(n):{}:r?St({element:r,padding:o}).fn(n):{}}}},kr=(e,t)=>({...Cr(e),options:[e,t]}),Mr=(e,t)=>({...Sr(e),options:[e,t]}),Nr=(e,t)=>({...Or(e),options:[e,t]}),Fr=(e,t)=>({...Ar(e),options:[e,t]}),Wr=(e,t)=>({...Pr(e),options:[e,t]}),Br=(e,t)=>({...Rr(e),options:[e,t]}),Ir=(e,t)=>({...Dr(e),options:[e,t]});var _r="Arrow",zt=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return B.jsx(ee.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:B.jsx("polygon",{points:"0,0 30,0 15,10"})})});zt.displayName=_r;var Hr=zt,nt="Popper",[Yt,$o]=bn(nt),[$r,Ut]=Yt(nt),Xt=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return B.jsx($r,{scope:t,anchor:r,onAnchorChange:o,children:n})};Xt.displayName=nt;var Kt="PopperAnchor",qt=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Ut(Kt,n),s=m.useRef(null),c=he(t,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:B.jsx(ee.div,{...o,ref:c})});qt.displayName=Kt;var rt="PopperContent",[jr,Vr]=Yt(rt),Zt=m.forwardRef((e,t)=>{var ot,it,st,ct,at,lt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:y,...a}=e,v=Ut(rt,n),[g,x]=m.useState(null),b=he(t,ue=>x(ue)),[w,E]=m.useState(null),S=Cn(w),C=(S==null?void 0:S.width)??0,P=(S==null?void 0:S.height)??0,L=r+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},N=Array.isArray(l)?l:[l],F=N.length>0,T={padding:R,boundary:N.filter(Yr),altBoundary:F},{refs:O,floatingStyles:_,placement:D,isPositioned:k,middlewareData:A}=Tr({strategy:"fixed",placement:L,whileElementsMounted:(...ue)=>Er(...ue,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[kr({mainAxis:o+P,alignmentAxis:s}),d&&Mr({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Nr():void 0,...T}),d&&Fr({...T}),Wr({...T,apply:({elements:ue,rects:ut,availableWidth:mn,availableHeight:pn})=>{const{width:vn,height:gn}=ut.reference,ve=ue.floating.style;ve.setProperty("--radix-popper-available-width",`${mn}px`),ve.setProperty("--radix-popper-available-height",`${pn}px`),ve.setProperty("--radix-popper-anchor-width",`${vn}px`),ve.setProperty("--radix-popper-anchor-height",`${gn}px`)}}),w&&Ir({element:w,padding:c}),Ur({arrowWidth:C,arrowHeight:P}),p&&Br({strategy:"referenceHidden",...T})]}),[M,j]=Jt(D),pe=se(y);Ve(()=>{k&&(pe==null||pe())},[k,pe]);const ln=(ot=A.arrow)==null?void 0:ot.x,un=(it=A.arrow)==null?void 0:it.y,fn=((st=A.arrow)==null?void 0:st.centerOffset)!==0,[dn,hn]=m.useState();return Ve(()=>{g&&hn(window.getComputedStyle(g).zIndex)},[g]),B.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:k?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:dn,"--radix-popper-transform-origin":[(ct=A.transformOrigin)==null?void 0:ct.x,(at=A.transformOrigin)==null?void 0:at.y].join(" "),...((lt=A.hide)==null?void 0:lt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:B.jsx(jr,{scope:n,placedSide:M,onArrowChange:E,arrowX:ln,arrowY:un,shouldHideArrow:fn,children:B.jsx(ee.div,{"data-side":M,"data-align":j,...a,ref:b,style:{...a.style,animation:k?void 0:"none"}})})})});Zt.displayName=rt;var Gt="PopperArrow",zr={top:"bottom",right:"left",bottom:"top",left:"right"},Qt=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Vr(Gt,r),s=zr[i.placedSide];return B.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]: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:B.jsx(Hr,{...o,ref:n,style:{...o.style,display:"block"}})})});Qt.displayName=Gt;function Yr(e){return e!==null}var Ur=e=>({name:"transformOrigin",options:e,fn(t){var v,g,x;const{placement:n,rects:r,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,c=s?0:e.arrowWidth,d=s?0:e.arrowHeight,[l,u]=Jt(n),f={start:"0%",center:"50%",end:"100%"}[u],p=(((g=o.arrow)==null?void 0:g.x)??0)+c/2,h=(((x=o.arrow)==null?void 0:x.y)??0)+d/2;let y="",a="";return l==="bottom"?(y=s?f:`${p}px`,a=`${-d}px`):l==="top"?(y=s?f:`${p}px`,a=`${r.floating.height+d}px`):l==="right"?(y=`${-d}px`,a=s?f:`${h}px`):l==="left"&&(y=`${r.floating.width+d}px`,a=s?f:`${h}px`),{data:{x:y,y:a}}}});function Jt(e){const[t,n="center"]=e.split("-");return[t,n]}var jo=Xt,Vo=qt,zo=Zt,Yo=Qt,Xr="Portal",Kr=m.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,i]=m.useState(!1);Ve(()=>i(!0),[]);const s=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return s?En.createPortal(B.jsx(ee.div,{...r,ref:t}),s):null});Kr.displayName=Xr;var qr=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},te=new WeakMap,ye=new WeakMap,we={},_e=0,en=function(e){return e&&(e.host||en(e.parentNode))},Zr=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=en(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})},Gr=function(e,t,n,r){var o=Zr(t,Array.isArray(e)?e:[e]);we[n]||(we[n]=new WeakMap);var i=we[n],s=[],c=new Set,d=new Set(o),l=function(f){!f||c.has(f)||(c.add(f),l(f.parentNode))};o.forEach(l);var u=function(f){!f||d.has(f)||Array.prototype.forEach.call(f.children,function(p){if(c.has(p))u(p);else try{var h=p.getAttribute(r),y=h!==null&&h!=="false",a=(te.get(p)||0)+1,v=(i.get(p)||0)+1;te.set(p,a),i.set(p,v),s.push(p),a===1&&y&&ye.set(p,!0),v===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return u(t),c.clear(),_e++,function(){s.forEach(function(f){var p=te.get(f)-1,h=i.get(f)-1;te.set(f,p),i.set(f,h),p||(ye.has(f)||f.removeAttribute(r),ye.delete(f)),h||f.removeAttribute(n)}),_e--,_e||(te=new WeakMap,te=new WeakMap,ye=new WeakMap,we={})}},Uo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=qr(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Gr(r,o,n,"aria-hidden")):function(){return null}},V=function(){return V=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},V.apply(this,arguments)};function tn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Qr(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ce="right-scroll-bar-position",Se="width-before-scroll-bar",Jr="with-scroll-bars-hidden",eo="--removed-body-scroll-bar-size";function He(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function to(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var no=typeof window<"u"?m.useLayoutEffect:m.useEffect,Pt=new WeakMap;function ro(e,t){var n=to(null,function(r){return e.forEach(function(o){return He(o,r)})});return no(function(){var r=Pt.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(c){i.has(c)||He(c,null)}),i.forEach(function(c){o.has(c)||He(c,s)})}Pt.set(n,e)},[e]),n}function oo(e){return e}function io(e,t){t===void 0&&(t=oo);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(c){return c!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var c=n;n=[],c.forEach(i),s=n}var d=function(){var u=s;s=[],u.forEach(i)},l=function(){return Promise.resolve().then(d)};l(),n={push:function(u){s.push(u),l()},filter:function(u){return s=s.filter(u),n}}}};return o}function so(e){e===void 0&&(e={});var t=io(null);return t.options=V({async:!0,ssr:!1},e),t}var nn=function(e){var t=e.sideCar,n=tn(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,V({},n))};nn.isSideCarExport=!0;function co(e,t){return e.useMedium(t),nn}var rn=so(),$e=function(){},ke=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:$e,onWheelCapture:$e,onTouchMoveCapture:$e}),o=r[0],i=r[1],s=e.forwardProps,c=e.children,d=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,h=e.noIsolation,y=e.inert,a=e.allowPinchZoom,v=e.as,g=v===void 0?"div":v,x=e.gapMode,b=tn(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=p,E=ro([n,t]),S=V(V({},b),o);return m.createElement(m.Fragment,null,u&&m.createElement(w,{sideCar:rn,removeScrollBar:l,shards:f,noIsolation:h,inert:y,setCallbacks:i,allowPinchZoom:!!a,lockRef:n,gapMode:x}),s?m.cloneElement(m.Children.only(c),V(V({},S),{ref:E})):m.createElement(g,V({},S,{className:d,ref:E}),c))});ke.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ke.classNames={fullWidth:Se,zeroRight:Ce};var ao=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function lo(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ao();return t&&e.setAttribute("nonce",t),e}function uo(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fo(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ho=function(){var e=0,t=null;return{add:function(n){e==0&&(t=lo())&&(uo(t,n),fo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mo=function(){var e=ho();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},on=function(){var e=mo(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},po={left:0,top:0,right:0,gap:0},je=function(e){return parseInt(e||"",10)||0},vo=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[je(n),je(r),je(o)]},go=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return po;var t=vo(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])}},yo=on(),ie="data-scroll-locked",wo=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,c=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(Jr,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(c,"px ").concat(r,`;
  }
  body[`).concat(ie,`] {
    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(s,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(c,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(Ce,` {
    right: `).concat(c,"px ").concat(r,`;
  }
  
  .`).concat(Se,` {
    margin-right: `).concat(c,"px ").concat(r,`;
  }
  
  .`).concat(Ce," .").concat(Ce,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Se," .").concat(Se,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(ie,`] {
    `).concat(eo,": ").concat(c,`px;
  }
`)},Rt=function(){var e=parseInt(document.body.getAttribute(ie)||"0",10);return isFinite(e)?e:0},bo=function(){m.useEffect(function(){return document.body.setAttribute(ie,(Rt()+1).toString()),function(){var e=Rt()-1;e<=0?document.body.removeAttribute(ie):document.body.setAttribute(ie,e.toString())}},[])},xo=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;bo();var i=m.useMemo(function(){return go(o)},[o]);return m.createElement(yo,{styles:wo(i,!t,o,n?"":"!important")})},Ke=!1;if(typeof window<"u")try{var be=Object.defineProperty({},"passive",{get:function(){return Ke=!0,!0}});window.addEventListener("test",be,be),window.removeEventListener("test",be,be)}catch{Ke=!1}var ne=Ke?{passive:!1}:!1,Eo=function(e){return e.tagName==="TEXTAREA"},sn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Eo(e)&&n[t]==="visible")},Co=function(e){return sn(e,"overflowY")},So=function(e){return sn(e,"overflowX")},Ot=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=cn(e,r);if(o){var i=an(e,r),s=i[1],c=i[2];if(s>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ao=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Po=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},cn=function(e,t){return e==="v"?Co(t):So(t)},an=function(e,t){return e==="v"?Ao(t):Po(t)},Ro=function(e,t){return e==="h"&&t==="rtl"?-1:1},Oo=function(e,t,n,r,o){var i=Ro(e,window.getComputedStyle(t).direction),s=i*r,c=n.target,d=t.contains(c),l=!1,u=s>0,f=0,p=0;do{var h=an(e,c),y=h[0],a=h[1],v=h[2],g=a-v-i*y;(y||g)&&cn(e,c)&&(f+=g,p+=y),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(u&&Math.abs(f)<1||!u&&Math.abs(p)<1)&&(l=!0),l},xe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Lt=function(e){return[e.deltaX,e.deltaY]},Tt=function(e){return e&&"current"in e?e.current:e},Lo=function(e,t){return e[0]===t[0]&&e[1]===t[1]},To=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Do=0,re=[];function ko(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(Do++)[0],i=m.useState(on)[0],s=m.useRef(e);m.useEffect(function(){s.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var a=Qr([e.lockRef.current],(e.shards||[]).map(Tt),!0).filter(Boolean);return a.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),a.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=m.useCallback(function(a,v){if("touches"in a&&a.touches.length===2||a.type==="wheel"&&a.ctrlKey)return!s.current.allowPinchZoom;var g=xe(a),x=n.current,b="deltaX"in a?a.deltaX:x[0]-g[0],w="deltaY"in a?a.deltaY:x[1]-g[1],E,S=a.target,C=Math.abs(b)>Math.abs(w)?"h":"v";if("touches"in a&&C==="h"&&S.type==="range")return!1;var P=Ot(C,S);if(!P)return!0;if(P?E=C:(E=C==="v"?"h":"v",P=Ot(C,S)),!P)return!1;if(!r.current&&"changedTouches"in a&&(b||w)&&(r.current=E),!E)return!0;var L=r.current||E;return Oo(L,v,a,L==="h"?b:w)},[]),d=m.useCallback(function(a){var v=a;if(!(!re.length||re[re.length-1]!==i)){var g="deltaY"in v?Lt(v):xe(v),x=t.current.filter(function(E){return E.name===v.type&&(E.target===v.target||v.target===E.shadowParent)&&Lo(E.delta,g)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var b=(s.current.shards||[]).map(Tt).filter(Boolean).filter(function(E){return E.contains(v.target)}),w=b.length>0?c(v,b[0]):!s.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),l=m.useCallback(function(a,v,g,x){var b={name:a,delta:v,target:g,should:x,shadowParent:Mo(g)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(w){return w!==b})},1)},[]),u=m.useCallback(function(a){n.current=xe(a),r.current=void 0},[]),f=m.useCallback(function(a){l(a.type,Lt(a),a.target,c(a,e.lockRef.current))},[]),p=m.useCallback(function(a){l(a.type,xe(a),a.target,c(a,e.lockRef.current))},[]);m.useEffect(function(){return re.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",d,ne),document.addEventListener("touchmove",d,ne),document.addEventListener("touchstart",u,ne),function(){re=re.filter(function(a){return a!==i}),document.removeEventListener("wheel",d,ne),document.removeEventListener("touchmove",d,ne),document.removeEventListener("touchstart",u,ne)}},[]);var h=e.removeScrollBar,y=e.inert;return m.createElement(m.Fragment,null,y?m.createElement(i,{styles:To(o)}):null,h?m.createElement(xo,{gapMode:e.gapMode}):null)}function Mo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const No=co(rn,ko);var Fo=m.forwardRef(function(e,t){return m.createElement(ke,V({},e,{ref:t,sideCar:No}))});Fo.classNames=ke.classNames;export{Vo as A,zo as C,Ln as D,Fn as F,Kr as P,Fo as R,jo as a,Yo as b,$o as c,_o as d,Uo as h,Ho as u};
