1 line
19 KiB
JavaScript
1 line
19 KiB
JavaScript
import{Y as e,_ as t,dt as n,ft as r,lt as i,ot as a,tt as o,vt as s}from"./CaGtQlYh.js";var c=Math.min,l=Math.max,u=Math.round,d=Math.floor,f=e=>({x:e,y:e}),p={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function m(e,t,n){return l(e,c(t,n))}function h(e,t){return typeof e==`function`?e(t):e}function g(e){return e.split(`-`)[0]}function _(e){return e.split(`-`)[1]}function v(e){return e===`x`?`y`:`x`}function y(e){return e===`y`?`height`:`width`}function b(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function x(e){return v(b(e))}function S(e,t,n){n===void 0&&(n=!1);let r=_(e),i=x(e),a=y(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=j(o)),[o,j(o)]}function C(e){let t=j(e);return[w(e),t,w(t)]}function w(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var T=[`left`,`right`],E=[`right`,`left`],D=[`top`,`bottom`],O=[`bottom`,`top`];function k(e,t,n){switch(e){case`top`:case`bottom`:return n?t?E:T:t?T:E;case`left`:case`right`:return t?D:O;default:return[]}}function A(e,t,n,r){let i=_(e),a=k(g(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(w)))),a}function j(e){let t=g(e);return p[t]+e.slice(t.length)}function M(e){return{top:0,right:0,bottom:0,left:0,...e}}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:M(e)}function N(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function P(e,t,n){let{reference:r,floating:i}=e,a=b(t),o=x(t),s=y(o),c=g(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(_(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function te(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=h(t,e),p=ee(f),m=o[d?u===`floating`?`reference`:`floating`:u],g=N(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),_=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(v))&&await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1},b=N(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:v,strategy:s}):_);return{top:(g.top-b.top+p.top)/y.y,bottom:(b.bottom-g.bottom+p.bottom)/y.y,left:(g.left-b.left+p.left)/y.x,right:(b.right-g.right+p.right)/y.x}}var F=50,I=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:te},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=P(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<F&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=P(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ne=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:u,padding:d=0}=h(e,t)||{};if(u==null)return{};let f=ee(d),p={x:n,y:r},g=x(i),v=y(g),b=await o.getDimensions(u),S=g===`y`,C=S?`top`:`left`,w=S?`bottom`:`right`,T=S?`clientHeight`:`clientWidth`,E=a.reference[v]+a.reference[g]-p[g]-a.floating[v],D=p[g]-a.reference[g],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u)),k=O?O[T]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[T]||a.floating[v]);let A=E/2-D/2,j=k/2-b[v]/2-1,M=c(f[C],j),N=c(f[w],j),P=M,te=k-b[v]-N,F=k/2-b[v]/2+A,I=m(P,F,te),ne=!l.arrow&&_(i)!=null&&F!==I&&a.reference[v]/2-(F<P?M:N)-b[v]/2<0,L=ne?F<P?F-P:F-te:0;return{[g]:p[g]+L,data:{[g]:I,centerOffset:F-I-L,...ne&&{alignmentOffset:L}},reset:ne}}}),L=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,..._}=h(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let v=g(r),y=b(o),x=g(o)===o,w=await(s.isRTL==null?void 0:s.isRTL(c.floating)),T=d||(x||!m?[j(o)]:C(o)),E=p!==`none`;!d&&E&&T.push(...A(o,m,p,w));let D=[o,...T],O=await s.detectOverflow(t,_),k=[],M=i.flip?.overflows||[];if(l&&k.push(O[v]),u){let e=S(r,a,w);k.push(O[e[0]],O[e[1]])}if(M=[...M,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=D[e];if(t&&(!(u===`alignment`&&y!==b(t))||M.every(e=>b(e.placement)===y?e.overflows[0]>0:!0)))return{data:{index:e,overflows:M},reset:{placement:t}};let n=M.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=M.filter(e=>{if(E){let t=b(e.placement);return t===y||t===`y`}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]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},re=new Set([`left`,`top`]);async function ie(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=g(n),s=_(n),c=b(n)===`y`,l=re.has(o)?-1:1,u=a&&c?-1:1,d=h(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ae=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ie(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},oe=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=h(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=b(g(i)),p=v(f),_=u[p],y=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=_+d[e],r=_-d[t];_=m(n,_,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=y+d[e],r=y-d[t];y=m(n,y,r)}let x=c.fn({...t,[p]:_,[f]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:o,[f]:s}}}}}},se=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:u=()=>{},...d}=h(e,t),f=await o.detectOverflow(t,d),p=g(i),m=_(i),v=b(i)===`y`,{width:y,height:x}=a.floating,S,C;p===`top`||p===`bottom`?(S=p,C=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(C=p,S=m===`end`?`top`:`bottom`);let w=x-f.top-f.bottom,T=y-f.left-f.right,E=c(x-f[S],w),D=c(y-f[C],T),O=!t.middlewareData.shift,k=E,A=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=w),O&&!m){let e=l(f.left,0),t=l(f.right,0),n=l(f.top,0),r=l(f.bottom,0);v?A=y-2*(e!==0||t!==0?e+t:l(f.left,f.right)):k=x-2*(n!==0||r!==0?n+r:l(f.top,f.bottom))}await u({...t,availableWidth:A,availableHeight:k});let j=await o.getDimensions(s.floating);return y!==j.width||x!==j.height?{reset:{rects:!0}}:{}}}};function R(){return typeof window<`u`}function z(e){return ce(e)?(e.nodeName||``).toLowerCase():`#document`}function B(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){return((ce(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ce(e){return R()?e instanceof Node||e instanceof B(e).Node:!1}function H(e){return R()?e instanceof Element||e instanceof B(e).Element:!1}function U(e){return R()?e instanceof HTMLElement||e instanceof B(e).HTMLElement:!1}function le(e){return!R()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof B(e).ShadowRoot}function W(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ue(e){return/^(table|td|th)$/.test(z(e))}function de(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var fe=/transform|translate|scale|rotate|perspective|filter/,pe=/paint|layout|strict|content/,G=e=>!!e&&e!==`none`,me;function he(e){let t=H(e)?q(e):e;return G(t.transform)||G(t.translate)||G(t.scale)||G(t.rotate)||G(t.perspective)||!_e()&&(G(t.backdropFilter)||G(t.filter))||fe.test(t.willChange||``)||pe.test(t.contain||``)}function ge(e){let t=Y(e);for(;U(t)&&!K(t);){if(he(t))return t;if(de(t))return null;t=Y(t)}return null}function _e(){return me??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),me}function K(e){return/^(html|body|#document)$/.test(z(e))}function q(e){return B(e).getComputedStyle(e)}function J(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(z(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||le(e)&&e.host||V(e);return le(t)?t.host:t}function ve(e){let t=Y(e);return K(t)?e.ownerDocument?e.ownerDocument.body:e.body:U(t)&&W(t)?t:ve(t)}function X(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ve(e),i=r===e.ownerDocument?.body,a=B(r);if(i){let e=ye(a);return t.concat(a,a.visualViewport||[],W(r)?r:[],e&&n?X(e):[])}else return t.concat(r,X(r,[],n))}function ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function be(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=U(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=u(n)!==a||u(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function xe(e){return H(e)?e:e.contextElement}function Z(e){let t=xe(e);if(!U(t))return f(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=be(t),o=(a?u(n.width):n.width)/r,s=(a?u(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Se=f(0);function Ce(e){let t=B(e);return!_e()||!t.visualViewport?Se:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function we(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==B(e)?!1:t}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=xe(e),o=f(1);t&&(r?H(r)&&(o=Z(r)):o=Z(e));let s=we(a,n,r)?Ce(a):f(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=B(a),t=r&&H(r)?B(r):r,n=e,i=ye(n);for(;i&&r&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=B(i),i=ye(n)}}return N({width:u,height:d,x:c,y:l})}function Te(e,t){let n=J(e).scrollLeft;return t?t.left+n:Q(V(e)).left+n}function Ee(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Te(e,n),y:n.top+t.scrollTop}}function De(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=V(r),s=t?de(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=f(1),u=f(0),d=U(r);if((d||!d&&!a)&&((z(r)!==`body`||W(o))&&(c=J(r)),d)){let e=Q(r);l=Z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let p=o&&!d&&!a?Ee(o,c):f(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function Oe(e){return Array.from(e.getClientRects())}function ke(e){let t=V(e),n=J(e),r=e.ownerDocument.body,i=l(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=l(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Te(e),s=-n.scrollTop;return q(r).direction===`rtl`&&(o+=l(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ae=25;function je(e,t){let n=B(e),r=V(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=_e();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Te(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ae&&(a-=o)}else l<=Ae&&(a+=l);return{width:a,height:o,x:s,y:c}}function Me(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=U(e)?Z(e):f(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ne(e,t,n){let r;if(t===`viewport`)r=je(e,n);else if(t===`document`)r=ke(V(e));else if(H(t))r=Me(t,n);else{let n=Ce(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return N(r)}function Pe(e,t){let n=Y(e);return n===t||!H(n)||K(n)?!1:q(n).position===`fixed`||Pe(n,t)}function Fe(e,t){let n=t.get(e);if(n)return n;let r=X(e,[],!1).filter(e=>H(e)&&z(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?Y(e):e;for(;H(o)&&!K(o);){let t=q(o),n=he(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||W(o)&&!n&&Pe(e,o))?r=r.filter(e=>e!==o):i=t,o=Y(o)}return t.set(e,r),r}function Ie(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?de(t)?[]:Fe(t,this._c):[].concat(n),r],o=Ne(t,a[0],i),s=o.top,u=o.right,d=o.bottom,f=o.left;for(let e=1;e<a.length;e++){let n=Ne(t,a[e],i);s=l(n.top,s),u=c(n.right,u),d=c(n.bottom,d),f=l(n.left,f)}return{width:u-f,height:d-s,x:f,y:s}}function Le(e){let{width:t,height:n}=be(e);return{width:t,height:n}}function Re(e,t,n){let r=U(t),i=V(t),a=n===`fixed`,o=Q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=f(0);function l(){c.x=Te(i)}if(r||!r&&!a)if((z(t)!==`body`||W(i))&&(s=J(t)),r){let e=Q(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Ee(i,s):f(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function ze(e){return q(e).position===`static`}function Be(e,t){if(!U(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return V(e)===n&&(n=n.ownerDocument.body),n}function Ve(e,t){let n=B(e);if(de(e))return n;if(!U(e)){let t=Y(e);for(;t&&!K(t);){if(H(t)&&!ze(t))return t;t=Y(t)}return n}let r=Be(e,t);for(;r&&ue(r)&&ze(r);)r=Be(r,t);return r&&K(r)&&ze(r)&&!he(r)?n:r||ge(e)||n}var He=async function(e){let t=this.getOffsetParent||Ve,n=this.getDimensions,r=await n(e.floating);return{reference:Re(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ue(e){return q(e).direction===`rtl`}var We={convertOffsetParentRelativeRectToViewportRelativeRect:De,getDocumentElement:V,getClippingRect:Ie,getOffsetParent:Ve,getElementRects:He,getClientRects:Oe,getDimensions:Le,getScale:Z,isElement:H,isRTL:Ue};function Ge(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ke(e,t){let n=null,r,i=V(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),a();let f=e.getBoundingClientRect(),{left:p,top:m,width:h,height:g}=f;if(s||t(),!h||!g)return;let _=d(m),v=d(i.clientWidth-(p+h)),y=d(i.clientHeight-(m+g)),b=d(p),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:l(0,c(1,u))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(n!==u){if(!S)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Ge(f,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(C,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return o(!0),a}function qe(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=xe(e),u=i||a?[...l?X(l):[],...t?X(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ke(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!Ge(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Je=ae,Ye=oe,Xe=L,Ze=se,Qe=ne,$e=(e,t,n)=>{let r=new Map,i={platform:We,...n},a={...i.platform,_c:r};return I(e,t,{...i,platform:a})};function et(e){return typeof e==`object`&&!!e&&`$el`in e}function tt(e){if(et(e)){let t=e.$el;return ce(t)&&z(t)===`#comment`?null:t}return e}function $(e){return typeof e==`function`?e():s(e)}function nt(e){return{name:`arrow`,options:e,fn(t){let n=tt($(e.element));return n==null?{}:Qe({element:n,padding:e.padding}).fn(t)}}}function rt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function it(e,t){let n=rt(e);return Math.round(t*n)/n}function at(s,c,l){l===void 0&&(l={});let u=l.whileElementsMounted,d=t(()=>$(l.open)??!0),f=t(()=>$(l.middleware)),p=t(()=>$(l.placement)??`bottom`),m=t(()=>$(l.strategy)??`absolute`),h=t(()=>$(l.transform)??!0),g=t(()=>tt(s.value)),_=t(()=>tt(c.value)),v=i(0),y=i(0),b=i(m.value),x=i(p.value),S=r({}),C=i(!1),w=t(()=>{let e={position:b.value,left:`0`,top:`0`};if(!_.value)return e;let t=it(_.value,v.value),n=it(_.value,y.value);return h.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...rt(_.value)>=1.5&&{willChange:`transform`}}:{position:b.value,left:t+`px`,top:n+`px`}}),T;function E(){if(g.value==null||_.value==null)return;let e=d.value;$e(g.value,_.value,{middleware:f.value,placement:p.value,strategy:m.value}).then(t=>{v.value=t.x,y.value=t.y,b.value=t.strategy,x.value=t.placement,S.value=t.middlewareData,C.value=e!==!1})}function D(){typeof T==`function`&&(T(),T=void 0)}function O(){if(D(),u===void 0){E();return}if(g.value!=null&&_.value!=null){T=u(g.value,_.value,E);return}}function k(){d.value||(C.value=!1)}return e([f,p,m,d],E,{flush:`sync`}),e([g,_],O,{flush:`sync`}),e(d,k,{flush:`sync`}),o()&&a(D),{x:n(v),y:n(y),strategy:n(b),placement:n(x),middlewareData:n(S),isPositioned:n(C),floatingStyles:w,update:E}}export{Je as a,Xe as i,at as n,Ye as o,qe as r,Ze as s,nt as t}; |