import{D as Me,O as ke,J as R,w as ge,K as a,z as Fe,x as be,r as A,Q as F,R as Ee}from"./index-DLMsdH5y.js";var Se=ke();const We=Me(Se);function hn({className:e,type:t,...n}){return R.jsx("input",{type:t,"data-slot":"input",className:ge("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var _e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],je=_e.reduce((e,t)=>{const n=Fe(`Primitive.${t}`),r=a.forwardRef((o,s)=>{const{asChild:c,...i}=o,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(f,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Be="Label",Ce=a.forwardRef((e,t)=>R.jsx(je.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ce.displayName=Be;var $e=Ce;function yn({className:e,...t}){return R.jsx($e,{"data-slot":"label",className:ge("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function gn(e,t){const n=a.createContext(t),r=s=>{const{children:c,...i}=s,f=a.useMemo(()=>i,Object.values(i));return R.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function o(s){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ve(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),f=n.length;n=[...n,c];const l=d=>{const{scope:p,children:g,...C}=d,u=p?.[e]?.[f]||i,m=a.useMemo(()=>C,Object.values(C));return R.jsx(u.Provider,{value:m,children:g})};l.displayName=s+"Provider";function v(d,p){const g=p?.[e]?.[f]||i,C=a.useContext(g);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,v]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const f=i?.[e]||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:f}}),[i,f])}};return o.scopeName=e,[r,Ue(o,...t)]}function Ue(...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(s){const c=r.reduce((i,{useScope:f,scopeName:l})=>{const d=f(s)[`__scope${l}`];return{...i,...d}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function He(e){const t=ze(e),n=a.forwardRef((r,o)=>{const{children:s,...c}=r,i=a.Children.toArray(s),f=i.find(Xe);if(f){const l=f.props.children,v=i.map(d=>d===f?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:d);return R.jsx(t,{...c,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,v):null})}return R.jsx(t,{...c,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function ze(e){const t=a.forwardRef((n,r)=>{const{children:o,...s}=n;if(a.isValidElement(o)){const c=Ze(o),i=Ye(s,o.props);return o.type!==a.Fragment&&(i.ref=r?be(r,c):c),a.cloneElement(o,i)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ke=Symbol("radix.slottable");function Xe(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ke}function Ye(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const f=s(...i);return o(...i),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ze(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 Ge=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],z=Ge.reduce((e,t)=>{const n=He(`Primitive.${t}`),r=a.forwardRef((o,s)=>{const{asChild:c,...i}=o,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(f,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qe(e,t){e&&Se.flushSync(()=>e.dispatchEvent(t))}function ae(e){const t=Qe(e),n=a.forwardRef((r,o)=>{const{children:s,...c}=r,i=a.Children.toArray(s),f=i.find(et);if(f){const l=f.props.children,v=i.map(d=>d===f?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:d);return R.jsx(t,{...c,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,v):null})}return R.jsx(t,{...c,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Qe(e){const t=a.forwardRef((n,r)=>{const{children:o,...s}=n;if(a.isValidElement(o)){const c=nt(o),i=tt(s,o.props);return o.type!==a.Fragment&&(i.ref=r?be(r,c):c),a.cloneElement(o,i)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Je=Symbol("radix.slottable");function et(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Je}function tt(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const f=s(...i);return o(...i),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function nt(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 bn(e){const t=e+"CollectionProvider",[n,r]=Ve(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=u=>{const{scope:m,children:h}=u,y=A.useRef(null),b=A.useRef(new Map).current;return R.jsx(o,{scope:m,itemMap:b,collectionRef:y,children:h})};c.displayName=t;const i=e+"CollectionSlot",f=ae(i),l=A.forwardRef((u,m)=>{const{scope:h,children:y}=u,b=s(i,h),E=F(m,b.collectionRef);return R.jsx(f,{ref:E,children:y})});l.displayName=i;const v=e+"CollectionItemSlot",d="data-radix-collection-item",p=ae(v),g=A.forwardRef((u,m)=>{const{scope:h,children:y,...b}=u,E=A.useRef(null),w=F(m,E),x=s(v,h);return A.useEffect(()=>(x.itemMap.set(E,{ref:E,...b}),()=>{x.itemMap.delete(E)})),R.jsx(p,{[d]:"",ref:w,children:y})});g.displayName=v;function C(u){const m=s(e+"CollectionConsumer",u);return A.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((x,S)=>b.indexOf(x.ref.current)-b.indexOf(S.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:c,Slot:l,ItemSlot:g},C,r]}var K=globalThis?.document?a.useLayoutEffect:()=>{},rt=Ee[" useId ".trim().toString()]||(()=>{}),ot=0;function En(e){const[t,n]=a.useState(rt());return K(()=>{n(r=>r??String(ot++))},[e]),e||(t?`radix-${t}`:"")}function W(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}var at=Ee[" useInsertionEffect ".trim().toString()]||K;function Sn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,c]=it({defaultProp:t,onChange:n}),i=e!==void 0,f=i?e:o;{const v=a.useRef(e!==void 0);a.useEffect(()=>{const d=v.current;d!==i&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${i?"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.`),v.current=i},[i,r])}const l=a.useCallback(v=>{if(i){const d=st(v)?v(e):v;d!==e&&c.current?.(d)}else s(v)},[i,e,s,c]);return[f,l]}function it({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),s=a.useRef(t);return at(()=>{s.current=t},[t]),a.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function st(e){return typeof e=="function"}var ct=a.createContext(void 0);function Cn(e){const t=a.useContext(ct);return e||t||"ltr"}function wn(e){const[t,n]=a.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let c,i;if("borderBoxSize"in s){const f=s.borderBoxSize,l=Array.isArray(f)?f[0]:f;c=l.inlineSize,i=l.blockSize}else c=e.offsetWidth,i=e.offsetHeight;n({width:c,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Rn(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ut(e,t=globalThis?.document){const n=W(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 lt="DismissableLayer",ne="dismissableLayer.update",ft="dismissableLayer.pointerDownOutside",dt="dismissableLayer.focusOutside",ie,we=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vt=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:i,...f}=e,l=a.useContext(we),[v,d]=a.useState(null),p=v?.ownerDocument??globalThis?.document,[,g]=a.useState({}),C=F(t,S=>d(S)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),h=u.indexOf(m),y=v?u.indexOf(v):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,E=y>=h,w=ht(S=>{const N=S.target,T=[...l.branches].some(k=>k.contains(N));!E||T||(o?.(S),c?.(S),S.defaultPrevented||i?.())},p),x=yt(S=>{const N=S.target;[...l.branches].some(k=>k.contains(N))||(s?.(S),c?.(S),S.defaultPrevented||i?.())},p);return ut(S=>{y===l.layers.size-1&&(r?.(S),!S.defaultPrevented&&i&&(S.preventDefault(),i()))},p),a.useEffect(()=>{if(v)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(ie=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(v)),l.layers.add(v),se(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=ie)}},[v,p,n,l]),a.useEffect(()=>()=>{v&&(l.layers.delete(v),l.layersWithOutsidePointerEventsDisabled.delete(v),se())},[v,l]),a.useEffect(()=>{const S=()=>g({});return document.addEventListener(ne,S),()=>document.removeEventListener(ne,S)},[]),R.jsx(z.div,{...f,ref:C,style:{pointerEvents:b?E?"auto":"none":void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,x.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,w.onPointerDownCapture)})});vt.displayName=lt;var mt="DismissableLayerBranch",pt=a.forwardRef((e,t)=>{const n=a.useContext(we),r=a.useRef(null),o=F(t,r);return a.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),R.jsx(z.div,{...e,ref:o})});pt.displayName=mt;function ht(e,t=globalThis?.document){const n=W(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let f=function(){Re(ft,n,l,{discrete:!0})};const l={originalEvent:i};i.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",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yt(e,t=globalThis?.document){const n=W(e),r=a.useRef(!1);return a.useEffect(()=>{const o=s=>{s.target&&!r.current&&Re(dt,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function se(){const e=new CustomEvent(ne);document.dispatchEvent(e)}function Re(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?qe(o,s):o.dispatchEvent(s)}var Z="focusScope.autoFocusOnMount",G="focusScope.autoFocusOnUnmount",ce={bubbles:!1,cancelable:!0},gt="FocusScope",bt=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[i,f]=a.useState(null),l=W(o),v=W(s),d=a.useRef(null),p=F(t,u=>f(u)),g=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let u=function(b){if(g.paused||!i)return;const E=b.target;i.contains(E)?d.current=E:O(d.current,{select:!0})},m=function(b){if(g.paused||!i)return;const E=b.relatedTarget;E!==null&&(i.contains(E)||O(d.current,{select:!0}))},h=function(b){if(document.activeElement===document.body)for(const w of b)w.removedNodes.length>0&&O(i)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const y=new MutationObserver(h);return i&&y.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),y.disconnect()}}},[r,i,g.paused]),a.useEffect(()=>{if(i){le.add(g);const u=document.activeElement;if(!i.contains(u)){const h=new CustomEvent(Z,ce);i.addEventListener(Z,l),i.dispatchEvent(h),h.defaultPrevented||(Et(xt(xe(i)),{select:!0}),document.activeElement===u&&O(i))}return()=>{i.removeEventListener(Z,l),setTimeout(()=>{const h=new CustomEvent(G,ce);i.addEventListener(G,v),i.dispatchEvent(h),h.defaultPrevented||O(u??document.body,{select:!0}),i.removeEventListener(G,v),le.remove(g)},0)}}},[i,l,v,g]);const C=a.useCallback(u=>{if(!n&&!r||g.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,h=document.activeElement;if(m&&h){const y=u.currentTarget,[b,E]=St(y);b&&E?!u.shiftKey&&h===E?(u.preventDefault(),n&&O(b,{select:!0})):u.shiftKey&&h===b&&(u.preventDefault(),n&&O(E,{select:!0})):h===y&&u.preventDefault()}},[n,r,g.paused]);return R.jsx(z.div,{tabIndex:-1,...c,ref:p,onKeyDown:C})});bt.displayName=gt;function Et(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function St(e){const t=xe(e),n=ue(t,e),r=ue(t.reverse(),e);return[n,r]}function xe(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 ue(e,t){for(const n of e)if(!Ct(n,{upTo:t}))return n}function Ct(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 wt(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wt(e)&&t&&e.select()}}var le=Rt();function Rt(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=fe(e,t),e.unshift(t)},remove(t){e=fe(e,t),e[0]?.resume()}}}function fe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xt(e){return e.filter(t=>t.tagName!=="A")}var Pt="Portal",Ot=a.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=a.useState(!1);K(()=>s(!0),[]);const c=n||o&&globalThis?.document?.body;return c?We.createPortal(R.jsx(z.div,{...r,ref:t}),c):null});Ot.displayName=Pt;var q=0;function xn(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??de()),document.body.insertAdjacentElement("beforeend",e[1]??de()),q++,()=>{q===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),q--}},[])}function de(){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 P=function(){return P=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return Ht;var t=zt(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])}},Xt=Ae(),M="data-scroll-locked",Yt=function(e,t,n,r){var o=e.left,s=e.top,c=e.right,i=e.gap;return n===void 0&&(n="margin"),` .`.concat(At,` { overflow: hidden `).concat(r,`; padding-right: `).concat(i,"px ").concat(r,`; } body[`).concat(M,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(o,`px; padding-top: `).concat(s,`px; padding-right: `).concat(c,`px; margin-left:0; margin-top:0; margin-right: `).concat(i,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(U,` { right: `).concat(i,"px ").concat(r,`; } .`).concat(H,` { margin-right: `).concat(i,"px ").concat(r,`; } .`).concat(U," .").concat(U,` { right: 0 `).concat(r,`; } .`).concat(H," .").concat(H,` { margin-right: 0 `).concat(r,`; } body[`).concat(M,`] { `).concat(Tt,": ").concat(i,`px; } `)},me=function(){var e=parseInt(document.body.getAttribute(M)||"0",10);return isFinite(e)?e:0},Zt=function(){a.useEffect(function(){return document.body.setAttribute(M,(me()+1).toString()),function(){var e=me()-1;e<=0?document.body.removeAttribute(M):document.body.setAttribute(M,e.toString())}},[])},Gt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Zt();var s=a.useMemo(function(){return Kt(o)},[o]);return a.createElement(Xt,{styles:Yt(s,!t,o,n?"":"!important")})},re=!1;if(typeof window<"u")try{var j=Object.defineProperty({},"passive",{get:function(){return re=!0,!0}});window.addEventListener("test",j,j),window.removeEventListener("test",j,j)}catch{re=!1}var D=re?{passive:!1}:!1,qt=function(e){return e.tagName==="TEXTAREA"},Te=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!qt(e)&&n[t]==="visible")},Qt=function(e){return Te(e,"overflowY")},Jt=function(e){return Te(e,"overflowX")},pe=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=De(e,r);if(o){var s=Le(e,r),c=s[1],i=s[2];if(c>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},en=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},tn=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},De=function(e,t){return e==="v"?Qt(t):Jt(t)},Le=function(e,t){return e==="v"?en(t):tn(t)},nn=function(e,t){return e==="h"&&t==="rtl"?-1:1},rn=function(e,t,n,r,o){var s=nn(e,window.getComputedStyle(t).direction),c=s*r,i=n.target,f=t.contains(i),l=!1,v=c>0,d=0,p=0;do{if(!i)break;var g=Le(e,i),C=g[0],u=g[1],m=g[2],h=u-m-s*C;(C||h)&&De(e,i)&&(d+=h,p+=C);var y=i.parentNode;i=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!f&&i!==document.body||f&&(t.contains(i)||t===i));return(v&&Math.abs(d)<1||!v&&Math.abs(p)<1)&&(l=!0),l},B=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},he=function(e){return[e.deltaX,e.deltaY]},ye=function(e){return e&&"current"in e?e.current:e},on=function(e,t){return e[0]===t[0]&&e[1]===t[1]},an=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},sn=0,L=[];function cn(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(sn++)[0],s=a.useState(Ae)[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 u=Nt([e.lockRef.current],(e.shards||[]).map(ye),!0).filter(Boolean);return u.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),u.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=a.useCallback(function(u,m){if("touches"in u&&u.touches.length===2||u.type==="wheel"&&u.ctrlKey)return!c.current.allowPinchZoom;var h=B(u),y=n.current,b="deltaX"in u?u.deltaX:y[0]-h[0],E="deltaY"in u?u.deltaY:y[1]-h[1],w,x=u.target,S=Math.abs(b)>Math.abs(E)?"h":"v";if("touches"in u&&S==="h"&&x.type==="range")return!1;var N=window.getSelection(),T=N&&N.anchorNode,k=T?T===x||T.contains(x):!1;if(k)return!1;var _=pe(S,x);if(!_)return!0;if(_?w=S:(w=S==="v"?"h":"v",_=pe(S,x)),!_)return!1;if(!r.current&&"changedTouches"in u&&(b||E)&&(r.current=w),!w)return!0;var oe=r.current||w;return rn(oe,m,u,oe==="h"?b:E)},[]),f=a.useCallback(function(u){var m=u;if(!(!L.length||L[L.length-1]!==s)){var h="deltaY"in m?he(m):B(m),y=t.current.filter(function(w){return w.name===m.type&&(w.target===m.target||m.target===w.shadowParent)&&on(w.delta,h)})[0];if(y&&y.should){m.cancelable&&m.preventDefault();return}if(!y){var b=(c.current.shards||[]).map(ye).filter(Boolean).filter(function(w){return w.contains(m.target)}),E=b.length>0?i(m,b[0]):!c.current.noIsolation;E&&m.cancelable&&m.preventDefault()}}},[]),l=a.useCallback(function(u,m,h,y){var b={name:u,delta:m,target:h,should:y,shadowParent:un(h)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(E){return E!==b})},1)},[]),v=a.useCallback(function(u){n.current=B(u),r.current=void 0},[]),d=a.useCallback(function(u){l(u.type,he(u),u.target,i(u,e.lockRef.current))},[]),p=a.useCallback(function(u){l(u.type,B(u),u.target,i(u,e.lockRef.current))},[]);a.useEffect(function(){return L.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",f,D),document.addEventListener("touchmove",f,D),document.addEventListener("touchstart",v,D),function(){L=L.filter(function(u){return u!==s}),document.removeEventListener("wheel",f,D),document.removeEventListener("touchmove",f,D),document.removeEventListener("touchstart",v,D)}},[]);var g=e.removeScrollBar,C=e.inert;return a.createElement(a.Fragment,null,C?a.createElement(s,{styles:an(o)}):null,g?a.createElement(Gt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function un(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ln=Wt(Ne,cn);var fn=a.forwardRef(function(e,t){return a.createElement(X,P({},e,{ref:t,sideCar:ln}))});fn.classNames=X.classNames;var dn=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},I=new WeakMap,$=new WeakMap,V={},te=0,Ie=function(e){return e&&(e.host||Ie(e.parentNode))},vn=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ie(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})},mn=function(e,t,n,r){var o=vn(t,Array.isArray(e)?e:[e]);V[n]||(V[n]=new WeakMap);var s=V[n],c=[],i=new Set,f=new Set(o),l=function(d){!d||i.has(d)||(i.add(d),l(d.parentNode))};o.forEach(l);var v=function(d){!d||f.has(d)||Array.prototype.forEach.call(d.children,function(p){if(i.has(p))v(p);else try{var g=p.getAttribute(r),C=g!==null&&g!=="false",u=(I.get(p)||0)+1,m=(s.get(p)||0)+1;I.set(p,u),s.set(p,m),c.push(p),u===1&&C&&$.set(p,!0),m===1&&p.setAttribute(n,"true"),C||p.setAttribute(r,"true")}catch(h){console.error("aria-hidden: cannot operate on ",p,h)}})};return v(t),i.clear(),te++,function(){c.forEach(function(d){var p=I.get(d)-1,g=s.get(d)-1;I.set(d,p),s.set(d,g),p||($.has(d)||d.removeAttribute(r),$.delete(d)),g||d.removeAttribute(n)}),te--,te||(I=new WeakMap,I=new WeakMap,$=new WeakMap,V={})}},Pn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=dn(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),mn(r,o,n,"aria-hidden")):function(){return null}};export{vt as D,bt as F,hn as I,yn as L,Ot as P,fn as R,z as a,bn as b,Y as c,gn as d,Ve as e,Sn as f,Cn as g,Pn as h,xn as i,En as j,K as k,Rn as l,wn as m,Se as r,W as u};