@rdsaude/pulso-react-components
Version:
Biblioteca de componentes React do Pulso Design System da RD Saúde oferece componentes consistentes e de alto desempenho, alinhados com os padrões da RDSaúde. Ideal para desenvolver aplicações modernas e acessíveis.
41 lines (36 loc) • 74.8 kB
JavaScript
import{a as xe}from"./chunk-ATE4V42Q.js";import{a as Z}from"./chunk-V5IX4U5J.js";import{a as C,b as A,c as k,e as de}from"./chunk-UABQX4UA.js";function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},F.apply(null,arguments)}import{useState as ee,useRef as Ie,createElement as _,useCallback as he,forwardRef as Re,useEffect as Qe,Fragment as Sr,useMemo as rs}from"react";import{createPortal as Cr}from"react-dom";function Wt(e,[t,o]){return Math.min(o,Math.max(t,e))}function Q(e,t,{checkForDefaultPrevented:o=!0}={}){return function(r){if(e==null||e(r),o===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}import ye from"react";import{createContextScope as ri}from"@radix-ui/react-context";import{useCallback as ti}from"react";function oi(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ni(...e){return t=>e.forEach(o=>oi(o,t))}function G(...e){return ti(ni(...e),e)}import{Slot as To}from"@radix-ui/react-slot";function _o(e){let t=e+"CollectionProvider",[o,n]=ri(t),[r,i]=o(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{let{scope:$,children:u}=p,d=ye.useRef(null),b=ye.useRef(new Map).current;return ye.createElement(r,{scope:$,itemMap:b,collectionRef:d},u)},s=e+"CollectionSlot",c=ye.forwardRef((p,$)=>{let{scope:u,children:d}=p,b=i(s,u),v=G($,b.collectionRef);return ye.createElement(To,{ref:v},d)}),f=e+"CollectionItemSlot",m="data-radix-collection-item",l=ye.forwardRef((p,$)=>{let y=p,{scope:u,children:d}=y,b=k(y,["scope","children"]),v=ye.useRef(null),h=G($,v),x=i(f,u);return ye.useEffect(()=>(x.itemMap.set(v,C({ref:v},b)),()=>void x.itemMap.delete(v))),ye.createElement(To,{[m]:"",ref:h},d)});function g(p){let $=i(e+"CollectionConsumer",p);return ye.useCallback(()=>{let d=$.collectionRef.current;if(!d)return[];let b=Array.from(d.querySelectorAll(`[${m}]`));return Array.from($.itemMap.values()).sort((x,y)=>b.indexOf(x.ref.current)-b.indexOf(y.ref.current))},[$.collectionRef,$.itemMap])}return[{Provider:a,Slot:c,ItemSlot:l},g,n]}import{createContextScope as is}from"@radix-ui/react-context";import{createContext as ii,createElement as Xs,useContext as ai}from"react";var si=ii(void 0);function Ao(e){let t=ai(si);return e||t||"ltr"}import{createContext as bi,forwardRef as $i,useContext as xi,useState as Do,useEffect as rt,createElement as yi,useRef as jt}from"react";import{forwardRef as ci,useEffect as li,createElement as fi}from"react";import{flushSync as ui}from"react-dom";import{Slot as di}from"@radix-ui/react-slot";var pi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],X=pi.reduce((e,t)=>{let o=ci((n,r)=>{let c=n,{asChild:i}=c,a=k(c,["asChild"]),s=i?di:t;return li(()=>{window[Symbol.for("radix-ui")]=!0},[]),fi(s,F({},a,{ref:r}))});return o.displayName=`Primitive.${t}`,A(C({},e),{[t]:o})},{});function Io(e,t){e&&ui(()=>e.dispatchEvent(t))}import{useRef as mi,useEffect as hi,useMemo as vi}from"react";function re(e){let t=mi(e);return hi(()=>{t.current=e}),vi(()=>(...o)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...o)},[])}import{useEffect as gi}from"react";function No(e,t=globalThis==null?void 0:globalThis.document){let o=re(e);gi(()=>{let n=r=>{r.key==="Escape"&&o(r)};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[o,t])}var zt="dismissableLayer.update",wi="dismissableLayer.pointerDownOutside",Si="dismissableLayer.focusOutside",Lo,Ci=bi({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mo=$i((e,t)=>{var o;let S=e,{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:c}=S,f=k(S,["disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss"]),m=xi(Ci),[l,g]=Do(null),p=(o=l==null?void 0:l.ownerDocument)!==null&&o!==void 0?o:globalThis==null?void 0:globalThis.document,[,$]=Do({}),u=G(t,w=>g(w)),d=Array.from(m.layers),[b]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),v=d.indexOf(b),h=l?d.indexOf(l):-1,x=m.layersWithOutsidePointerEventsDisabled.size>0,y=h>=v,P=Ri(w=>{let D=w.target,L=[...m.branches].some(M=>M.contains(D));!y||L||(i==null||i(w),s==null||s(w),w.defaultPrevented||c==null||c())},p),R=Ei(w=>{let D=w.target;[...m.branches].some(M=>M.contains(D))||(a==null||a(w),s==null||s(w),w.defaultPrevented||c==null||c())},p);return No(w=>{h===m.layers.size-1&&(r==null||r(w),!w.defaultPrevented&&c&&(w.preventDefault(),c()))},p),rt(()=>{if(l)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Lo=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(l)),m.layers.add(l),ko(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Lo)}},[l,p,n,m]),rt(()=>()=>{l&&(m.layers.delete(l),m.layersWithOutsidePointerEventsDisabled.delete(l),ko())},[l,m]),rt(()=>{let w=()=>$({});return document.addEventListener(zt,w),()=>document.removeEventListener(zt,w)},[]),yi(X.div,F({},f,{ref:u,style:C({pointerEvents:x?y?"auto":"none":void 0},e.style),onFocusCapture:Q(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Q(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Q(e.onPointerDownCapture,P.onPointerDownCapture)}))});function Ri(e,t=globalThis==null?void 0:globalThis.document){let o=re(e),n=jt(!1),r=jt(()=>{});return rt(()=>{let i=s=>{if(s.target&&!n.current){let m=function(){Vo(wi,o,f,{discrete:!0})};var c=m;let f={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=m,t.addEventListener("click",r.current,{once:!0})):m()}n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,o]),{onPointerDownCapture:()=>n.current=!0}}function Ei(e,t=globalThis==null?void 0:globalThis.document){let o=re(e),n=jt(!1);return rt(()=>{let r=i=>{i.target&&!n.current&&Vo(Si,o,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,o]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ko(){let e=new CustomEvent(zt);document.dispatchEvent(e)}function Vo(e,t,o,{discrete:n}){let r=o.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:o});t&&r.addEventListener(e,t,{once:!0}),n?Io(r,i):r.dispatchEvent(i)}import{useEffect as Pi}from"react";var Yt=0;function Fo(){Pi(()=>{var e,t;let o=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=o[0])!==null&&e!==void 0?e:Ho()),document.body.insertAdjacentElement("beforeend",(t=o[1])!==null&&t!==void 0?t:Ho()),Yt++,()=>{Yt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Yt--}},[])}function Ho(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}import{forwardRef as Oi,useState as Ti,useRef as Bo,useEffect as Wo,useCallback as _i,createElement as Ai}from"react";var qt="focusScope.autoFocusOnMount",Ut="focusScope.autoFocusOnUnmount",jo={bubbles:!1,cancelable:!0};var Uo=Oi((e,t)=>{let u=e,{loop:o=!1,trapped:n=!1,onMountAutoFocus:r,onUnmountAutoFocus:i}=u,a=k(u,["loop","trapped","onMountAutoFocus","onUnmountAutoFocus"]),[s,c]=Ti(null),f=re(r),m=re(i),l=Bo(null),g=G(t,d=>c(d)),p=Bo({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Wo(()=>{if(n){let h=function(R){if(p.paused||!s)return;let S=R.target;s.contains(S)?l.current=S:Ae(l.current,{select:!0})},x=function(R){if(p.paused||!s)return;let S=R.relatedTarget;S!==null&&(s.contains(S)||Ae(l.current,{select:!0}))},y=function(R){let S=document.activeElement;for(let w of R)w.removedNodes.length>0&&(s!=null&&s.contains(S)||Ae(s))};var d=h,b=x,v=y;document.addEventListener("focusin",h),document.addEventListener("focusout",x);let P=new MutationObserver(y);return s&&P.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",x),P.disconnect()}}},[n,s,p.paused]),Wo(()=>{if(s){Yo.add(p);let d=document.activeElement;if(!s.contains(d)){let v=new CustomEvent(qt,jo);s.addEventListener(qt,f),s.dispatchEvent(v),v.defaultPrevented||(Ii(Mi(Ko(s)),{select:!0}),document.activeElement===d&&Ae(s))}return()=>{s.removeEventListener(qt,f),setTimeout(()=>{let v=new CustomEvent(Ut,jo);s.addEventListener(Ut,m),s.dispatchEvent(v),v.defaultPrevented||Ae(d!=null?d:document.body,{select:!0}),s.removeEventListener(Ut,m),Yo.remove(p)},0)}}},[s,f,m,p]);let $=_i(d=>{if(!o&&!n||p.paused)return;let b=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,v=document.activeElement;if(b&&v){let h=d.currentTarget,[x,y]=Ni(h);x&&y?!d.shiftKey&&v===y?(d.preventDefault(),o&&Ae(x,{select:!0})):d.shiftKey&&v===x&&(d.preventDefault(),o&&Ae(y,{select:!0})):v===h&&d.preventDefault()}},[o,n,p.paused]);return Ai(X.div,F({tabIndex:-1},a,{ref:g,onKeyDown:$}))});function Ii(e,{select:t=!1}={}){let o=document.activeElement;for(let n of e)if(Ae(n,{select:t}),document.activeElement!==o)return}function Ni(e){let t=Ko(e),o=zo(t,e),n=zo(t.reverse(),e);return[o,n]}function Ko(e){let t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let r=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||r?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)t.push(o.currentNode);return t}function zo(e,t){for(let o of e)if(!Di(o,{upTo:t}))return o}function Di(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 Li(e){return e instanceof HTMLInputElement&&"select"in e}function Ae(e,{select:t=!1}={}){if(e&&e.focus){let o=document.activeElement;e.focus({preventScroll:!0}),e!==o&&Li(e)&&t&&e.select()}}var Yo=ki();function ki(){let e=[];return{add(t){let o=e[0];t!==o&&(o==null||o.pause()),e=qo(e,t),e.unshift(t)},remove(t){var o;e=qo(e,t),(o=e[0])===null||o===void 0||o.resume()}}}function qo(e,t){let o=[...e],n=o.indexOf(t);return n!==-1&&o.splice(n,1),o}function Mi(e){return e.filter(t=>t.tagName!=="A")}import*as ht from"react";import{useLayoutEffect as Vi}from"react";var ue=globalThis!=null&&globalThis.document?Vi:()=>{};var Hi=ht.useId||(()=>{}),Fi=0;function Kt(e){let[t,o]=ht.useState(Hi());return ue(()=>{e||o(n=>n!=null?n:String(Fi++))},[e]),e||(t?`radix-${t}`:"")}import{useState as Pt,createElement as ft,forwardRef as jn,useRef as ua,useEffect as da}from"react";var Go=["top","right","bottom","left"];var we=Math.min,ie=Math.max,at=Math.round,st=Math.floor,ve=e=>({x:e,y:e}),Bi={left:"right",right:"left",bottom:"top",top:"bottom"},Wi={start:"end",end:"start"};function gt(e,t,o){return ie(e,we(t,o))}function Se(e,t){return typeof e=="function"?e(t):e}function Ce(e){return e.split("-")[0]}function Ne(e){return e.split("-")[1]}function bt(e){return e==="x"?"y":"x"}function $t(e){return e==="y"?"height":"width"}function ge(e){return["top","bottom"].includes(Ce(e))?"y":"x"}function xt(e){return bt(ge(e))}function Xo(e,t,o){o===void 0&&(o=!1);let n=Ne(e),r=xt(e),i=$t(r),a=r==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=it(a)),[a,it(a)]}function Qo(e){let t=it(e);return[vt(e),t,vt(t)]}function vt(e){return e.replace(/start|end/g,t=>Wi[t])}function ji(e,t,o){let n=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return o?t?r:n:t?n:r;case"left":case"right":return t?i:a;default:return[]}}function Zo(e,t,o,n){let r=Ne(e),i=ji(Ce(e),o==="start",n);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(vt)))),i}function it(e){return e.replace(/left|right|bottom|top/g,t=>Bi[t])}function zi(e){return C({top:0,right:0,bottom:0,left:0},e)}function Gt(e){return typeof e!="number"?zi(e):{top:e,right:e,bottom:e,left:e}}function De(e){let{x:t,y:o,width:n,height:r}=e;return{width:n,height:r,top:o,left:t,right:t+n,bottom:o+r,x:t,y:o}}function Jo(e,t,o){let{reference:n,floating:r}=e,i=ge(t),a=xt(t),s=$t(a),c=Ce(t),f=i==="y",m=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2,g=n[s]/2-r[s]/2,p;switch(c){case"top":p={x:m,y:n.y-r.height};break;case"bottom":p={x:m,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:l};break;case"left":p={x:n.x-r.width,y:l};break;default:p={x:n.x,y:n.y}}switch(Ne(t)){case"start":p[a]-=g*(o&&f?-1:1);break;case"end":p[a]+=g*(o&&f?-1:1);break}return p}var on=(e,t,o)=>de(void 0,null,function*(){let{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:a}=o,s=i.filter(Boolean),c=yield a.isRTL==null?void 0:a.isRTL(t),f=yield a.getElementRects({reference:e,floating:t,strategy:r}),{x:m,y:l}=Jo(f,n,c),g=n,p={},$=0;for(let u=0;u<s.length;u++){let{name:d,fn:b}=s[u],{x:v,y:h,data:x,reset:y}=yield b({x:m,y:l,initialPlacement:n,placement:g,strategy:r,middlewareData:p,rects:f,platform:a,elements:{reference:e,floating:t}});m=v!=null?v:m,l=h!=null?h:l,p=A(C({},p),{[d]:C(C({},p[d]),x)}),y&&$<=50&&($++,typeof y=="object"&&(y.placement&&(g=y.placement),y.rects&&(f=y.rects===!0?yield a.getElementRects({reference:e,floating:t,strategy:r}):y.rects),{x:m,y:l}=Jo(f,g,c)),u=-1)}return{x:m,y:l,placement:g,strategy:r,middlewareData:p}});function ze(e,t){return de(this,null,function*(){var o;t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:l="floating",altBoundary:g=!1,padding:p=0}=Se(t,e),$=Gt(p),d=s[g?l==="floating"?"reference":"floating":l],b=De(yield i.getClippingRect({element:(o=yield i.isElement==null?void 0:i.isElement(d))==null||o?d:d.contextElement||(yield i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:f,rootBoundary:m,strategy:c})),v=l==="floating"?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,h=yield i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating),x=(yield i.isElement==null?void 0:i.isElement(h))?(yield i.getScale==null?void 0:i.getScale(h))||{x:1,y:1}:{x:1,y:1},y=De(i.convertOffsetParentRelativeRectToViewportRelativeRect?yield i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:h,strategy:c}):v);return{top:(b.top-y.top+$.top)/x.y,bottom:(y.bottom-b.bottom+$.bottom)/x.y,left:(b.left-y.left+$.left)/x.x,right:(y.right-b.right+$.right)/x.x}})}var nn=e=>({name:"arrow",options:e,fn(o){return de(this,null,function*(){let{x:n,y:r,placement:i,rects:a,platform:s,elements:c,middlewareData:f}=o,{element:m,padding:l=0}=Se(e,o)||{};if(m==null)return{};let g=Gt(l),p={x:n,y:r},$=xt(i),u=$t($),d=yield s.getDimensions(m),b=$==="y",v=b?"top":"left",h=b?"bottom":"right",x=b?"clientHeight":"clientWidth",y=a.reference[u]+a.reference[$]-p[$]-a.floating[u],P=p[$]-a.reference[$],R=yield s.getOffsetParent==null?void 0:s.getOffsetParent(m),S=R?R[x]:0;(!S||!(yield s.isElement==null?void 0:s.isElement(R)))&&(S=c.floating[x]||a.floating[u]);let w=y/2-P/2,D=S/2-d[u]/2-1,L=we(g[v],D),M=we(g[h],D),I=L,U=S-d[u]-M,O=S/2-d[u]/2+w,N=gt(I,O,U),Y=!f.arrow&&Ne(i)!=null&&O!==N&&a.reference[u]/2-(O<I?L:M)-d[u]/2<0,T=Y?O<I?O-I:O-U:0;return{[$]:p[$]+T,data:C({[$]:N,centerOffset:O-N-T},Y&&{alignmentOffset:T}),reset:Y}})}});var rn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(o){return de(this,null,function*(){var n,r;let{placement:i,middlewareData:a,rects:s,initialPlacement:c,platform:f,elements:m}=o,O=Se(e,o),{mainAxis:l=!0,crossAxis:g=!0,fallbackPlacements:p,fallbackStrategy:$="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:d=!0}=O,b=k(O,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let v=Ce(i),h=ge(c),x=Ce(c)===c,y=yield f.isRTL==null?void 0:f.isRTL(m.floating),P=p||(x||!d?[it(c)]:Qo(c)),R=u!=="none";!p&&R&&P.push(...Zo(c,d,u,y));let S=[c,...P],w=yield ze(o,b),D=[],L=((r=a.flip)==null?void 0:r.overflows)||[];if(l&&D.push(w[v]),g){let N=Xo(i,s,y);D.push(w[N[0]],w[N[1]])}if(L=[...L,{placement:i,overflows:D}],!D.every(N=>N<=0)){var M,I;let N=(((M=a.flip)==null?void 0:M.index)||0)+1,Y=S[N];if(Y&&(!(g==="alignment"?h!==ge(Y):!1)||L.every(B=>B.overflows[0]>0&&ge(B.placement)===h)))return{data:{index:N,overflows:L},reset:{placement:Y}};let T=(I=L.filter(q=>q.overflows[0]<=0).sort((q,B)=>q.overflows[1]-B.overflows[1])[0])==null?void 0:I.placement;if(!T)switch($){case"bestFit":{var U;let q=(U=L.filter(B=>{if(R){let ae=ge(B.placement);return ae===h||ae==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ae=>ae>0).reduce((ae,Ee)=>ae+Ee,0)]).sort((B,ae)=>B[1]-ae[1])[0])==null?void 0:U[0];q&&(T=q);break}case"initialPlacement":T=c;break}if(i!==T)return{reset:{placement:T}}}return{}})}}};function en(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tn(e){return Go.some(t=>e[t]>=0)}var an=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(o){return de(this,null,function*(){let{rects:n}=o,a=Se(e,o),{strategy:r="referenceHidden"}=a,i=k(a,["strategy"]);switch(r){case"referenceHidden":{let s=yield ze(o,A(C({},i),{elementContext:"reference"})),c=en(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:tn(c)}}}case"escaped":{let s=yield ze(o,A(C({},i),{altBoundary:!0})),c=en(s,n.floating);return{data:{escapedOffsets:c,escaped:tn(c)}}}default:return{}}})}}};function Yi(e,t){return de(this,null,function*(){let{placement:o,platform:n,elements:r}=e,i=yield n.isRTL==null?void 0:n.isRTL(r.floating),a=Ce(o),s=Ne(o),c=ge(o)==="y",f=["left","top"].includes(a)?-1:1,m=i&&c?-1:1,l=Se(t,e),{mainAxis:g,crossAxis:p,alignmentAxis:$}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return s&&typeof $=="number"&&(p=s==="end"?$*-1:$),c?{x:p*m,y:g*f}:{x:g*f,y:p*m}})}var sn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(o){return de(this,null,function*(){var n,r;let{x:i,y:a,placement:s,middlewareData:c}=o,f=yield Yi(o,e);return s===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:a+f.y,data:A(C({},f),{placement:s})}})}}},cn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(o){return de(this,null,function*(){let{x:n,y:r,placement:i}=o,b=Se(e,o),{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:v=>{let{x:h,y:x}=v;return{x:h,y:x}}}}=b,f=k(b,["mainAxis","crossAxis","limiter"]),m={x:n,y:r},l=yield ze(o,f),g=ge(Ce(i)),p=bt(g),$=m[p],u=m[g];if(a){let v=p==="y"?"top":"left",h=p==="y"?"bottom":"right",x=$+l[v],y=$-l[h];$=gt(x,$,y)}if(s){let v=g==="y"?"top":"left",h=g==="y"?"bottom":"right",x=u+l[v],y=u-l[h];u=gt(x,u,y)}let d=c.fn(A(C({},o),{[p]:$,[g]:u}));return A(C({},d),{data:{x:d.x-n,y:d.y-r,enabled:{[p]:a,[g]:s}}})})}}},ln=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:o,y:n,placement:r,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:f=!0}=Se(e,t),m={x:o,y:n},l=ge(r),g=bt(l),p=m[g],$=m[l],u=Se(s,t),d=typeof u=="number"?{mainAxis:u,crossAxis:0}:C({mainAxis:0,crossAxis:0},u);if(c){let h=g==="y"?"height":"width",x=i.reference[g]-i.floating[h]+d.mainAxis,y=i.reference[g]+i.reference[h]-d.mainAxis;p<x?p=x:p>y&&(p=y)}if(f){var b,v;let h=g==="y"?"width":"height",x=["top","left"].includes(Ce(r)),y=i.reference[l]-i.floating[h]+(x&&((b=a.offset)==null?void 0:b[l])||0)+(x?0:d.crossAxis),P=i.reference[l]+i.reference[h]+(x?0:((v=a.offset)==null?void 0:v[l])||0)-(x?d.crossAxis:0);$<y?$=y:$>P&&($=P)}return{[g]:p,[l]:$}}}},fn=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(o){return de(this,null,function*(){var n,r;let{placement:i,rects:a,platform:s,elements:c}=o,L=Se(e,o),{apply:f=()=>{}}=L,m=k(L,["apply"]),l=yield ze(o,m),g=Ce(i),p=Ne(i),$=ge(i)==="y",{width:u,height:d}=a.floating,b,v;g==="top"||g==="bottom"?(b=g,v=p===((yield s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(v=g,b=p==="end"?"top":"bottom");let h=d-l.top-l.bottom,x=u-l.left-l.right,y=we(d-l[b],h),P=we(u-l[v],x),R=!o.middlewareData.shift,S=y,w=P;if((n=o.middlewareData.shift)!=null&&n.enabled.x&&(w=x),(r=o.middlewareData.shift)!=null&&r.enabled.y&&(S=h),R&&!p){let M=ie(l.left,0),I=ie(l.right,0),U=ie(l.top,0),O=ie(l.bottom,0);$?w=u-2*(M!==0||I!==0?M+I:ie(l.left,l.right)):S=d-2*(U!==0||O!==0?U+O:ie(l.top,l.bottom))}yield f(A(C({},o),{availableWidth:w,availableHeight:S}));let D=yield s.getDimensions(c.floating);return u!==D.width||d!==D.height?{reset:{rects:!0}}:{}})}}};function yt(){return typeof window!="undefined"}function ke(e){return dn(e)?(e.nodeName||"").toLowerCase():"#document"}function le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function be(e){var t;return(t=(dn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dn(e){return yt()?e instanceof Node||e instanceof le(e).Node:!1}function pe(e){return yt()?e instanceof Element||e instanceof le(e).Element:!1}function $e(e){return yt()?e instanceof HTMLElement||e instanceof le(e).HTMLElement:!1}function un(e){return!yt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof le(e).ShadowRoot}function Ye(e){let{overflow:t,overflowX:o,overflowY:n,display:r}=me(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(r)}function pn(e){return["table","td","th"].includes(ke(e))}function ct(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(o){return!1}})}function wt(e){let t=St(),o=pe(e)?me(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>o[n]?o[n]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!t&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!t&&(o.filter?o.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function mn(e){let t=Pe(e);for(;$e(t)&&!Me(t);){if(wt(t))return t;if(ct(t))return null;t=Pe(t)}return null}function St(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Me(e){return["html","body","#document"].includes(ke(e))}function me(e){return le(e).getComputedStyle(e)}function lt(e){return pe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pe(e){if(ke(e)==="html")return e;let t=e.assignedSlot||e.parentNode||un(e)&&e.host||be(e);return un(t)?t.host:t}function hn(e){let t=Pe(e);return Me(t)?e.ownerDocument?e.ownerDocument.body:e.body:$e(t)&&Ye(t)?t:hn(t)}function Le(e,t,o){var n;t===void 0&&(t=[]),o===void 0&&(o=!0);let r=hn(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=le(r);if(i){let s=Ct(a);return t.concat(a,a.visualViewport||[],Ye(r)?r:[],s&&o?Le(s):[])}return t.concat(r,Le(r,[],o))}function Ct(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bn(e){let t=me(e),o=parseFloat(t.width)||0,n=parseFloat(t.height)||0,r=$e(e),i=r?e.offsetWidth:o,a=r?e.offsetHeight:n,s=at(o)!==i||at(n)!==a;return s&&(o=i,n=a),{width:o,height:n,$:s}}function Qt(e){return pe(e)?e:e.contextElement}function qe(e){let t=Qt(e);if(!$e(t))return ve(1);let o=t.getBoundingClientRect(),{width:n,height:r,$:i}=bn(t),a=(i?at(o.width):o.width)/n,s=(i?at(o.height):o.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var qi=ve(0);function $n(e){let t=le(e);return!St()||!t.visualViewport?qi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ui(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==le(e)?!1:t}function Ve(e,t,o,n){t===void 0&&(t=!1),o===void 0&&(o=!1);let r=e.getBoundingClientRect(),i=Qt(e),a=ve(1);t&&(n?pe(n)&&(a=qe(n)):a=qe(e));let s=Ui(i,o,n)?$n(i):ve(0),c=(r.left+s.x)/a.x,f=(r.top+s.y)/a.y,m=r.width/a.x,l=r.height/a.y;if(i){let g=le(i),p=n&&pe(n)?le(n):n,$=g,u=Ct($);for(;u&&n&&p!==$;){let d=qe(u),b=u.getBoundingClientRect(),v=me(u),h=b.left+(u.clientLeft+parseFloat(v.paddingLeft))*d.x,x=b.top+(u.clientTop+parseFloat(v.paddingTop))*d.y;c*=d.x,f*=d.y,m*=d.x,l*=d.y,c+=h,f+=x,$=le(u),u=Ct($)}}return De({width:m,height:l,x:c,y:f})}function Zt(e,t){let o=lt(e).scrollLeft;return t?t.left+o:Ve(be(e)).left+o}function xn(e,t,o){o===void 0&&(o=!1);let n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-(o?0:Zt(e,n)),i=n.top+t.scrollTop;return{x:r,y:i}}function Ki(e){let{elements:t,rect:o,offsetParent:n,strategy:r}=e,i=r==="fixed",a=be(n),s=t?ct(t.floating):!1;if(n===a||s&&i)return o;let c={scrollLeft:0,scrollTop:0},f=ve(1),m=ve(0),l=$e(n);if((l||!l&&!i)&&((ke(n)!=="body"||Ye(a))&&(c=lt(n)),$e(n))){let p=Ve(n);f=qe(n),m.x=p.x+n.clientLeft,m.y=p.y+n.clientTop}let g=a&&!l&&!i?xn(a,c,!0):ve(0);return{width:o.width*f.x,height:o.height*f.y,x:o.x*f.x-c.scrollLeft*f.x+m.x+g.x,y:o.y*f.y-c.scrollTop*f.y+m.y+g.y}}function Gi(e){return Array.from(e.getClientRects())}function Xi(e){let t=be(e),o=lt(e),n=e.ownerDocument.body,r=ie(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ie(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-o.scrollLeft+Zt(e),s=-o.scrollTop;return me(n).direction==="rtl"&&(a+=ie(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:s}}function Qi(e,t){let o=le(e),n=be(e),r=o.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,c=0;if(r){i=r.width,a=r.height;let f=St();(!f||f&&t==="fixed")&&(s=r.offsetLeft,c=r.offsetTop)}return{width:i,height:a,x:s,y:c}}function Zi(e,t){let o=Ve(e,!0,t==="fixed"),n=o.top+e.clientTop,r=o.left+e.clientLeft,i=$e(e)?qe(e):ve(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,c=r*i.x,f=n*i.y;return{width:a,height:s,x:c,y:f}}function vn(e,t,o){let n;if(t==="viewport")n=Qi(e,o);else if(t==="document")n=Xi(be(e));else if(pe(t))n=Zi(t,o);else{let r=$n(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return De(n)}function yn(e,t){let o=Pe(e);return o===t||!pe(o)||Me(o)?!1:me(o).position==="fixed"||yn(o,t)}function Ji(e,t){let o=t.get(e);if(o)return o;let n=Le(e,[],!1).filter(s=>pe(s)&&ke(s)!=="body"),r=null,i=me(e).position==="fixed",a=i?Pe(e):e;for(;pe(a)&&!Me(a);){let s=me(a),c=wt(a);!c&&s.position==="fixed"&&(r=null),(i?!c&&!r:!c&&s.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Ye(a)&&!c&&yn(e,a))?n=n.filter(m=>m!==a):r=s,a=Pe(a)}return t.set(e,n),n}function ea(e){let{element:t,boundary:o,rootBoundary:n,strategy:r}=e,a=[...o==="clippingAncestors"?ct(t)?[]:Ji(t,this._c):[].concat(o),n],s=a[0],c=a.reduce((f,m)=>{let l=vn(t,m,r);return f.top=ie(l.top,f.top),f.right=we(l.right,f.right),f.bottom=we(l.bottom,f.bottom),f.left=ie(l.left,f.left),f},vn(t,s,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ta(e){let{width:t,height:o}=bn(e);return{width:t,height:o}}function oa(e,t,o){let n=$e(t),r=be(t),i=o==="fixed",a=Ve(e,!0,i,t),s={scrollLeft:0,scrollTop:0},c=ve(0);function f(){c.x=Zt(r)}if(n||!n&&!i)if((ke(t)!=="body"||Ye(r))&&(s=lt(t)),n){let p=Ve(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else r&&f();i&&!n&&r&&f();let m=r&&!n&&!i?xn(r,s):ve(0),l=a.left+s.scrollLeft-c.x-m.x,g=a.top+s.scrollTop-c.y-m.y;return{x:l,y:g,width:a.width,height:a.height}}function Xt(e){return me(e).position==="static"}function gn(e,t){if(!$e(e)||me(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return be(e)===o&&(o=o.ownerDocument.body),o}function wn(e,t){let o=le(e);if(ct(e))return o;if(!$e(e)){let r=Pe(e);for(;r&&!Me(r);){if(pe(r)&&!Xt(r))return r;r=Pe(r)}return o}let n=gn(e,t);for(;n&&pn(n)&&Xt(n);)n=gn(n,t);return n&&Me(n)&&Xt(n)&&!wt(n)?o:n||mn(e)||o}var na=function(e){return de(this,null,function*(){let t=this.getOffsetParent||wn,o=this.getDimensions,n=yield o(e.floating);return{reference:oa(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}})};function ra(e){return me(e).direction==="rtl"}var Sn={convertOffsetParentRelativeRectToViewportRelativeRect:Ki,getDocumentElement:be,getClippingRect:ea,getOffsetParent:wn,getElementRects:na,getClientRects:Gi,getDimensions:ta,getScale:qe,isElement:pe,isRTL:ra};function Cn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ia(e,t){let o=null,n,r=be(e);function i(){var s;clearTimeout(n),(s=o)==null||s.disconnect(),o=null}function a(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),i();let f=e.getBoundingClientRect(),{left:m,top:l,width:g,height:p}=f;if(s||t(),!g||!p)return;let $=st(l),u=st(r.clientWidth-(m+g)),d=st(r.clientHeight-(l+p)),b=st(m),h={rootMargin:-$+"px "+-u+"px "+-d+"px "+-b+"px",threshold:ie(0,we(1,c))||1},x=!0;function y(P){let R=P[0].intersectionRatio;if(R!==c){if(!x)return a();R?a(!1,R):n=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!Cn(f,e.getBoundingClientRect())&&a(),x=!1}try{o=new IntersectionObserver(y,A(C({},h),{root:r.ownerDocument}))}catch(P){o=new IntersectionObserver(y,h)}o.observe(e)}return a(!0),i}function Jt(e,t,o,n){n===void 0&&(n={});let{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,f=Qt(e),m=r||i?[...f?Le(f):[],...Le(t)]:[];m.forEach(b=>{r&&b.addEventListener("scroll",o,{passive:!0}),i&&b.addEventListener("resize",o)});let l=f&&s?ia(f,o):null,g=-1,p=null;a&&(p=new ResizeObserver(b=>{let[v]=b;v&&v.target===f&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var h;(h=p)==null||h.observe(t)})),o()}),f&&!c&&p.observe(f),p.observe(t));let $,u=c?Ve(e):null;c&&d();function d(){let b=Ve(e);u&&!Cn(u,b)&&o(),u=b,$=requestAnimationFrame(d)}return o(),()=>{var b;m.forEach(v=>{r&&v.removeEventListener("scroll",o),i&&v.removeEventListener("resize",o)}),l==null||l(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame($)}}var Rn=sn;var En=cn,Pn=rn,On=fn,Tn=an,eo=nn;var _n=ln,to=(e,t,o)=>{let n=new Map,r=C({platform:Sn},o),i=A(C({},r.platform),{_c:n});return on(e,t,A(C({},r),{platform:i}))};import*as K from"react";import{useLayoutEffect as aa}from"react";import*as In from"react-dom";var sa=typeof document!="undefined",ca=function(){},Rt=sa?aa:ca;function Et(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 o,n,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(n=o;n--!==0;)if(!Et(e[n],t[n]))return!1;return!0}if(r=Object.keys(e),o=r.length,o!==Object.keys(t).length)return!1;for(n=o;n--!==0;)if(!{}.hasOwnProperty.call(t,r[n]))return!1;for(n=o;n--!==0;){let i=r[n];if(!(i==="_owner"&&e.$$typeof)&&!Et(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Nn(e){return typeof window=="undefined"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function An(e,t){let o=Nn(e);return Math.round(t*o)/o}function oo(e){let t=K.useRef(e);return Rt(()=>{t.current=e}),t}function Dn(e){e===void 0&&(e={});let{placement:t="bottom",strategy:o="absolute",middleware:n=[],platform:r,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:c,open:f}=e,[m,l]=K.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=K.useState(n);Et(g,n)||p(n);let[$,u]=K.useState(null),[d,b]=K.useState(null),v=K.useCallback(T=>{T!==P.current&&(P.current=T,u(T))},[]),h=K.useCallback(T=>{T!==R.current&&(R.current=T,b(T))},[]),x=i||$,y=a||d,P=K.useRef(null),R=K.useRef(null),S=K.useRef(m),w=c!=null,D=oo(c),L=oo(r),M=oo(f),I=K.useCallback(()=>{if(!P.current||!R.current)return;let T={placement:t,strategy:o,middleware:g};L.current&&(T.platform=L.current),to(P.current,R.current,T).then(q=>{let B=A(C({},q),{isPositioned:M.current!==!1});U.current&&!Et(S.current,B)&&(S.current=B,In.flushSync(()=>{l(B)}))})},[g,t,o,L,M]);Rt(()=>{f===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,l(T=>A(C({},T),{isPositioned:!1})))},[f]);let U=K.useRef(!1);Rt(()=>(U.current=!0,()=>{U.current=!1}),[]),Rt(()=>{if(x&&(P.current=x),y&&(R.current=y),x&&y){if(D.current)return D.current(x,y,I);I()}},[x,y,I,D,w]);let O=K.useMemo(()=>({reference:P,floating:R,setReference:v,setFloating:h}),[v,h]),N=K.useMemo(()=>({reference:x,floating:y}),[x,y]),Y=K.useMemo(()=>{let T={position:o,left:0,top:0};if(!N.floating)return T;let q=An(N.floating,m.x),B=An(N.floating,m.y);return s?C(A(C({},T),{transform:"translate("+q+"px, "+B+"px)"}),Nn(N.floating)>=1.5&&{willChange:"transform"}):{position:o,left:q,top:B}},[o,s,N.floating,m.x,m.y]);return K.useMemo(()=>A(C({},m),{update:I,refs:O,elements:N,floatingStyles:Y}),[m,I,O,N,Y])}var la=e=>{function t(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){let{element:n,padding:r}=typeof e=="function"?e(o):e;return n&&t(n)?n.current!=null?eo({element:n.current,padding:r}).fn(o):{}:n?eo({element:n,padding:r}).fn(o):{}}}},Ln=(e,t)=>A(C({},Rn(e)),{options:[e,t]}),kn=(e,t)=>A(C({},En(e)),{options:[e,t]}),Mn=(e,t)=>A(C({},_n(e)),{options:[e,t]}),Vn=(e,t)=>A(C({},Pn(e)),{options:[e,t]}),Hn=(e,t)=>A(C({},On(e)),{options:[e,t]});var Fn=(e,t)=>A(C({},Tn(e)),{options:[e,t]});var Bn=(e,t)=>A(C({},la(e)),{options:[e,t]});import{createContextScope as pa}from"@radix-ui/react-context";import{useState as fa}from"react";function Wn(e){let[t,o]=fa(void 0);return ue(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});let n=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0],a,s;if("borderBoxSize"in i){let c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;a=f.inlineSize,s=f.blockSize}else a=e.offsetWidth,s=e.offsetHeight;o({width:a,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else o(void 0)},[e]),t}var zn="Popper",[Yn,no]=pa(zn),[ma,qn]=Yn(zn),ha=e=>{let{__scopePopper:t,children:o}=e,[n,r]=Pt(null);return ft(ma,{scope:t,anchor:n,onAnchorChange:r},o)},va="PopperAnchor",ga=jn((e,t)=>{let c=e,{__scopePopper:o,virtualRef:n}=c,r=k(c,["__scopePopper","virtualRef"]),i=qn(va,o),a=ua(null),s=G(t,a);return da(()=>{i.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:ft(X.div,F({},r,{ref:s}))}),Un="PopperContent",[ba,dl]=Yn(Un),$a=jn((e,t)=>{var o,n,r,i,a,s,c,f;let ce=e,{__scopePopper:m,side:l="bottom",sideOffset:g=0,align:p="center",alignOffset:$=0,arrowPadding:u=0,collisionBoundary:d=[],collisionPadding:b=0,sticky:v="partial",hideWhenDetached:h=!1,avoidCollisions:x=!0,onPlaced:y}=ce,P=k(ce,["__scopePopper","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions","onPlaced"]),R=qn(Un,m),[S,w]=Pt(null),D=G(t,ne=>w(ne)),[L,M]=Pt(null),I=Wn(L),U=(o=I==null?void 0:I.width)!==null&&o!==void 0?o:0,O=(n=I==null?void 0:I.height)!==null&&n!==void 0?n:0,N=l+(p!=="center"?"-"+p:""),Y=typeof b=="number"?b:C({top:0,right:0,bottom:0,left:0},b),T=Array.isArray(d)?d:[d],q=T.length>0,B={padding:Y,boundary:T.filter(xa),altBoundary:q},{refs:ae,floatingStyles:Ee,placement:et,isPositioned:Te,middlewareData:se}=Dn({strategy:"fixed",placement:N,whileElementsMounted:Jt,elements:{reference:R.anchor},middleware:[Ln({mainAxis:g+O,alignmentAxis:$}),x&&kn(C({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?Mn():void 0},B)),x&&Vn(C({},B)),Hn(A(C({},B),{apply:({elements:ne,rects:tt,availableWidth:ot,availableHeight:nt})=>{let{width:Jr,height:ei}=tt.reference,mt=ne.floating.style;mt.setProperty("--radix-popper-available-width",`${ot}px`),mt.setProperty("--radix-popper-available-height",`${nt}px`),mt.setProperty("--radix-popper-anchor-width",`${Jr}px`),mt.setProperty("--radix-popper-anchor-height",`${ei}px`)}})),L&&Bn({element:L,padding:u}),ya({arrowWidth:U,arrowHeight:O}),h&&Fn({strategy:"referenceHidden"})]}),[je,_e]=Kn(et),E=re(y);ue(()=>{Te&&(E==null||E())},[Te,E]);let W=(r=se.arrow)===null||r===void 0?void 0:r.x,oe=(i=se.arrow)===null||i===void 0?void 0:i.y,j=((a=se.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[V,H]=Pt();return ue(()=>{S&&H(window.getComputedStyle(S).zIndex)},[S]),ft("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:A(C({},Ee),{transform:Te?Ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[(s=se.transformOrigin)===null||s===void 0?void 0:s.x,(c=se.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")}),dir:e.dir},ft(ba,{scope:m,placedSide:je,onArrowChange:M,arrowX:W,arrowY:oe,shouldHideArrow:j},ft(X.div,F({"data-side":je,"data-align":_e},P,{ref:D,style:A(C({},P.style),{animation:Te?void 0:"none",opacity:(f=se.hide)!==null&&f!==void 0&&f.referenceHidden?0:void 0})}))))});function xa(e){return e!==null}var ya=e=>({name:"transformOrigin",options:e,fn(t){var o,n,r,i,a;let{placement:s,rects:c,middlewareData:f}=t,l=((o=f.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,g=l?0:e.arrowWidth,p=l?0:e.arrowHeight,[$,u]=Kn(s),d={start:"0%",center:"50%",end:"100%"}[u],b=((n=(r=f.arrow)===null||r===void 0?void 0:r.x)!==null&&n!==void 0?n:0)+g/2,v=((i=(a=f.arrow)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0)+p/2,h="",x="";return $==="bottom"?(h=l?d:`${b}px`,x=`${-p}px`):$==="top"?(h=l?d:`${b}px`,x=`${c.floating.height+p}px`):$==="right"?(h=`${-p}px`,x=l?d:`${v}px`):$==="left"&&(h=`${c.floating.width+p}px`,x=l?d:`${v}px`),{data:{x:h,y:x}}}});function Kn(e){let[t,o="center"]=e.split("-");return[t,o]}var Gn=ha,Xn=ga,Qn=$a;import{forwardRef as wa,createElement as Sa}from"react";import Ca from"react-dom";var Zn=wa((e,t)=>{var o;let i=e,{container:n=globalThis==null||(o=globalThis.document)===null||o===void 0?void 0:o.body}=i,r=k(i,["container"]);return n?Ca.createPortal(Sa(X.div,F({},r,{ref:t})),n):null});import{Slot as as}from"@radix-ui/react-slot";import{useCallback as Ra,useState as Ea,useRef as Pa,useEffect as Oa}from"react";function ro({prop:e,defaultProp:t,onChange:o=()=>{}}){let[n,r]=Ta({defaultProp:t,onChange:o}),i=e!==void 0,a=i?e:n,s=re(o),c=Ra(f=>{if(i){let l=typeof f=="function"?f(e):f;l!==e&&s(l)}else r(f)},[i,e,r,s]);return[a,c]}function Ta({defaultProp:e,onChange:t}){let o=Ea(e),[n]=o,r=Pa(n),i=re(t);return Oa(()=>{r.current!==n&&(i(n),r.current=n)},[n,r,i]),o}import{useRef as _a,useMemo as Aa}from"react";function Jn(e){let t=_a({value:e,previous:e});return Aa(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}import{forwardRef as Ia,createElement as Na}from"react";var er=Ia((e,t)=>Na(X.span,F({},e,{ref:t,style:C({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"},e.style)})));var Da=function(e){if(typeof document=="undefined")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ue=new WeakMap,Ot=new WeakMap,Tt={},io=0,tr=function(e){return e&&(e.host||tr(e.parentNode))},La=function(e,t){return t.map(function(o){if(e.contains(o))return o;var n=tr(o);return n&&e.contains(n)?n:(console.error("aria-hidden",o,"in not contained inside",e,". Doing nothing"),null)}).filter(function(o){return!!o})},ka=function(e,t,o,n){var r=La(t,Array.isArray(e)?e:[e]);Tt[o]||(Tt[o]=new WeakMap);var i=Tt[o],a=[],s=new Set,c=new Set(r),f=function(l){!l||s.has(l)||(s.add(l),f(l.parentNode))};r.forEach(f);var m=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(g){if(s.has(g))m(g);else try{var p=g.getAttribute(n),$=p!==null&&p!=="false",u=(Ue.get(g)||0)+1,d=(i.get(g)||0)+1;Ue.set(g,u),i.set(g,d),a.push(g),u===1&&$&&Ot.set(g,!0),d===1&&g.setAttribute(o,"true"),$||g.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",g,b)}})};return m(t),s.clear(),io++,function(){a.forEach(function(l){var g=Ue.get(l)-1,p=i.get(l)-1;Ue.set(l,g),i.set(l,p),g||(Ot.has(l)||l.removeAttribute(n),Ot.delete(l)),p||l.removeAttribute(o)}),io--,io||(Ue=new WeakMap,Ue=new WeakMap,Ot=new WeakMap,Tt={})}},or=function(e,t,o){o===void 0&&(o="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),r=t||Da(e);return r?(n.push.apply(n,Array.from(r.querySelectorAll("[aria-live], script"))),ka(n,r,o,"aria-hidden")):function(){return null}};var fe=function(){return fe=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++){o=arguments[n];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i])}return t},fe.apply(this,arguments)};function _t(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]]);return o}function nr(e,t,o){if(o||arguments.length===2)for(var n=0,r=t.length,i;n<r;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}import*as Lt from"react";import*as J from"react";var He="right-scroll-bar-position",Fe="width-before-scroll-bar",ao="with-scroll-bars-hidden",so="--removed-body-scroll-bar-size";function At(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}import{useState as Ma}from"react";function rr(e,t){var o=Ma(function(){return{value:e,callback:t,facade:{get current(){return o.value},set current(n){var r=o.value;r!==n&&(o.value=n,o.callback(n,r))}}}})[0];return o.callback=t,o.facade}import*as It from"react";var Va=typeof window!="undefined"?It.useLayoutEffect:It.useEffect,ir=new WeakMap;function co(e,t){var o=rr(t||null,function(n){return e.forEach(function(r){return At(r,n)})});return Va(function(){var n=ir.get(o);if(n){var r=new Set(n),i=new Set(e),a=o.current;r.forEach(function(s){i.has(s)||At(s,null)}),i.forEach(function(s){r.has(s)||At(s,a)})}ir.set(o,e)},[e]),o}function Ha(e){return e}function Fa(e,t){t===void 0&&(t=Ha);var o=[],n=!1,r={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:e},useMedium:function(i){var a=t(i,n);return o.push(a),function(){o=o.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(n=!0;o.length;){var a=o;o=[],a.forEach(i)}o={push:function(s){return i(s)},filter:function(){return o}}},assignMedium:function(i){n=!0;var a=[];if(o.length){var s=o;o=[],s.forEach(i),a=o}var c=function(){var m=a;a=[],m.forEach(i)},f=function(){return Promise.resolve().then(c)};f(),o={push:function(m){a.push(m),f()},filter:function(m){return a=a.filter(m),o}}}};return r}function lo(e){e===void 0&&(e={});var t=Fa(null);return t.options=fe({async:!0,ssr:!1},e),t}import*as ar from"react";var sr=function(e){var t=e.sideCar,o=_t(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return ar.createElement(n,fe({},o))};sr.isSideCarExport=!0;function fo(e,t){return e.useMedium(t),sr}var Nt=lo();var uo=function(){},ut=J.forwardRef(function(e,t){var o=J.useRef(null),n=J.useState({onScrollCapture:uo,onWheelCapture:uo,onTouchMoveCapture:uo}),r=n[0],i=n[1],a=e.forwardProps,s=e.children,c=e.className,f=e.removeScrollBar,m=e.enabled,l=e.shards,g=e.sideCar,p=e.noIsolation,$=e.inert,u=e.allowPinchZoom,d=e.as,b=d===void 0?"div":d,v=_t(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),h=g,x=co([o,t]),y=fe(fe({},v),r);return J.createElement(J.Fragment,null,m&&J.createElement(h,{sideCar:Nt,removeScrollBar:f,shards:l,noIsolation:p,inert:$,setCallbacks:i,allowPinchZoom:!!u,lockRef:o}),a?J.cloneElement(J.Children.only(s),fe(fe({},y),{ref:x})):J.createElement(b,fe({},y,{className:c,ref:x}),s))});ut.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ut.classNames={fullWidth:Fe,zeroRight:He};import*as z from"react";import*as Ge from"react";import*as fr from"react";var cr;var lr=function(){if(cr)return cr;if(typeof __webpack_nonce__!="undefined")return __webpack_nonce__};function Ba(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=lr();return t&&e.setAttribute("nonce",t),e}function Wa(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ja(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var po=function(){var e=0,t=null;return{add:function(o){e==0&&(t=Ba())&&(Wa(t,o),ja(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}};var mo=function(){var e=po();return function(t,o){fr.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&o])}};var dt=function(){var e=mo(),t=function(o){var n=o.styles,r=o.dynamic;return e(n,r),null};return t};var za={left:0,top:0,right:0,gap:0},ho=function(e){return parseInt(e||"",10)||0},Ya=function(e){var t=window.getComputedStyle(document.body),o=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[ho(o),ho(n),ho(r)]},vo=function(e){if(e===void 0&&(e="margin"),typeof window=="undefined")return za;var t=Ya(e),o=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-o+t[2]-t[0])}};var qa=dt(),Ke="data-scroll-locked",Ua=function(e,t,o,n){var r=e.left,i=e.top,a=e.right,s=e.gap;return o===void 0&&(o="margin"),`
.`.concat(ao,` {
overflow: hidden `).concat(n,`;
padding-right: `).concat(s,"px ").concat(n,`;
}
body[`).concat(Ke,`] {
overflow: hidden `).concat(n,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(n,";"),o==="margin"&&`
padding-left: `.concat(r,`px;
padding-top: `).concat(i,`px;
padding-right: `).concat(a,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(s,"px ").concat(n,`;
`),o==="padding"&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),`
}
.`).concat(He,` {
right: `).concat(s,"px ").concat(n,`;
}
.`).concat(Fe,` {
margin-right: `).concat(s,"px ").concat(n,`;
}
.`).concat(He," .").concat(He,` {
right: 0 `).concat(n,`;
}
.`).concat(Fe," .").concat(Fe,` {
margin-right: 0 `).concat(n,`;
}
body[`).concat(Ke,`] {
`).concat(so,": ").concat(s,`px;
}
`)},ur=function(){var e=parseInt(document.body.getAttribute(Ke)||"0",10);return isFinite(e)?e:0},Ka=function(){Ge.useEffect(function(){return document.body.setAttribute(Ke,(ur()+1).toString()),function(){var e=ur()-1;e<=0?document.body.removeAttribute(Ke):document.body.setAttribute(Ke,e.toString())}},[])},go=function(e){var t=e.noRelative,o=e.noImportant,n=e.gapMode,r=n===void 0?"margin":n;Ka();var i=Ge.useMemo(function(){return vo(r)},[r]);return Ge.createElement(qa,{styles:Ua(i,!t,r,o?"":"!important")})};var bo=!1;if(typeof window!="undefined")try{pt=Object.defineProperty({},"passive",{get:function(){return bo=!0,!0}}),window.addEventListener("test",pt,pt),window.removeEventListener("test",pt,pt)}catch(e){bo=!1}var pt,Be=bo?{passive:!1}:!1;var Ga=function(e){return e.tagName==="TEXTAREA"},dr=function(e,t){var o=window.getComputedStyle(e);return o[t]!=="hidden"&&!(o.overflowY===o.overflowX&&!Ga(e)&&o[t]==="visible")},Xa=function(e){return dr(e,"overflowY")},Qa=function(e){return dr(e,"overflowX")},$o=function(e,t){var o=t;do{typeof ShadowRoot!="undefined"&&o instanceof ShadowRoot&&(o=o.host);var n=pr(e,o);if(n){var r=mr(e,o),i=r[1],a=r[2];if(i>a)return!0}o=o.parentNode}while(o&&o!==document.body);return!1},Za=function(e){var t=e.scrollTop,o=e.scrollHeight,n=e.clientHeight;return[t,o,n]},Ja=function(e){var t=e.scrollLeft,o=e.scrollWidth,n=e.clientWidth;return[t,o,n]},pr=function(e,t){return e==="v"?Xa(t):Qa(t)},mr=function(e,t){return e==="v"?Za(t):Ja(t)},es=function(e,t){return e==="h"&&t==="rtl"?-1:1},hr=function(e,t,o,n,r){var i=es(e,window.getComputedStyle(t).direction),a=i*n,s=o.target,c=t.contains(s),f=!1,m=a>0,l=0,g=0;do{var p=mr(e,s),$=p[0],u=p[1],d=p[2],b=u-d-i*$;($||b)&&pr(e,s)&&(l+=b,g+=$),s=s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(m&&(r&&l===0||!r&&a>l)||!m&&(r&&g===0||!r&&-a>g))&&(f=!0),f};var Dt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vr=function(e){return[e.deltaX,e.deltaY]},gr=function(e){return e&&"current"in e?e.current:e},ts=function(e,t){return e[0]===t[0]&&e[1]===t[1]},os=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},ns=0,Xe=[];function br(e){var t=z.useRef([]),o=z.useRef([0,0]),n=z.useRef(),r=z.useState(ns++)[0],i=z.useState(function(){return dt()})[0],a=z.useRef(e);z.useEffect(function(){a.current=e},[e]),z.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var u=nr([e.lockRef.current],(e.shards||[]).map(gr),!0).filter(Boolean);return u.forEach(function(d){return d.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),u.forEach(function(d){return d.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var s=z.useCallback(function(u,d){if("touches"in u&&u.touches.length===2)return!a.current.allowPinchZoom;var b=Dt(u),v=o.current,h="deltaX"in u?u.deltaX:v[0]-b[0],x="deltaY"in u?u.deltaY:v[1]-b[1],y,P=u.target,R=Math.abs(h)>Math.abs(x)?"h":"v";if("touches"in u&&R==="h"&&P.type==="range")return!1;var S=$o(R,P);if(!S)return!0;if(S?y=R:(y=R==="v"?"h":"v",S=$o(R,P)),!S)return!1;if(!n.current&&"changedTouches"in u&&(h||x)&&(n.current=y),!y)return!0;var w=n.current||y;return hr(w,d,u,w==="h"?h:x,!0)},[]),c=z.useCallback(f