UNPKG

@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) 73.9 kB
import{a as Q}from"./chunk-2MB3Y6WI.js";import{a as _e}from"./chunk-OMQZQF62.js";import{a as C,b as A,c as L,d as de}from"./chunk-DDCCLFYC.js";function H(){return H=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},H.apply(null,arguments)}import{useState as J,useRef as Ie,createElement as _,useCallback as he,forwardRef as Se,useEffect as Qe,Fragment as Sr,useMemo as ns}from"react";import{createPortal as Cr}from"react-dom";function Wt(e,[t,o]){return Math.min(o,Math.max(t,e))}function fe(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 $e 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 _o}from"@radix-ui/react-slot";function Ao(e){let t=e+"CollectionProvider",[o,n]=ri(t),[r,i]=o(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{let{scope:$,children:f}=p,d=$e.useRef(null),b=$e.useRef(new Map).current;return $e.createElement(r,{scope:$,itemMap:b,collectionRef:d},f)},s=e+"CollectionSlot",c=$e.forwardRef((p,$)=>{let{scope:f,children:d}=p,b=i(s,f),h=G($,b.collectionRef);return $e.createElement(_o,{ref:h},d)}),u=e+"CollectionItemSlot",m="data-radix-collection-item",l=$e.forwardRef((p,$)=>{let y=p,{scope:f,children:d}=y,b=L(y,["scope","children"]),h=$e.useRef(null),v=G($,h),x=i(u,f);return $e.useEffect(()=>(x.itemMap.set(h,C({ref:h},b)),()=>void x.itemMap.delete(h))),$e.createElement(_o,{[m]:"",ref:v},d)});function g(p){let $=i(e+"CollectionConsumer",p);return $e.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 rs}from"@radix-ui/react-context";import{createContext as ii,createElement as Gs,useContext as ai}from"react";var si=ii(void 0);function Io(e){let t=ai(si);return e||t||"ltr"}import{createContext as bi,forwardRef as $i,useContext as xi,useState as Lo,useEffect as rt,createElement as yi,useRef as jt}from"react";function ht(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{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=L(c,["asChild"]),s=i?di:t;return li(()=>{window[Symbol.for("radix-ui")]=!0},[]),fi(s,H({},a,{ref:r}))});return o.displayName=`Primitive.${t}`,A(C({},e),{[t]:o})},{});function No(e,t){e&&ui(()=>e.dispatchEvent(t))}import{useRef as mi,useEffect as hi,useMemo as vi}from"react";function ne(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 Do(e,t=globalThis==null?void 0:globalThis.document){let o=ne(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",ko,Ci=bi({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vo=$i((e,t)=>{var o;let S=e,{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:c}=S,u=L(S,["disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss"]),m=xi(Ci),[l,g]=Lo(null),p=(o=l==null?void 0:l.ownerDocument)!==null&&o!==void 0?o:globalThis==null?void 0:globalThis.document,[,$]=Lo({}),f=G(t,w=>g(w)),d=Array.from(m.layers),[b]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),h=d.indexOf(b),v=l?d.indexOf(l):-1,x=m.layersWithOutsidePointerEventsDisabled.size>0,y=v>=h,E=Ri(w=>{let D=w.target,k=[...m.branches].some(M=>M.contains(D));!y||k||(i==null||i(w),s==null||s(w),w.defaultPrevented||c==null||c())},p),P=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 Do(w=>{v===m.layers.size-1&&(r==null||r(w),!w.defaultPrevented&&c&&(w.preventDefault(),c()))},p),rt(()=>{if(l)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(ko=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(l)),m.layers.add(l),Mo(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=ko)}},[l,p,n,m]),rt(()=>()=>{l&&(m.layers.delete(l),m.layersWithOutsidePointerEventsDisabled.delete(l),Mo())},[l,m]),rt(()=>{let w=()=>$({});return document.addEventListener(zt,w),()=>document.removeEventListener(zt,w)},[]),yi(X.div,H({},u,{ref:f,style:C({pointerEvents:x?y?"auto":"none":void 0},e.style),onFocusCapture:ht(e.onFocusCapture,P.onFocusCapture),onBlurCapture:ht(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ht(e.onPointerDownCapture,E.onPointerDownCapture)}))});function Ri(e,t=globalThis==null?void 0:globalThis.document){let o=ne(e),n=jt(!1),r=jt(()=>{});return rt(()=>{let i=s=>{if(s.target&&!n.current){let m=function(){Fo(wi,o,u,{discrete:!0})};var c=m;let u={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=ne(e),n=jt(!1);return rt(()=>{let r=i=>{i.target&&!n.current&&Fo(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 Mo(){let e=new CustomEvent(zt);document.dispatchEvent(e)}function Fo(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?No(r,i):r.dispatchEvent(i)}import{useEffect as Pi}from"react";var Yt=0;function Bo(){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 Wo,useEffect as jo,useCallback as _i,createElement as Ai}from"react";var Ut="focusScope.autoFocusOnMount",qt="focusScope.autoFocusOnUnmount",zo={bubbles:!1,cancelable:!0};var Ko=Oi((e,t)=>{let f=e,{loop:o=!1,trapped:n=!1,onMountAutoFocus:r,onUnmountAutoFocus:i}=f,a=L(f,["loop","trapped","onMountAutoFocus","onUnmountAutoFocus"]),[s,c]=Ti(null),u=ne(r),m=ne(i),l=Wo(null),g=G(t,d=>c(d)),p=Wo({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;jo(()=>{if(n){let v=function(P){if(p.paused||!s)return;let S=P.target;s.contains(S)?l.current=S:Ae(l.current,{select:!0})},x=function(P){if(p.paused||!s)return;let S=P.relatedTarget;S!==null&&(s.contains(S)||Ae(l.current,{select:!0}))},y=function(P){let S=document.activeElement;for(let w of P)w.removedNodes.length>0&&(s!=null&&s.contains(S)||Ae(s))};var d=v,b=x,h=y;document.addEventListener("focusin",v),document.addEventListener("focusout",x);let E=new MutationObserver(y);return s&&E.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),E.disconnect()}}},[n,s,p.paused]),jo(()=>{if(s){Uo.add(p);let d=document.activeElement;if(!s.contains(d)){let h=new CustomEvent(Ut,zo);s.addEventListener(Ut,u),s.dispatchEvent(h),h.defaultPrevented||(Ii(Mi(Go(s)),{select:!0}),document.activeElement===d&&Ae(s))}return()=>{s.removeEventListener(Ut,u),setTimeout(()=>{let h=new CustomEvent(qt,zo);s.addEventListener(qt,m),s.dispatchEvent(h),h.defaultPrevented||Ae(d!=null?d:document.body,{select:!0}),s.removeEventListener(qt,m),Uo.remove(p)},0)}}},[s,u,m,p]);let $=_i(d=>{if(!o&&!n||p.paused)return;let b=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,h=document.activeElement;if(b&&h){let v=d.currentTarget,[x,y]=Ni(v);x&&y?!d.shiftKey&&h===y?(d.preventDefault(),o&&Ae(x,{select:!0})):d.shiftKey&&h===x&&(d.preventDefault(),o&&Ae(y,{select:!0})):h===v&&d.preventDefault()}},[o,n,p.paused]);return Ai(X.div,H({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=Go(e),o=Yo(t,e),n=Yo(t.reverse(),e);return[o,n]}function Go(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 Yo(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 Uo=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 vt from"react";import{useLayoutEffect as Vi}from"react";var ue=globalThis!=null&&globalThis.document?Vi:()=>{};var Fi=vt.useId||(()=>{}),Hi=0;function Kt(e){let[t,o]=vt.useState(Fi());return ue(()=>{e||o(n=>n!=null?n:String(Hi++))},[e]),e||(t?`radix-${t}`:"")}import{useState as Ot,createElement as ft,forwardRef as jn,useRef as fa,useEffect as ua}from"react";var Xo=["top","right","bottom","left"];var xe=Math.min,re=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 bt(e,t,o){return re(e,xe(t,o))}function ye(e,t){return typeof e=="function"?e(t):e}function we(e){return e.split("-")[0]}function Ne(e){return e.split("-")[1]}function $t(e){return e==="x"?"y":"x"}function xt(e){return e==="y"?"height":"width"}function Re(e){return["top","bottom"].includes(we(e))?"y":"x"}function yt(e){return $t(Re(e))}function Qo(e,t,o){o===void 0&&(o=!1);let n=Ne(e),r=yt(e),i=xt(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 Zo(e){let t=it(e);return[gt(e),t,gt(t)]}function gt(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 Jo(e,t,o,n){let r=Ne(e),i=ji(we(e),o==="start",n);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(gt)))),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 en(e,t,o){let{reference:n,floating:r}=e,i=Re(t),a=yt(t),s=xt(a),c=we(t),u=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&&u?-1:1);break;case"end":p[a]+=g*(o&&u?-1:1);break}return p}var nn=(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),u=yield a.getElementRects({reference:e,floating:t,strategy:r}),{x:m,y:l}=en(u,n,c),g=n,p={},$=0;for(let f=0;f<s.length;f++){let{name:d,fn:b}=s[f],{x:h,y:v,data:x,reset:y}=yield b({x:m,y:l,initialPlacement:n,placement:g,strategy:r,middlewareData:p,rects:u,platform:a,elements:{reference:e,floating:t}});m=h!=null?h:m,l=v!=null?v:l,p=A(C({},p),{[d]:C(C({},p[d]),x)}),y&&$<=50&&($++,typeof y=="object"&&(y.placement&&(g=y.placement),y.rects&&(u=y.rects===!0?yield a.getElementRects({reference:e,floating:t,strategy:r}):y.rects),{x:m,y:l}=en(u,g,c)),f=-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:u="clippingAncestors",rootBoundary:m="viewport",elementContext:l="floating",altBoundary:g=!1,padding:p=0}=ye(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:u,rootBoundary:m,strategy:c})),h=l==="floating"?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=yield i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating),x=(yield i.isElement==null?void 0:i.isElement(v))?(yield i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},y=De(i.convertOffsetParentRelativeRectToViewportRelativeRect?yield i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:h,offsetParent:v,strategy:c}):h);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 rn=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:u}=o,{element:m,padding:l=0}=ye(e,o)||{};if(m==null)return{};let g=Gt(l),p={x:n,y:r},$=yt(i),f=xt($),d=yield s.getDimensions(m),b=$==="y",h=b?"top":"left",v=b?"bottom":"right",x=b?"clientHeight":"clientWidth",y=a.reference[f]+a.reference[$]-p[$]-a.floating[f],E=p[$]-a.reference[$],P=yield s.getOffsetParent==null?void 0:s.getOffsetParent(m),S=P?P[x]:0;(!S||!(yield s.isElement==null?void 0:s.isElement(P)))&&(S=c.floating[x]||a.floating[f]);let w=y/2-E/2,D=S/2-d[f]/2-1,k=xe(g[h],D),M=xe(g[v],D),I=k,q=S-d[f]-M,O=S/2-d[f]/2+w,N=bt(I,O,q),Y=!u.arrow&&Ne(i)!=null&&O!==N&&a.reference[f]/2-(O<I?k:M)-d[f]/2<0,T=Y?O<I?O-I:O-q:0;return{[$]:p[$]+T,data:C({[$]:N,centerOffset:O-N-T},Y&&{alignmentOffset:T}),reset:Y}})}});var an=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:u,elements:m}=o,O=ye(e,o),{mainAxis:l=!0,crossAxis:g=!0,fallbackPlacements:p,fallbackStrategy:$="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:d=!0}=O,b=L(O,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let h=we(i),v=Re(c),x=we(c)===c,y=yield u.isRTL==null?void 0:u.isRTL(m.floating),E=p||(x||!d?[it(c)]:Zo(c)),P=f!=="none";!p&&P&&E.push(...Jo(c,d,f,y));let S=[c,...E],w=yield ze(o,b),D=[],k=((r=a.flip)==null?void 0:r.overflows)||[];if(l&&D.push(w[h]),g){let N=Qo(i,s,y);D.push(w[N[0]],w[N[1]])}if(k=[...k,{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)return{data:{index:N,overflows:k},reset:{placement:Y}};let T=(I=k.filter(U=>U.overflows[0]<=0).sort((U,z)=>U.overflows[1]-z.overflows[1])[0])==null?void 0:I.placement;if(!T)switch($){case"bestFit":{var q;let U=(q=k.filter(z=>{if(P){let ie=Re(z.placement);return ie===v||ie==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(ie=>ie>0).reduce((ie,Ce)=>ie+Ce,0)]).sort((z,ie)=>z[1]-ie[1])[0])==null?void 0:q[0];U&&(T=U);break}case"initialPlacement":T=c;break}if(i!==T)return{reset:{placement:T}}}return{}})}}};function tn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function on(e){return Xo.some(t=>e[t]>=0)}var sn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(o){return de(this,null,function*(){let{rects:n}=o,a=ye(e,o),{strategy:r="referenceHidden"}=a,i=L(a,["strategy"]);switch(r){case"referenceHidden":{let s=yield ze(o,A(C({},i),{elementContext:"reference"})),c=tn(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:on(c)}}}case"escaped":{let s=yield ze(o,A(C({},i),{altBoundary:!0})),c=tn(s,n.floating);return{data:{escapedOffsets:c,escaped:on(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=we(o),s=Ne(o),c=Re(o)==="y",u=["left","top"].includes(a)?-1:1,m=i&&c?-1:1,l=ye(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*u}:{x:g*u,y:p*m}})}var cn=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,u=yield Yi(o,e);return s===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:a+u.y,data:A(C({},u),{placement:s})}})}}},ln=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=ye(e,o),{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:h=>{let{x:v,y:x}=h;return{x:v,y:x}}}}=b,u=L(b,["mainAxis","crossAxis","limiter"]),m={x:n,y:r},l=yield ze(o,u),g=Re(we(i)),p=$t(g),$=m[p],f=m[g];if(a){let h=p==="y"?"top":"left",v=p==="y"?"bottom":"right",x=$+l[h],y=$-l[v];$=bt(x,$,y)}if(s){let h=g==="y"?"top":"left",v=g==="y"?"bottom":"right",x=f+l[h],y=f-l[v];f=bt(x,f,y)}let d=c.fn(A(C({},o),{[p]:$,[g]:f}));return A(C({},d),{data:{x:d.x-n,y:d.y-r,enabled:{[p]:a,[g]:s}}})})}}},fn=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:u=!0}=ye(e,t),m={x:o,y:n},l=Re(r),g=$t(l),p=m[g],$=m[l],f=ye(s,t),d=typeof f=="number"?{mainAxis:f,crossAxis:0}:C({mainAxis:0,crossAxis:0},f);if(c){let v=g==="y"?"height":"width",x=i.reference[g]-i.floating[v]+d.mainAxis,y=i.reference[g]+i.reference[v]-d.mainAxis;p<x?p=x:p>y&&(p=y)}if(u){var b,h;let v=g==="y"?"width":"height",x=["top","left"].includes(we(r)),y=i.reference[l]-i.floating[v]+(x&&((b=a.offset)==null?void 0:b[l])||0)+(x?0:d.crossAxis),E=i.reference[l]+i.reference[v]+(x?0:((h=a.offset)==null?void 0:h[l])||0)-(x?d.crossAxis:0);$<y?$=y:$>E&&($=E)}return{[g]:p,[l]:$}}}},un=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,k=ye(e,o),{apply:u=()=>{}}=k,m=L(k,["apply"]),l=yield ze(o,m),g=we(i),p=Ne(i),$=Re(i)==="y",{width:f,height:d}=a.floating,b,h;g==="top"||g==="bottom"?(b=g,h=p===((yield s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(h=g,b=p==="end"?"top":"bottom");let v=d-l.top-l.bottom,x=f-l.left-l.right,y=xe(d-l[b],v),E=xe(f-l[h],x),P=!o.middlewareData.shift,S=y,w=E;if((n=o.middlewareData.shift)!=null&&n.enabled.x&&(w=x),(r=o.middlewareData.shift)!=null&&r.enabled.y&&(S=v),P&&!p){let M=re(l.left,0),I=re(l.right,0),q=re(l.top,0),O=re(l.bottom,0);$?w=f-2*(M!==0||I!==0?M+I:re(l.left,l.right)):S=d-2*(q!==0||O!==0?q+O:re(l.top,l.bottom))}yield u(A(C({},o),{availableWidth:w,availableHeight:S}));let D=yield s.getDimensions(c.floating);return f!==D.width||d!==D.height?{reset:{rects:!0}}:{}})}}};function wt(){return typeof window!="undefined"}function ke(e){return pn(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ge(e){var t;return(t=(pn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pn(e){return wt()?e instanceof Node||e instanceof ce(e).Node:!1}function pe(e){return wt()?e instanceof Element||e instanceof ce(e).Element:!1}function be(e){return wt()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function dn(e){return!wt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof ce(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 mn(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 St(e){let t=Ct(),o=pe(e)?me(e):e;return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!t&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!t&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function hn(e){let t=Ee(e);for(;be(t)&&!Me(t);){if(St(t))return t;if(ct(t))return null;t=Ee(t)}return null}function Ct(){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 ce(e).getComputedStyle(e)}function lt(e){return pe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ee(e){if(ke(e)==="html")return e;let t=e.assignedSlot||e.parentNode||dn(e)&&e.host||ge(e);return dn(t)?t.host:t}function vn(e){let t=Ee(e);return Me(t)?e.ownerDocument?e.ownerDocument.body:e.body:be(t)&&Ye(t)?t:vn(t)}function Le(e,t,o){var n;t===void 0&&(t=[]),o===void 0&&(o=!0);let r=vn(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=ce(r);if(i){let s=Rt(a);return t.concat(a,a.visualViewport||[],Ye(r)?r:[],s&&o?Le(s):[])}return t.concat(r,Le(r,[],o))}function Rt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $n(e){let t=me(e),o=parseFloat(t.width)||0,n=parseFloat(t.height)||0,r=be(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 Ue(e){let t=Qt(e);if(!be(t))return ve(1);let o=t.getBoundingClientRect(),{width:n,height:r,$:i}=$n(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 Ui=ve(0);function xn(e){let t=ce(e);return!Ct()||!t.visualViewport?Ui:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qi(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==ce(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=Ue(n)):a=Ue(e));let s=qi(i,o,n)?xn(i):ve(0),c=(r.left+s.x)/a.x,u=(r.top+s.y)/a.y,m=r.width/a.x,l=r.height/a.y;if(i){let g=ce(i),p=n&&pe(n)?ce(n):n,$=g,f=Rt($);for(;f&&n&&p!==$;){let d=Ue(f),b=f.getBoundingClientRect(),h=me(f),v=b.left+(f.clientLeft+parseFloat(h.paddingLeft))*d.x,x=b.top+(f.clientTop+parseFloat(h.paddingTop))*d.y;c*=d.x,u*=d.y,m*=d.x,l*=d.y,c+=v,u+=x,$=ce(f),f=Rt($)}}return De({width:m,height:l,x:c,y:u})}function Zt(e,t){let o=lt(e).scrollLeft;return t?t.left+o:Ve(ge(e)).left+o}function yn(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=ge(n),s=t?ct(t.floating):!1;if(n===a||s&&i)return o;let c={scrollLeft:0,scrollTop:0},u=ve(1),m=ve(0),l=be(n);if((l||!l&&!i)&&((ke(n)!=="body"||Ye(a))&&(c=lt(n)),be(n))){let p=Ve(n);u=Ue(n),m.x=p.x+n.clientLeft,m.y=p.y+n.clientTop}let g=a&&!l&&!i?yn(a,c,!0):ve(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-c.scrollLeft*u.x+m.x+g.x,y:o.y*u.y-c.scrollTop*u.y+m.y+g.y}}function Gi(e){return Array.from(e.getClientRects())}function Xi(e){let t=ge(e),o=lt(e),n=e.ownerDocument.body,r=re(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=re(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-o.scrollLeft+Zt(e),s=-o.scrollTop;return me(n).direction==="rtl"&&(a+=re(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:s}}function Qi(e,t){let o=ce(e),n=ge(e),r=o.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,c=0;if(r){i=r.width,a=r.height;let u=Ct();(!u||u&&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=be(e)?Ue(e):ve(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,c=r*i.x,u=n*i.y;return{width:a,height:s,x:c,y:u}}function gn(e,t,o){let n;if(t==="viewport")n=Qi(e,o);else if(t==="document")n=Xi(ge(e));else if(pe(t))n=Zi(t,o);else{let r=xn(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return De(n)}function wn(e,t){let o=Ee(e);return o===t||!pe(o)||Me(o)?!1:me(o).position==="fixed"||wn(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?Ee(e):e;for(;pe(a)&&!Me(a);){let s=me(a),c=St(a);!c&&s.position==="fixed"&&(r=null),(i?!c&&!r:!c&&s.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Ye(a)&&!c&&wn(e,a))?n=n.filter(m=>m!==a):r=s,a=Ee(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((u,m)=>{let l=gn(t,m,r);return u.top=re(l.top,u.top),u.right=xe(l.right,u.right),u.bottom=xe(l.bottom,u.bottom),u.left=re(l.left,u.left),u},gn(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}=$n(e);return{width:t,height:o}}function oa(e,t,o){let n=be(t),r=ge(t),i=o==="fixed",a=Ve(e,!0,i,t),s={scrollLeft:0,scrollTop:0},c=ve(0);if(n||!n&&!i)if((ke(t)!=="body"||Ye(r))&&(s=lt(t)),n){let g=Ve(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else r&&(c.x=Zt(r));let u=r&&!n&&!i?yn(r,s):ve(0),m=a.left+s.scrollLeft-c.x-u.x,l=a.top+s.scrollTop-c.y-u.y;return{x:m,y:l,width:a.width,height:a.height}}function Xt(e){return me(e).position==="static"}function bn(e,t){if(!be(e)||me(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return ge(e)===o&&(o=o.ownerDocument.body),o}function Sn(e,t){let o=ce(e);if(ct(e))return o;if(!be(e)){let r=Ee(e);for(;r&&!Me(r);){if(pe(r)&&!Xt(r))return r;r=Ee(r)}return o}let n=bn(e,t);for(;n&&mn(n)&&Xt(n);)n=bn(n,t);return n&&Me(n)&&Xt(n)&&!St(n)?o:n||hn(e)||o}var na=function(e){return de(this,null,function*(){let t=this.getOffsetParent||Sn,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 Cn={convertOffsetParentRelativeRectToViewportRelativeRect:Ki,getDocumentElement:ge,getClippingRect:ea,getOffsetParent:Sn,getElementRects:na,getClientRects:Gi,getDimensions:ta,getScale:Ue,isElement:pe,isRTL:ra};function ia(e,t){let o=null,n,r=ge(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{left:u,top:m,width:l,height:g}=e.getBoundingClientRect();if(s||t(),!l||!g)return;let p=st(m),$=st(r.clientWidth-(u+l)),f=st(r.clientHeight-(m+g)),d=st(u),h={rootMargin:-p+"px "+-$+"px "+-f+"px "+-d+"px",threshold:re(0,xe(1,c))||1},v=!0;function x(y){let E=y[0].intersectionRatio;if(E!==c){if(!v)return a();E?a(!1,E):n=setTimeout(()=>{a(!1,1e-7)},1e3)}v=!1}try{o=new IntersectionObserver(x,A(C({},h),{root:r.ownerDocument}))}catch(y){o=new IntersectionObserver(x,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,u=Qt(e),m=r||i?[...u?Le(u):[],...Le(t)]:[];m.forEach(b=>{r&&b.addEventListener("scroll",o,{passive:!0}),i&&b.addEventListener("resize",o)});let l=u&&s?ia(u,o):null,g=-1,p=null;a&&(p=new ResizeObserver(b=>{let[h]=b;h&&h.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var v;(v=p)==null||v.observe(t)})),o()}),u&&!c&&p.observe(u),p.observe(t));let $,f=c?Ve(e):null;c&&d();function d(){let b=Ve(e);f&&(b.x!==f.x||b.y!==f.y||b.width!==f.width||b.height!==f.height)&&o(),f=b,$=requestAnimationFrame(d)}return o(),()=>{var b;m.forEach(h=>{r&&h.removeEventListener("scroll",o),i&&h.removeEventListener("resize",o)}),l==null||l(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame($)}}var Rn=cn;var En=ln,Pn=an,On=un,Tn=sn,eo=rn;var _n=fn,to=(e,t,o)=>{let n=new Map,r=C({platform:Cn},o),i=A(C({},r.platform),{_c:n});return nn(e,t,A(C({},r),{platform:i}))};import*as K from"react";import{useLayoutEffect as aa,useEffect as sa}from"react";import*as In from"react-dom";var Et=typeof document!="undefined"?aa:sa;function Pt(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(!Pt(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)&&!Pt(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 Et(()=>{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:u}=e,[m,l]=K.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=K.useState(n);Pt(g,n)||p(n);let[$,f]=K.useState(null),[d,b]=K.useState(null),h=K.useCallback(T=>{T!==E.current&&(E.current=T,f(T))},[]),v=K.useCallback(T=>{T!==P.current&&(P.current=T,b(T))},[]),x=i||$,y=a||d,E=K.useRef(null),P=K.useRef(null),S=K.useRef(m),w=c!=null,D=oo(c),k=oo(r),M=oo(u),I=K.useCallback(()=>{if(!E.current||!P.current)return;let T={placement:t,strategy:o,middleware:g};k.current&&(T.platform=k.current),to(E.current,P.current,T).then(U=>{let z=A(C({},U),{isPositioned:M.current!==!1});q.current&&!Pt(S.current,z)&&(S.current=z,In.flushSync(()=>{l(z)}))})},[g,t,o,k,M]);Et(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,l(T=>A(C({},T),{isPositioned:!1})))},[u]);let q=K.useRef(!1);Et(()=>(q.current=!0,()=>{q.current=!1}),[]),Et(()=>{if(x&&(E.current=x),y&&(P.current=y),x&&y){if(D.current)return D.current(x,y,I);I()}},[x,y,I,D,w]);let O=K.useMemo(()=>({reference:E,floating:P,setReference:h,setFloating:v}),[h,v]),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 U=An(N.floating,m.x),z=An(N.floating,m.y);return s?C(A(C({},T),{transform:"translate("+U+"px, "+z+"px)"}),Nn(N.floating)>=1.5&&{willChange:"transform"}):{position:o,left:U,top:z}},[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 ca=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]}),Fn=(e,t)=>A(C({},On(e)),{options:[e,t]});var Hn=(e,t)=>A(C({},Tn(e)),{options:[e,t]});var Bn=(e,t)=>A(C({},ca(e)),{options:[e,t]});import{createContextScope as da}from"@radix-ui/react-context";import{useState as la}from"react";function Wn(e){let[t,o]=la(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,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,s=u.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]=da(zn),[pa,Un]=Yn(zn),ma=e=>{let{__scopePopper:t,children:o}=e,[n,r]=Ot(null);return ft(pa,{scope:t,anchor:n,onAnchorChange:r},o)},ha="PopperAnchor",va=jn((e,t)=>{let c=e,{__scopePopper:o,virtualRef:n}=c,r=L(c,["__scopePopper","virtualRef"]),i=Un(ha,o),a=fa(null),s=G(t,a);return ua(()=>{i.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:ft(X.div,H({},r,{ref:s}))}),qn="PopperContent",[ga,dl]=Yn(qn),ba=jn((e,t)=>{var o,n,r,i,a,s,c,u;let se=e,{__scopePopper:m,side:l="bottom",sideOffset:g=0,align:p="center",alignOffset:$=0,arrowPadding:f=0,collisionBoundary:d=[],collisionPadding:b=0,sticky:h="partial",hideWhenDetached:v=!1,avoidCollisions:x=!0,onPlaced:y}=se,E=L(se,["__scopePopper","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions","onPlaced"]),P=Un(qn,m),[S,w]=Ot(null),D=G(t,oe=>w(oe)),[k,M]=Ot(null),I=Wn(k),q=(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],U=T.length>0,z={padding:Y,boundary:T.filter($a),altBoundary:U},{refs:ie,floatingStyles:Ce,placement:et,isPositioned:Oe,middlewareData:ae}=Dn({strategy:"fixed",placement:N,whileElementsMounted:Jt,elements:{reference:P.anchor},middleware:[Ln({mainAxis:g+O,alignmentAxis:$}),x&&kn(C({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Mn():void 0},z)),x&&Vn(C({},z)),Fn(A(C({},z),{apply:({elements:oe,rects:tt,availableWidth:ot,availableHeight:nt})=>{let{width:Jr,height:ei}=tt.reference,mt=oe.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`)}})),k&&Bn({element:k,padding:f}),xa({arrowWidth:q,arrowHeight:O}),v&&Hn({strategy:"referenceHidden"})]}),[je,Te]=Kn(et),R=ne(y);ue(()=>{Oe&&(R==null||R())},[Oe,R]);let B=(r=ae.arrow)===null||r===void 0?void 0:r.x,te=(i=ae.arrow)===null||i===void 0?void 0:i.y,W=((a=ae.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[V,F]=Ot();return ue(()=>{S&&F(window.getComputedStyle(S).zIndex)},[S]),ft("div",{ref:ie.setFloating,"data-radix-popper-content-wrapper":"",style:A(C({},Ce),{transform:Oe?Ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[(s=ae.transformOrigin)===null||s===void 0?void 0:s.x,(c=ae.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")}),dir:e.dir},ft(ga,{scope:m,placedSide:je,onArrowChange:M,arrowX:B,arrowY:te,shouldHideArrow:W},ft(X.div,H({"data-side":je,"data-align":Te},E,{ref:D,style:A(C({},E.style),{animation:Oe?void 0:"none",opacity:(u=ae.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0})}))))});function $a(e){return e!==null}var xa=e=>({name:"transformOrigin",options:e,fn(t){var o,n,r,i,a;let{placement:s,rects:c,middlewareData:u}=t,l=((o=u.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,g=l?0:e.arrowWidth,p=l?0:e.arrowHeight,[$,f]=Kn(s),d={start:"0%",center:"50%",end:"100%"}[f],b=((n=(r=u.arrow)===null||r===void 0?void 0:r.x)!==null&&n!==void 0?n:0)+g/2,h=((i=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0)+p/2,v="",x="";return $==="bottom"?(v=l?d:`${b}px`,x=`${-p}px`):$==="top"?(v=l?d:`${b}px`,x=`${c.floating.height+p}px`):$==="right"?(v=`${-p}px`,x=l?d:`${h}px`):$==="left"&&(v=`${c.floating.width+p}px`,x=l?d:`${h}px`),{data:{x:v,y:x}}}});function Kn(e){let[t,o="center"]=e.split("-");return[t,o]}var Gn=ma,Xn=va,Qn=ba;import{forwardRef as ya,createElement as wa}from"react";import Sa from"react-dom";var Zn=ya((e,t)=>{var o;let i=e,{container:n=globalThis==null||(o=globalThis.document)===null||o===void 0?void 0:o.body}=i,r=L(i,["container"]);return n?Sa.createPortal(wa(X.div,H({},r,{ref:t})),n):null});import{Slot as is}from"@radix-ui/react-slot";import{useCallback as Ca,useState as Ra,useRef as Ea,useEffect as Pa}from"react";function ro({prop:e,defaultProp:t,onChange:o=()=>{}}){let[n,r]=Oa({defaultProp:t,onChange:o}),i=e!==void 0,a=i?e:n,s=ne(o),c=Ca(u=>{if(i){let l=typeof u=="function"?u(e):u;l!==e&&s(l)}else r(u)},[i,e,r,s]);return[a,c]}function Oa({defaultProp:e,onChange:t}){let o=Ra(e),[n]=o,r=Ea(n),i=ne(t);return Pa(()=>{r.current!==n&&(i(n),r.current=n)},[n,r,i]),o}import{useRef as Ta,useMemo as _a}from"react";function Jn(e){let t=Ta({value:e,previous:e});return _a(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}import{forwardRef as Aa,createElement as Ia}from"react";var er=Aa((e,t)=>Ia(X.span,H({},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 Na=function(e){if(typeof document=="undefined")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qe=new WeakMap,Tt=new WeakMap,_t={},io=0,tr=function(e){return e&&(e.host||tr(e.parentNode))},Da=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})},La=function(e,t,o,n){var r=Da(t,Array.isArray(e)?e:[e]);_t[o]||(_t[o]=new WeakMap);var i=_t[o],a=[],s=new Set,c=new Set(r),u=function(l){!l||s.has(l)||(s.add(l),u(l.parentNode))};r.forEach(u);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",f=(qe.get(g)||0)+1,d=(i.get(g)||0)+1;qe.set(g,f),i.set(g,d),a.push(g),f===1&&$&&Tt.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=qe.get(l)-1,p=i.get(l)-1;qe.set(l,g),i.set(l,p),g||(Tt.has(l)||l.removeAttribute(n),Tt.delete(l)),p||l.removeAttribute(o)}),io--,io||(qe=new WeakMap,qe=new WeakMap,Tt=new WeakMap,_t={})}},or=function(e,t,o){o===void 0&&(o="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),r=t||Na(e);return r?(n.push.apply(n,Array.from(r.querySelectorAll("[aria-live]"))),La(n,r,o,"aria-hidden")):function(){return null}};var le=function(){return le=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},le.apply(this,arguments)};function At(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 kt from"react";import*as Z from"react";var Fe="right-scroll-bar-position",He="width-before-scroll-bar",ao="with-scroll-bars-hidden",so="--removed-body-scroll-bar-size";function It(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}import{useState as ka}from"react";function rr(e,t){var o=ka(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 Nt from"react";var Ma=typeof window!="undefined"?Nt.useLayoutEffect:Nt.useEffect,ir=new WeakMap;function co(e,t){var o=rr(t||null,function(n){return e.forEach(function(r){return It(r,n)})});return Ma(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)||It(s,null)}),i.forEach(function(s){r.has(s)||It(s,a)})}ir.set(o,e)},[e]),o}function Va(e){return e}function Fa(e,t){t===void 0&&(t=Va);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)},u=function(){return Promise.resolve().then(c)};u(),o={push:function(m){a.push(m),u()},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=le({async:!0,ssr:!1},e),t}import*as ar from"react";var sr=function(e){var t=e.sideCar,o=At(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,le({},o))};sr.isSideCarExport=!0;function fo(e,t){return e.useMedium(t),sr}var Dt=lo();var uo=function(){},ut=Z.forwardRef(function(e,t){var o=Z.useRef(null),n=Z.useState({onScrollCapture:uo,onWheelCapture:uo,onTouchMoveCapture:uo}),r=n[0],i=n[1],a=e.forwardProps,s=e.children,c=e.className,u=e.removeScrollBar,m=e.enabled,l=e.shards,g=e.sideCar,p=e.noIsolation,$=e.inert,f=e.allowPinchZoom,d=e.as,b=d===void 0?"div":d,h=At(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),v=g,x=co([o,t]),y=le(le({},h),r);return Z.createElement(Z.Fragment,null,m&&Z.createElement(v,{sideCar:Dt,removeScrollBar:u,shards:l,noIsolation:p,inert:$,setCallbacks:i,allowPinchZoom:!!f,lockRef:o}),a?Z.cloneElement(Z.Children.only(s),le(le({},y),{ref:x})):Z.createElement(b,le({},y,{className:c,ref:x}),s))});ut.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ut.classNames={fullWidth:He,zeroRight:Fe};import*as j 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 Ha(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=lr();return t&&e.setAttribute("nonce",t),e}function Ba(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wa(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=Ha())&&(Ba(t,o),Wa(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 ja={left:0,top:0,right:0,gap:0},ho=function(e){return parseInt(e||"",10)||0},za=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 ja;var t=za(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 Ya=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(Fe,` { right: `).concat(s,"px ").concat(n,`; } .`).concat(He,` { margin-right: `).concat(s,"px ").concat(n,`; } .`).concat(Fe," .").concat(Fe,` { right: 0 `).concat(n,`; } .`).concat(He," .").concat(He,` { 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},qa=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;qa();var i=Ge.useMemo(function(){return vo(r)},[r]);return Ge.createElement(Ya,{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 Ka=function(e){return e.tagName==="TEXTAREA"},dr=function(e,t){var o=window.getComputedStyle(e);return o[t]!=="hidden"&&!(o.overflowY===o.overflowX&&!Ka(e)&&o[t]==="visible")},Ga=function(e){return dr(e,"overflowY")},Xa=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},Qa=function(e){var t=e.scrollTop,o=e.scrollHeight,n=e.clientHeight;return[t,o,n]},Za=function(e){var t=e.scrollLeft,o=e.scrollWidth,n=e.clientWidth;return[t,o,n]},pr=function(e,t){return e==="v"?Ga(t):Xa(t)},mr=function(e,t){return e==="v"?Qa(t):Za(t)},Ja=function(e,t){return e==="h"&&t==="rtl"?-1:1},hr=function(e,t,o,n,r){var i=Ja(e,window.getComputedStyle(t).direction),a=i*n,s=o.target,c=t.contains(s),u=!1,m=a>0,l=0,g=0;do{var p=mr(e,s),$=p[0],f=p[1],d=p[2],b=f-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))&&(u=!0),u};var Lt=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},es=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ts=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},os=0,Xe=[];function br(e){var t=j.useRef([]),o=j.useRef([0,0]),n=j.useRef(),r=j.useState(os++)[0],i=j.useState(function(){return dt()})[0],a=j.useRef(e);j.useEffect(function(){a.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var f=nr([e.lockRef.current],(e.shards||[]).map(gr),!0).filter(Boolean);return f.forEach(function(d){return d.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),f.forEach(function(d){return d.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var s=j.useCallback(function(f,d){if("touches"in f&&f.touches.length===2)return!a.current.allowPinchZoom;var b=Lt(f),h=o.current,v="deltaX"in f?f.deltaX:h[0]-b[0],x="deltaY"in f?f.deltaY:h[1]-b[1],y,E=f.target,P=Math.abs(v)>Math.abs(x)?"h":"v";if("touches"in f&&P==="h"&&E.type==="range")return!1;var S=$o(P,E);if(!S)return!0;if(S?y=P:(y=P==="v"?"h":"v",S=$o(P,E)),!S)return!1;if(!n.current&&"changedTouches"in f&&(v||x)&&(n.current=y),!y)return!0;var w=n.current||y;return hr(w,d,f,w==="h"?v:x,!0)},[]),c=j.useCallback(function(f){var d=f;if(!(!Xe.length||Xe[Xe.length-1]!==i)){var b="deltaY"in d?vr(d):Lt(d),h=t.current.filter(function(y){return y.name=