const t=math.min,e=math.max,n=math.round,o=t=>({x:t,y:t});function i(t,e){return"function"==typeof t?t(e):t}function r(t){return t.split("-")[0]}function l(t){return t.split("-")[1]}function c(t){return"y"===t?"height":"width"}function s(t){return["top","bottom"].includes(r(t))?"y":"x"}function f(t){return"x"===s(t)?"y":"x"}function a(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function u(t,e,n){let{reference:o,floating:i}=t;const a=s(e),u=f(e),d=c(u),h=r(e),p="y"===a,m=o.x+o.width/2-i.width/2,y=o.y+o.height/2-i.height/2,g=o[d]/2-i[d]/2;let x;switch(h){case"top":x={x:m,y:o.y-i.height};break;case"bottom":x={x:m,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:y};break;case"left":x={x:o.x-i.width,y:y};break;default:x={x:o.x,y:o.y}}switch(l(e)){case"start":x[u]-=g*(n&&p?-1:1);break;case"end":x[u]+=g*(n&&p?-1:1)}return x}const d=n=>({name:"arrow",options:n,async fn(o){const{x:r,y:s,placement:a,rects:u,platform:d,elements:h,middlewaredata:p}=o,{element:m,padding:y=0}=i(n,o)||{};if(null==m)return{};const g=function(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}}(y),x={x:r,y:s},w=f(a),b=c(w),v=await d.getdimensions(m),t="y"===w,l=t?"top":"left",r=t?"bottom":"right",e=t?"clientheight":"clientwidth",d=u.reference[b]+u.reference[w]-x[w]-u.floating[b],c=x[w]-u.reference[w],s=await(null==d.getoffsetparent?void 0:d.getoffsetparent(m));let a=s?s[e]:0;a&&await(null==d.iselement?void 0:d.iselement(s))||(a=h.floating[e]||u.floating[b]);const h=d/2-c/2,w=a/2-v[b]/2-1,k=t(g[l],w),o=t(g[r],w),f=k,p=a-v[b]-o,v=a/2-v[b]/2+h,m=e(f,t(v,p));const n=!p.arrow&&null!=l(a)&&v!=m&&u.reference[b]/2-(v(n.willchange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function r(){return!("undefined"==typeof css||!css.supports)&&css.supports("-webkit-backdrop-filter","none")}function e(t){return["html","body","#document"].includes(p(t))}function d(t){return m(t).getcomputedstyle(t)}function c(t){return x(t)?{scrollleft:t.scrollleft,scrolltop:t.scrolltop}:{scrollleft:t.pagexoffset,scrolltop:t.pageyoffset}}function s(t){if("html"===p(t))return t;const e=t.assignedslot||t.parentnode||b(t)&&t.host||y(t);return b(e)?e.host:e}function a(t){const e=s(t);return e(e)?t.ownerdocument?t.ownerdocument.body:t.body:w(e)&&v(e)?e:a(e)}function h(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=a(t),r=i===(null==(o=t.ownerdocument)?void 0:o.body),l=m(i);return r?e.concat(l,l.visualviewport||[],v(i)?i:[],l.frameelement&&n?h(l.frameelement):[]):e.concat(i,h(i,[],n))}function w(t){const e=d(t);let o=parsefloat(e.width)||0,i=parsefloat(e.height)||0;const r=w(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 k(t){return x(t)?t:t.contextelement}function o(t){const e=k(t);if(!w(e))return o(1);const i=e.getboundingclientrect(),{width:r,height:l,$:c}=w(e);let s=(c?n(i.width):i.width)/r,f=(c?n(i.height):i.height)/l;return s&&number.isfinite(s)||(s=1),f&&number.isfinite(f)||(f=1),{x:s,y:f}}const f=o(0);function p(t){const e=m(t);return r()&&e.visualviewport?{x:e.visualviewport.offsetleft,y:e.visualviewport.offsettop}:f}function v(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getboundingclientrect(),l=k(t);let c=o(1);e&&(i?x(i)&&(c=o(i)):c=o(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==m(t))&&e}(l,n,i)?p(l):o(0);let f=(r.left+s.x)/c.x,u=(r.top+s.y)/c.y,d=r.width/c.x,h=r.height/c.y;if(l){const t=m(l),e=i&&x(i)?m(i):i;let n=t.frameelement;for(;n&&i&&e!==t;){const t=o(n),e=n.getboundingclientrect(),o=d(n),i=e.left+(n.clientleft+parsefloat(o.paddingleft))*t.x,r=e.top+(n.clienttop+parsefloat(o.paddingtop))*t.y;f*=t.x,u*=t.y,d*=t.x,h*=t.y,f+=i,u+=r,n=m(n).frameelement}}return a({width:d,height:h,x:f,y:u})}function m(t){return v(y(t)).left+c(t).scrollleft}function n(t,n,i){let r;if("viewport"===n)r=function(t,e){const n=m(t),o=y(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=r();(!t||t&&"fixed"===e)&&(c=i.offsetleft,s=i.offsettop)}return{width:r,height:l,x:c,y:s}}(t,i);else if("document"===n)r=function(t){const n=y(t),o=c(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+m(t);const s=-o.scrolltop;return"rtl"===d(i).direction&&(c+=e(n.clientwidth,i.clientwidth)-r),{width:r,height:l,x:c,y:s}}(y(t));else if(x(n))r=function(t,e){const n=v(t,!0,"fixed"===e),i=n.top+t.clienttop,r=n.left+t.clientleft,l=w(t)?o(t):o(1);return{width:t.clientwidth*l.x,height:t.clientheight*l.y,x:r*l.x,y:i*l.y}}(n,i);else{const e=p(t);r={...n,x:n.x-e.x,y:n.y-e.y}}return a(r)}function b(t,e){const n=s(t);return!(n===e||!x(n)||e(n))&&("fixed"===d(n).position||b(n,e))}function x(t,e,n){const i=w(e),r=y(e),l="fixed"===n,c=v(t,!0,l,e);let s={scrollleft:0,scrolltop:0};const f=o(0);if(i||!i&&!l)if(("body"!==p(e)||v(r))&&(s=c(e)),i){const t=v(e,!0,l,e);f.x=t.x+e.clientleft,f.y=t.y+e.clienttop}else r&&(f.x=m(r));return{x:c.left+s.scrollleft-f.x,y:c.top+s.scrolltop-f.y,width:c.width,height:c.height}}function y(t,e){return w(t)&&"fixed"!==d(t).position?e?e(t):t.offsetparent:null}function $(t,e){const n=m(t);if(!w(t))return n;let o=y(t,e);for(;o&&t(o)&&"static"===d(o).position;)o=y(o,e);return o&&("html"===p(o)||"body"===p(o)&&"static"===d(o).position&&!l(o))?n:o||function(t){let e=s(t);for(;w(e)&&!e(e);){if(l(e))return e;e=s(e)}return null}(t)||n}const _={convertoffsetparentrelativerecttoviewportrelativerect:function(t){let{rect:e,offsetparent:n,strategy:i}=t;const r=w(n),l=y(n);if(n===l)return e;let c={scrollleft:0,scrolltop:0},s=o(1);const f=o(0);if((r||!r&&"fixed"!==i)&&(("body"!==p(n)||v(l))&&(c=c(n)),w(n))){const t=v(n);s=o(n),f.x=t.x+n.clientleft,f.y=t.y+n.clienttop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-c.scrollleft*s.x+f.x,y:e.y*s.y-c.scrolltop*s.y+f.y}},getdocumentelement:y,getclippingrect:function(n){let{element:o,boundary:i,rootboundary:r,strategy:l}=n;const c=[..."clippingancestors"===i?function(t,e){const n=e.get(t);if(n)return n;let o=h(t,[],!1).filter((t=>x(t)&&"body"!==p(t))),i=null;const r="fixed"===d(t).position;let l=r?s(t):t;for(;x(l)&&!e(l);){const e=d(l),n=l(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||v(l)&&!n&&b(t,l))?o=o.filter((t=>t!==l)):i=e,l=s(l)}return e.set(t,o),o}(o,this._c):[].concat(i),r],s=c[0],f=c.reduce(((n,i)=>{const r=n(o,i,l);return n.top=e(r.top,n.top),n.right=t(r.right,n.right),n.bottom=t(r.bottom,n.bottom),n.left=e(r.left,n.left),n}),n(o,s,l));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}},getoffsetparent:$,getelementrects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getoffsetparent||$,r=this.getdimensions;return{reference:x(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 w(t)},getscale:o,iselement:x,isrtl:function(t){return"rtl"===d(t).direction}},j=(t,e,n)=>{const o=new map,i={platform:_,...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 f=await l.getelementrects({reference:t,floating:e,strategy:i}),{x:a,y:d}=u(f,o,s),h=o,p={},m=0;for(let y=0;y