"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2411],{55395:function(t,e,n){n.d(e,{Q:function(){return r}});var o=n(10451),i=n(61142);const r=(0,i.Bi)((t=>{let{state:e,...n}=t;return n={...n,ref:(0,o.cR)(e.anchorRef,n.ref)},n}));(0,i.LM)((t=>{const e=r(t);return(0,i.az)("div",e)}))},21940:function(t,e,n){n.d(e,{v:function(){return mt}});var o=n(67294);const i=Math.min,r=Math.max,l=Math.round,c=Math.floor,s=t=>({x:t,y:t}),a={left:"right",right:"left",bottom:"top",top:"bottom"},f={start:"end",end:"start"};function u(t,e,n){return r(t,i(e,n))}function d(t,e){return"function"===typeof t?t(e):t}function p(t){return t.split("-")[0]}function m(t){return t.split("-")[1]}function h(t){return"x"===t?"y":"x"}function g(t){return"y"===t?"height":"width"}function y(t){return["top","bottom"].includes(p(t))?"y":"x"}function w(t){return h(y(t))}function x(t){return t.replace(/start|end/g,(t=>f[t]))}function v(t){return t.replace(/left|right|bottom|top/g,(t=>a[t]))}function b(t){return"number"!==typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function R(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function E(t,e,n){let{reference:o,floating:i}=t;const r=y(e),l=w(e),c=g(l),s=p(e),a="y"===r,f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,d=o[c]/2-i[c]/2;let h;switch(s){case"top":h={x:f,y:o.y-i.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:u};break;case"left":h={x:o.x-i.width,y:u};break;default:h={x:o.x,y:o.y}}switch(m(e)){case"start":h[l]-=d*(n&&a?-1:1);break;case"end":h[l]+=d*(n&&a?-1:1)}return h}async function L(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:c,strategy:s}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=d(e,t),h=b(m),g=c[p?"floating"===u?"reference":"floating":u],y=R(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:s})),w="floating"===u?{...l.floating,x:o,y:i}:l.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(c.floating)),v=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},E=R(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:x,strategy:s}):w);return{top:(y.top-E.top+h.top)/v.y,bottom:(E.bottom-y.bottom+h.bottom)/v.y,left:(y.left-E.left+h.left)/v.x,right:(E.right-y.right+h.right)/v.x}}function T(t){return O(t)?(t.nodeName||"").toLowerCase():"#document"}function A(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function P(t){var e;return null==(e=(O(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function O(t){return t instanceof Node||t instanceof A(t).Node}function C(t){return t instanceof Element||t instanceof A(t).Element}function D(t){return t instanceof HTMLElement||t instanceof A(t).HTMLElement}function k(t){return"undefined"!==typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof A(t).ShadowRoot)}function S(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=B(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function W(t){return["table","td","th"].includes(T(t))}function M(t){const e=F(),n=B(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function F(){return!("undefined"===typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function H(t){return["html","body","#document"].includes(T(t))}function B(t){return A(t).getComputedStyle(t)}function V(t){return C(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function z(t){if("html"===T(t))return t;const e=t.assignedSlot||t.parentNode||k(t)&&t.host||P(t);return k(e)?e.host:e}function N(t){const e=z(t);return H(e)?t.ownerDocument?t.ownerDocument.body:t.body:D(e)&&S(e)?e:N(e)}function _(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=N(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=A(i);return r?e.concat(l,l.visualViewport||[],S(i)?i:[],l.frameElement&&n?_(l.frameElement):[]):e.concat(i,_(i,[],n))}function j(t){const e=B(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=D(t),r=i?t.offsetWidth:n,c=i?t.offsetHeight:o,s=l(n)!==r||l(o)!==c;return s&&(n=r,o=c),{width:n,height:o,$:s}}function I(t){return C(t)?t:t.contextElement}function X(t){const e=I(t);if(!D(e))return s(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=j(e);let c=(r?l(n.width):n.width)/o,a=(r?l(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),a&&Number.isFinite(a)||(a=1),{x:c,y:a}}const $=s(0);function q(t){const e=A(t);return F()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:$}function Y(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=I(t);let l=s(1);e&&(o?C(o)&&(l=X(o)):l=X(t));const c=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==A(t))&&e}(r,n,o)?q(r):s(0);let a=(i.left+c.x)/l.x,f=(i.top+c.y)/l.y,u=i.width/l.x,d=i.height/l.y;if(r){const t=A(r),e=o&&C(o)?A(o):o;let n=t.frameElement;for(;n&&o&&e!==t;){const t=X(n),e=n.getBoundingClientRect(),o=B(n),i=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,f*=t.y,u*=t.x,d*=t.y,a+=i,f+=r,n=A(n).frameElement}}return R({width:u,height:d,x:a,y:f})}function G(t){return Y(P(t)).left+V(t).scrollLeft}function J(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=A(t),o=P(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,c=0,s=0;if(i){r=i.width,l=i.height;const t=F();(!t||t&&"fixed"===e)&&(c=i.offsetLeft,s=i.offsetTop)}return{width:r,height:l,x:c,y:s}}(t,n);else if("document"===e)o=function(t){const e=P(t),n=V(t),o=t.ownerDocument.body,i=r(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=r(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+G(t);const s=-n.scrollTop;return"rtl"===B(o).direction&&(c+=r(e.clientWidth,o.clientWidth)-i),{width:i,height:l,x:c,y:s}}(P(t));else if(C(e))o=function(t,e){const n=Y(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=D(t)?X(t):s(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=q(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return R(o)}function Q(t,e){const n=z(t);return!(n===e||!C(n)||H(n))&&("fixed"===B(n).position||Q(n,e))}function K(t,e,n){const o=D(e),i=P(e),r="fixed"===n,l=Y(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const a=s(0);if(o||!o&&!r)if(("body"!==T(e)||S(i))&&(c=V(e)),o){const t=Y(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=G(i));return{x:l.left+c.scrollLeft-a.x,y:l.top+c.scrollTop-a.y,width:l.width,height:l.height}}function U(t,e){return D(t)&&"fixed"!==B(t).position?e?e(t):t.offsetParent:null}function Z(t,e){const n=A(t);if(!D(t))return n;let o=U(t,e);for(;o&&W(o)&&"static"===B(o).position;)o=U(o,e);return o&&("html"===T(o)||"body"===T(o)&&"static"===B(o).position&&!M(o))?n:o||function(t){let e=z(t);for(;D(e)&&!H(e);){if(M(e))return e;e=z(e)}return null}(t)||n}const tt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=D(n),r=P(n);if(n===r)return e;let l={scrollLeft:0,scrollTop:0},c=s(1);const a=s(0);if((i||!i&&"fixed"!==o)&&(("body"!==T(n)||S(r))&&(l=V(n)),D(n))){const t=Y(n);c=X(n),a.x=t.x+n.clientLeft,a.y=t.y+n.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+a.x,y:e.y*c.y-l.scrollTop*c.y+a.y}},getDocumentElement:P,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:l}=t;const c="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let o=_(t,[],!1).filter((t=>C(t)&&"body"!==T(t))),i=null;const r="fixed"===B(t).position;let l=r?z(t):t;for(;C(l)&&!H(l);){const e=B(l),n=M(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||S(l)&&!n&&Q(t,l))?o=o.filter((t=>t!==l)):i=e,l=z(l)}return e.set(t,o),o}(e,this._c):[].concat(n),s=[...c,o],a=s[0],f=s.reduce(((t,n)=>{const o=J(e,n,l);return t.top=r(o.top,t.top),t.right=i(o.right,t.right),t.bottom=i(o.bottom,t.bottom),t.left=r(o.left,t.left),t}),J(e,a,l));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}},getOffsetParent:Z,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||Z,r=this.getDimensions;return{reference:K(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return j(t)},getScale:X,isElement:C,isRTL:function(t){return"rtl"===B(t).direction}};function et(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:a="function"===typeof ResizeObserver,layoutShift:f="function"===typeof IntersectionObserver,animationFrame:u=!1}=o,d=I(t),p=l||s?[...d?_(d):[],..._(e)]:[];p.forEach((t=>{l&&t.addEventListener("scroll",n,{passive:!0}),s&&t.addEventListener("resize",n)}));const m=d&&f?function(t,e){let n,o=null;const l=P(t);function s(){clearTimeout(n),o&&o.disconnect(),o=null}return function a(f,u){void 0===f&&(f=!1),void 0===u&&(u=1),s();const{left:d,top:p,width:m,height:h}=t.getBoundingClientRect();if(f||e(),!m||!h)return;const g={rootMargin:-c(p)+"px "+-c(l.clientWidth-(d+m))+"px "+-c(l.clientHeight-(p+h))+"px "+-c(d)+"px",threshold:r(0,i(1,u))||1};let y=!0;function w(t){const e=t[0].intersectionRatio;if(e!==u){if(!y)return a();e?a(!1,e):n=setTimeout((()=>{a(!1,1e-7)}),100)}y=!1}try{o=new IntersectionObserver(w,{...g,root:l.ownerDocument})}catch(x){o=new IntersectionObserver(w,g)}o.observe(t)}(!0),s}(d,n):null;let h,g=-1,y=null;a&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===d&&y&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame((()=>{y&&y.observe(e)}))),n()})),d&&!u&&y.observe(d),y.observe(e));let w=u?Y(t):null;return u&&function e(){const o=Y(t);!w||o.x===w.x&&o.y===w.y&&o.width===w.width&&o.height===w.height||n();w=o,h=requestAnimationFrame(e)}(),n(),()=>{p.forEach((t=>{l&&t.removeEventListener("scroll",n),s&&t.removeEventListener("resize",n)})),m&&m(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(h)}}const nt=(t,e,n)=>{const o=new Map,i={platform:tt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,c=r.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=E(a,o,s),d=o,p={},m=0;for(let h=0;h<c.length;h++){const{name:n,fn:r}=c[h],{x:g,y:y,data:w,reset:x}=await r({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:p,rects:a,platform:l,elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=y?y:u,p={...p,[n]:{...p[n],...w}},x&&m<=50&&(m++,"object"===typeof x&&(x.placement&&(d=x.placement),x.rects&&(a=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):x.rects),({x:f,y:u}=E(a,d,s))),h=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:p}})(t,e,{...i,platform:r})};var ot=n(10451),it=n(73935),rt=n(86676);const lt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:l,platform:c,elements:s,middlewareData:a}=e,{element:f,padding:p=0}=d(t,e)||{};if(null==f)return{};const h=b(p),y={x:n,y:o},x=w(r),v=g(x),R=await c.getDimensions(f),E="y"===x,L=E?"top":"left",T=E?"bottom":"right",A=E?"clientHeight":"clientWidth",P=l.reference[v]+l.reference[x]-y[x]-l.floating[v],O=y[x]-l.reference[x],C=await(null==c.getOffsetParent?void 0:c.getOffsetParent(f));let D=C?C[A]:0;D&&await(null==c.isElement?void 0:c.isElement(C))||(D=s.floating[A]||l.floating[v]);const k=P/2-O/2,S=D/2-R[v]/2-1,W=i(h[L],S),M=i(h[T],S),F=W,H=D-R[v]-M,B=D/2-R[v]/2+k,V=u(F,B,H),z=!a.arrow&&null!=m(r)&&B!=V&&l.reference[v]/2-(B<F?W:M)-R[v]/2<0,N=z?B<F?B-F:B-H:0;return{[x]:y[x]+N,data:{[x]:V,centerOffset:B-V-N,...z&&{alignmentOffset:N}},reset:z}}}),ct=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:c,platform:s,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:R=!0,...E}=d(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const T=p(i),A=p(c)===c,P=await(null==s.isRTL?void 0:s.isRTL(a.floating)),O=h||(A||!R?[v(c)]:function(t){const e=v(t);return[x(t),e,x(e)]}(c));h||"none"===b||O.push(...function(t,e,n,o){const i=m(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:l;default:return[]}}(p(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(x)))),r}(c,R,b,P));const C=[c,...O],D=await L(e,E),k=[];let S=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&k.push(D[T]),u){const t=function(t,e,n){void 0===n&&(n=!1);const o=m(t),i=w(t),r=g(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=v(l)),[l,v(l)]}(i,l,P);k.push(D[t[0]],D[t[1]])}if(S=[...S,{placement:i,overflows:k}],!k.every((t=>t<=0))){var W,M;const t=((null==(W=r.flip)?void 0:W.index)||0)+1,e=C[t];if(e)return{data:{index:t,overflows:S},reset:{placement:e}};let n=null==(M=S.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:M.placement;if(!n)switch(y){case"bestFit":{var F;const t=null==(F=S.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:F[0];t&&(n=t);break}case"initialPlacement":n=c}if(i!==n)return{reset:{placement:n}}}return{}}}},st=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:o}=e,i=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=p(n),c=m(n),s="y"===y(n),a=["left","top"].includes(l)?-1:1,f=r&&s?-1:1,u=d(e,t);let{mainAxis:h,crossAxis:g,alignmentAxis:w}="number"===typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return c&&"number"===typeof w&&(g="end"===c?-1*w:w),s?{x:g*f,y:h*a}:{x:h*a,y:g*f}}(e,t);return{x:n+i.x,y:o+i.y,data:i}}}},at=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:l=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...s}=d(t,e),a={x:n,y:o},f=await L(e,s),m=y(p(i)),g=h(m);let w=a[g],x=a[m];if(r){const t="y"===g?"bottom":"right";w=u(w+f["y"===g?"top":"left"],w,w-f[t])}if(l){const t="y"===m?"bottom":"right";x=u(x+f["y"===m?"top":"left"],x,x-f[t])}const v=c.fn({...e,[g]:w,[m]:x});return{...v,data:{x:v.x-n,y:v.y-o}}}}},ft=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:l,elements:c}=e,{apply:s=(()=>{}),...a}=d(t,e),f=await L(e,a),u=p(n),h=m(n),g="y"===y(n),{width:w,height:x}=o.floating;let v,b;"top"===u||"bottom"===u?(v=u,b=h===(await(null==l.isRTL?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(b=u,v="end"===h?"top":"bottom");const R=x-f[v],E=w-f[b],T=!e.middlewareData.shift;let A=R,P=E;if(g){const t=w-f.left-f.right;P=h||T?i(E,t):t}else{const t=x-f.top-f.bottom;A=h||T?i(R,t):t}if(T&&!h){const t=r(f.left,0),e=r(f.right,0),n=r(f.top,0),o=r(f.bottom,0);g?P=w-2*(0!==t||0!==e?t+e:r(f.left,f.right)):A=x-2*(0!==n||0!==o?n+o:r(f.top,f.bottom))}await s({...e,availableWidth:P,availableHeight:A});const O=await l.getDimensions(c.floating);return w!==O.width||x!==O.height?{reset:{rects:!0}}:{}}}};function ut(t,e,n,o){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===o&&(o=0),"function"===typeof DOMRect)return new DOMRect(t,e,n,o);const i={x:t,y:e,width:n,height:o,top:e,right:t+n,bottom:e+o,left:t};return{...i,toJSON:()=>i}}function dt(t,e){return{contextElement:t.current||void 0,getBoundingClientRect:()=>{const n=t.current,o=e(n);return o||!n?function(t){if(!t)return ut();const{x:e,y:n,width:o,height:i}=t;return ut(e,n,o,i)}(o):n.getBoundingClientRect()}}}function pt(t){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(t)}function mt(t){let{placement:e="bottom",fixed:n=!1,gutter:i,flip:r=!0,shift:l=0,slide:c=!0,overlap:s=!1,sameWidth:a=!1,fitViewport:f=!1,arrowPadding:u=4,overflowPadding:d=8,renderCallback:p,...m}=void 0===t?{}:t;const h=(0,rt.b)(m),g=(0,ot.zX)(m.getAnchorRect||(t=>(null==t?void 0:t.getBoundingClientRect())||null)),y=(0,o.useRef)(null),w=(0,o.useRef)(null),x=(0,o.useRef)(null),[v,b]=(0,o.useState)(e),[R,E]=(0,ot.NW)();(0,ot.Gw)((()=>{var t;if(null==(t=h.contentElement)||!t.isConnected)return;const o=w.current;if(!o)return;const m=dt(y,g),v=x.current,R=((null==v?void 0:v.clientHeight)||0)/2,E="number"===typeof i?i+R:null!=i?i:R;o.style.setProperty("--popover-overflow-padding",d+"px");const L=()=>et(m,o,(async()=>{if(!h.mounted)return;const t=[st((t=>{let{placement:e}=t;return{crossAxis:!!e.split("-")[1]?void 0:l,mainAxis:E,alignmentAxis:l}}))];if(!1!==r){const e="string"===typeof r?r.split(" "):void 0;if(void 0!==e&&!e.every(pt))throw new Error("`flip` expects a spaced-delimited list of placements");t.push(ct({padding:d,fallbackPlacements:e}))}(c||s)&&t.push(at({mainAxis:c,crossAxis:s,padding:d})),t.push(ft({padding:d,apply(t){let{availableWidth:e,availableHeight:n,rects:i}=t;const r=Math.round(i.reference.width);e=Math.floor(e),n=Math.floor(n),o.style.setProperty("--popover-anchor-width",r+"px"),o.style.setProperty("--popover-available-width",e+"px"),o.style.setProperty("--popover-available-height",n+"px"),a&&(o.style.width=r+"px"),f&&(o.style.maxWidth=e+"px",o.style.maxHeight=n+"px")}})),v&&t.push(lt({element:v,padding:u}));const i=await nt(m,o,{placement:e,strategy:n?"fixed":"absolute",middleware:t});(0,it.flushSync)((()=>{b(i.placement)}));const p=Math.round(i.x),g=Math.round(i.y);if(Object.assign(o.style,{top:"0",left:"0",transform:"translate3d("+p+"px, "+g+"px, 0)"}),v&&i.middlewareData.arrow){const{x:t,y:e}=i.middlewareData.arrow,n=i.placement.split("-")[0];Object.assign(v.style,{left:null!=t?t+"px":"",top:null!=e?e+"px":"",[n]:"100%"})}}),{elementResize:"function"===typeof ResizeObserver});return p?p({mounted:h.mounted,placement:e,fixed:n,gutter:E,shift:l,overlap:s,flip:r,sameWidth:a,fitViewport:f,arrowPadding:u,overflowPadding:d,popover:o,anchor:m,arrow:v,setPlacement:b,defaultRenderCallback:L}):L()}),[R,h.contentElement,g,i,h.mounted,l,s,r,d,c,a,f,u,e,n,p]);return(0,o.useMemo)((()=>({...h,getAnchorRect:g,anchorRef:y,popoverRef:w,arrowRef:x,currentPlacement:v,placement:e,fixed:n,gutter:i,shift:l,flip:r,slide:c,overlap:s,sameWidth:a,fitViewport:f,arrowPadding:u,overflowPadding:d,render:E,renderCallback:p})),[h,g,v,e,n,i,l,r,c,s,a,f,u,d,E,p])}}}]);