const t=Math.min,e=Math.max,n=Math.round,o=Math.floor,i=t=>({x:t,y:t}),r={left:"right",right:"left",bottom:"top",top:"bottom"};function l(n,o,i){return e(n,t(o,i))}function c(t,e){return"function"==typeof t?t(e):t}function s(t){return t.split("-")[0]}function a(t){return t.split("-")[1]}function f(t){return"x"===t?"y":"x"}function u(t){return"y"===t?"height":"width"}function d(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function h(t){return f(d(t))}function m(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const p=["left","right"],g=["right","left"],y=["top","bottom"],w=["bottom","top"];function x(t,e,n,o){const i=a(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?g:p:e?p:g;case"left":case"right":return e?y:w;default:return[]}}(s(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(m)))),r}function v(t){const e=s(t);return r[e]+t.slice(e.length)}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){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function L(t,e,n){let{reference:o,floating:i}=t;const r=d(e),l=h(e),c=u(l),f=s(e),m="y"===r,p=o.x+o.width/2-i.width/2,g=o.y+o.height/2-i.height/2,y=o[c]/2-i[c]/2;let w;switch(f){case"top":w={x:p,y:o.y-i.height};break;case"bottom":w={x:p,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:g};break;case"left":w={x:o.x-i.width,y:g};break;default:w={x:o.x,y:o.y}}switch(a(e)){case"start":w[l]-=y*(n&&m?-1:1);break;case"end":w[l]+=y*(n&&m?-1:1)}return w}async function T(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:a}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=c(e,t),p=b(m),g=s[h?"floating"===d?"reference":"floating":d],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(s.floating)),boundary:f,rootBoundary:u,strategy:a})),w="floating"===d?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),v=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},L=R(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:x,strategy:a}):w);return{top:(y.top-L.top+p.top)/v.y,bottom:(L.bottom-y.bottom+p.bottom)/v.y,left:(y.left-L.left+p.left)/v.x,right:(L.right-y.right+p.right)/v.x}}const E=new Set(["left","top"]);function A(){return"undefined"!=typeof window}function O(t){return C(t)?(t.nodeName||"").toLowerCase():"#document"}function S(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function D(t){var e;return null==(e=(C(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function C(t){return!!A()&&(t instanceof Node||t instanceof S(t).Node)}function P(t){return!!A()&&(t instanceof Element||t instanceof S(t).Element)}function F(t){return!!A()&&(t instanceof HTMLElement||t instanceof S(t).HTMLElement)}function W(t){return!(!A()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof S(t).ShadowRoot)}function k(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=q(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function H(t){return/^(table|td|th)$/.test(O(t))}function B(t){try{if(t.matches(":popover-open"))return!0}catch(e){}try{return t.matches(":modal")}catch(e){return!1}}const M=/transform|translate|scale|rotate|perspective|filter/,V=/paint|layout|strict|content/,z=t=>!!t&&"none"!==t;let N;function $(t){const e=P(t)?q(t):t;return z(e.transform)||z(e.translate)||z(e.scale)||z(e.rotate)||z(e.perspective)||!I()&&(z(e.backdropFilter)||z(e.filter))||M.test(e.willChange||"")||V.test(e.contain||"")}function I(){return null==N&&(N="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),N}function j(t){return/^(html|body|#document)$/.test(O(t))}function q(t){return S(t).getComputedStyle(t)}function X(t){return P(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Y(t){if("html"===O(t))return t;const e= // Step into the shadow DOM of the parent of a slotted node. t.assignedSlot||// DOM Element detected. t.parentNode||// ShadowRoot detected. W(t)&&t.host||// Fallback. D(t);return W(e)?e.host:e}function _(t){const e=Y(t);return j(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&k(e)?e:_(e)}function G(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=_(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=S(i);if(r){const t=J(l);return e.concat(l,l.visualViewport||[],k(i)?i:[],t&&n?G(t):[])}return e.concat(i,G(i,[],n))}function J(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function K(t){const e=q(t);let o=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=F(t),l=r?t.offsetWidth:o,c=r?t.offsetHeight:i,s=n(o)!==l||n(i)!==c;return s&&(o=l,i=c),{width:o,height:i,$:s}}function Q(t){return P(t)?t:t.contextElement}function U(t){const e=Q(t);if(!F(e))return i(1);const o=e.getBoundingClientRect(),{width:r,height:l,$:c}=K(e);let s=(c?n(o.width):o.width)/r,a=(c?n(o.height):o.height)/l;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Z=i(0);function tt(t){const e=S(t);return I()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Z}function et(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),l=Q(t);let c=i(1);e&&(o?P(o)&&(c=U(o)):c=U(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==S(t))&&e}(l,n,o)?tt(l):i(0);let a=(r.left+s.x)/c.x,f=(r.top+s.y)/c.y,u=r.width/c.x,d=r.height/c.y;if(l){const t=S(l),e=o&&P(o)?S(o):o;let n=t,i=J(n);for(;i&&o&&e!==n;){const t=U(i),e=i.getBoundingClientRect(),o=q(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,f*=t.y,u*=t.x,d*=t.y,a+=r,f+=l,n=S(i),i=J(n)}}return R({width:u,height:d,x:a,y:f})}function nt(t,e){const n=X(t).scrollLeft;return e?e.left+n:et(D(t)).left+n}function ot(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-nt(t,n),y:n.top+e.scrollTop}}function it(t,n,o){let r;if("viewport"===n)r=function(t,e){const n=S(t),o=D(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=I();(!t||t&&"fixed"===e)&&(c=i.offsetLeft,s=i.offsetTop)}const a=nt(o);if(a<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(o.clientWidth-e.clientWidth-i);l<=25&&(r-=l)}else a<=25&&(r+=a);return{width:r,height:l,x:c,y:s}}(t,o);else if("document"===n)r=function(t){const n=D(t),o=X(t),i=t.ownerDocument.body,r=e(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),l=e(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let c=-o.scrollLeft+nt(t);const s=-o.scrollTop;return"rtl"===q(i).direction&&(c+=e(n.clientWidth,i.clientWidth)-r),{width:r,height:l,x:c,y:s}}(D(t));else if(P(n))r=function(t,e){const n=et(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,l=F(t)?U(t):i(1);return{width:t.clientWidth*l.x,height:t.clientHeight*l.y,x:r*l.x,y:o*l.y}}(n,o);else{const e=tt(t);r={x:n.x-e.x,y:n.y-e.y,width:n.width,height:n.height}}return R(r)}function rt(t,e){const n=Y(t);return!(n===e||!P(n)||j(n))&&("fixed"===q(n).position||rt(n,e))}function lt(t,e,n){const o=F(e),r=D(e),l="fixed"===n,c=et(t,!0,l,e);let s={scrollLeft:0,scrollTop:0};const a=i(0);function f(){a.x=nt(r)}if(o||!o&&!l)if(("body"!==O(e)||k(r))&&(s=X(e)),o){const t=et(e,!0,l,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else r&&f();l&&!o&&r&&f();const u=!r||o||l?i(0):ot(r,s);return{x:c.left+s.scrollLeft-a.x-u.x,y:c.top+s.scrollTop-a.y-u.y,width:c.width,height:c.height}}function ct(t){return"static"===q(t).position}function st(t,e){if(!F(t)||"fixed"===q(t).position)return null;if(e)return e(t);let n=t.offsetParent;return D(t)===n&&(n=n.ownerDocument.body),n}function at(t,e){const n=S(t);if(B(t))return n;if(!F(t)){let e=Y(t);for(;e&&!j(e);){if(P(e)&&!ct(e))return e;e=Y(e)}return n}let o=st(t,e);for(;o&&H(o)&&ct(o);)o=st(o,e);return o&&j(o)&&ct(o)&&!$(o)?n:o||function(t){let e=Y(t);for(;F(e)&&!j(e);){if($(e))return e;if(B(e))return null;e=Y(e)}return null}(t)||n}const ft={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const l="fixed"===r,c=D(o),s=!!e&&B(e.floating);if(o===c||s&&l)return n;let a={scrollLeft:0,scrollTop:0},f=i(1);const u=i(0),d=F(o);if((d||!d&&!l)&&(("body"!==O(o)||k(c))&&(a=X(o)),d)){const t=et(o);f=U(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!c||d||l?i(0):ot(c,a);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-a.scrollTop*f.y+u.y+h.y}},getDocumentElement:D,getClippingRect:function(n){let{element:o,boundary:i,rootBoundary:r,strategy:l}=n;const c=[..."clippingAncestors"===i?B(o)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=G(t,[],!1).filter(t=>P(t)&&"body"!==O(t)),i=null;const r="fixed"===q(t).position;let l=r?Y(t):t;for(;P(l)&&!j(l);){const e=q(l),n=$(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||k(l)&&!n&&rt(t,l))?o=o.filter(t=>t!==l):i=e,l=Y(l)}return e.set(t,o),o}(o,this._c):[].concat(i),r],s=it(o,c[0],l);let a=s.top,f=s.right,u=s.bottom,d=s.left;for(let h=1;h{c&&t.addEventListener("scroll",r,{passive:!0}),s&&t.addEventListener("resize",r)});const m=d&&f?function(n,i){let r,l=null;const c=D(n);function s(){var t;clearTimeout(r),null==(t=l)||t.disconnect(),l=null}return function a(f,u){void 0===f&&(f=!1),void 0===u&&(u=1),s();const d=n.getBoundingClientRect(),{left:h,top:m,width:p,height:g}=d;if(f||i(),!p||!g)return;const y={rootMargin:-o(m)+"px "+-o(c.clientWidth-(h+p))+"px "+-o(c.clientHeight-(m+g))+"px "+-o(h)+"px",threshold:e(0,t(1,u))||1};let w=!0;function x(t){const e=t[0].intersectionRatio;if(e!==u){if(!w)return a();e?a(!1,e):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==e||ut(d,n.getBoundingClientRect())||a(),w=!1}try{l=new IntersectionObserver(x,{...y, // Handle