mirotone-react
Version:
Mirotone React is a component library for the Mirotone Design System, offering a range of components and utilities to speed up development for Miro. It draws inspiration from Mirotone CSS and Miro UI Components.
1 lines • 110 kB
JavaScript
"use strict";var e=require("react/jsx-runtime"),n=require("react"),t=require("react-dom");function r(e){var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}var o=r(n),a=r(t);function i(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}function s(e,n,{checkForDefaultPrevented:t=!0}={}){return function(r){if(e?.(r),!1===t||!r.defaultPrevented)return n?.(r)}}function c(e,n){if("function"==typeof e)return e(n);null!=e&&(e.current=n)}function l(...e){return n=>{let t=!1;const r=e.map((e=>{const r=c(e,n);return t||"function"!=typeof r||(t=!0),r}));if(t)return()=>{for(let n=0;n<r.length;n++){const t=r[n];"function"==typeof t?t():c(e[n],null)}}}}function u(...e){return o.useCallback(l(...e),e)}function d(n,t=[]){let r=[];const a=()=>{const e=r.map((e=>o.createContext(e)));return function(t){const r=t?.[n]||e;return o.useMemo((()=>({[`__scope${n}`]:{...t,[n]:r}})),[t,r])}};return a.scopeName=n,[function(t,a){const i=o.createContext(a),s=r.length;r=[...r,a];const c=t=>{const{scope:r,children:a,...c}=t,l=r?.[n]?.[s]||i,u=o.useMemo((()=>c),Object.values(c));return e.jsx(l.Provider,{value:u,children:a})};return c.displayName=t+"Provider",[c,function(e,r){const c=r?.[n]?.[s]||i,l=o.useContext(c);if(l)return l;if(void 0!==a)return a;throw new Error(`\`${e}\` must be used within \`${t}\``)}]},f(a,...t)]}function f(...e){const n=e[0];if(1===e.length)return n;const t=()=>{const t=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=t.reduce(((n,{useScope:t,scopeName:r})=>({...n,...t(e)[`__scope${r}`]})),{});return o.useMemo((()=>({[`__scope${n.scopeName}`]:r})),[r])}};return t.scopeName=n.scopeName,t}function p(e){const n=o.useRef(e);return o.useEffect((()=>{n.current=e})),o.useMemo((()=>(...e)=>n.current?.(...e)),[])}function m({prop:e,defaultProp:n,onChange:t=()=>{}}){const[r,a]=function({defaultProp:e,onChange:n}){const t=o.useState(e),[r]=t,a=o.useRef(r),i=p(n);return o.useEffect((()=>{a.current!==r&&(i(r),a.current=r)}),[r,a,i]),t}({defaultProp:n,onChange:t}),i=void 0!==e,s=i?e:r,c=p(t);return[s,o.useCallback((n=>{if(i){const t="function"==typeof n?n(e):n;t!==e&&c(t)}else a(n)}),[i,e,a,c])]}i("@import url('https://unpkg.com/mirotone@5.3.0/dist/styles.css');\n");var h=o.forwardRef(((n,t)=>{const{children:r,...a}=n,i=o.Children.toArray(r),s=i.find(y);if(s){const n=s.props.children,r=i.map((e=>e===s?o.Children.count(n)>1?o.Children.only(null):o.isValidElement(n)?n.props.children:null:e));return e.jsx(g,{...a,ref:t,children:o.isValidElement(n)?o.cloneElement(n,void 0,r):null})}return e.jsx(g,{...a,ref:t,children:r})}));h.displayName="Slot";var g=o.forwardRef(((e,n)=>{const{children:t,...r}=e;if(o.isValidElement(t)){const e=function(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;if(t)return e.ref;if(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t)return e.props.ref;return e.props.ref||e.ref}(t),a=function(e,n){const t={...n};for(const r in n){const o=e[r],a=n[r];/^on[A-Z]/.test(r)?o&&a?t[r]=(...e)=>{a(...e),o(...e)}:o&&(t[r]=o):"style"===r?t[r]={...o,...a}:"className"===r&&(t[r]=[o,a].filter(Boolean).join(" "))}return{...e,...t}}(r,t.props);return t.type!==o.Fragment&&(a.ref=n?l(n,e):e),o.cloneElement(t,a)}return o.Children.count(t)>1?o.Children.only(null):null}));g.displayName="SlotClone";var v=({children:n})=>e.jsx(e.Fragment,{children:n});function y(e){return o.isValidElement(e)&&e.type===v}var x=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((n,t)=>{const r=o.forwardRef(((n,r)=>{const{asChild:o,...a}=n,i=o?h:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(i,{...a,ref:r})}));return r.displayName=`Primitive.${t}`,{...n,[t]:r}}),{});function w(e,n){e&&a.flushSync((()=>e.dispatchEvent(n)))}function b(t){const r=t+"CollectionProvider",[o,a]=d(r),[i,s]=o(r,{collectionRef:{current:null},itemMap:new Map}),c=t=>{const{scope:r,children:o}=t,a=n.useRef(null),s=n.useRef(new Map).current;return e.jsx(i,{scope:r,itemMap:s,collectionRef:a,children:o})};c.displayName=r;const l=t+"CollectionSlot",f=n.forwardRef(((n,t)=>{const{scope:r,children:o}=n,a=u(t,s(l,r).collectionRef);return e.jsx(h,{ref:a,children:o})}));f.displayName=l;const p=t+"CollectionItemSlot",m="data-radix-collection-item",g=n.forwardRef(((t,r)=>{const{scope:o,children:a,...i}=t,c=n.useRef(null),l=u(r,c),d=s(p,o);return n.useEffect((()=>(d.itemMap.set(c,{ref:c,...i}),()=>{d.itemMap.delete(c)}))),e.jsx(h,{[m]:"",ref:l,children:a})}));return g.displayName=p,[{Provider:c,Slot:f,ItemSlot:g},function(e){const r=s(t+"CollectionConsumer",e);return n.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const n=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(r.itemMap.values()).sort(((e,t)=>n.indexOf(e.ref.current)-n.indexOf(t.ref.current)))}),[r.collectionRef,r.itemMap])},a]}var _=o.createContext(void 0);function C(e){const n=o.useContext(_);return e||n||"ltr"}var N,R="dismissableLayer.update",E="dismissableLayer.pointerDownOutside",j="dismissableLayer.focusOutside",k=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),T=o.forwardRef(((n,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:l,onDismiss:d,...f}=n,m=o.useContext(k),[h,g]=o.useState(null),v=h?.ownerDocument??globalThis?.document,[,y]=o.useState({}),w=u(t,(e=>g(e))),b=Array.from(m.layers),[_]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),C=b.indexOf(_),T=h?b.indexOf(h):-1,M=m.layersWithOutsidePointerEventsDisabled.size>0,A=T>=C,O=function(e,n=globalThis?.document){const t=p(e),r=o.useRef(!1),a=o.useRef((()=>{}));return o.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){S(E,t,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=r,n.addEventListener("click",a.current,{once:!0})):r()}else n.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,t]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const n=e.target,t=[...m.branches].some((e=>e.contains(n)));A&&!t&&(i?.(e),l?.(e),e.defaultPrevented||d?.())}),v),P=function(e,n=globalThis?.document){const t=p(e),r=o.useRef(!1);return o.useEffect((()=>{const e=e=>{if(e.target&&!r.current){S(j,t,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,t]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const n=e.target;[...m.branches].some((e=>e.contains(n)))||(c?.(e),l?.(e),e.defaultPrevented||d?.())}),v);return function(e,n=globalThis?.document){const t=p(e);o.useEffect((()=>{const e=e=>{"Escape"===e.key&&t(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})}),[t,n])}((e=>{T===m.layers.size-1&&(a?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))}),v),o.useEffect((()=>{if(h)return r&&(0===m.layersWithOutsidePointerEventsDisabled.size&&(N=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),D(),()=>{r&&1===m.layersWithOutsidePointerEventsDisabled.size&&(v.body.style.pointerEvents=N)}}),[h,v,r,m]),o.useEffect((()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),D())}),[h,m]),o.useEffect((()=>{const e=()=>y({});return document.addEventListener(R,e),()=>document.removeEventListener(R,e)}),[]),e.jsx(x.div,{...f,ref:w,style:{pointerEvents:M?A?"auto":"none":void 0,...n.style},onFocusCapture:s(n.onFocusCapture,P.onFocusCapture),onBlurCapture:s(n.onBlurCapture,P.onBlurCapture),onPointerDownCapture:s(n.onPointerDownCapture,O.onPointerDownCapture)})}));T.displayName="DismissableLayer";function D(){const e=new CustomEvent(R);document.dispatchEvent(e)}function S(e,n,t,{discrete:r}){const o=t.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&o.addEventListener(e,n,{once:!0}),r?w(o,a):o.dispatchEvent(a)}o.forwardRef(((n,t)=>{const r=o.useContext(k),a=o.useRef(null),i=u(t,a);return o.useEffect((()=>{const e=a.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),e.jsx(x.div,{...n,ref:i})})).displayName="DismissableLayerBranch";var M=0;function A(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var O="focusScope.autoFocusOnMount",P="focusScope.autoFocusOnUnmount",I={bubbles:!1,cancelable:!0},L=o.forwardRef(((n,t)=>{const{loop:r=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...c}=n,[l,d]=o.useState(null),f=p(i),m=p(s),h=o.useRef(null),g=u(t,(e=>d(e))),v=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect((()=>{if(a){let e=function(e){if(v.paused||!l)return;const n=e.target;l.contains(n)?h.current=n:W(h.current,{select:!0})},n=function(e){if(v.paused||!l)return;const n=e.relatedTarget;null!==n&&(l.contains(n)||W(h.current,{select:!0}))},t=function(e){if(document.activeElement===document.body)for(const n of e)n.removedNodes.length>0&&W(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",n);const r=new MutationObserver(t);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",n),r.disconnect()}}}),[a,l,v.paused]),o.useEffect((()=>{if(l){H.add(v);const n=document.activeElement;if(!l.contains(n)){const t=new CustomEvent(O,I);l.addEventListener(O,f),l.dispatchEvent(t),t.defaultPrevented||(!function(e,{select:n=!1}={}){const t=document.activeElement;for(const r of e)if(W(r,{select:n}),document.activeElement!==t)return}((e=F(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===n&&W(l))}return()=>{l.removeEventListener(O,f),setTimeout((()=>{const e=new CustomEvent(P,I);l.addEventListener(P,m),l.dispatchEvent(e),e.defaultPrevented||W(n??document.body,{select:!0}),l.removeEventListener(P,m),H.remove(v)}),0)}}var e}),[l,f,m,v]);const y=o.useCallback((e=>{if(!r&&!a)return;if(v.paused)return;const n="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,t=document.activeElement;if(n&&t){const n=e.currentTarget,[o,a]=function(e){const n=F(e),t=z(n,e),r=z(n.reverse(),e);return[t,r]}(n);o&&a?e.shiftKey||t!==a?e.shiftKey&&t===o&&(e.preventDefault(),r&&W(a,{select:!0})):(e.preventDefault(),r&&W(o,{select:!0})):t===n&&e.preventDefault()}}),[r,a,v.paused]);return e.jsx(x.div,{tabIndex:-1,...c,ref:g,onKeyDown:y})}));function F(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const n="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||n?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function z(e,n){for(const t of e)if(!B(t,{upTo:n}))return t}function B(e,{upTo:n}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==n&&e===n)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function W(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&n&&e.select()}}L.displayName="FocusScope";var H=function(){let e=[];return{add(n){const t=e[0];n!==t&&t?.pause(),e=K(e,n),e.unshift(n)},remove(n){e=K(e,n),e[0]?.resume()}}}();function K(e,n){const t=[...e],r=t.indexOf(n);return-1!==r&&t.splice(r,1),t}var G=Boolean(globalThis?.document)?o.useLayoutEffect:()=>{},$=o["useId".toString()]||(()=>{}),U=0;function V(e){const[n,t]=o.useState($());return G((()=>{t((e=>e??String(U++)))}),[e]),e||(n?`radix-${n}`:"")}const X=["top","right","bottom","left"],Y=Math.min,Z=Math.max,q=Math.round,Q=Math.floor,J=e=>({x:e,y:e}),ee={left:"right",right:"left",bottom:"top",top:"bottom"},ne={start:"end",end:"start"};function te(e,n,t){return Z(e,Y(n,t))}function re(e,n){return"function"==typeof e?e(n):e}function oe(e){return e.split("-")[0]}function ae(e){return e.split("-")[1]}function ie(e){return"x"===e?"y":"x"}function se(e){return"y"===e?"height":"width"}function ce(e){return["top","bottom"].includes(oe(e))?"y":"x"}function le(e){return ie(ce(e))}function ue(e){return e.replace(/start|end/g,(e=>ne[e]))}function de(e){return e.replace(/left|right|bottom|top/g,(e=>ee[e]))}function fe(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function pe(e){const{x:n,y:t,width:r,height:o}=e;return{width:r,height:o,top:t,left:n,right:n+r,bottom:t+o,x:n,y:t}}function me(e,n,t){let{reference:r,floating:o}=e;const a=ce(n),i=le(n),s=se(i),c=oe(n),l="y"===a,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(c){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ae(n)){case"start":p[i]-=f*(t&&l?-1:1);break;case"end":p[i]+=f*(t&&l?-1:1)}return p}async function he(e,n){var t;void 0===n&&(n={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=re(n,e),m=fe(p),h=s[f?"floating"===d?"reference":"floating":d],g=pe(await a.getClippingRect({element:null==(t=await(null==a.isElement?void 0:a.isElement(h)))||t?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),v="floating"===d?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),x=await(null==a.isElement?void 0:a.isElement(y))&&await(null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},w=pe(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:c}):v);return{top:(g.top-w.top+m.top)/x.y,bottom:(w.bottom-g.bottom+m.bottom)/x.y,left:(g.left-w.left+m.left)/x.x,right:(w.right-g.right+m.right)/x.x}}function ge(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function ve(e){return X.some((n=>e[n]>=0))}function ye(){return"undefined"!=typeof window}function xe(e){return _e(e)?(e.nodeName||"").toLowerCase():"#document"}function we(e){var n;return(null==e||null==(n=e.ownerDocument)?void 0:n.defaultView)||window}function be(e){var n;return null==(n=(_e(e)?e.ownerDocument:e.document)||window.document)?void 0:n.documentElement}function _e(e){return!!ye()&&(e instanceof Node||e instanceof we(e).Node)}function Ce(e){return!!ye()&&(e instanceof Element||e instanceof we(e).Element)}function Ne(e){return!!ye()&&(e instanceof HTMLElement||e instanceof we(e).HTMLElement)}function Re(e){return!(!ye()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof we(e).ShadowRoot)}function Ee(e){const{overflow:n,overflowX:t,overflowY:r,display:o}=Me(e);return/auto|scroll|overlay|hidden|clip/.test(n+r+t)&&!["inline","contents"].includes(o)}function je(e){return["table","td","th"].includes(xe(e))}function ke(e){return[":popover-open",":modal"].some((n=>{try{return e.matches(n)}catch(e){return!1}}))}function Te(e){const n=De(),t=Ce(e)?Me(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!t[e]&&"none"!==t[e]))||!!t.containerType&&"normal"!==t.containerType||!n&&!!t.backdropFilter&&"none"!==t.backdropFilter||!n&&!!t.filter&&"none"!==t.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(t.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(t.contain||"").includes(e)))}function De(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Se(e){return["html","body","#document"].includes(xe(e))}function Me(e){return we(e).getComputedStyle(e)}function Ae(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Oe(e){if("html"===xe(e))return e;const n=e.assignedSlot||e.parentNode||Re(e)&&e.host||be(e);return Re(n)?n.host:n}function Pe(e){const n=Oe(e);return Se(n)?e.ownerDocument?e.ownerDocument.body:e.body:Ne(n)&&Ee(n)?n:Pe(n)}function Ie(e,n,t){var r;void 0===n&&(n=[]),void 0===t&&(t=!0);const o=Pe(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=we(o);if(a){const e=Le(i);return n.concat(i,i.visualViewport||[],Ee(o)?o:[],e&&t?Ie(e):[])}return n.concat(o,Ie(o,[],t))}function Le(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fe(e){const n=Me(e);let t=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const o=Ne(e),a=o?e.offsetWidth:t,i=o?e.offsetHeight:r,s=q(t)!==a||q(r)!==i;return s&&(t=a,r=i),{width:t,height:r,$:s}}function ze(e){return Ce(e)?e:e.contextElement}function Be(e){const n=ze(e);if(!Ne(n))return J(1);const t=n.getBoundingClientRect(),{width:r,height:o,$:a}=Fe(n);let i=(a?q(t.width):t.width)/r,s=(a?q(t.height):t.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const We=J(0);function He(e){const n=we(e);return De()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:We}function Ke(e,n,t,r){void 0===n&&(n=!1),void 0===t&&(t=!1);const o=e.getBoundingClientRect(),a=ze(e);let i=J(1);n&&(r?Ce(r)&&(i=Be(r)):i=Be(e));const s=function(e,n,t){return void 0===n&&(n=!1),!(!t||n&&t!==we(e))&&n}(a,t,r)?He(a):J(0);let c=(o.left+s.x)/i.x,l=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=we(a),n=r&&Ce(r)?we(r):r;let t=e,o=Le(t);for(;o&&r&&n!==t;){const e=Be(o),n=o.getBoundingClientRect(),r=Me(o),a=n.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=n.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=i,t=we(o),o=Le(t)}}return pe({width:u,height:d,x:c,y:l})}function Ge(e,n){const t=Ae(e).scrollLeft;return n?n.left+t:Ke(be(e)).left+t}function $e(e,n,t){void 0===t&&(t=!1);const r=e.getBoundingClientRect();return{x:r.left+n.scrollLeft-(t?0:Ge(e,r)),y:r.top+n.scrollTop}}function Ue(e,n,t){let r;if("viewport"===n)r=function(e,n){const t=we(e),r=be(e),o=t.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,c=0;if(o){a=o.width,i=o.height;const e=De();(!e||e&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:i,x:s,y:c}}(e,t);else if("document"===n)r=function(e){const n=be(e),t=Ae(e),r=e.ownerDocument.body,o=Z(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),a=Z(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-t.scrollLeft+Ge(e);const s=-t.scrollTop;return"rtl"===Me(r).direction&&(i+=Z(n.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(be(e));else if(Ce(n))r=function(e,n){const t=Ke(e,!0,"fixed"===n),r=t.top+e.clientTop,o=t.left+e.clientLeft,a=Ne(e)?Be(e):J(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(n,t);else{const t=He(e);r={x:n.x-t.x,y:n.y-t.y,width:n.width,height:n.height}}return pe(r)}function Ve(e,n){const t=Oe(e);return!(t===n||!Ce(t)||Se(t))&&("fixed"===Me(t).position||Ve(t,n))}function Xe(e,n,t){const r=Ne(n),o=be(n),a="fixed"===t,i=Ke(e,!0,a,n);let s={scrollLeft:0,scrollTop:0};const c=J(0);if(r||!r&&!a)if(("body"!==xe(n)||Ee(o))&&(s=Ae(n)),r){const e=Ke(n,!0,a,n);c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}else o&&(c.x=Ge(o));const l=!o||r||a?J(0):$e(o,s);return{x:i.left+s.scrollLeft-c.x-l.x,y:i.top+s.scrollTop-c.y-l.y,width:i.width,height:i.height}}function Ye(e){return"static"===Me(e).position}function Ze(e,n){if(!Ne(e)||"fixed"===Me(e).position)return null;if(n)return n(e);let t=e.offsetParent;return be(e)===t&&(t=t.ownerDocument.body),t}function qe(e,n){const t=we(e);if(ke(e))return t;if(!Ne(e)){let n=Oe(e);for(;n&&!Se(n);){if(Ce(n)&&!Ye(n))return n;n=Oe(n)}return t}let r=Ze(e,n);for(;r&&je(r)&&Ye(r);)r=Ze(r,n);return r&&Se(r)&&Ye(r)&&!Te(r)?t:r||function(e){let n=Oe(e);for(;Ne(n)&&!Se(n);){if(Te(n))return n;if(ke(n))return null;n=Oe(n)}return null}(e)||t}const Qe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:n,rect:t,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=be(r),s=!!n&&ke(n.floating);if(r===i||s&&a)return t;let c={scrollLeft:0,scrollTop:0},l=J(1);const u=J(0),d=Ne(r);if((d||!d&&!a)&&(("body"!==xe(r)||Ee(i))&&(c=Ae(r)),Ne(r))){const e=Ke(r);l=Be(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||a?J(0):$e(i,c,!0);return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:t.y*l.y-c.scrollTop*l.y+u.y+f.y}},getDocumentElement:be,getClippingRect:function(e){let{element:n,boundary:t,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===t?ke(n)?[]:function(e,n){const t=n.get(e);if(t)return t;let r=Ie(e,[],!1).filter((e=>Ce(e)&&"body"!==xe(e))),o=null;const a="fixed"===Me(e).position;let i=a?Oe(e):e;for(;Ce(i)&&!Se(i);){const n=Me(i),t=Te(i);t||"fixed"!==n.position||(o=null),(a?!t&&!o:!t&&"static"===n.position&&o&&["absolute","fixed"].includes(o.position)||Ee(i)&&!t&&Ve(e,i))?r=r.filter((e=>e!==i)):o=n,i=Oe(i)}return n.set(e,r),r}(n,this._c):[].concat(t),r],i=a[0],s=a.reduce(((e,t)=>{const r=Ue(n,t,o);return e.top=Z(r.top,e.top),e.right=Y(r.right,e.right),e.bottom=Y(r.bottom,e.bottom),e.left=Z(r.left,e.left),e}),Ue(n,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:qe,getElementRects:async function(e){const n=this.getOffsetParent||qe,t=this.getDimensions,r=await t(e.floating);return{reference:Xe(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:n,height:t}=Fe(e);return{width:n,height:t}},getScale:Be,isElement:Ce,isRTL:function(e){return"rtl"===Me(e).direction}};function Je(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function en(e,n,t,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,l=ze(e),u=o||a?[...l?Ie(l):[],...Ie(n)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",t,{passive:!0}),a&&e.addEventListener("resize",t)}));const d=l&&s?function(e,n){let t,r=null;const o=be(e);function a(){var e;clearTimeout(t),null==(e=r)||e.disconnect(),r=null}return function i(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),a();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||n(),!f||!p)return;const m={rootMargin:-Q(d)+"px "+-Q(o.clientWidth-(u+f))+"px "+-Q(o.clientHeight-(d+p))+"px "+-Q(u)+"px",threshold:Z(0,Y(1,c))||1};let h=!0;function g(n){const r=n[0].intersectionRatio;if(r!==c){if(!h)return i();r?i(!1,r):t=setTimeout((()=>{i(!1,1e-7)}),1e3)}1!==r||Je(l,e.getBoundingClientRect())||i(),h=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),a}(l,t):null;let f,p=-1,m=null;i&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&m&&(m.unobserve(n),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(n)}))),t()})),l&&!c&&m.observe(l),m.observe(n));let h=c?Ke(e):null;return c&&function n(){const r=Ke(e);h&&!Je(h,r)&&t();h=r,f=requestAnimationFrame(n)}(),t(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",t),a&&e.removeEventListener("resize",t)})),null==d||d(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(f)}}const nn=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(n){var t,r;const{x:o,y:a,placement:i,middlewareData:s}=n,c=await async function(e,n){const{placement:t,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=oe(t),s=ae(t),c="y"===ce(t),l=["left","top"].includes(i)?-1:1,u=a&&c?-1:1,d=re(n,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}(n,e);return i===(null==(t=s.offset)?void 0:t.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:i}}}}},tn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:r,placement:o}=n,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:n,y:t}=e;return{x:n,y:t}}},...c}=re(e,n),l={x:t,y:r},u=await he(n,c),d=ce(oe(o)),f=ie(d);let p=l[f],m=l[d];if(a){const e="y"===f?"bottom":"right";p=te(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";m=te(m+u["y"===d?"top":"left"],m,m-u[e])}const h=s.fn({...n,[f]:p,[d]:m});return{...h,data:{x:h.x-t,y:h.y-r,enabled:{[f]:a,[d]:i}}}}}},rn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(n){var t,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:c,elements:l}=n,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=re(e,n);if(null!=(t=a.arrow)&&t.alignmentOffset)return{};const v=oe(o),y=ce(s),x=oe(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),b=f||(x||!h?[de(s)]:function(e){const n=de(e);return[ue(e),n,ue(n)]}(s)),_="none"!==m;!f&&_&&b.push(...function(e,n,t,r){const o=ae(e);let a=function(e,n,t){const r=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return t?n?o:r:n?r:o;case"left":case"right":return n?a:i;default:return[]}}(oe(e),"start"===t,r);return o&&(a=a.map((e=>e+"-"+o)),n&&(a=a.concat(a.map(ue)))),a}(s,h,m,w));const C=[s,...b],N=await he(n,g),R=[];let E=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&R.push(N[v]),d){const e=function(e,n,t){void 0===t&&(t=!1);const r=ae(e),o=le(e),a=se(o);let i="x"===o?r===(t?"end":"start")?"right":"left":"start"===r?"bottom":"top";return n.reference[a]>n.floating[a]&&(i=de(i)),[i,de(i)]}(o,i,w);R.push(N[e[0]],N[e[1]])}if(E=[...E,{placement:o,overflows:R}],!R.every((e=>e<=0))){var j,k;const e=((null==(j=a.flip)?void 0:j.index)||0)+1,n=C[e];if(n)return{data:{index:e,overflows:E},reset:{placement:n}};let t=null==(k=E.filter((e=>e.overflows[0]<=0)).sort(((e,n)=>e.overflows[1]-n.overflows[1]))[0])?void 0:k.placement;if(!t)switch(p){case"bestFit":{var T;const e=null==(T=E.filter((e=>{if(_){const n=ce(e.placement);return n===y||"y"===n}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,n)=>e+n),0)])).sort(((e,n)=>e[1]-n[1]))[0])?void 0:T[0];e&&(t=e);break}case"initialPlacement":t=s}if(o!==t)return{reset:{placement:t}}}return{}}}},on=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(n){var t,r;const{placement:o,rects:a,platform:i,elements:s}=n,{apply:c=()=>{},...l}=re(e,n),u=await he(n,l),d=oe(o),f=ae(o),p="y"===ce(o),{width:m,height:h}=a.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g="end"===f?"top":"bottom");const y=h-u.top-u.bottom,x=m-u.left-u.right,w=Y(h-u[g],y),b=Y(m-u[v],x),_=!n.middlewareData.shift;let C=w,N=b;if(null!=(t=n.middlewareData.shift)&&t.enabled.x&&(N=x),null!=(r=n.middlewareData.shift)&&r.enabled.y&&(C=y),_&&!f){const e=Z(u.left,0),n=Z(u.right,0),t=Z(u.top,0),r=Z(u.bottom,0);p?N=m-2*(0!==e||0!==n?e+n:Z(u.left,u.right)):C=h-2*(0!==t||0!==r?t+r:Z(u.top,u.bottom))}await c({...n,availableWidth:N,availableHeight:C});const R=await i.getDimensions(s.floating);return m!==R.width||h!==R.height?{reset:{rects:!0}}:{}}}},an=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(n){const{rects:t}=n,{strategy:r="referenceHidden",...o}=re(e,n);switch(r){case"referenceHidden":{const e=ge(await he(n,{...o,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ve(e)}}}case"escaped":{const e=ge(await he(n,{...o,altBoundary:!0}),t.floating);return{data:{escapedOffsets:e,escaped:ve(e)}}}default:return{}}}}},sn=e=>({name:"arrow",options:e,async fn(n){const{x:t,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:c}=n,{element:l,padding:u=0}=re(e,n)||{};if(null==l)return{};const d=fe(u),f={x:t,y:r},p=le(o),m=se(p),h=await i.getDimensions(l),g="y"===p,v=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",w=a.reference[m]+a.reference[p]-f[p]-a.floating[m],b=f[p]-a.reference[p],_=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l));let C=_?_[x]:0;C&&await(null==i.isElement?void 0:i.isElement(_))||(C=s.floating[x]||a.floating[m]);const N=w/2-b/2,R=C/2-h[m]/2-1,E=Y(d[v],R),j=Y(d[y],R),k=E,T=C-h[m]-j,D=C/2-h[m]/2+N,S=te(k,D,T),M=!c.arrow&&null!=ae(o)&&D!==S&&a.reference[m]/2-(D<k?E:j)-h[m]/2<0,A=M?D<k?D-k:D-T:0;return{[p]:f[p]+A,data:{[p]:S,centerOffset:D-S-A,...M&&{alignmentOffset:A}},reset:M}}}),cn=function(e){return void 0===e&&(e={}),{options:e,fn(n){const{x:t,y:r,placement:o,rects:a,middlewareData:i}=n,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=re(e,n),u={x:t,y:r},d=ce(o),f=ie(d);let p=u[f],m=u[d];const h=re(s,n),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const e="y"===f?"height":"width",n=a.reference[f]-a.floating[e]+g.mainAxis,t=a.reference[f]+a.reference[e]-g.mainAxis;p<n?p=n:p>t&&(p=t)}if(l){var v,y;const e="y"===f?"width":"height",n=["top","left"].includes(oe(o)),t=a.reference[d]-a.floating[e]+(n&&(null==(v=i.offset)?void 0:v[d])||0)+(n?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(n?0:(null==(y=i.offset)?void 0:y[d])||0)-(n?g.crossAxis:0);m<t?m=t:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ln=(e,n,t)=>{const r=new Map,o={platform:Qe,...t},a={...o.platform,_c:r};return(async(e,n,t)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=t,s=a.filter(Boolean),c=await(null==i.isRTL?void 0:i.isRTL(n));let l=await i.getElementRects({reference:e,floating:n,strategy:o}),{x:u,y:d}=me(l,r,c),f=r,p={},m=0;for(let t=0;t<s.length;t++){const{name:a,fn:h}=s[t],{x:g,y:v,data:y,reset:x}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:l,platform:i,elements:{reference:e,floating:n}});u=null!=g?g:u,d=null!=v?v:d,p={...p,[a]:{...p[a],...y}},x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(l=!0===x.rects?await i.getElementRects({reference:e,floating:n,strategy:o}):x.rects),({x:u,y:d}=me(l,f,c))),t=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,n,{...o,platform:a})};var un="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function dn(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if("function"==typeof e&&e.toString()===n.toString())return!0;let t,r,o;if(e&&n&&"object"==typeof e){if(Array.isArray(e)){if(t=e.length,t!==n.length)return!1;for(r=t;0!=r--;)if(!dn(e[r],n[r]))return!1;return!0}if(o=Object.keys(e),t=o.length,t!==Object.keys(n).length)return!1;for(r=t;0!=r--;)if(!{}.hasOwnProperty.call(n,o[r]))return!1;for(r=t;0!=r--;){const t=o[r];if(("_owner"!==t||!e.$$typeof)&&!dn(e[t],n[t]))return!1}return!0}return e!=e&&n!=n}function fn(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pn(e,n){const t=fn(e);return Math.round(n*t)/t}function mn(e){const n=o.useRef(e);return un((()=>{n.current=e})),n}const hn=e=>({name:"arrow",options:e,fn(n){const{element:t,padding:r}="function"==typeof e?e(n):e;return t&&(o=t,{}.hasOwnProperty.call(o,"current"))?null!=t.current?sn({element:t.current,padding:r}).fn(n):{}:t?sn({element:t,padding:r}).fn(n):{};var o}}),gn=(e,n)=>({...nn(e),options:[e,n]}),vn=(e,n)=>({...tn(e),options:[e,n]}),yn=(e,n)=>({...cn(e),options:[e,n]}),xn=(e,n)=>({...rn(e),options:[e,n]}),wn=(e,n)=>({...on(e),options:[e,n]}),bn=(e,n)=>({...an(e),options:[e,n]}),_n=(e,n)=>({...hn(e),options:[e,n]});var Cn=o.forwardRef(((n,t)=>{const{children:r,width:o=10,height:a=5,...i}=n;return e.jsx(x.svg,{...i,ref:t,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?r:e.jsx("polygon",{points:"0,0 30,0 15,10"})})}));Cn.displayName="Arrow";var Nn=Cn;var Rn="Popper",[En,jn]=d(Rn),[kn,Tn]=En(Rn),Dn=n=>{const{__scopePopper:t,children:r}=n,[a,i]=o.useState(null);return e.jsx(kn,{scope:t,anchor:a,onAnchorChange:i,children:r})};Dn.displayName=Rn;var Sn="PopperAnchor",Mn=o.forwardRef(((n,t)=>{const{__scopePopper:r,virtualRef:a,...i}=n,s=Tn(Sn,r),c=o.useRef(null),l=u(t,c);return o.useEffect((()=>{s.onAnchorChange(a?.current||c.current)})),a?null:e.jsx(x.div,{...i,ref:l})}));Mn.displayName=Sn;var An="PopperContent",[On,Pn]=En(An),In=o.forwardRef(((n,t)=>{const{__scopePopper:r,side:i="bottom",sideOffset:s=0,align:c="center",alignOffset:l=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:w,...b}=n,_=Tn(An,r),[C,N]=o.useState(null),R=u(t,(e=>N(e))),[E,j]=o.useState(null),k=function(e){const[n,t]=o.useState(void 0);return G((()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver((n=>{if(!Array.isArray(n))return;if(!n.length)return;const r=n[0];let o,a;if("borderBoxSize"in r){const e=r.borderBoxSize,n=Array.isArray(e)?e[0]:e;o=n.inlineSize,a=n.blockSize}else o=e.offsetWidth,a=e.offsetHeight;t({width:o,height:a})}));return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}t(void 0)}),[e]),n}(E),T=k?.width??0,D=k?.height??0,S=i+("center"!==c?"-"+c:""),M="number"==typeof h?h:{top:0,right:0,bottom:0,left:0,...h},A=Array.isArray(m)?m:[m],O=A.length>0,P={padding:M,boundary:A.filter(Bn),altBoundary:O},{refs:I,floatingStyles:L,placement:F,isPositioned:z,middlewareData:B}=function(e){void 0===e&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=o.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=o.useState(r);dn(m,r)||h(r);const[g,v]=o.useState(null),[y,x]=o.useState(null),w=o.useCallback((e=>{e!==N.current&&(N.current=e,v(e))}),[]),b=o.useCallback((e=>{e!==R.current&&(R.current=e,x(e))}),[]),_=s||g,C=c||y,N=o.useRef(null),R=o.useRef(null),E=o.useRef(f),j=null!=u,k=mn(u),T=mn(i),D=mn(d),S=o.useCallback((()=>{if(!N.current||!R.current)return;const e={placement:n,strategy:t,middleware:m};T.current&&(e.platform=T.current),ln(N.current,R.current,e).then((e=>{const n={...e,isPositioned:!1!==D.current};M.current&&!dn(E.current,n)&&(E.current=n,a.flushSync((()=>{p(n)})))}))}),[m,n,t,T,D]);un((()=>{!1===d&&E.current.isPositioned&&(E.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[d]);const M=o.useRef(!1);un((()=>(M.current=!0,()=>{M.current=!1})),[]),un((()=>{if(_&&(N.current=_),C&&(R.current=C),_&&C){if(k.current)return k.current(_,C,S);S()}}),[_,C,S,k,j]);const A=o.useMemo((()=>({reference:N,floating:R,setReference:w,setFloating:b})),[w,b]),O=o.useMemo((()=>({reference:_,floating:C})),[_,C]),P=o.useMemo((()=>{const e={position:t,left:0,top:0};if(!O.floating)return e;const n=pn(O.floating,f.x),r=pn(O.floating,f.y);return l?{...e,transform:"translate("+n+"px, "+r+"px)",...fn(O.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:n,top:r}}),[t,l,O.floating,f.x,f.y]);return o.useMemo((()=>({...f,update:S,refs:A,elements:O,floatingStyles:P})),[f,S,A,O,P])}({strategy:"fixed",placement:S,whileElementsMounted:(...e)=>en(...e,{animationFrame:"always"===y}),elements:{reference:_.anchor},middleware:[gn({mainAxis:s+D,alignmentAxis:l}),f&&vn({mainAxis:!0,crossAxis:!1,limiter:"partial"===g?yn():void 0,...P}),f&&xn({...P}),wn({...P,apply:({elements:e,rects:n,availableWidth:t,availableHeight:r})=>{const{width:o,height:a}=n.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${t}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),E&&_n({element:E,padding:d}),Wn({arrowWidth:T,arrowHeight:D}),v&&bn({strategy:"referenceHidden",...P})]}),[W,H]=Hn(F),K=p(w);G((()=>{z&&K?.()}),[z,K]);const $=B.arrow?.x,U=B.arrow?.y,V=0!==B.arrow?.centerOffset,[X,Y]=o.useState();return G((()=>{C&&Y(window.getComputedStyle(C).zIndex)}),[C]),e.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:z?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:e.jsx(On,{scope:r,placedSide:W,onArrowChange:j,arrowX:$,arrowY:U,shouldHideArrow:V,children:e.jsx(x.div,{"data-side":W,"data-align":H,...b,ref:R,style:{...b.style,animation:z?void 0:"none"}})})})}));In.displayName=An;var Ln="PopperArrow",Fn={top:"bottom",right:"left",bottom:"top",left:"right"},zn=o.forwardRef((function(n,t){const{__scopePopper:r,...o}=n,a=Pn(Ln,r),i=Fn[a.placedSide];return e.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:e.jsx(Nn,{...o,ref:t,style:{...o.style,display:"block"}})})}));function Bn(e){return null!==e}zn.displayName=Ln;var Wn=e=>({name:"transformOrigin",options:e,fn(n){const{placement:t,rects:r,middlewareData:o}=n,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Hn(t),u={start:"0%",center:"50%",end:"100%"}[l],d=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+s/2;let p="",m="";return"bottom"===c?(p=a?u:`${d}px`,m=-s+"px"):"top"===c?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):"right"===c?(p=-s+"px",m=a?u:`${f}px`):"left"===c&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Hn(e){const[n,t="center"]=e.split("-");return[n,t]}var Kn=Dn,Gn=Mn,$n=In,Un=zn,Vn=o.forwardRef(((n,r)=>{const{container:a,...i}=n,[s,c]=o.useState(!1);G((()=>c(!0)),[]);const l=a||s&&globalThis?.document?.body;return l?t.createPortal(e.jsx(x.div,{...i,ref:r}),l):null}));Vn.displayName="Portal";var Xn=e=>{const{present:n,children:t}=e,r=function(e){const[n,t]=o.useState(),r=o.useRef({}),a=o.useRef(e),i=o.useRef("none"),s=e?"mounted":"unmounted",[c,l]=function(e,n){return o.useReducer(((e,t)=>n[e][t]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect((()=>{const e=Yn(r.current);i.current="mounted"===c?e:"none"}),[c]),G((()=>{const n=r.current,t=a.current;if(t!==e){const r=i.current,o=Yn(n);if(e)l("MOUNT");else if("none"===o||"none"===n?.display)l("UNMOUNT");else{l(t&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=e}}),[e,l]),G((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,o=o=>{const i=Yn(r.current).includes(o.animationName);if(o.target===n&&i&&(l("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},s=e=>{e.target===n&&(i.current=Yn(r.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",o),n.addEventListener("animationend",o),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",o),n.removeEventListener("animationend",o)}}l("ANIMATION_END")}),[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:o.useCallback((e=>{e&&(r.current=getComputedStyle(e)),t(e)}),[])}}(n),a="function"==typeof t?t({present:r.isPresent}):o.Children.only(t),i=u(r.ref,function(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;if(t)return e.ref;if(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof t||r.isPresent?o.cloneElement(a,{ref:i}):null};function Yn(e){return e?.animationName||"none"}Xn.displayName="Presence";var Zn="rovingFocusGroup.onEntryFocus",qn={bubbles:!1,cancelable:!0},Qn="RovingFocusGroup",[Jn,et,nt]=b(Qn),[tt,rt]=d(Qn,[nt]),[ot,at]=tt(Qn),it=o.forwardRef(((n,t)=>e.jsx(Jn.Provider,{scope:n.__scopeRovingFocusGroup,children:e.jsx(Jn.Slot,{scope:n.__scopeRovingFocusGroup,children:e.jsx(st,{...n,ref:t})})})));it.displayName=Qn;var st=o.forwardRef(((n,t)=>{const{__scopeRovingFocusGroup:r,orientation:a,loop:i=!1,dir:c,currentTabStopId:l,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:g=!1,...v}=n,y=o.useRef(null),w=u(t,y),b=C(c),[_=null,N]=m({prop:l,defaultProp:d,onChange:f}),[R,E]=o.useState(!1),j=p(h),k=et(r),T=o.useRef(!1),[D,S]=o.useState(0);return o.useEffect((()=>{const e=y.current;if(e)return e.addEventListener(Zn,j),()=>e.removeEventListener(Zn,j)}),[j]),e.jsx(ot,{scope:r,orientation:a,dir:b,loop:i,currentTabStopId:_,onItemFocus:o.useCallback((e=>N(e)),[N]),onItemShiftTab:o.useCallback((()=>E(!0)),[]),onFocusableItemAdd:o.useCallback((()=>S((e=>e+1))),[]),onFocusableItemRemove:o.useCallback((()=>S((e=>e-1))),[]),children:e.jsx(x.div,{tabIndex:R||0===D?-1:0,"data-orientation":a,...v,ref:w,style:{outline:"none",...n.style},onMouseDown:s(n.onMouseDown,(()=>{T.current=!0})),onFocus:s(n.onFocus,(e=>{const n=!T.current;if(e.target===e.currentTarget&&n&&!R){const n=new CustomEvent(Zn,qn);if(e.currentTarget.dispatchEvent(n),!n.defaultPrevented){const e=k().filter((e=>e.focusable));dt([e.find((e=>e.active)),e.find((e=>e.id===_)),...e].filter(Boolean).map((e=>e.ref.current)),g)}}T.current=!1})),onBlur:s(n.onBlur,(()=>E(!1)))})})})),ct="RovingFocusGroupItem",lt=o.forwardRef(((n,t)=>{const{__scopeRovingFocusGroup:r,focusable:a=!0,active:i=!1,tabStopId:c,...l}=n,u=V(),d=c||u,f=at(ct,r),p=f.currentTabStopId===d,m=et(r),{onFocusableItemAdd:h,onFocusableItemRemove:g}=f;return o.useEffect((()=>{if(a)return h(),()=>g()}),[a,h,g]),e.jsx(Jn.ItemSlot,{scope:r,id:d,focusable:a,active:i,children:e.jsx(x.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:s(n.onMouseDown,(e=>{a?f.onItemFocus(d):e.preventDefault()})),onFocus:s(n.onFocus,(()=>f.onItemFocus(d))),onKeyDown:s(n.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const n=function(e,n,t){const r=function(e,n){return"rtl"!==n?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,t);return"vertical"===n&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===n&&["ArrowUp","ArrowDown"].includes(r)?void 0:ut[r]}(e,f.orientation,f.dir);if(void 0!==n){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=m().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===n)o.reverse();else if("prev"===n||"next"===n){"prev"===n&&o.reverse();const a=o.indexOf(e.currentTarget);o=f.loop?(r=a+1,(t=o).map(((e,n)=>t[(r+n)%t.length]))):o.slice(a+1)}setTimeout((()=>dt(o)))}var t,r}))})})}));lt.displayName=ct;var ut={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function dt(e,n=!1){const t=document.activeElement;for(const r of e){if(r===t)return;if(r.focus({preventScroll:n}),document.activeElement!==t)return}}var ft=it,pt=lt,mt=new WeakMap,ht=new WeakMap,gt={},vt=0,yt=function(e){return e&&(e.host||yt(e.parentNode))},xt=function(e,n,t,r){var o=function(e,n){return n.map((function(n){if(e.contains(n))return n;var t=yt(n);return t&&e.contains(t)?t:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(n,Array.isArray(e)?e:[e]);gt[t]||(gt[t]=new WeakMap);var a=gt[t],i=[],s=new Set,c=new Set(o),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};o.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(s.has(e))u(e);else try{var n=e.getAttribute(r),o=null!==n&&"false"!==n,c=(mt.get(e)||0)+1,l=(a.get(e)||0)+1;mt.set(e,c),a.set(e,l),i.push(e),1===c&&o&&ht.set(e,!0),1===l&&e.setAttribute(t,"true"),o||e.setAttribute(r,"true")}catch(n){console.error("aria-hidden: cannot operate on ",e,n)}}))};return u(n),s.clear(),vt++,function(){i.forEach((function(e){var n=mt.get(e)-1,o=a.get(e)-1;mt.set(e,n),a.set(e,o),n||(ht.has(e)||e.removeAttribute(r),ht.delete(e)),o||e.removeAttribute(t)})),--vt||(mt=new WeakMap,mt=new WeakMap,ht=new WeakMap,gt={})}},wt=function(e,n,t){void 0===t&&(t="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),xt(r,o,t,"aria-hidden")):function(){return null}},bt=function(){return bt=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},bt.apply(this,arguments)};function _t(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var Ct="right-scroll-bar-position",Nt="width-before-scroll-bar";function Rt(e,n){return"function"==typeof e?e(n):e&&(e.current=n),e}var Et="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,jt=new WeakMap;function kt(e,t){var r,o,a,i=(r=null,o=function(n){return e.forEach((function(e){return Rt(e,n)}))},(a=n.useState((function(){return{value:r,callback:o,facade:{get current(){return a.value},set current(e){var n=a.value;n!==e&&(a.value=e,a.callback(e,n))}}}}))[0]).callback=o,a.facade);return Et((function(){var n=jt.get(i);if(n){var t=new Set(n),r=new Set(e),o=i.current;t.forEach((function(e){r.has(e)||Rt(e,null)})),r.forEach((function(e){t.has(e)||Rt(e,o)}))}jt.set(i,e)}),[e]),i}function Tt(e){return e}var Dt=function(e){var n=e.sideCar,t=_t(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=n.read();if(!r)throw new Error("Sidecar medium not found");return o.createElement(r,bt({},t))};Dt.isSideCarExport=!0;var St=function(e){void 0===e&&(e={});var n=function(e,n){void 0===n&&(n=Tt);var t=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:e},useMedium:function(e){var o=n(e,r);return t.push(o),function(){t=t.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;t.length;){var n=t;t=[],n.forEach(e)}t={push:function(n){return e(n)},filter:function(){return t}}},assignMedium:function(e){r=!0;var n=[];if(t.length){var o=t;t=[],o.forEach(e),n=t}var a=function(){var t=n;n=[],t.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),t={push:function(e){n.push(e),i()},filter:function(e){return n=n.filter(e),t}}}}}(null);return n.options=bt({async:!0,ssr:!1},e),n}(),Mt=function(){},At=o.forwardRef((function(e,n){var t=o.useRef(null),r=o.useState({onScrollCapture:Mt,onWheelCapture:Mt,onTouchMoveCapture:Mt}),a=r[0],i=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,x=e.gapMode,w=_t(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=p,_=kt([t,n]),C=bt(bt({},w),a);return o.createElement(o.Fragment,null,d&&o.createElement(b,{sideCar:St,removeScrollBar:u,shards:f,noIsolation:m,inert:h,setCallbacks:i,allowPinchZoom:!!g,lockRef:t,gapMode:x}),s?o.cloneElement(o.Children.only(c),bt(bt({},C),{ref:_})):o.createElement(y,bt({},C,{className:l,ref:_}),c))}));At.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},At.classNames={fullWidth:Nt,zeroRight:Ct};function Ot(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return n&&e.setAttribute("nonce",n),e}var Pt=function(){var e=0,n=null;return{add:function(t){var r,o;0==e&&(n=Ot())&&(o=t,(r=n).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(n)),e++},remove:function(){! --e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},It=function(){var e,n=(e=Pt(),function(n,t){o.useEffect((function(){return e.add(n),function(){e.remove()}}),[n&&t])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},Lt={left:0,top: