@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.
38 lines (33 loc) • 79.2 kB
JavaScript
"use strict";var Ei=Object.create;var lt=Object.defineProperty,Pi=Object.defineProperties,Oi=Object.getOwnPropertyDescriptor,Ti=Object.getOwnPropertyDescriptors,_i=Object.getOwnPropertyNames,xt=Object.getOwnPropertySymbols,Ai=Object.getPrototypeOf,Gt=Object.prototype.hasOwnProperty,Ho=Object.prototype.propertyIsEnumerable;var Fo=(e,t,o)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,C=(e,t)=>{for(var o in t||(t={}))Gt.call(t,o)&&Fo(e,o,t[o]);if(xt)for(var o of xt(t))Ho.call(t,o)&&Fo(e,o,t[o]);return e},A=(e,t)=>Pi(e,Ti(t));var D=(e,t)=>{var o={};for(var r in e)Gt.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&xt)for(var r of xt(e))t.indexOf(r)<0&&Ho.call(e,r)&&(o[r]=e[r]);return o};var Ii=(e,t)=>{for(var o in t)lt(e,o,{get:t[o],enumerable:!0})},Bo=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of _i(t))!Gt.call(e,n)&&n!==o&<(e,n,{get:()=>t[n],enumerable:!(r=Oi(t,n))||r.enumerable});return e};var ie=(e,t,o)=>(o=e!=null?Ei(Ai(e)):{},Bo(t||!e||!e.__esModule?lt(o,"default",{value:e,enumerable:!0}):o,e)),Ni=e=>Bo(lt({},"__esModule",{value:!0}),e);var he=(e,t,o)=>new Promise((r,n)=>{var i=c=>{try{a(o.next(c))}catch(l){n(l)}},s=c=>{try{a(o.throw(c))}catch(l){n(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);a((o=o.apply(e,t)).next())});var Ra={};Ii(Ra,{InputSelect:()=>Ca});module.exports=Ni(Ra);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 r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},H.apply(null,arguments)}var x=require("react"),_o=require("react-dom");function Xt(e,[t,o]){return Math.min(o,Math.max(t,e))}function ee(e,t,{checkForDefaultPrevented:o=!0}={}){return function(n){if(e==null||e(n),o===!1||!n.defaultPrevented)return t==null?void 0:t(n)}}var $e=ie(require("react"),1),jo=require("@radix-ui/react-context");var Wo=require("react");function Di(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Li(...e){return t=>e.forEach(o=>Di(o,t))}function Q(...e){return(0,Wo.useCallback)(Li(...e),e)}var Qt=require("@radix-ui/react-slot");function zo(e){let t=e+"CollectionProvider",[o,r]=(0,jo.createContextScope)(t),[n,i]=o(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{let{scope:$,children:u}=p,d=$e.default.useRef(null),b=$e.default.useRef(new Map).current;return $e.default.createElement(n,{scope:$,itemMap:b,collectionRef:d},u)},a=e+"CollectionSlot",c=$e.default.forwardRef((p,$)=>{let{scope:u,children:d}=p,b=i(a,u),v=Q($,b.collectionRef);return $e.default.createElement(Qt.Slot,{ref:v},d)}),l=e+"CollectionItemSlot",m="data-radix-collection-item",f=$e.default.forwardRef((p,$)=>{let w=p,{scope:u,children:d}=w,b=D(w,["scope","children"]),v=$e.default.useRef(null),h=Q($,v),y=i(l,u);return $e.default.useEffect(()=>(y.itemMap.set(v,C({ref:v},b)),()=>void y.itemMap.delete(v))),$e.default.createElement(Qt.Slot,{[m]:"",ref:h},d)});function g(p){let $=i(e+"CollectionConsumer",p);return $e.default.useCallback(()=>{let d=$.collectionRef.current;if(!d)return[];let b=Array.from(d.querySelectorAll(`[${m}]`));return Array.from($.itemMap.values()).sort((y,w)=>b.indexOf(y.ref.current)-b.indexOf(w.ref.current))},[$.collectionRef,$.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},g,r]}var jn=require("@radix-ui/react-context");var ft=require("react"),ki=(0,ft.createContext)(void 0);function Ko(e){let t=(0,ft.useContext)(ki);return e||t||"ltr"}var q=require("react");var qe=require("react"),Uo=require("react-dom"),Yo=require("@radix-ui/react-slot");var Mi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Z=Mi.reduce((e,t)=>{let o=(0,qe.forwardRef)((r,n)=>{let c=r,{asChild:i}=c,s=D(c,["asChild"]),a=i?Yo.Slot:t;return(0,qe.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,qe.createElement)(a,H({},s,{ref:n}))});return o.displayName=`Primitive.${t}`,A(C({},e),{[t]:o})},{});function qo(e,t){e&&(0,Uo.flushSync)(()=>e.dispatchEvent(t))}var Ge=require("react");function se(e){let t=(0,Ge.useRef)(e);return(0,Ge.useEffect)(()=>{t.current=e}),(0,Ge.useMemo)(()=>(...o)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...o)},[])}var Go=require("react");function Xo(e,t=globalThis==null?void 0:globalThis.document){let o=se(e);(0,Go.useEffect)(()=>{let r=n=>{n.key==="Escape"&&o(n)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[o,t])}var Zt="dismissableLayer.update",Vi="dismissableLayer.pointerDownOutside",Fi="dismissableLayer.focusOutside",Qo,Hi=(0,q.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jo=(0,q.forwardRef)((e,t)=>{var o;let R=e,{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:c}=R,l=D(R,["disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss"]),m=(0,q.useContext)(Hi),[f,g]=(0,q.useState)(null),p=(o=f==null?void 0:f.ownerDocument)!==null&&o!==void 0?o:globalThis==null?void 0:globalThis.document,[,$]=(0,q.useState)({}),u=Q(t,S=>g(S)),d=Array.from(m.layers),[b]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),v=d.indexOf(b),h=f?d.indexOf(f):-1,y=m.layersWithOutsidePointerEventsDisabled.size>0,w=h>=v,O=Bi(S=>{let L=S.target,k=[...m.branches].some(M=>M.contains(L));!w||k||(i==null||i(S),a==null||a(S),S.defaultPrevented||c==null||c())},p),E=Wi(S=>{let L=S.target;[...m.branches].some(M=>M.contains(L))||(s==null||s(S),a==null||a(S),S.defaultPrevented||c==null||c())},p);return Xo(S=>{h===m.layers.size-1&&(n==null||n(S),!S.defaultPrevented&&c&&(S.preventDefault(),c()))},p),(0,q.useEffect)(()=>{if(f)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Qo=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(f)),m.layers.add(f),Zo(),()=>{r&&m.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Qo)}},[f,p,r,m]),(0,q.useEffect)(()=>()=>{f&&(m.layers.delete(f),m.layersWithOutsidePointerEventsDisabled.delete(f),Zo())},[f,m]),(0,q.useEffect)(()=>{let S=()=>$({});return document.addEventListener(Zt,S),()=>document.removeEventListener(Zt,S)},[]),(0,q.createElement)(Z.div,H({},l,{ref:u,style:C({pointerEvents:y?w?"auto":"none":void 0},e.style),onFocusCapture:ee(e.onFocusCapture,E.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,O.onPointerDownCapture)}))});function Bi(e,t=globalThis==null?void 0:globalThis.document){let o=se(e),r=(0,q.useRef)(!1),n=(0,q.useRef)(()=>{});return(0,q.useEffect)(()=>{let i=a=>{if(a.target&&!r.current){let m=function(){er(Vi,o,l,{discrete:!0})};var c=m;let l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=m,t.addEventListener("click",n.current,{once:!0})):m()}r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",n.current)}},[t,o]),{onPointerDownCapture:()=>r.current=!0}}function Wi(e,t=globalThis==null?void 0:globalThis.document){let o=se(e),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>{let n=i=>{i.target&&!r.current&&er(Fi,o,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,o]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Zo(){let e=new CustomEvent(Zt);document.dispatchEvent(e)}function er(e,t,o,{discrete:r}){let n=o.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:o});t&&n.addEventListener(e,t,{once:!0}),r?qo(n,i):n.dispatchEvent(i)}var or=require("react"),Jt=0;function rr(){(0,or.useEffect)(()=>{var e,t;let o=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=o[0])!==null&&e!==void 0?e:tr()),document.body.insertAdjacentElement("beforeend",(t=o[1])!==null&&t!==void 0?t:tr()),Jt++,()=>{Jt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Jt--}},[])}function tr(){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}var ue=require("react");var eo="focusScope.autoFocusOnMount",to="focusScope.autoFocusOnUnmount",nr={bubbles:!1,cancelable:!0};var cr=(0,ue.forwardRef)((e,t)=>{let u=e,{loop:o=!1,trapped:r=!1,onMountAutoFocus:n,onUnmountAutoFocus:i}=u,s=D(u,["loop","trapped","onMountAutoFocus","onUnmountAutoFocus"]),[a,c]=(0,ue.useState)(null),l=se(n),m=se(i),f=(0,ue.useRef)(null),g=Q(t,d=>c(d)),p=(0,ue.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,ue.useEffect)(()=>{if(r){let h=function(E){if(p.paused||!a)return;let R=E.target;a.contains(R)?f.current=R:De(f.current,{select:!0})},y=function(E){if(p.paused||!a)return;let R=E.relatedTarget;R!==null&&(a.contains(R)||De(f.current,{select:!0}))},w=function(E){let R=document.activeElement;for(let S of E)S.removedNodes.length>0&&(a!=null&&a.contains(R)||De(a))};var d=h,b=y,v=w;document.addEventListener("focusin",h),document.addEventListener("focusout",y);let O=new MutationObserver(w);return a&&O.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),O.disconnect()}}},[r,a,p.paused]),(0,ue.useEffect)(()=>{if(a){sr.add(p);let d=document.activeElement;if(!a.contains(d)){let v=new CustomEvent(eo,nr);a.addEventListener(eo,l),a.dispatchEvent(v),v.defaultPrevented||(ji(qi(lr(a)),{select:!0}),document.activeElement===d&&De(a))}return()=>{a.removeEventListener(eo,l),setTimeout(()=>{let v=new CustomEvent(to,nr);a.addEventListener(to,m),a.dispatchEvent(v),v.defaultPrevented||De(d!=null?d:document.body,{select:!0}),a.removeEventListener(to,m),sr.remove(p)},0)}}},[a,l,m,p]);let $=(0,ue.useCallback)(d=>{if(!o&&!r||p.paused)return;let b=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,v=document.activeElement;if(b&&v){let h=d.currentTarget,[y,w]=zi(h);y&&w?!d.shiftKey&&v===w?(d.preventDefault(),o&&De(y,{select:!0})):d.shiftKey&&v===y&&(d.preventDefault(),o&&De(w,{select:!0})):v===h&&d.preventDefault()}},[o,r,p.paused]);return(0,ue.createElement)(Z.div,H({tabIndex:-1},s,{ref:g,onKeyDown:$}))});function ji(e,{select:t=!1}={}){let o=document.activeElement;for(let r of e)if(De(r,{select:t}),document.activeElement!==o)return}function zi(e){let t=lr(e),o=ir(t,e),r=ir(t.reverse(),e);return[o,r]}function lr(e){let t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{let n=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||n?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)t.push(o.currentNode);return t}function ir(e,t){for(let o of e)if(!Ki(o,{upTo:t}))return o}function Ki(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 Ui(e){return e instanceof HTMLInputElement&&"select"in e}function De(e,{select:t=!1}={}){if(e&&e.focus){let o=document.activeElement;e.focus({preventScroll:!0}),e!==o&&Ui(e)&&t&&e.select()}}var sr=Yi();function Yi(){let e=[];return{add(t){let o=e[0];t!==o&&(o==null||o.pause()),e=ar(e,t),e.unshift(t)},remove(t){var o;e=ar(e,t),(o=e[0])===null||o===void 0||o.resume()}}}function ar(e,t){let o=[...e],r=o.indexOf(t);return r!==-1&&o.splice(r,1),o}function qi(e){return e.filter(t=>t.tagName!=="A")}var yt=ie(require("react"),1);var fr=require("react"),me=globalThis!=null&&globalThis.document?fr.useLayoutEffect:()=>{};var Gi=yt.useId||(()=>{}),Xi=0;function oo(e){let[t,o]=yt.useState(Gi());return me(()=>{e||o(r=>r!=null?r:String(Xi++))},[e]),e||(t?`radix-${t}`:"")}var J=require("react");var ur=["top","right","bottom","left"];var Ee=Math.min,ae=Math.max,dt=Math.round,pt=Math.floor,xe=e=>({x:e,y:e}),Qi={left:"right",right:"left",bottom:"top",top:"bottom"},Zi={start:"end",end:"start"};function St(e,t,o){return ae(e,Ee(t,o))}function Pe(e,t){return typeof e=="function"?e(t):e}function Oe(e){return e.split("-")[0]}function ke(e){return e.split("-")[1]}function Ct(e){return e==="x"?"y":"x"}function Rt(e){return e==="y"?"height":"width"}function ye(e){return["top","bottom"].includes(Oe(e))?"y":"x"}function Et(e){return Ct(ye(e))}function dr(e,t,o){o===void 0&&(o=!1);let r=ke(e),n=Et(e),i=Rt(n),s=n==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ut(s)),[s,ut(s)]}function pr(e){let t=ut(e);return[wt(e),t,wt(t)]}function wt(e){return e.replace(/start|end/g,t=>Zi[t])}function Ji(e,t,o){let r=["left","right"],n=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return o?t?n:r:t?r:n;case"left":case"right":return t?i:s;default:return[]}}function mr(e,t,o,r){let n=ke(e),i=Ji(Oe(e),o==="start",r);return n&&(i=i.map(s=>s+"-"+n),t&&(i=i.concat(i.map(wt)))),i}function ut(e){return e.replace(/left|right|bottom|top/g,t=>Qi[t])}function es(e){return C({top:0,right:0,bottom:0,left:0},e)}function ro(e){return typeof e!="number"?es(e):{top:e,right:e,bottom:e,left:e}}function Me(e){let{x:t,y:o,width:r,height:n}=e;return{width:r,height:n,top:o,left:t,right:t+r,bottom:o+n,x:t,y:o}}function hr(e,t,o){let{reference:r,floating:n}=e,i=ye(t),s=Et(t),a=Rt(s),c=Oe(t),l=i==="y",m=r.x+r.width/2-n.width/2,f=r.y+r.height/2-n.height/2,g=r[a]/2-n[a]/2,p;switch(c){case"top":p={x:m,y:r.y-n.height};break;case"bottom":p={x:m,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-n.width,y:f};break;default:p={x:r.x,y:r.y}}switch(ke(t)){case"start":p[s]-=g*(o&&l?-1:1);break;case"end":p[s]+=g*(o&&l?-1:1);break}return p}var br=(e,t,o)=>he(void 0,null,function*(){let{placement:r="bottom",strategy:n="absolute",middleware:i=[],platform:s}=o,a=i.filter(Boolean),c=yield s.isRTL==null?void 0:s.isRTL(t),l=yield s.getElementRects({reference:e,floating:t,strategy:n}),{x:m,y:f}=hr(l,r,c),g=r,p={},$=0;for(let u=0;u<a.length;u++){let{name:d,fn:b}=a[u],{x:v,y:h,data:y,reset:w}=yield b({x:m,y:f,initialPlacement:r,placement:g,strategy:n,middlewareData:p,rects:l,platform:s,elements:{reference:e,floating:t}});m=v!=null?v:m,f=h!=null?h:f,p=A(C({},p),{[d]:C(C({},p[d]),y)}),w&&$<=50&&($++,typeof w=="object"&&(w.placement&&(g=w.placement),w.rects&&(l=w.rects===!0?yield s.getElementRects({reference:e,floating:t,strategy:n}):w.rects),{x:m,y:f}=hr(l,g,c)),u=-1)}return{x:m,y:f,placement:g,strategy:n,middlewareData:p}});function Xe(e,t){return he(this,null,function*(){var o;t===void 0&&(t={});let{x:r,y:n,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=Pe(t,e),$=ro(p),d=a[g?f==="floating"?"reference":"floating":f],b=Me(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(a.floating)),boundary:l,rootBoundary:m,strategy:c})),v=f==="floating"?{x:r,y:n,width:s.floating.width,height:s.floating.height}:s.reference,h=yield i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating),y=(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},w=Me(i.convertOffsetParentRelativeRectToViewportRelativeRect?yield i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:h,strategy:c}):v);return{top:(b.top-w.top+$.top)/y.y,bottom:(w.bottom-b.bottom+$.bottom)/y.y,left:(b.left-w.left+$.left)/y.x,right:(w.right-b.right+$.right)/y.x}})}var $r=e=>({name:"arrow",options:e,fn(o){return he(this,null,function*(){let{x:r,y:n,placement:i,rects:s,platform:a,elements:c,middlewareData:l}=o,{element:m,padding:f=0}=Pe(e,o)||{};if(m==null)return{};let g=ro(f),p={x:r,y:n},$=Et(i),u=Rt($),d=yield a.getDimensions(m),b=$==="y",v=b?"top":"left",h=b?"bottom":"right",y=b?"clientHeight":"clientWidth",w=s.reference[u]+s.reference[$]-p[$]-s.floating[u],O=p[$]-s.reference[$],E=yield a.getOffsetParent==null?void 0:a.getOffsetParent(m),R=E?E[y]:0;(!R||!(yield a.isElement==null?void 0:a.isElement(E)))&&(R=c.floating[y]||s.floating[u]);let S=w/2-O/2,L=R/2-d[u]/2-1,k=Ee(g[v],L),M=Ee(g[h],L),I=k,G=R-d[u]-M,T=R/2-d[u]/2+S,N=St(I,T,G),K=!l.arrow&&ke(i)!=null&&T!==N&&s.reference[u]/2-(T<I?k:M)-d[u]/2<0,_=K?T<I?T-I:T-G:0;return{[$]:p[$]+_,data:C({[$]:N,centerOffset:T-N-_},K&&{alignmentOffset:_}),reset:K}})}});var xr=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(o){return he(this,null,function*(){var r,n;let{placement:i,middlewareData:s,rects:a,initialPlacement:c,platform:l,elements:m}=o,T=Pe(e,o),{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:p,fallbackStrategy:$="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:d=!0}=T,b=D(T,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=s.arrow)!=null&&r.alignmentOffset)return{};let v=Oe(i),h=ye(c),y=Oe(c)===c,w=yield l.isRTL==null?void 0:l.isRTL(m.floating),O=p||(y||!d?[ut(c)]:pr(c)),E=u!=="none";!p&&E&&O.push(...mr(c,d,u,w));let R=[c,...O],S=yield Xe(o,b),L=[],k=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&L.push(S[v]),g){let N=dr(i,a,w);L.push(S[N[0]],S[N[1]])}if(k=[...k,{placement:i,overflows:L}],!L.every(N=>N<=0)){var M,I;let N=(((M=s.flip)==null?void 0:M.index)||0)+1,K=R[N];if(K&&(!(g==="alignment"?h!==ye(K):!1)||k.every(B=>B.overflows[0]>0&&ye(B.placement)===h)))return{data:{index:N,overflows:k},reset:{placement:K}};let _=(I=k.filter(U=>U.overflows[0]<=0).sort((U,B)=>U.overflows[1]-B.overflows[1])[0])==null?void 0:I.placement;if(!_)switch($){case"bestFit":{var G;let U=(G=k.filter(B=>{if(E){let ce=ye(B.placement);return ce===h||ce==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ce=>ce>0).reduce((ce,Te)=>ce+Te,0)]).sort((B,ce)=>B[1]-ce[1])[0])==null?void 0:G[0];U&&(_=U);break}case"initialPlacement":_=c;break}if(i!==_)return{reset:{placement:_}}}return{}})}}};function vr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gr(e){return ur.some(t=>e[t]>=0)}var yr=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(o){return he(this,null,function*(){let{rects:r}=o,s=Pe(e,o),{strategy:n="referenceHidden"}=s,i=D(s,["strategy"]);switch(n){case"referenceHidden":{let a=yield Xe(o,A(C({},i),{elementContext:"reference"})),c=vr(a,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:gr(c)}}}case"escaped":{let a=yield Xe(o,A(C({},i),{altBoundary:!0})),c=vr(a,r.floating);return{data:{escapedOffsets:c,escaped:gr(c)}}}default:return{}}})}}};function ts(e,t){return he(this,null,function*(){let{placement:o,platform:r,elements:n}=e,i=yield r.isRTL==null?void 0:r.isRTL(n.floating),s=Oe(o),a=ke(o),c=ye(o)==="y",l=["left","top"].includes(s)?-1:1,m=i&&c?-1:1,f=Pe(t,e),{mainAxis:g,crossAxis:p,alignmentAxis:$}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof $=="number"&&(p=a==="end"?$*-1:$),c?{x:p*m,y:g*l}:{x:g*l,y:p*m}})}var wr=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(o){return he(this,null,function*(){var r,n;let{x:i,y:s,placement:a,middlewareData:c}=o,l=yield ts(o,e);return a===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:A(C({},l),{placement:a})}})}}},Sr=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(o){return he(this,null,function*(){let{x:r,y:n,placement:i}=o,b=Pe(e,o),{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:v=>{let{x:h,y}=v;return{x:h,y}}}}=b,l=D(b,["mainAxis","crossAxis","limiter"]),m={x:r,y:n},f=yield Xe(o,l),g=ye(Oe(i)),p=Ct(g),$=m[p],u=m[g];if(s){let v=p==="y"?"top":"left",h=p==="y"?"bottom":"right",y=$+f[v],w=$-f[h];$=St(y,$,w)}if(a){let v=g==="y"?"top":"left",h=g==="y"?"bottom":"right",y=u+f[v],w=u-f[h];u=St(y,u,w)}let d=c.fn(A(C({},o),{[p]:$,[g]:u}));return A(C({},d),{data:{x:d.x-r,y:d.y-n,enabled:{[p]:s,[g]:a}}})})}}},Cr=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:o,y:r,placement:n,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Pe(e,t),m={x:o,y:r},f=ye(n),g=Ct(f),p=m[g],$=m[f],u=Pe(a,t),d=typeof u=="number"?{mainAxis:u,crossAxis:0}:C({mainAxis:0,crossAxis:0},u);if(c){let h=g==="y"?"height":"width",y=i.reference[g]-i.floating[h]+d.mainAxis,w=i.reference[g]+i.reference[h]-d.mainAxis;p<y?p=y:p>w&&(p=w)}if(l){var b,v;let h=g==="y"?"width":"height",y=["top","left"].includes(Oe(n)),w=i.reference[f]-i.floating[h]+(y&&((b=s.offset)==null?void 0:b[f])||0)+(y?0:d.crossAxis),O=i.reference[f]+i.reference[h]+(y?0:((v=s.offset)==null?void 0:v[f])||0)-(y?d.crossAxis:0);$<w?$=w:$>O&&($=O)}return{[g]:p,[f]:$}}}},Rr=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(o){return he(this,null,function*(){var r,n;let{placement:i,rects:s,platform:a,elements:c}=o,k=Pe(e,o),{apply:l=()=>{}}=k,m=D(k,["apply"]),f=yield Xe(o,m),g=Oe(i),p=ke(i),$=ye(i)==="y",{width:u,height:d}=s.floating,b,v;g==="top"||g==="bottom"?(b=g,v=p===((yield a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(v=g,b=p==="end"?"top":"bottom");let h=d-f.top-f.bottom,y=u-f.left-f.right,w=Ee(d-f[b],h),O=Ee(u-f[v],y),E=!o.middlewareData.shift,R=w,S=O;if((r=o.middlewareData.shift)!=null&&r.enabled.x&&(S=y),(n=o.middlewareData.shift)!=null&&n.enabled.y&&(R=h),E&&!p){let M=ae(f.left,0),I=ae(f.right,0),G=ae(f.top,0),T=ae(f.bottom,0);$?S=u-2*(M!==0||I!==0?M+I:ae(f.left,f.right)):R=d-2*(G!==0||T!==0?G+T:ae(f.top,f.bottom))}yield l(A(C({},o),{availableWidth:S,availableHeight:R}));let L=yield a.getDimensions(c.floating);return u!==L.width||d!==L.height?{reset:{rects:!0}}:{}})}}};function Pt(){return typeof window!="undefined"}function Fe(e){return Pr(e)?(e.nodeName||"").toLowerCase():"#document"}function de(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function we(e){var t;return(t=(Pr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Pr(e){return Pt()?e instanceof Node||e instanceof de(e).Node:!1}function ve(e){return Pt()?e instanceof Element||e instanceof de(e).Element:!1}function Se(e){return Pt()?e instanceof HTMLElement||e instanceof de(e).HTMLElement:!1}function Er(e){return!Pt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof de(e).ShadowRoot}function Qe(e){let{overflow:t,overflowX:o,overflowY:r,display:n}=ge(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&!["inline","contents"].includes(n)}function Or(e){return["table","td","th"].includes(Fe(e))}function mt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(o){return!1}})}function Ot(e){let t=Tt(),o=ve(e)?ge(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>o[r]?o[r]!=="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(r=>(o.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(o.contain||"").includes(r))}function Tr(e){let t=_e(e);for(;Se(t)&&!He(t);){if(Ot(t))return t;if(mt(t))return null;t=_e(t)}return null}function Tt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function He(e){return["html","body","#document"].includes(Fe(e))}function ge(e){return de(e).getComputedStyle(e)}function ht(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _e(e){if(Fe(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Er(e)&&e.host||we(e);return Er(t)?t.host:t}function _r(e){let t=_e(e);return He(t)?e.ownerDocument?e.ownerDocument.body:e.body:Se(t)&&Qe(t)?t:_r(t)}function Ve(e,t,o){var r;t===void 0&&(t=[]),o===void 0&&(o=!0);let n=_r(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),s=de(n);if(i){let a=_t(s);return t.concat(s,s.visualViewport||[],Qe(n)?n:[],a&&o?Ve(a):[])}return t.concat(n,Ve(n,[],o))}function _t(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nr(e){let t=ge(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=Se(e),i=n?e.offsetWidth:o,s=n?e.offsetHeight:r,a=dt(o)!==i||dt(r)!==s;return a&&(o=i,r=s),{width:o,height:r,$:a}}function io(e){return ve(e)?e:e.contextElement}function Ze(e){let t=io(e);if(!Se(t))return xe(1);let o=t.getBoundingClientRect(),{width:r,height:n,$:i}=Nr(t),s=(i?dt(o.width):o.width)/r,a=(i?dt(o.height):o.height)/n;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var os=xe(0);function Dr(e){let t=de(e);return!Tt()||!t.visualViewport?os:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rs(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==de(e)?!1:t}function Be(e,t,o,r){t===void 0&&(t=!1),o===void 0&&(o=!1);let n=e.getBoundingClientRect(),i=io(e),s=xe(1);t&&(r?ve(r)&&(s=Ze(r)):s=Ze(e));let a=rs(i,o,r)?Dr(i):xe(0),c=(n.left+a.x)/s.x,l=(n.top+a.y)/s.y,m=n.width/s.x,f=n.height/s.y;if(i){let g=de(i),p=r&&ve(r)?de(r):r,$=g,u=_t($);for(;u&&r&&p!==$;){let d=Ze(u),b=u.getBoundingClientRect(),v=ge(u),h=b.left+(u.clientLeft+parseFloat(v.paddingLeft))*d.x,y=b.top+(u.clientTop+parseFloat(v.paddingTop))*d.y;c*=d.x,l*=d.y,m*=d.x,f*=d.y,c+=h,l+=y,$=de(u),u=_t($)}}return Me({width:m,height:f,x:c,y:l})}function so(e,t){let o=ht(e).scrollLeft;return t?t.left+o:Be(we(e)).left+o}function Lr(e,t,o){o===void 0&&(o=!1);let r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-(o?0:so(e,r)),i=r.top+t.scrollTop;return{x:n,y:i}}function ns(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,i=n==="fixed",s=we(r),a=t?mt(t.floating):!1;if(r===s||a&&i)return o;let c={scrollLeft:0,scrollTop:0},l=xe(1),m=xe(0),f=Se(r);if((f||!f&&!i)&&((Fe(r)!=="body"||Qe(s))&&(c=ht(r)),Se(r))){let p=Be(r);l=Ze(r),m.x=p.x+r.clientLeft,m.y=p.y+r.clientTop}let g=s&&!f&&!i?Lr(s,c,!0):xe(0);return{width:o.width*l.x,height:o.height*l.y,x:o.x*l.x-c.scrollLeft*l.x+m.x+g.x,y:o.y*l.y-c.scrollTop*l.y+m.y+g.y}}function is(e){return Array.from(e.getClientRects())}function ss(e){let t=we(e),o=ht(e),r=e.ownerDocument.body,n=ae(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ae(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),s=-o.scrollLeft+so(e),a=-o.scrollTop;return ge(r).direction==="rtl"&&(s+=ae(t.clientWidth,r.clientWidth)-n),{width:n,height:i,x:s,y:a}}function as(e,t){let o=de(e),r=we(e),n=o.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(n){i=n.width,s=n.height;let l=Tt();(!l||l&&t==="fixed")&&(a=n.offsetLeft,c=n.offsetTop)}return{width:i,height:s,x:a,y:c}}function cs(e,t){let o=Be(e,!0,t==="fixed"),r=o.top+e.clientTop,n=o.left+e.clientLeft,i=Se(e)?Ze(e):xe(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=n*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function Ar(e,t,o){let r;if(t==="viewport")r=as(e,o);else if(t==="document")r=ss(we(e));else if(ve(t))r=cs(t,o);else{let n=Dr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Me(r)}function kr(e,t){let o=_e(e);return o===t||!ve(o)||He(o)?!1:ge(o).position==="fixed"||kr(o,t)}function ls(e,t){let o=t.get(e);if(o)return o;let r=Ve(e,[],!1).filter(a=>ve(a)&&Fe(a)!=="body"),n=null,i=ge(e).position==="fixed",s=i?_e(e):e;for(;ve(s)&&!He(s);){let a=ge(s),c=Ot(s);!c&&a.position==="fixed"&&(n=null),(i?!c&&!n:!c&&a.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||Qe(s)&&!c&&kr(e,s))?r=r.filter(m=>m!==s):n=a,s=_e(s)}return t.set(e,r),r}function fs(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,s=[...o==="clippingAncestors"?mt(t)?[]:ls(t,this._c):[].concat(o),r],a=s[0],c=s.reduce((l,m)=>{let f=Ar(t,m,n);return l.top=ae(f.top,l.top),l.right=Ee(f.right,l.right),l.bottom=Ee(f.bottom,l.bottom),l.left=ae(f.left,l.left),l},Ar(t,a,n));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function us(e){let{width:t,height:o}=Nr(e);return{width:t,height:o}}function ds(e,t,o){let r=Se(t),n=we(t),i=o==="fixed",s=Be(e,!0,i,t),a={scrollLeft:0,scrollTop:0},c=xe(0);function l(){c.x=so(n)}if(r||!r&&!i)if((Fe(t)!=="body"||Qe(n))&&(a=ht(t)),r){let p=Be(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else n&&l();i&&!r&&n&&l();let m=n&&!r&&!i?Lr(n,a):xe(0),f=s.left+a.scrollLeft-c.x-m.x,g=s.top+a.scrollTop-c.y-m.y;return{x:f,y:g,width:s.width,height:s.height}}function no(e){return ge(e).position==="static"}function Ir(e,t){if(!Se(e)||ge(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return we(e)===o&&(o=o.ownerDocument.body),o}function Mr(e,t){let o=de(e);if(mt(e))return o;if(!Se(e)){let n=_e(e);for(;n&&!He(n);){if(ve(n)&&!no(n))return n;n=_e(n)}return o}let r=Ir(e,t);for(;r&&Or(r)&&no(r);)r=Ir(r,t);return r&&He(r)&&no(r)&&!Ot(r)?o:r||Tr(e)||o}var ps=function(e){return he(this,null,function*(){let t=this.getOffsetParent||Mr,o=this.getDimensions,r=yield o(e.floating);return{reference:ds(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function ms(e){return ge(e).direction==="rtl"}var Vr={convertOffsetParentRelativeRectToViewportRelativeRect:ns,getDocumentElement:we,getClippingRect:fs,getOffsetParent:Mr,getElementRects:ps,getClientRects:is,getDimensions:us,getScale:Ze,isElement:ve,isRTL:ms};function Fr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hs(e,t){let o=null,r,n=we(e);function i(){var a;clearTimeout(r),(a=o)==null||a.disconnect(),o=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();let l=e.getBoundingClientRect(),{left:m,top:f,width:g,height:p}=l;if(a||t(),!g||!p)return;let $=pt(f),u=pt(n.clientWidth-(m+g)),d=pt(n.clientHeight-(f+p)),b=pt(m),h={rootMargin:-$+"px "+-u+"px "+-d+"px "+-b+"px",threshold:ae(0,Ee(1,c))||1},y=!0;function w(O){let E=O[0].intersectionRatio;if(E!==c){if(!y)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!Fr(l,e.getBoundingClientRect())&&s(),y=!1}try{o=new IntersectionObserver(w,A(C({},h),{root:n.ownerDocument}))}catch(O){o=new IntersectionObserver(w,h)}o.observe(e)}return s(!0),i}function ao(e,t,o,r){r===void 0&&(r={});let{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=io(e),m=n||i?[...l?Ve(l):[],...Ve(t)]:[];m.forEach(b=>{n&&b.addEventListener("scroll",o,{passive:!0}),i&&b.addEventListener("resize",o)});let f=l&&a?hs(l,o):null,g=-1,p=null;s&&(p=new ResizeObserver(b=>{let[v]=b;v&&v.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var h;(h=p)==null||h.observe(t)})),o()}),l&&!c&&p.observe(l),p.observe(t));let $,u=c?Be(e):null;c&&d();function d(){let b=Be(e);u&&!Fr(u,b)&&o(),u=b,$=requestAnimationFrame(d)}return o(),()=>{var b;m.forEach(v=>{n&&v.removeEventListener("scroll",o),i&&v.removeEventListener("resize",o)}),f==null||f(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame($)}}var Hr=wr;var Br=Sr,Wr=xr,jr=Rr,zr=yr,co=$r;var Kr=Cr,lo=(e,t,o)=>{let r=new Map,n=C({platform:Vr},o),i=A(C({},n.platform),{_c:r});return br(e,t,A(C({},n),{platform:i}))};var X=ie(require("react"),1),Yr=require("react"),qr=ie(require("react-dom"),1);var vs=typeof document!="undefined",gs=function(){},At=vs?Yr.useLayoutEffect:gs;function It(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,r,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(r=o;r--!==0;)if(!It(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=o;r--!==0;){let i=n[r];if(!(i==="_owner"&&e.$$typeof)&&!It(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Gr(e){return typeof window=="undefined"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ur(e,t){let o=Gr(e);return Math.round(t*o)/o}function fo(e){let t=X.useRef(e);return At(()=>{t.current=e}),t}function Xr(e){e===void 0&&(e={});let{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:n,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[m,f]=X.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=X.useState(r);It(g,r)||p(r);let[$,u]=X.useState(null),[d,b]=X.useState(null),v=X.useCallback(_=>{_!==O.current&&(O.current=_,u(_))},[]),h=X.useCallback(_=>{_!==E.current&&(E.current=_,b(_))},[]),y=i||$,w=s||d,O=X.useRef(null),E=X.useRef(null),R=X.useRef(m),S=c!=null,L=fo(c),k=fo(n),M=fo(l),I=X.useCallback(()=>{if(!O.current||!E.current)return;let _={placement:t,strategy:o,middleware:g};k.current&&(_.platform=k.current),lo(O.current,E.current,_).then(U=>{let B=A(C({},U),{isPositioned:M.current!==!1});G.current&&!It(R.current,B)&&(R.current=B,qr.flushSync(()=>{f(B)}))})},[g,t,o,k,M]);At(()=>{l===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(_=>A(C({},_),{isPositioned:!1})))},[l]);let G=X.useRef(!1);At(()=>(G.current=!0,()=>{G.current=!1}),[]),At(()=>{if(y&&(O.current=y),w&&(E.current=w),y&&w){if(L.current)return L.current(y,w,I);I()}},[y,w,I,L,S]);let T=X.useMemo(()=>({reference:O,floating:E,setReference:v,setFloating:h}),[v,h]),N=X.useMemo(()=>({reference:y,floating:w}),[y,w]),K=X.useMemo(()=>{let _={position:o,left:0,top:0};if(!N.floating)return _;let U=Ur(N.floating,m.x),B=Ur(N.floating,m.y);return a?C(A(C({},_),{transform:"translate("+U+"px, "+B+"px)"}),Gr(N.floating)>=1.5&&{willChange:"transform"}):{position:o,left:U,top:B}},[o,a,N.floating,m.x,m.y]);return X.useMemo(()=>A(C({},m),{update:I,refs:T,elements:N,floatingStyles:K}),[m,I,T,N,K])}var bs=e=>{function t(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){let{element:r,padding:n}=typeof e=="function"?e(o):e;return r&&t(r)?r.current!=null?co({element:r.current,padding:n}).fn(o):{}:r?co({element:r,padding:n}).fn(o):{}}}},Qr=(e,t)=>A(C({},Hr(e)),{options:[e,t]}),Zr=(e,t)=>A(C({},Br(e)),{options:[e,t]}),Jr=(e,t)=>A(C({},Kr(e)),{options:[e,t]}),en=(e,t)=>A(C({},Wr(e)),{options:[e,t]}),tn=(e,t)=>A(C({},jr(e)),{options:[e,t]});var on=(e,t)=>A(C({},zr(e)),{options:[e,t]});var rn=(e,t)=>A(C({},bs(e)),{options:[e,t]});var an=require("@radix-ui/react-context");var nn=require("react");function sn(e){let[t,o]=(0,nn.useState)(void 0);return me(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});let r=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let i=n[0],s,a;if("borderBoxSize"in i){let c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;s=l.inlineSize,a=l.blockSize}else s=e.offsetWidth,a=e.offsetHeight;o({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else o(void 0)},[e]),t}var cn="Popper",[ln,uo]=(0,an.createContextScope)(cn),[$s,fn]=ln(cn),xs=e=>{let{__scopePopper:t,children:o}=e,[r,n]=(0,J.useState)(null);return(0,J.createElement)($s,{scope:t,anchor:r,onAnchorChange:n},o)},ys="PopperAnchor",ws=(0,J.forwardRef)((e,t)=>{let c=e,{__scopePopper:o,virtualRef:r}=c,n=D(c,["__scopePopper","virtualRef"]),i=fn(ys,o),s=(0,J.useRef)(null),a=Q(t,s);return(0,J.useEffect)(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:(0,J.createElement)(Z.div,H({},n,{ref:a}))}),un="PopperContent",[Ss,kc]=ln(un),Cs=(0,J.forwardRef)((e,t)=>{var o,r,n,i,s,a,c,l;let fe=e,{__scopePopper:m,side:f="bottom",sideOffset:g=0,align:p="center",alignOffset:$=0,arrowPadding:u=0,collisionBoundary:d=[],collisionPadding:b=0,sticky:v="partial",hideWhenDetached:h=!1,avoidCollisions:y=!0,onPlaced:w}=fe,O=D(fe,["__scopePopper","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions","onPlaced"]),E=fn(un,m),[R,S]=(0,J.useState)(null),L=Q(t,ne=>S(ne)),[k,M]=(0,J.useState)(null),I=sn(k),G=(o=I==null?void 0:I.width)!==null&&o!==void 0?o:0,T=(r=I==null?void 0:I.height)!==null&&r!==void 0?r:0,N=f+(p!=="center"?"-"+p:""),K=typeof b=="number"?b:C({top:0,right:0,bottom:0,left:0},b),_=Array.isArray(d)?d:[d],U=_.length>0,B={padding:K,boundary:_.filter(Rs),altBoundary:U},{refs:ce,floatingStyles:Te,placement:it,isPositioned:Ie,middlewareData:le}=Xr({strategy:"fixed",placement:N,whileElementsMounted:ao,elements:{reference:E.anchor},middleware:[Qr({mainAxis:g+T,alignmentAxis:$}),y&&Zr(C({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?Jr():void 0},B)),y&&en(C({},B)),tn(A(C({},B),{apply:({elements:ne,rects:st,availableWidth:at,availableHeight:ct})=>{let{width:Ci,height:Ri}=st.reference,$t=ne.floating.style;$t.setProperty("--radix-popper-available-width",`${at}px`),$t.setProperty("--radix-popper-available-height",`${ct}px`),$t.setProperty("--radix-popper-anchor-width",`${Ci}px`),$t.setProperty("--radix-popper-anchor-height",`${Ri}px`)}})),k&&rn({element:k,padding:u}),Es({arrowWidth:G,arrowHeight:T}),h&&on({strategy:"referenceHidden"})]}),[Ye,Ne]=dn(it),P=se(w);me(()=>{Ie&&(P==null||P())},[Ie,P]);let W=(n=le.arrow)===null||n===void 0?void 0:n.x,re=(i=le.arrow)===null||i===void 0?void 0:i.y,j=((s=le.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[V,F]=(0,J.useState)();return me(()=>{R&&F(window.getComputedStyle(R).zIndex)},[R]),(0,J.createElement)("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:A(C({},Te),{transform:Ie?Te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[(a=le.transformOrigin)===null||a===void 0?void 0:a.x,(c=le.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")}),dir:e.dir},(0,J.createElement)(Ss,{scope:m,placedSide:Ye,onArrowChange:M,arrowX:W,arrowY:re,shouldHideArrow:j},(0,J.createElement)(Z.div,H({"data-side":Ye,"data-align":Ne},O,{ref:L,style:A(C({},O.style),{animation:Ie?void 0:"none",opacity:(l=le.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0})}))))});function Rs(e){return e!==null}var Es=e=>({name:"transformOrigin",options:e,fn(t){var o,r,n,i,s;let{placement:a,rects:c,middlewareData:l}=t,f=((o=l.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,g=f?0:e.arrowWidth,p=f?0:e.arrowHeight,[$,u]=dn(a),d={start:"0%",center:"50%",end:"100%"}[u],b=((r=(n=l.arrow)===null||n===void 0?void 0:n.x)!==null&&r!==void 0?r:0)+g/2,v=((i=(s=l.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+p/2,h="",y="";return $==="bottom"?(h=f?d:`${b}px`,y=`${-p}px`):$==="top"?(h=f?d:`${b}px`,y=`${c.floating.height+p}px`):$==="right"?(h=`${-p}px`,y=f?d:`${v}px`):$==="left"&&(h=`${c.floating.width+p}px`,y=f?d:`${v}px`),{data:{x:h,y}}}});function dn(e){let[t,o="center"]=e.split("-");return[t,o]}var pn=xs,mn=ws,hn=Cs;var Nt=require("react"),vn=ie(require("react-dom"),1);var gn=(0,Nt.forwardRef)((e,t)=>{var o;let i=e,{container:r=globalThis==null||(o=globalThis.document)===null||o===void 0?void 0:o.body}=i,n=D(i,["container"]);return r?vn.default.createPortal((0,Nt.createElement)(Z.div,H({},n,{ref:t})),r):null});var zn=require("@radix-ui/react-slot");var Le=require("react");function po({prop:e,defaultProp:t,onChange:o=()=>{}}){let[r,n]=Ps({defaultProp:t,onChange:o}),i=e!==void 0,s=i?e:r,a=se(o),c=(0,Le.useCallback)(l=>{if(i){let f=typeof l=="function"?l(e):l;f!==e&&a(f)}else n(l)},[i,e,n,a]);return[s,c]}function Ps({defaultProp:e,onChange:t}){let o=(0,Le.useState)(e),[r]=o,n=(0,Le.useRef)(r),i=se(t);return(0,Le.useEffect)(()=>{n.current!==r&&(i(r),n.current=r)},[r,n,i]),o}var Dt=require("react");function bn(e){let t=(0,Dt.useRef)({value:e,previous:e});return(0,Dt.useMemo)(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Lt=require("react");var $n=(0,Lt.forwardRef)((e,t)=>(0,Lt.createElement)(Z.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 Os=function(e){if(typeof document=="undefined")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Je=new WeakMap,kt=new WeakMap,Mt={},mo=0,xn=function(e){return e&&(e.host||xn(e.parentNode))},Ts=function(e,t){return t.map(function(o){if(e.contains(o))return o;var r=xn(o);return r&&e.contains(r)?r:(console.error("aria-hidden",o,"in not contained inside",e,". Doing nothing"),null)}).filter(function(o){return!!o})},_s=function(e,t,o,r){var n=Ts(t,Array.isArray(e)?e:[e]);Mt[o]||(Mt[o]=new WeakMap);var i=Mt[o],s=[],a=new Set,c=new Set(n),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};n.forEach(l);var m=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))m(g);else try{var p=g.getAttribute(r),$=p!==null&&p!=="false",u=(Je.get(g)||0)+1,d=(i.get(g)||0)+1;Je.set(g,u),i.set(g,d),s.push(g),u===1&&$&&kt.set(g,!0),d===1&&g.setAttribute(o,"true"),$||g.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",g,b)}})};return m(t),a.clear(),mo++,function(){s.forEach(function(f){var g=Je.get(f)-1,p=i.get(f)-1;Je.set(f,g),i.set(f,p),g||(kt.has(f)||f.removeAttribute(r),kt.delete(f)),p||f.removeAttribute(o)}),mo--,mo||(Je=new WeakMap,Je=new WeakMap,kt=new WeakMap,Mt={})}},yn=function(e,t,o){o===void 0&&(o="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),n=t||Os(e);return n?(r.push.apply(r,Array.from(n.querySelectorAll("[aria-live], script"))),_s(r,n,o,"aria-hidden")):function(){return null}};var pe=function(){return pe=Object.assign||function(t){for(var o,r=1,n=arguments.length;r<n;r++){o=arguments[r];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i])}return t},pe.apply(this,arguments)};function Vt(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]]);return o}function wn(e,t,o){if(o||arguments.length===2)for(var r=0,n=t.length,i;r<n;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var jt=ie(require("react"));var te=ie(require("react"));var We="right-scroll-bar-position",je="width-before-scroll-bar",ho="with-scroll-bars-hidden",vo="--removed-body-scroll-bar-size";function Ft(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}var Sn=require("react");function Cn(e,t){var o=(0,Sn.useState)(function(){return{value:e,callback:t,facade:{get current(){return o.value},set current(r){var n=o.value;n!==r&&(o.value=r,o.callback(r,n))}}}})[0];return o.callback=t,o.facade}var Ht=ie(require("react"));var As=typeof window!="undefined"?Ht.useLayoutEffect:Ht.useEffect,Rn=new WeakMap;function go(e,t){var o=Cn(t||null,function(r){return e.forEach(function(n){return Ft(n,r)})});return As(function(){var r=Rn.get(o);if(r){var n=new Set(r),i=new Set(e),s=o.current;n.forEach(function(a){i.has(a)||Ft(a,null)}),i.forEach(function(a){n.has(a)||Ft(a,s)})}Rn.set(o,e)},[e]),o}function Is(e){return e}function Ns(e,t){t===void 0&&(t=Is);var o=[],r=!1,n={read:function(){if(r)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 s=t(i,r);return o.push(s),function(){o=o.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;o.length;){var s=o;o=[],s.forEach(i)}o={push:function(a){return i(a)},filter:function(){return o}}},assignMedium:function(i){r=!0;var s=[];if(o.length){var a=o;o=[],a.forEach(i),s=o}var c=function(){var m=s;s=[],m.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),o={push:function(m){s.push(m),l()},filter:function(m){return s=s.filter(m),o}}}};return n}function bo(e){e===void 0&&(e={});var t=Ns(null);return t.options=pe({async:!0,ssr:!1},e),t}var En=ie(require("react")),Pn=function(e){var t=e.sideCar,o=Vt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return En.createElement(r,pe({},o))};Pn.isSideCarExport=!0;function $o(e,t){return e.useMedium(t),Pn}var Bt=bo();var xo=function(){},vt=te.forwardRef(function(e,t){var o=te.useRef(null),r=te.useState({onScrollCapture:xo,onWheelCapture:xo,onTouchMoveCapture:xo}),n=r[0],i=r[1],s=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,m=e.enabled,f=e.shards,g=e.sideCar,p=e.noIsolation,$=e.inert,u=e.allowPinchZoom,d=e.as,b=d===void 0?"div":d,v=Vt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),h=g,y=go([o,t]),w=pe(pe({},v),n);return te.createElement(te.Fragment,null,m&&te.createElement(h,{sideCar:Bt,removeScrollBar:l,shards:f,noIsolation:p,inert:$,setCallbacks:i,allowPinchZoom:!!u,lockRef:o}),s?te.cloneElement(te.Children.only(a),pe(pe({},w),{ref:y})):te.createElement(b,pe({},w,{className:c,ref:y}),a))});vt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vt.classNames={fullWidth:je,zeroRight:We};var z=ie(require("react"));var tt=ie(require("react"));var _n=ie(require("react"));var On;var Tn=function(){if(On)return On;if(typeof __webpack_nonce__!="undefined")return __webpack_nonce__};function Ds(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Tn();return t&&e.setAttribute("nonce",t),e}function Ls(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ks(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yo=function(){var e=0,t=null;return{add:function(o){e==0&&(t=Ds())&&(Ls(t,o),ks(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}};var wo=function(){var e=yo();return function(t,o){_n.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&o])}};var gt=function(){var e=wo(),t=function(o){var r=o.styles,n=o.dynamic;return e(r,n),null};return t};var Ms={left:0,top:0,right:0,gap:0},So=function(e){return parseInt(e||"",10)||0},Vs=function(e){var t=window.getComputedStyle(document.body),o=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],n=t[e==="padding"?"paddingRight":"marginRight"];return[So(o),So(r),So(n)]},Co=function(e){if(e===void 0&&(e="margin"),typeof window=="undefined")return Ms;var t=Vs(e),o=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-o+t[2]-t[0])}};var Fs=gt(),et="data-scroll-locked",Hs=function(e,t,o,r){var n=e.left,i=e.top,s=e.right,a=e.gap;return o===void 0&&(o="margin"),`
.`.concat(ho,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(a,"px ").concat(r,`;
}
body[`).concat(et,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),o==="margin"&&`
padding-left: `.concat(n,`px;
padding-top: `).concat(i,`px;
padding-right: `).concat(s,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(a,"px ").concat(r,`;
`),o==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(We,` {
right: `).concat(a,"px ").concat(r,`;
}
.`).concat(je,` {
margin-right: `).concat(a,"px ").concat(r,`;
}
.`).concat(We," .").concat(We,` {
right: 0 `).concat(r,`;
}
.`).concat(je," .").concat(je,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(et,`] {
`).concat(vo,": ").concat(a,`px;
}
`)},An=function(){var e=parseInt(document.body.getAttribute(et)||"0",10);return isFinite(e)?e:0},Bs=function(){tt.useEffect(function(){return document.body.setAttribute(et,(An()+1).toString()),function(){var e=An()-1;e<=0?document.body.removeAttribute(et):document.body.setAttribute(et,e.toString())}},[])},Ro=function(e){var t=e.noRelative,o=e.noImportant,r=e.gapMode,n=r===void 0?"margin":r;Bs();var i=tt.useMemo(function(){return Co(n)},[n]);return tt.createElement(Fs,{styles:Hs(i,!t,n,o?"":"!important")})};var Eo=!1;if(typeof window!="undefined")try{bt=Object.defineProperty({},"passive",{get:function(){return Eo=!0,!0}}),window.addEventListener("test",bt,bt),window.removeEventListener("test",bt,bt)}catch(e){Eo=!1}var bt,ze=Eo?{passive:!1}:!1;var Ws=function(e){return e.tagName==="TEXTAREA"},In=function(e,t){var o=window.getComputedStyle(e);return o[t]!=="hidden"&&!(o.overflowY===o.overflowX&&!Ws(e)&&o[t]==="visible")},js=function(e){return In(e,"overflowY")},zs=function(e){return In(e,"overflowX")},Po=function(e,t){var o=t;do{typeof ShadowRoot!="undefined"&&o instanceof ShadowRoot&&(o=o.host);var r=Nn(e,o);if(r){var n=Dn(e,o),i=n[1],s=n[2];if(i>s)return!0}o=o.parentNode}while(o&&o!==document.body);return!1},Ks=function(e){var t=e.scrollTop,o=e.scrollHeight,r=e.clientHeight;return[t,o,r]},Us=function(e){var t=e.scrollLeft,o=e.scrollWidth,r=e.clientWidth;return[t,o,r]},Nn=function(e,t){return e==="v"?js(t):zs(t)},Dn=function(e,t){return e==="v"?Ks(t):Us(t)},Ys=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ln=function(e,t,o,r,n){var i=Ys(e,window.getComputedStyle(t).direction),s=i*r,a=o.target,c=t.contains(a),l=!1,m=s>0,f=0,g=0;do{var p=Dn(e,a),$=p[0],u=p[1],d=p[2],b=u-d-i*$;($||b)&&Nn(e,a)&&(f+=b,g+=$),a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(m&&(n&&f===0||!n&&s>f)||!m&&(n&&g===0||!n&&-s>g))&&(l=!0),l};var Wt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kn=function(e){return[e.deltaX,e.deltaY]},Mn=function(e){return e&&"current"in e?e.current:e},qs=fun