jattac.libs.web.overflow-menu 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
package/dist/index.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useState as t,useRef as n,useEffect as r,useLayoutEffect as o}from"react";import{AnimatePresence as i,motion as a}from"framer-motion";import{createPortal as l}from"react-dom";var s={trigger:"OverflowMenu-module_trigger__imdPK",menu:"OverflowMenu-module_menu__n8uKD",dotsWrapper:"OverflowMenu-module_dotsWrapper__CHO9Q",dot:"OverflowMenu-module_dot__g5Rgi"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".OverflowMenu-module_menuWrapper__psD7a{display:inline-block;position:relative;z-index:0}.OverflowMenu-module_trigger__imdPK{align-items:center;background:transparent;border:none;border-radius:50%;color:#024b59;cursor:pointer;display:flex;font-size:1.8rem;height:3rem;justify-content:center;transition:color .2s ease,background-color .2s ease;width:3rem}.OverflowMenu-module_trigger__imdPK:focus,.OverflowMenu-module_trigger__imdPK:hover{background-color:rgba(2,75,89,.05);color:#016a80;outline:none}.OverflowMenu-module_menu__n8uKD{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:hsla(0,0%,100%,.75);border:1px solid #016a80;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.12);color:#024b59;display:flex;flex-direction:column;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-weight:500;gap:.35rem;min-width:180px;padding:.5rem .25rem;width:max-content;z-index:9999}.OverflowMenu-module_menu__n8uKD button{background:transparent;border:none;border-bottom:1px solid rgba(2,75,89,.1);border-radius:8px;color:#024b59;cursor:pointer;font-size:1rem;padding:.6rem 1rem;text-align:left;transition:background .25s ease,transform .12s ease;user-select:none}.OverflowMenu-module_menu__n8uKD button:last-child{border-bottom:none}.OverflowMenu-module_menu__n8uKD button:focus,.OverflowMenu-module_menu__n8uKD button:hover{background:rgba(2,75,89,.05);outline:none;transform:scale(1.03)}.OverflowMenu-module_menu__n8uKD button:active{background:rgba(2,75,89,.1);transform:scale(.98)}.OverflowMenu-module_dotsWrapper__CHO9Q{align-items:center;display:flex;flex-direction:column;gap:3px;justify-content:center}.OverflowMenu-module_dot__g5Rgi{background-color:currentColor;border-radius:50%;display:block;height:5px;width:5px}");const d=()=>{const t={initial:{y:0,scale:1},hover:{y:-4,scale:1.2,transition:{type:"spring",stiffness:500,damping:20}},rest:{y:0,scale:1,transition:{type:"spring",stiffness:500,damping:20}}};return e.createElement(a.div,{className:s.dotsWrapper,initial:"rest",whileHover:"hover",animate:"rest"},[0,1,2].map(n=>e.createElement(a.span,{key:n,className:s.dot,variants:t,custom:n,transition:{delay:.05*n}})))},u=({items:u,icon:c,className:m="",portal:p=null})=>{const[f,g]=t(!1),[b,_]=t(!0),[v,h]=t({top:0,left:0}),[w,y]=t({x:0,y:0}),x=n(null),k=n(null);r(()=>{_(!1)},[]);const O=e=>{k.current&&k.current.contains(e.target)||x.current&&!x.current.contains(e.target)&&g(!1)};r(()=>(f?document.addEventListener("mousedown",O):document.removeEventListener("mousedown",O),()=>{document.removeEventListener("mousedown",O)}),[f]),o(()=>{if(f&&x.current){const e=x.current.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight;let r=w.y,o=w.x;o+e.width>t&&(o=t-e.width-10),r+e.height>n&&(r=n-e.height-10),o<0&&(o=10),r<0&&(r=10),h({top:r,left:o})}},[f,w]);const M={hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},C=e.createElement(i,null,f&&e.createElement(a.div,{ref:x,className:s.menu,style:{position:"fixed",top:`${v.top}px`,left:`${v.left}px`},variants:{hidden:{opacity:0,scale:.95,transition:{duration:.1}},visible:{opacity:1,scale:1,transition:{duration:.2,staggerChildren:.05}}},initial:!b&&"hidden",animate:"visible",exit:"hidden"},u.map((t,n)=>e.createElement(a.button,{key:n,className:s.menuItem,onClick:()=>{var e;null===(e=t.onClick)||void 0===e||e.call(t),g(!1)},variants:M,whileHover:{scale:1.05,y:-2,color:"#016a80",backgroundColor:"rgba(2, 75, 89, 0.05)",transition:{type:"spring",stiffness:400,damping:15}}},t.content))));return e.createElement("div",{className:s.overflowMenu},e.createElement(a.button,{ref:k,onClick:e=>{e.stopPropagation(),y({x:e.clientX,y:e.clientY}),g(!f)},className:`${s.trigger} ${m}`,"aria-haspopup":"true","aria-expanded":f,whileHover:{scale:1.1,y:-2,color:"#016a80",backgroundColor:"rgba(2, 75, 89, 0.05)",transition:{type:"spring",stiffness:400,damping:15}}},c||e.createElement(d,null)),p?l(C,p):C)};export{u as default};
|
|
1
|
+
import*as e from"react";import t,{useLayoutEffect as n,useState as r}from"react";import{jsx as o}from"react/jsx-runtime";import*as i from"react-dom";import a from"react-dom";import{AnimatePresence as c,motion as s}from"framer-motion";function u(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function l(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let n=!1;const r=e.map(e=>{const r=l(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():l(e[t],null)}}}}function f(...t){return e.useCallback(d(...t),t)}function p(t,n=[]){let r=[];const i=()=>{const n=r.map(t=>e.createContext(t));return function(r){const o=r?.[t]||n;return e.useMemo(()=>({[`__scope${t}`]:{...r,[t]:o}}),[r,o])}};return i.scopeName=t,[function(n,i){const a=e.createContext(i),c=r.length;r=[...r,i];const s=n=>{const{scope:r,children:i,...s}=n,u=r?.[t]?.[c]||a,l=e.useMemo(()=>s,Object.values(s));return o(u.Provider,{value:l,children:i})};return s.displayName=n+"Provider",[s,function(r,o){const s=o?.[t]?.[c]||a,u=e.useContext(s);if(u)return u;if(void 0!==i)return i;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},m(i,...n)]}function m(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=r.reduce((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return r.scopeName=n.scopeName,r}var h=globalThis?.document?e.useLayoutEffect:()=>{},g=e[" useInsertionEffect ".trim().toString()]||h;function v({prop:t,defaultProp:n,onChange:r=()=>{},caller:o}){const[i,a,c]=function({defaultProp:t,onChange:n}){const[r,o]=e.useState(t),i=e.useRef(r),a=e.useRef(n);return g(()=>{a.current=n},[n]),e.useEffect(()=>{i.current!==r&&(a.current?.(r),i.current=r)},[r,i]),[r,o,a]}({defaultProp:n,onChange:r}),s=void 0!==t,u=s?t:i;{const n=e.useRef(void 0!==t);e.useEffect(()=>{const e=n.current;if(e!==s){const t=e?"controlled":"uncontrolled",n=s?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}n.current=s},[s,o])}const l=e.useCallback(e=>{if(s){const n=function(e){return"function"==typeof e}(e)?e(t):e;n!==t&&c.current?.(n)}else a(e)},[s,t,a,c]);return[u,l]}function y(t){const n=w(t),r=e.forwardRef((t,r)=>{const{children:i,...a}=t,c=e.Children.toArray(i),s=c.find(x);if(s){const t=s.props.children,i=c.map(n=>n===s?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n);return o(n,{...a,ref:r,children:e.isValidElement(t)?e.cloneElement(t,void 0,i):null})}return o(n,{...a,ref:r,children:i})});return r.displayName=`${t}.Slot`,r}function w(t){const n=e.forwardRef((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==e.Fragment&&(i.ref=n?d(n,t):t),e.cloneElement(r,i)}return e.Children.count(r)>1?e.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}var b=Symbol("radix.slottable");function x(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===b}var E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=y(`Primitive.${n}`),i=e.forwardRef((e,t)=>{const{asChild:i,...a}=e,c=i?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),o(c,{...a,ref:t})});return i.displayName=`Primitive.${n}`,{...t,[n]:i}},{});function C(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))}function R(e){const n=e+"CollectionProvider",[r,i]=p(n),[a,c]=r(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,i=t.useRef(null),c=t.useRef(new Map).current;return o(a,{scope:n,itemMap:c,collectionRef:i,children:r})};s.displayName=n;const u=e+"CollectionSlot",l=y(u),d=t.forwardRef((e,t)=>{const{scope:n,children:r}=e,i=f(t,c(u,n).collectionRef);return o(l,{ref:i,children:r})});d.displayName=u;const m=e+"CollectionItemSlot",h="data-radix-collection-item",g=y(m),v=t.forwardRef((e,n)=>{const{scope:r,children:i,...a}=e,s=t.useRef(null),u=f(n,s),l=c(m,r);return t.useEffect(()=>(l.itemMap.set(s,{ref:s,...a}),()=>{l.itemMap.delete(s)})),o(g,{[h]:"",ref:u,children:i})});return v.displayName=m,[{Provider:s,Slot:d,ItemSlot:v},function(n){const r=c(e+"CollectionConsumer",n);return t.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},i]}var _=e.createContext(void 0);function M(t){const n=e.useContext(_);return t||n||"ltr"}function S(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>n.current?.(...e),[])}var D,O="dismissableLayer.update",P="dismissableLayer.pointerDownOutside",T="dismissableLayer.focusOutside",A=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),k=e.forwardRef((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:s,onDismiss:l,...d}=t,p=e.useContext(A),[m,h]=e.useState(null),g=m?.ownerDocument??globalThis?.document,[,v]=e.useState({}),y=f(n,e=>h(e)),w=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=w.indexOf(b),C=m?w.indexOf(m):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,_=C>=x,M=function(t,n=globalThis?.document){const r=S(t),o=e.useRef(!1),i=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){L(P,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=t,n.addEventListener("click",i.current,{once:!0})):t()}else n.removeEventListener("click",i.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...p.branches].some(e=>e.contains(t));_&&!n&&(a?.(e),s?.(e),e.defaultPrevented||l?.())},g),k=function(t,n=globalThis?.document){const r=S(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){L(T,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...p.branches].some(e=>e.contains(t))||(c?.(e),s?.(e),e.defaultPrevented||l?.())},g);return function(t,n=globalThis?.document){const r=S(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{C===p.layers.size-1&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},g),e.useEffect(()=>{if(m)return r&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(D=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),N(),()=>{r&&1===p.layersWithOutsidePointerEventsDisabled.size&&(g.body.style.pointerEvents=D)}},[m,g,r,p]),e.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),N())},[m,p]),e.useEffect(()=>{const e=()=>v({});return document.addEventListener(O,e),()=>document.removeEventListener(O,e)},[]),o(E.div,{...d,ref:y,style:{pointerEvents:R?_?"auto":"none":void 0,...t.style},onFocusCapture:u(t.onFocusCapture,k.onFocusCapture),onBlurCapture:u(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:u(t.onPointerDownCapture,M.onPointerDownCapture)})});k.displayName="DismissableLayer";function N(){const e=new CustomEvent(O);document.dispatchEvent(e)}function L(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?C(o,i):o.dispatchEvent(i)}e.forwardRef((t,n)=>{const r=e.useContext(A),i=e.useRef(null),a=f(n,i);return e.useEffect(()=>{const e=i.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),o(E.div,{...t,ref:a})}).displayName="DismissableLayerBranch";var I=0;function F(){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 W="focusScope.autoFocusOnMount",K="focusScope.autoFocusOnUnmount",B={bubbles:!1,cancelable:!0},H=e.forwardRef((t,n)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:c,...s}=t,[u,l]=e.useState(null),d=S(a),p=S(c),m=e.useRef(null),h=f(n,e=>l(e)),g=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(i){let e=function(e){if(g.paused||!u)return;const t=e.target;u.contains(t)?m.current=t:j(m.current,{select:!0})},t=function(e){if(g.paused||!u)return;const t=e.relatedTarget;null!==t&&(u.contains(t)||j(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&j(u)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[i,u,g.paused]),e.useEffect(()=>{if(u){V.add(g);const t=document.activeElement;if(!u.contains(t)){const n=new CustomEvent(W,B);u.addEventListener(W,d),u.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(j(r,{select:t}),document.activeElement!==n)return}((e=$(u),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&j(u))}return()=>{u.removeEventListener(W,d),setTimeout(()=>{const e=new CustomEvent(K,B);u.addEventListener(K,p),u.dispatchEvent(e),e.defaultPrevented||j(t??document.body,{select:!0}),u.removeEventListener(K,p),V.remove(g)},0)}}var e},[u,d,p,g]);const v=e.useCallback(e=>{if(!r&&!i)return;if(g.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,i]=function(e){const t=$(e),n=z(t,e),r=z(t.reverse(),e);return[n,r]}(t);o&&i?e.shiftKey||n!==i?e.shiftKey&&n===o&&(e.preventDefault(),r&&j(i,{select:!0})):(e.preventDefault(),r&&j(o,{select:!0})):n===t&&e.preventDefault()}},[r,i,g.paused]);return o(E.div,{tabIndex:-1,...s,ref:h,onKeyDown:v})});function $(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function z(e,t){for(const n of e)if(!U(n,{upTo:t}))return n}function U(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function j(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}H.displayName="FocusScope";var V=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=G(e,t),e.unshift(t)},remove(t){e=G(e,t),e[0]?.resume()}}}();function G(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var X=e[" useId ".trim().toString()]||(()=>{}),Y=0;function q(t){const[n,r]=e.useState(X());return h(()=>{r(e=>e??String(Y++))},[t]),t||(n?`radix-${n}`:"")}const Z=["top","right","bottom","left"],Q=Math.min,J=Math.max,ee=Math.round,te=Math.floor,ne=e=>({x:e,y:e}),re={left:"right",right:"left",bottom:"top",top:"bottom"},oe={start:"end",end:"start"};function ie(e,t,n){return J(e,Q(t,n))}function ae(e,t){return"function"==typeof e?e(t):e}function ce(e){return e.split("-")[0]}function se(e){return e.split("-")[1]}function ue(e){return"x"===e?"y":"x"}function le(e){return"y"===e?"height":"width"}const de=new Set(["top","bottom"]);function fe(e){return de.has(ce(e))?"y":"x"}function pe(e){return ue(fe(e))}function me(e){return e.replace(/start|end/g,e=>oe[e])}const he=["left","right"],ge=["right","left"],ve=["top","bottom"],ye=["bottom","top"];function we(e,t,n,r){const o=se(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?ge:he:t?he:ge;case"left":case"right":return t?ve:ye;default:return[]}}(ce(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(me)))),i}function be(e){return e.replace(/left|right|bottom|top/g,e=>re[e])}function xe(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 Ee(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ce(e,t,n){let{reference:r,floating:o}=e;const i=fe(t),a=pe(t),c=le(a),s=ce(t),u="y"===i,l=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[c]/2-o[c]/2;let p;switch(s){case"top":p={x:l,y:r.y-o.height};break;case"bottom":p={x:l,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(se(t)){case"start":p[a]-=f*(n&&u?-1:1);break;case"end":p[a]+=f*(n&&u?-1:1)}return p}async function Re(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:c,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=ae(t,e),m=xe(p),h=c[f?"floating"===d?"reference":"floating":d],g=Ee(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:l,strategy:s})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=Ee(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:y,strategy:s}):v);return{top:(g.top-b.top+m.top)/w.y,bottom:(b.bottom-g.bottom+m.bottom)/w.y,left:(g.left-b.left+m.left)/w.x,right:(b.right-g.right+m.right)/w.x}}function _e(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Me(e){return Z.some(t=>e[t]>=0)}const Se=new Set(["left","top"]);function De(){return"undefined"!=typeof window}function Oe(e){return Ae(e)?(e.nodeName||"").toLowerCase():"#document"}function Pe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Te(e){var t;return null==(t=(Ae(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Ae(e){return!!De()&&(e instanceof Node||e instanceof Pe(e).Node)}function ke(e){return!!De()&&(e instanceof Element||e instanceof Pe(e).Element)}function Ne(e){return!!De()&&(e instanceof HTMLElement||e instanceof Pe(e).HTMLElement)}function Le(e){return!(!De()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Pe(e).ShadowRoot)}const Ie=new Set(["inline","contents"]);function Fe(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ie.has(o)}const We=new Set(["table","td","th"]);function Ke(e){return We.has(Oe(e))}const Be=[":popover-open",":modal"];function He(e){return Be.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const $e=["transform","translate","scale","rotate","perspective"],ze=["transform","translate","scale","rotate","perspective","filter"],Ue=["paint","layout","strict","content"];function je(e){const t=Ve(),n=ke(e)?Ye(e):e;return $e.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||ze.some(e=>(n.willChange||"").includes(e))||Ue.some(e=>(n.contain||"").includes(e))}function Ve(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ge=new Set(["html","body","#document"]);function Xe(e){return Ge.has(Oe(e))}function Ye(e){return Pe(e).getComputedStyle(e)}function qe(e){return ke(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ze(e){if("html"===Oe(e))return e;const t=e.assignedSlot||e.parentNode||Le(e)&&e.host||Te(e);return Le(t)?t.host:t}function Qe(e){const t=Ze(e);return Xe(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ne(t)&&Fe(t)?t:Qe(t)}function Je(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Qe(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Pe(o);if(i){const e=et(a);return t.concat(a,a.visualViewport||[],Fe(o)?o:[],e&&n?Je(e):[])}return t.concat(o,Je(o,[],n))}function et(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tt(e){const t=Ye(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ne(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,c=ee(n)!==i||ee(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function nt(e){return ke(e)?e:e.contextElement}function rt(e){const t=nt(e);if(!Ne(t))return ne(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=tt(t);let a=(i?ee(n.width):n.width)/r,c=(i?ee(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),c&&Number.isFinite(c)||(c=1),{x:a,y:c}}const ot=ne(0);function it(e){const t=Pe(e);return Ve()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ot}function at(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=nt(e);let a=ne(1);t&&(r?ke(r)&&(a=rt(r)):a=rt(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Pe(e))&&t}(i,n,r)?it(i):ne(0);let s=(o.left+c.x)/a.x,u=(o.top+c.y)/a.y,l=o.width/a.x,d=o.height/a.y;if(i){const e=Pe(i),t=r&&ke(r)?Pe(r):r;let n=e,o=et(n);for(;o&&r&&t!==n;){const e=rt(o),t=o.getBoundingClientRect(),r=Ye(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,u*=e.y,l*=e.x,d*=e.y,s+=i,u+=a,n=Pe(o),o=et(n)}}return Ee({width:l,height:d,x:s,y:u})}function ct(e,t){const n=qe(e).scrollLeft;return t?t.left+n:at(Te(e)).left+n}function st(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ct(e,n),y:n.top+t.scrollTop}}const ut=new Set(["absolute","fixed"]);function lt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Pe(e),r=Te(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,c=0,s=0;if(o){i=o.width,a=o.height;const e=Ve();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,s=o.offsetTop)}const u=ct(r);if(u<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else u<=25&&(i+=u);return{width:i,height:a,x:c,y:s}}(e,n);else if("document"===t)r=function(e){const t=Te(e),n=qe(e),r=e.ownerDocument.body,o=J(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=J(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ct(e);const c=-n.scrollTop;return"rtl"===Ye(r).direction&&(a+=J(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:c}}(Te(e));else if(ke(t))r=function(e,t){const n=at(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ne(e)?rt(e):ne(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=it(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ee(r)}function dt(e,t){const n=Ze(e);return!(n===t||!ke(n)||Xe(n))&&("fixed"===Ye(n).position||dt(n,t))}function ft(e,t,n){const r=Ne(t),o=Te(t),i="fixed"===n,a=at(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=ne(0);function u(){s.x=ct(o)}if(r||!r&&!i)if(("body"!==Oe(t)||Fe(o))&&(c=qe(t)),r){const e=at(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&u();i&&!r&&o&&u();const l=!o||r||i?ne(0):st(o,c);return{x:a.left+c.scrollLeft-s.x-l.x,y:a.top+c.scrollTop-s.y-l.y,width:a.width,height:a.height}}function pt(e){return"static"===Ye(e).position}function mt(e,t){if(!Ne(e)||"fixed"===Ye(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Te(e)===n&&(n=n.ownerDocument.body),n}function ht(e,t){const n=Pe(e);if(He(e))return n;if(!Ne(e)){let t=Ze(e);for(;t&&!Xe(t);){if(ke(t)&&!pt(t))return t;t=Ze(t)}return n}let r=mt(e,t);for(;r&&Ke(r)&&pt(r);)r=mt(r,t);return r&&Xe(r)&&pt(r)&&!je(r)?n:r||function(e){let t=Ze(e);for(;Ne(t)&&!Xe(t);){if(je(t))return t;if(He(t))return null;t=Ze(t)}return null}(e)||n}const gt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Te(r),c=!!t&&He(t.floating);if(r===a||c&&i)return n;let s={scrollLeft:0,scrollTop:0},u=ne(1);const l=ne(0),d=Ne(r);if((d||!d&&!i)&&(("body"!==Oe(r)||Fe(a))&&(s=qe(r)),Ne(r))){const e=at(r);u=rt(r),l.x=e.x+r.clientLeft,l.y=e.y+r.clientTop}const f=!a||d||i?ne(0):st(a,s);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+l.x+f.x,y:n.y*u.y-s.scrollTop*u.y+l.y+f.y}},getDocumentElement:Te,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?He(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Je(e,[],!1).filter(e=>ke(e)&&"body"!==Oe(e)),o=null;const i="fixed"===Ye(e).position;let a=i?Ze(e):e;for(;ke(a)&&!Xe(a);){const t=Ye(a),n=je(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&ut.has(o.position)||Fe(a)&&!n&&dt(e,a))?r=r.filter(e=>e!==a):o=t,a=Ze(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((e,n)=>{const r=lt(t,n,o);return e.top=J(r.top,e.top),e.right=Q(r.right,e.right),e.bottom=Q(r.bottom,e.bottom),e.left=J(r.left,e.left),e},lt(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:ht,getElementRects:async function(e){const t=this.getOffsetParent||ht,n=this.getDimensions,r=await n(e.floating);return{reference:ft(e.reference,await t(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:t,height:n}=tt(e);return{width:t,height:n}},getScale:rt,isElement:ke,isRTL:function(e){return"rtl"===Ye(e).direction}};function vt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yt(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,u=nt(e),l=o||i?[...u?Je(u):[],...Je(t)]:[];l.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&c?function(e,t){let n,r=null;const o=Te(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),i();const u=e.getBoundingClientRect(),{left:l,top:d,width:f,height:p}=u;if(c||t(),!f||!p)return;const m={rootMargin:-te(d)+"px "+-te(o.clientWidth-(l+f))+"px "+-te(o.clientHeight-(d+p))+"px "+-te(l)+"px",threshold:J(0,Q(1,s))||1};let h=!0;function g(t){const r=t[0].intersectionRatio;if(r!==s){if(!h)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||vt(u,e.getBoundingClientRect())||a(),h=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),i}(u,n):null;let f,p=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),u&&!s&&m.observe(u),m.observe(t));let h=s?at(e):null;return s&&function t(){const r=at(e);h&&!vt(h,r)&&n();h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;l.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(f)}}const wt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:c}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=ce(n),c=se(n),s="y"===fe(n),u=Se.has(a)?-1:1,l=i&&s?-1:1,d=ae(t,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 c&&"number"==typeof m&&(p="end"===c?-1*m:m),s?{x:p*l,y:f*u}:{x:f*u,y:p*l}}(t,e);return a===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:a}}}}},bt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=ae(e,t),u={x:n,y:r},l=await Re(t,s),d=fe(ce(o)),f=ue(d);let p=u[f],m=u[d];if(i){const e="y"===f?"bottom":"right";p=ie(p+l["y"===f?"top":"left"],p,p-l[e])}if(a){const e="y"===d?"bottom":"right";m=ie(m+l["y"===d?"top":"left"],m,m-l[e])}const h=c.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:i,[d]:a}}}}}},xt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:c,platform:s,elements:u}=t,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=ae(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=ce(o),y=fe(c),w=ce(c)===c,b=await(null==s.isRTL?void 0:s.isRTL(u.floating)),x=f||(w||!h?[be(c)]:function(e){const t=be(e);return[me(e),t,me(t)]}(c)),E="none"!==m;!f&&E&&x.push(...we(c,h,m,b));const C=[c,...x],R=await Re(t,g),_=[];let M=(null==(r=i.flip)?void 0:r.overflows)||[];if(l&&_.push(R[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=se(e),o=pe(e),i=le(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=be(a)),[a,be(a)]}(o,a,b);_.push(R[e[0]],R[e[1]])}if(M=[...M,{placement:o,overflows:_}],!_.every(e=>e<=0)){var S,D;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=C[e];if(t){if(!("alignment"===d&&y!==fe(t))||M.every(e=>fe(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:M},reset:{placement:t}}}let n=null==(D=M.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:D.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=M.filter(e=>{if(E){const t=fe(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},Et=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:c}=t,{apply:s=()=>{},...u}=ae(e,t),l=await Re(t,u),d=ce(o),f=se(o),p="y"===fe(o),{width:m,height:h}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=f===(await(null==a.isRTL?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(v=d,g="end"===f?"top":"bottom");const y=h-l.top-l.bottom,w=m-l.left-l.right,b=Q(h-l[g],y),x=Q(m-l[v],w),E=!t.middlewareData.shift;let C=b,R=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(R=w),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(C=y),E&&!f){const e=J(l.left,0),t=J(l.right,0),n=J(l.top,0),r=J(l.bottom,0);p?R=m-2*(0!==e||0!==t?e+t:J(l.left,l.right)):C=h-2*(0!==n||0!==r?n+r:J(l.top,l.bottom))}await s({...t,availableWidth:R,availableHeight:C});const _=await a.getDimensions(c.floating);return m!==_.width||h!==_.height?{reset:{rects:!0}}:{}}}},Ct=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ae(e,t);switch(r){case"referenceHidden":{const e=_e(await Re(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Me(e)}}}case"escaped":{const e=_e(await Re(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Me(e)}}}default:return{}}}}},Rt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:c,middlewareData:s}=t,{element:u,padding:l=0}=ae(e,t)||{};if(null==u)return{};const d=xe(l),f={x:n,y:r},p=pe(o),m=le(p),h=await a.getDimensions(u),g="y"===p,v=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-f[p]-i.floating[m],x=f[p]-i.reference[p],E=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let C=E?E[w]:0;C&&await(null==a.isElement?void 0:a.isElement(E))||(C=c.floating[w]||i.floating[m]);const R=b/2-x/2,_=C/2-h[m]/2-1,M=Q(d[v],_),S=Q(d[y],_),D=M,O=C-h[m]-S,P=C/2-h[m]/2+R,T=ie(D,P,O),A=!s.arrow&&null!=se(o)&&P!==T&&i.reference[m]/2-(P<D?M:S)-h[m]/2<0,k=A?P<D?P-D:P-O:0;return{[p]:f[p]+k,data:{[p]:T,centerOffset:P-T-k,...A&&{alignmentOffset:k}},reset:A}}}),_t=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:c=0,mainAxis:s=!0,crossAxis:u=!0}=ae(e,t),l={x:n,y:r},d=fe(o),f=ue(d);let p=l[f],m=l[d];const h=ae(c,t),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,n=i.reference[f]+i.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(u){var v,y;const e="y"===f?"width":"height",t=Se.has(ce(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Mt=(e,t,n)=>{const r=new Map,o={platform:gt,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,c=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:l,y:d}=Ce(u,r,s),f=r,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:h}=c[n],{x:g,y:v,data:y,reset:w}=await h({x:l,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:u,platform:a,elements:{reference:e,floating:t}});l=null!=g?g:l,d=null!=v?v:d,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(u=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:l,y:d}=Ce(u,f,s))),n=-1)}return{x:l,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var St="undefined"!=typeof document?n:function(){};function Dt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!Dt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Dt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ot(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pt(e,t){const n=Ot(e);return Math.round(t*n)/n}function Tt(t){const n=e.useRef(t);return St(()=>{n.current=t}),n}const At=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Rt({element:n.current,padding:r}).fn(t):{}:n?Rt({element:n,padding:r}).fn(t):{};var o}}),kt=(e,t)=>({...wt(e),options:[e,t]}),Nt=(e,t)=>({...bt(e),options:[e,t]}),Lt=(e,t)=>({..._t(e),options:[e,t]}),It=(e,t)=>({...xt(e),options:[e,t]}),Ft=(e,t)=>({...Et(e),options:[e,t]}),Wt=(e,t)=>({...Ct(e),options:[e,t]}),Kt=(e,t)=>({...At(e),options:[e,t]});var Bt=e.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return o(E.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o("polygon",{points:"0,0 30,0 15,10"})})});Bt.displayName="Arrow";var Ht=Bt;var $t="Popper",[zt,Ut]=p($t),[jt,Vt]=zt($t),Gt=t=>{const{__scopePopper:n,children:r}=t,[i,a]=e.useState(null);return o(jt,{scope:n,anchor:i,onAnchorChange:a,children:r})};Gt.displayName=$t;var Xt="PopperAnchor",Yt=e.forwardRef((t,n)=>{const{__scopePopper:r,virtualRef:i,...a}=t,c=Vt(Xt,r),s=e.useRef(null),u=f(n,s),l=e.useRef(null);return e.useEffect(()=>{const e=l.current;l.current=i?.current||s.current,e!==l.current&&c.onAnchorChange(l.current)}),i?null:o(E.div,{...a,ref:u})});Yt.displayName=Xt;var qt="PopperContent",[Zt,Qt]=zt(qt),Jt=e.forwardRef((t,n)=>{const{__scopePopper:r,side:a="bottom",sideOffset:c=0,align:s="center",alignOffset:u=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:w,...b}=t,x=Vt(qt,r),[C,R]=e.useState(null),_=f(n,e=>R(e)),[M,D]=e.useState(null),O=function(t){const[n,r]=e.useState(void 0);return h(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=t.offsetWidth,i=t.offsetHeight;r({width:o,height:i})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)},[t]),n}(M),P=O?.width??0,T=O?.height??0,A=a+("center"!==s?"-"+s:""),k="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},N=Array.isArray(p)?p:[p],L=N.length>0,I={padding:k,boundary:N.filter(rn),altBoundary:L},{refs:F,floatingStyles:W,placement:K,isPositioned:B,middlewareData:H}=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:a,elements:{reference:c,floating:s}={},transform:u=!0,whileElementsMounted:l,open:d}=t,[f,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(o);Dt(m,o)||h(o);const[g,v]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback(e=>{e!==R.current&&(R.current=e,v(e))},[]),x=e.useCallback(e=>{e!==_.current&&(_.current=e,w(e))},[]),E=c||g,C=s||y,R=e.useRef(null),_=e.useRef(null),M=e.useRef(f),S=null!=l,D=Tt(l),O=Tt(a),P=Tt(d),T=e.useCallback(()=>{if(!R.current||!_.current)return;const e={placement:n,strategy:r,middleware:m};O.current&&(e.platform=O.current),Mt(R.current,_.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};A.current&&!Dt(M.current,t)&&(M.current=t,i.flushSync(()=>{p(t)}))})},[m,n,r,O,P]);St(()=>{!1===d&&M.current.isPositioned&&(M.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const A=e.useRef(!1);St(()=>(A.current=!0,()=>{A.current=!1}),[]),St(()=>{if(E&&(R.current=E),C&&(_.current=C),E&&C){if(D.current)return D.current(E,C,T);T()}},[E,C,T,D,S]);const k=e.useMemo(()=>({reference:R,floating:_,setReference:b,setFloating:x}),[b,x]),N=e.useMemo(()=>({reference:E,floating:C}),[E,C]),L=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=Pt(N.floating,f.x),n=Pt(N.floating,f.y);return u?{...e,transform:"translate("+t+"px, "+n+"px)",...Ot(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,u,N.floating,f.x,f.y]);return e.useMemo(()=>({...f,update:T,refs:k,elements:N,floatingStyles:L}),[f,T,k,N,L])}({strategy:"fixed",placement:A,whileElementsMounted:(...e)=>yt(...e,{animationFrame:"always"===y}),elements:{reference:x.anchor},middleware:[kt({mainAxis:c+T,alignmentAxis:u}),d&&Nt({mainAxis:!0,crossAxis:!1,limiter:"partial"===g?Lt():void 0,...I}),d&&It({...I}),Ft({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),M&&Kt({element:M,padding:l}),on({arrowWidth:P,arrowHeight:T}),v&&Wt({strategy:"referenceHidden",...I})]}),[$,z]=an(K),U=S(w);h(()=>{B&&U?.()},[B,U]);const j=H.arrow?.x,V=H.arrow?.y,G=0!==H.arrow?.centerOffset,[X,Y]=e.useState();return h(()=>{C&&Y(window.getComputedStyle(C).zIndex)},[C]),o("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:B?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o(Zt,{scope:r,placedSide:$,onArrowChange:D,arrowX:j,arrowY:V,shouldHideArrow:G,children:o(E.div,{"data-side":$,"data-align":z,...b,ref:_,style:{...b.style,animation:B?void 0:"none"}})})})});Jt.displayName=qt;var en="PopperArrow",tn={top:"bottom",right:"left",bottom:"top",left:"right"},nn=e.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,i=Qt(en,n),a=tn[i.placedSide];return o("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o(Ht,{...r,ref:t,style:{...r.style,display:"block"}})})});function rn(e){return null!==e}nn.displayName=en;var on=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[s,u]=an(n),l={start:"0%",center:"50%",end:"100%"}[u],d=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+c/2;let p="",m="";return"bottom"===s?(p=i?l:`${d}px`,m=-c+"px"):"top"===s?(p=i?l:`${d}px`,m=`${r.floating.height+c}px`):"right"===s?(p=-c+"px",m=i?l:`${f}px`):"left"===s&&(p=`${r.floating.width+c}px`,m=i?l:`${f}px`),{data:{x:p,y:m}}}});function an(e){const[t,n="center"]=e.split("-");return[t,n]}var cn=Gt,sn=Yt,un=Jt,ln=nn,dn=e.forwardRef((t,n)=>{const{container:r,...i}=t,[c,s]=e.useState(!1);h(()=>s(!0),[]);const u=r||c&&globalThis?.document?.body;return u?a.createPortal(o(E.div,{...i,ref:n}),u):null});dn.displayName="Portal";var fn=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),c=t?"mounted":"unmounted",[s,u]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=pn(o.current);a.current="mounted"===s?e:"none"},[s]),h(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=pn(e);if(t)u("MOUNT");else if("none"===o||"none"===e?.display)u("UNMOUNT");else{u(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,u]),h(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=pn(o.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(u("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},c=e=>{e.target===n&&(a.current=pn(o.current))};return n.addEventListener("animationstart",c),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",c),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=f(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function pn(e){return e?.animationName||"none"}fn.displayName="Presence";var mn="rovingFocusGroup.onEntryFocus",hn={bubbles:!1,cancelable:!0},gn="RovingFocusGroup",[vn,yn,wn]=R(gn),[bn,xn]=p(gn,[wn]),[En,Cn]=bn(gn),Rn=e.forwardRef((e,t)=>o(vn.Provider,{scope:e.__scopeRovingFocusGroup,children:o(vn.Slot,{scope:e.__scopeRovingFocusGroup,children:o(_n,{...e,ref:t})})}));Rn.displayName=gn;var _n=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:a=!1,dir:c,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:p,preventScrollOnEntryFocus:m=!1,...h}=t,g=e.useRef(null),y=f(n,g),w=M(c),[b,x]=v({prop:s,defaultProp:l??null,onChange:d,caller:gn}),[C,R]=e.useState(!1),_=S(p),D=yn(r),O=e.useRef(!1),[P,T]=e.useState(0);return e.useEffect(()=>{const e=g.current;if(e)return e.addEventListener(mn,_),()=>e.removeEventListener(mn,_)},[_]),o(En,{scope:r,orientation:i,dir:w,loop:a,currentTabStopId:b,onItemFocus:e.useCallback(e=>x(e),[x]),onItemShiftTab:e.useCallback(()=>R(!0),[]),onFocusableItemAdd:e.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>T(e=>e-1),[]),children:o(E.div,{tabIndex:C||0===P?-1:0,"data-orientation":i,...h,ref:y,style:{outline:"none",...t.style},onMouseDown:u(t.onMouseDown,()=>{O.current=!0}),onFocus:u(t.onFocus,e=>{const t=!O.current;if(e.target===e.currentTarget&&t&&!C){const t=new CustomEvent(mn,hn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=D().filter(e=>e.focusable);On([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),m)}}O.current=!1}),onBlur:u(t.onBlur,()=>R(!1))})})}),Mn="RovingFocusGroupItem",Sn=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:a=!1,tabStopId:c,children:s,...l}=t,d=q(),f=c||d,p=Cn(Mn,r),m=p.currentTabStopId===f,h=yn(r),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:y}=p;return e.useEffect(()=>{if(i)return g(),()=>v()},[i,g,v]),o(vn.ItemSlot,{scope:r,id:f,focusable:i,active:a,children:o(E.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:n,onMouseDown:u(t.onMouseDown,e=>{i?p.onItemFocus(f):e.preventDefault()}),onFocus:u(t.onFocus,()=>p.onItemFocus(f)),onKeyDown:u(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Dn[r]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=p.loop?(r=i+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>On(o))}var n,r}),children:"function"==typeof s?s({isCurrentTabStop:m,hasTabStop:null!=y}):s})})});Sn.displayName=Mn;var Dn={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function On(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var Pn=Rn,Tn=Sn,An=new WeakMap,kn=new WeakMap,Nn={},Ln=0,In=function(e){return e&&(e.host||In(e.parentNode))},Fn=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=In(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Nn[n]||(Nn[n]=new WeakMap);var i=Nn[n],a=[],c=new Set,s=new Set(o),u=function(e){e&&!c.has(e)&&(c.add(e),u(e.parentNode))};o.forEach(u);var l=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(c.has(e))l(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(An.get(e)||0)+1,u=(i.get(e)||0)+1;An.set(e,s),i.set(e,u),a.push(e),1===s&&o&&kn.set(e,!0),1===u&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return l(t),c.clear(),Ln++,function(){a.forEach(function(e){var t=An.get(e)-1,o=i.get(e)-1;An.set(e,t),i.set(e,o),t||(kn.has(e)||e.removeAttribute(r),kn.delete(e)),o||e.removeAttribute(n)}),--Ln||(An=new WeakMap,An=new WeakMap,kn=new WeakMap,Nn={})}},Wn=function(e,t,n){void 0===n&&(n="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], script"))),Fn(r,o,n,"aria-hidden")):function(){return null}},Kn=function(){return Kn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Kn.apply(this,arguments)};function Bn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var Hn="right-scroll-bar-position",$n="width-before-scroll-bar";function zn(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Un="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,jn=new WeakMap;function Vn(e,t){var n,o,i,a=(n=null,o=function(t){return e.forEach(function(e){return zn(e,t)})},(i=r(function(){return{value:n,callback:o,facade:{get current(){return i.value},set current(e){var t=i.value;t!==e&&(i.value=e,i.callback(e,t))}}}})[0]).callback=o,i.facade);return Un(function(){var t=jn.get(a);if(t){var n=new Set(t),r=new Set(e),o=a.current;n.forEach(function(e){r.has(e)||zn(e,null)}),r.forEach(function(e){n.has(e)||zn(e,o)})}jn.set(a,e)},[e]),a}function Gn(e){return e}var Xn=function(t){var n=t.sideCar,r=Bn(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,Kn({},r))};Xn.isSideCarExport=!0;var Yn=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Gn);var n=[],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 n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=Kn({async:!0,ssr:!1},e),t}(),qn=function(){},Zn=e.forwardRef(function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:qn,onWheelCapture:qn,onTouchMoveCapture:qn}),i=o[0],a=o[1],c=t.forwardProps,s=t.children,u=t.className,l=t.removeScrollBar,d=t.enabled,f=t.shards,p=t.sideCar,m=t.noRelative,h=t.noIsolation,g=t.inert,v=t.allowPinchZoom,y=t.as,w=void 0===y?"div":y,b=t.gapMode,x=Bn(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,C=Vn([r,n]),R=Kn(Kn({},x),i);return e.createElement(e.Fragment,null,d&&e.createElement(E,{sideCar:Yn,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!v,lockRef:r,gapMode:b}),c?e.cloneElement(e.Children.only(s),Kn(Kn({},R),{ref:C})):e.createElement(w,Kn({},R,{className:u,ref:C}),s))});Zn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Zn.classNames={fullWidth:$n,zeroRight:Hn};function Qn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Jn=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=Qn())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},er=function(){var t,n=(t=Jn(),function(n,r){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},tr={left:0,top:0,right:0,gap:0},nr=function(e){return parseInt(e||"",10)||0},rr=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return tr;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[nr(n),nr(r),nr(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},or=er(),ir="data-scroll-locked",ar=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,c=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(c,"px ").concat(r,";\n }\n body[").concat(ir,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(c,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Hn," {\n right: ").concat(c,"px ").concat(r,";\n }\n \n .").concat($n," {\n margin-right: ").concat(c,"px ").concat(r,";\n }\n \n .").concat(Hn," .").concat(Hn," {\n right: 0 ").concat(r,";\n }\n \n .").concat($n," .").concat($n," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ir,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(c,"px;\n }\n")},cr=function(){var e=parseInt(document.body.getAttribute(ir)||"0",10);return isFinite(e)?e:0},sr=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,i=void 0===o?"margin":o;e.useEffect(function(){return document.body.setAttribute(ir,(cr()+1).toString()),function(){var e=cr()-1;e<=0?document.body.removeAttribute(ir):document.body.setAttribute(ir,e.toString())}},[]);var a=e.useMemo(function(){return rr(i)},[i]);return e.createElement(or,{styles:ar(a,!n,i,r?"":"!important")})},ur=!1;if("undefined"!=typeof window)try{var lr=Object.defineProperty({},"passive",{get:function(){return ur=!0,!0}});window.addEventListener("test",lr,lr),window.removeEventListener("test",lr,lr)}catch(e){ur=!1}var dr=!!ur&&{passive:!1},fr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},pr=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),mr(e,r)){var o=hr(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},mr=function(e,t){return"v"===e?function(e){return fr(e,"overflowY")}(t):function(e){return fr(e,"overflowX")}(t)},hr=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},gr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vr=function(e){return[e.deltaX,e.deltaY]},yr=function(e){return e&&"current"in e?e.current:e},wr=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},br=0,xr=[];function Er(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Cr,Rr=(Cr=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),i=e.useState(br++)[0],a=e.useState(er)[0],c=e.useRef(t);e.useEffect(function(){c.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var e=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map(yr),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!c.current.allowPinchZoom;var n,i=gr(e),a=r.current,s="deltaX"in e?e.deltaX:a[0]-i[0],u="deltaY"in e?e.deltaY:a[1]-i[1],l=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===l.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===l||p.contains(l)))return!1;var m=pr(d,l);if(!m)return!0;if(m?n=d:(n="v"===d?"h":"v",m=pr(d,l)),!m)return!1;if(!o.current&&"changedTouches"in e&&(s||u)&&(o.current=n),!n)return!0;var h=o.current||n;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,c=t.contains(a),s=!1,u=i>0,l=0,d=0;do{if(!a)break;var f=hr(e,a),p=f[0],m=f[1]-f[2]-o*p;(p||m)&&mr(e,a)&&(l+=m,d+=p);var h=a.parentNode;a=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(l)<1||!u&&Math.abs(d)<1)&&(s=!0),s}(h,t,e,"h"===h?s:u)},[]),u=e.useCallback(function(e){var t=e;if(xr.length&&xr[xr.length-1]===a){var r="deltaY"in t?vr(t):gr(t),o=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var i=(c.current.shards||[]).map(yr).filter(Boolean).filter(function(e){return e.contains(t.target)});(i.length>0?s(t,i[0]):!c.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),l=e.useCallback(function(e,t,r,o){var i={name:e,delta:t,target:r,should:o,shadowParent:Er(r)};n.current.push(i),setTimeout(function(){n.current=n.current.filter(function(e){return e!==i})},1)},[]),d=e.useCallback(function(e){r.current=gr(e),o.current=void 0},[]),f=e.useCallback(function(e){l(e.type,vr(e),e.target,s(e,t.lockRef.current))},[]),p=e.useCallback(function(e){l(e.type,gr(e),e.target,s(e,t.lockRef.current))},[]);e.useEffect(function(){return xr.push(a),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,dr),document.addEventListener("touchmove",u,dr),document.addEventListener("touchstart",d,dr),function(){xr=xr.filter(function(e){return e!==a}),document.removeEventListener("wheel",u,dr),document.removeEventListener("touchmove",u,dr),document.removeEventListener("touchstart",d,dr)}},[]);var m=t.removeScrollBar,h=t.inert;return e.createElement(e.Fragment,null,h?e.createElement(a,{styles:wr(i)}):null,m?e.createElement(sr,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},Yn.useMedium(Cr),Xn),_r=e.forwardRef(function(t,n){return e.createElement(Zn,Kn({},t,{ref:n,sideCar:Rr}))});_r.classNames=Zn.classNames;var Mr=["Enter"," "],Sr=["ArrowUp","PageDown","End"],Dr=["ArrowDown","PageUp","Home",...Sr],Or={ltr:[...Mr,"ArrowRight"],rtl:[...Mr,"ArrowLeft"]},Pr={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tr="Menu",[Ar,kr,Nr]=R(Tr),[Lr,Ir]=p(Tr,[Nr,Ut,xn]),Fr=Ut(),Wr=xn(),[Kr,Br]=Lr(Tr),[Hr,$r]=Lr(Tr),zr=t=>{const{__scopeMenu:n,open:r=!1,children:i,dir:a,onOpenChange:c,modal:s=!0}=t,u=Fr(n),[l,d]=e.useState(null),f=e.useRef(!1),p=S(c),m=M(a);return e.useEffect(()=>{const e=()=>{f.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),o(cn,{...u,children:o(Kr,{scope:n,open:r,onOpenChange:p,content:l,onContentChange:d,children:o(Hr,{scope:n,onClose:e.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:s,children:i})})})};zr.displayName=Tr;var Ur=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Fr(n);return o(sn,{...i,...r,ref:t})});Ur.displayName="MenuAnchor";var jr="MenuPortal",[Vr,Gr]=Lr(jr,{forceMount:void 0}),Xr=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Br(jr,t);return o(Vr,{scope:t,forceMount:n,children:o(fn,{present:n||a.open,children:o(dn,{asChild:!0,container:i,children:r})})})};Xr.displayName=jr;var Yr="MenuContent",[qr,Zr]=Lr(Yr),Qr=e.forwardRef((e,t)=>{const n=Gr(Yr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Br(Yr,e.__scopeMenu),c=$r(Yr,e.__scopeMenu);return o(Ar.Provider,{scope:e.__scopeMenu,children:o(fn,{present:r||a.open,children:o(Ar.Slot,{scope:e.__scopeMenu,children:c.modal?o(Jr,{...i,ref:t}):o(eo,{...i,ref:t})})})})}),Jr=e.forwardRef((t,n)=>{const r=Br(Yr,t.__scopeMenu),i=e.useRef(null),a=f(n,i);return e.useEffect(()=>{const e=i.current;if(e)return Wn(e)},[]),o(no,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:u(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),eo=e.forwardRef((e,t)=>{const n=Br(Yr,e.__scopeMenu);return o(no,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),to=y("MenuContent.ScrollLock"),no=e.forwardRef((t,n)=>{const{__scopeMenu:r,loop:i=!1,trapFocus:a,onOpenAutoFocus:c,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:d,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:v,disableOutsideScroll:y,...w}=t,b=Br(Yr,r),x=$r(Yr,r),E=Fr(r),C=Wr(r),R=kr(r),[_,M]=e.useState(null),S=e.useRef(null),D=f(n,S,b.onContentChange),O=e.useRef(0),P=e.useRef(""),T=e.useRef(0),A=e.useRef(null),N=e.useRef("right"),L=e.useRef(0),W=y?_r:e.Fragment,K=y?{as:to,allowPinchZoom:!0}:void 0,B=e=>{const t=P.current+e,n=R().filter(e=>!e.disabled),r=document.activeElement,o=n.find(e=>e.ref.current===r)?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(c=e,s=Math.max(i,0),c.map((e,t)=>c[(s+t)%c.length]));var c,s;1===o.length&&(a=a.filter(e=>e!==n));const u=a.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}(n.map(e=>e.textValue),t,o),a=n.find(e=>e.textValue===i)?.ref.current;!function e(t){P.current=t,window.clearTimeout(O.current),""!==t&&(O.current=window.setTimeout(()=>e(""),1e3))}(t),a&&setTimeout(()=>a.focus())};e.useEffect(()=>()=>window.clearTimeout(O.current),[]),e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??F()),document.body.insertAdjacentElement("beforeend",e[1]??F()),I++,()=>{1===I&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),I--}},[]);const $=e.useCallback(e=>N.current===A.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e],c=t[i],s=a.x,u=a.y,l=c.x,d=c.y;u>r!=d>r&&n<(l-s)*(r-u)/(d-u)+s&&(o=!o)}return o}(n,t)}(e,A.current?.area),[]);return o(qr,{scope:r,searchRef:P,onItemEnter:e.useCallback(e=>{$(e)&&e.preventDefault()},[$]),onItemLeave:e.useCallback(e=>{$(e)||(S.current?.focus(),M(null))},[$]),onTriggerLeave:e.useCallback(e=>{$(e)&&e.preventDefault()},[$]),pointerGraceTimerRef:T,onPointerGraceIntentChange:e.useCallback(e=>{A.current=e},[]),children:o(W,{...K,children:o(H,{asChild:!0,trapped:a,onMountAutoFocus:u(c,e=>{e.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:o(k,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:v,children:o(Pn,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:i,currentTabStopId:_,onCurrentTabStopIdChange:M,onEntryFocus:u(d,e=>{x.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:o(un,{role:"menu","aria-orientation":"vertical","data-state":Oo(b.open),"data-radix-menu-content":"",dir:x.dir,...E,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:u(w.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&B(e.key));const o=S.current;if(e.target!==o)return;if(!Dr.includes(e.key))return;e.preventDefault();const i=R().filter(e=>!e.disabled).map(e=>e.ref.current);Sr.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)}),onBlur:u(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),P.current="")}),onPointerMove:u(t.onPointerMove,Ao(e=>{const t=e.target,n=L.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>L.current?"right":"left";N.current=t,L.current=e.clientX}}))})})})})})})});Qr.displayName=Yr;var ro=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o(E.div,{role:"group",...r,ref:t})});ro.displayName="MenuGroup";var oo=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o(E.div,{...r,ref:t})});oo.displayName="MenuLabel";var io="MenuItem",ao="menu.itemSelect",co=e.forwardRef((t,n)=>{const{disabled:r=!1,onSelect:i,...a}=t,c=e.useRef(null),s=$r(io,t.__scopeMenu),l=Zr(io,t.__scopeMenu),d=f(n,c),p=e.useRef(!1);return o(so,{...a,ref:d,disabled:r,onClick:u(t.onClick,()=>{const e=c.current;if(!r&&e){const t=new CustomEvent(ao,{bubbles:!0,cancelable:!0});e.addEventListener(ao,e=>i?.(e),{once:!0}),C(e,t),t.defaultPrevented?p.current=!1:s.onClose()}}),onPointerDown:e=>{t.onPointerDown?.(e),p.current=!0},onPointerUp:u(t.onPointerUp,e=>{p.current||e.currentTarget?.click()}),onKeyDown:u(t.onKeyDown,e=>{const t=""!==l.searchRef.current;r||t&&" "===e.key||Mr.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});co.displayName=io;var so=e.forwardRef((t,n)=>{const{__scopeMenu:r,disabled:i=!1,textValue:a,...c}=t,s=Zr(io,r),l=Wr(r),d=e.useRef(null),p=f(n,d),[m,h]=e.useState(!1),[g,v]=e.useState("");return e.useEffect(()=>{const e=d.current;e&&v((e.textContent??"").trim())},[c.children]),o(Ar.ItemSlot,{scope:r,disabled:i,textValue:a??g,children:o(Tn,{asChild:!0,...l,focusable:!i,children:o(E.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...c,ref:p,onPointerMove:u(t.onPointerMove,Ao(e=>{if(i)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:u(t.onPointerLeave,Ao(e=>s.onItemLeave(e))),onFocus:u(t.onFocus,()=>h(!0)),onBlur:u(t.onBlur,()=>h(!1))})})})}),uo=e.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return o(yo,{scope:e.__scopeMenu,checked:n,children:o(co,{role:"menuitemcheckbox","aria-checked":Po(n)?"mixed":n,...i,ref:t,"data-state":To(n),onSelect:u(i.onSelect,()=>r?.(!!Po(n)||!n),{checkForDefaultPrevented:!1})})})});uo.displayName="MenuCheckboxItem";var lo="MenuRadioGroup",[fo,po]=Lr(lo,{value:void 0,onValueChange:()=>{}}),mo=e.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=S(r);return o(fo,{scope:e.__scopeMenu,value:n,onValueChange:a,children:o(ro,{...i,ref:t})})});mo.displayName=lo;var ho="MenuRadioItem",go=e.forwardRef((e,t)=>{const{value:n,...r}=e,i=po(ho,e.__scopeMenu),a=n===i.value;return o(yo,{scope:e.__scopeMenu,checked:a,children:o(co,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":To(a),onSelect:u(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});go.displayName=ho;var vo="MenuItemIndicator",[yo,wo]=Lr(vo,{checked:!1}),bo=e.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=wo(vo,n);return o(fn,{present:r||Po(a.checked)||!0===a.checked,children:o(E.span,{...i,ref:t,"data-state":To(a.checked)})})});bo.displayName=vo;var xo=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o(E.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});xo.displayName="MenuSeparator";var Eo=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Fr(n);return o(ln,{...i,...r,ref:t})});Eo.displayName="MenuArrow";var[Co,Ro]=Lr("MenuSub"),_o="MenuSubTrigger",Mo=e.forwardRef((t,n)=>{const r=Br(_o,t.__scopeMenu),i=$r(_o,t.__scopeMenu),a=Ro(_o,t.__scopeMenu),c=Zr(_o,t.__scopeMenu),s=e.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:f}=c,p={__scopeMenu:t.__scopeMenu},m=e.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return e.useEffect(()=>m,[m]),e.useEffect(()=>{const e=l.current;return()=>{window.clearTimeout(e),f(null)}},[l,f]),o(Ur,{asChild:!0,...p,children:o(so,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Oo(r.open),...t,ref:d(n,a.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:u(t.onPointerMove,Ao(e=>{c.onItemEnter(e),e.defaultPrevented||t.disabled||r.open||s.current||(c.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{r.onOpenChange(!0),m()},100))})),onPointerLeave:u(t.onPointerLeave,Ao(e=>{m();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,i=o?-5:5,a=t[o?"left":"right"],s=t[o?"right":"left"];c.onPointerGraceIntentChange({area:[{x:e.clientX+i,y:e.clientY},{x:a,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:a,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(e),e.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:u(t.onKeyDown,e=>{const n=""!==c.searchRef.current;t.disabled||n&&" "===e.key||Or[i.dir].includes(e.key)&&(r.onOpenChange(!0),r.content?.focus(),e.preventDefault())})})})});Mo.displayName=_o;var So="MenuSubContent",Do=e.forwardRef((t,n)=>{const r=Gr(Yr,t.__scopeMenu),{forceMount:i=r.forceMount,...a}=t,c=Br(Yr,t.__scopeMenu),s=$r(Yr,t.__scopeMenu),l=Ro(So,t.__scopeMenu),d=e.useRef(null),p=f(n,d);return o(Ar.Provider,{scope:t.__scopeMenu,children:o(fn,{present:i||c.open,children:o(Ar.Slot,{scope:t.__scopeMenu,children:o(no,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:p,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:u(t.onFocusOutside,e=>{e.target!==l.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:u(t.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:u(t.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=Pr[s.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});function Oo(e){return e?"open":"closed"}function Po(e){return"indeterminate"===e}function To(e){return Po(e)?"indeterminate":e?"checked":"unchecked"}function Ao(e){return t=>"mouse"===t.pointerType?e(t):void 0}Do.displayName=So;var ko=zr,No=Ur,Lo=Xr,Io=Qr,Fo=ro,Wo=oo,Ko=co,Bo=uo,Ho=mo,$o=go,zo=bo,Uo=xo,jo=Eo,Vo=Mo,Go=Do,Xo="DropdownMenu",[Yo,qo]=p(Xo,[Ir]),Zo=Ir(),[Qo,Jo]=Yo(Xo),ei=t=>{const{__scopeDropdownMenu:n,children:r,dir:i,open:a,defaultOpen:c,onOpenChange:s,modal:u=!0}=t,l=Zo(n),d=e.useRef(null),[f,p]=v({prop:a,defaultProp:c??!1,onChange:s,caller:Xo});return o(Qo,{scope:n,triggerId:q(),triggerRef:d,contentId:q(),open:f,onOpenChange:p,onOpenToggle:e.useCallback(()=>p(e=>!e),[p]),modal:u,children:o(ko,{...l,open:f,onOpenChange:p,dir:i,modal:u,children:r})})};ei.displayName=Xo;var ti="DropdownMenuTrigger",ni=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Jo(ti,n),c=Zo(n);return o(No,{asChild:!0,...c,children:o(E.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:d(t,a.triggerRef),onPointerDown:u(e.onPointerDown,e=>{r||0!==e.button||!1!==e.ctrlKey||(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:u(e.onKeyDown,e=>{r||(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});ni.displayName=ti;var ri=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Zo(t);return o(Lo,{...r,...n})};ri.displayName="DropdownMenuPortal";var oi="DropdownMenuContent",ii=e.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...i}=t,a=Jo(oi,r),c=Zo(r),s=e.useRef(!1);return o(Io,{id:a.contentId,"aria-labelledby":a.triggerId,...c,...i,ref:n,onCloseAutoFocus:u(t.onCloseAutoFocus,e=>{s.current||a.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:u(t.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;a.modal&&!r||(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ii.displayName=oi;e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o(Fo,{...i,...r,ref:t})}).displayName="DropdownMenuGroup";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o(Wo,{...i,...r,ref:t})}).displayName="DropdownMenuLabel";var ai=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o(Ko,{...i,...r,ref:t})});ai.displayName="DropdownMenuItem";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o(Bo,{...i,...r,ref:t})}).displayName="DropdownMenuCheckboxItem";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o(Ho,{...i,...r,ref:t})}).displayName="DropdownMenuRadioGroup";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o($o,{...i,...r,ref:t})}).displayName="DropdownMenuRadioItem";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o(zo,{...i,...r,ref:t})}).displayName="DropdownMenuItemIndicator";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o(Uo,{...i,...r,ref:t})}).displayName="DropdownMenuSeparator";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o(jo,{...i,...r,ref:t})}).displayName="DropdownMenuArrow";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o(Vo,{...i,...r,ref:t})}).displayName="DropdownMenuSubTrigger";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zo(n);return o(Go,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";var ci=ei,si=ni,ui=ri,li=ii,di=ai;var fi={trigger:"OverflowMenu-module_trigger__imdPK",menu:"OverflowMenu-module_menu__n8uKD",dotsWrapper:"OverflowMenu-module_dotsWrapper__CHO9Q",dot:"OverflowMenu-module_dot__g5Rgi"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".OverflowMenu-module_menuWrapper__psD7a{display:inline-block;position:relative;z-index:0}.OverflowMenu-module_trigger__imdPK{align-items:center;background:transparent;border:none;border-radius:50%;color:#024b59;cursor:pointer;display:flex;font-size:1.8rem;height:3rem;justify-content:center;transition:color .2s ease,background-color .2s ease;width:3rem}.OverflowMenu-module_trigger__imdPK:focus,.OverflowMenu-module_trigger__imdPK:hover{background-color:rgba(2,75,89,.05);color:#016a80;outline:none}.OverflowMenu-module_menu__n8uKD{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:hsla(0,0%,100%,.75);border:1px solid #016a80;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.12);color:#024b59;display:flex;flex-direction:column;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-weight:500;gap:.35rem;min-width:180px;padding:.5rem .25rem;width:max-content;z-index:9999}.OverflowMenu-module_menu__n8uKD button{background:transparent;border:none;border-bottom:1px solid rgba(2,75,89,.1);border-radius:8px;color:#024b59;cursor:pointer;font-size:1rem;padding:.6rem 1rem;text-align:left;transition:background .25s ease,transform .12s ease;user-select:none}.OverflowMenu-module_menu__n8uKD button:last-child{border-bottom:none}.OverflowMenu-module_menu__n8uKD button:focus,.OverflowMenu-module_menu__n8uKD button:hover{background:rgba(2,75,89,.05);outline:none;transform:scale(1.03)}.OverflowMenu-module_menu__n8uKD button:active{background:rgba(2,75,89,.1);transform:scale(.98)}.OverflowMenu-module_dotsWrapper__CHO9Q{align-items:center;display:flex;flex-direction:column;gap:3px;justify-content:center}.OverflowMenu-module_dot__g5Rgi{background-color:currentColor;border-radius:50%;display:block;height:5px;width:5px}");const pi=()=>{const e={initial:{y:0,scale:1},hover:{y:-4,scale:1.2,transition:{type:"spring",stiffness:500,damping:20}},rest:{y:0,scale:1,transition:{type:"spring",stiffness:500,damping:20}}};return t.createElement(s.div,{className:fi.dotsWrapper,initial:"rest",whileHover:"hover",animate:"rest"},[0,1,2].map(n=>t.createElement(s.span,{key:n,className:fi.dot,variants:e,custom:n,transition:{delay:.05*n}})))},mi=({items:e,icon:n,className:r="",portal:o=null})=>{const[i,a]=t.useState(!1),u={hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},l=t.createElement(c,null,i&&t.createElement(ui,{container:o,forceMount:!0},t.createElement(li,{asChild:!0,className:fi.menu,sideOffset:5,align:"end"},t.createElement(s.div,{variants:{hidden:{opacity:0,scale:.95,transition:{duration:.1}},visible:{opacity:1,scale:1,transition:{duration:.2,staggerChildren:.05}}},initial:"hidden",animate:"visible",exit:"hidden"},e.map((e,n)=>t.createElement(di,{key:n,asChild:!0,className:fi.menuItem,onSelect:()=>{var t;null===(t=e.onClick)||void 0===t||t.call(e)}},t.createElement(s.button,{variants:u},e.content)))))));return t.createElement(ci,{open:i,onOpenChange:a},t.createElement(si,{asChild:!0,className:`${fi.trigger} ${r}`},t.createElement(s.button,{"aria-haspopup":"true","aria-expanded":i,whileHover:{scale:1.1,y:-2,color:"#016a80",backgroundColor:"rgba(2, 75, 89, 0.05)",transition:{type:"spring",stiffness:400,damping:15}}},n||t.createElement(pi,null))),l)};export{mi as default};
|
|
2
2
|
//# sourceMappingURL=index.es.js.map
|