2024-07-24 17:58:32 +02:00
|
|
|
import{_ as C}from"./iframe-b-JpuRmt.js";import{s as kt}from"./popup-CD-YygjT.js";import{i as Ft,e as It,f as Bt}from"./XPro-IST7frsp.js";import{r as P,i as bt,b as At}from"./runtime-D6MmngXK.js";import"../sb-preview/runtime.js";import"./index-BCQHTg7S.js";import"./index-DmiCujb-.js";import"./lifecycle-u0QeOdKt.js";import"./each-BS8lKJpw.js";import"./spread-CgU5AtxT.js";import"./globals-D0QH3NT1.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./tslib.es6-pJfR_DrR.js";function Mt(){Ft(),It(),Bt()}const Y=Math.min,$=Math.max,it=Math.round,ot=Math.floor,I=t=>({x:t,y:t}),Nt={left:"right",right:"left",bottom:"top",top:"bottom"},Wt={start:"end",end:"start"};function ft(t,e,o){return $(t,Y(e,o))}function tt(t,e){return typeof t=="function"?t(e):t}function z(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Et(t){return t==="x"?"y":"x"}function mt(t){return t==="y"?"height":"width"}function q(t){return["top","bottom"].includes(z(t))?"y":"x"}function dt(t){return Et(q(t))}function $t(t,e,o){o===void 0&&(o=!1);const n=et(t),i=dt(t),s=mt(i);let r=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=rt(r)),[r,rt(r)]}function zt(t){const e=rt(t);return[ut(t),e,ut(e)]}function ut(t){return t.replace(/start|end/g,e=>Wt[e])}function Ht(t,e,o){const n=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return o?e?i:n:e?n:i;case"left":case"right":return e?s:r;default:return[]}}function jt(t,e,o,n){const i=et(t);let s=Ht(z(t),o==="start",n);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(ut)))),s}function rt(t){return t.replace(/left|right|bottom|top/g,e=>Nt[e])}function Xt(t){return{top:0,right:0,bottom:0,left:0,...t}}function Rt(t){return typeof t!="number"?Xt(t):{top:t,right:t,bottom:t,left:t}}function st(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function wt(t,e,o){let{reference:n,floating:i}=t;const s=q(e),r=dt(e),c=mt(r),l=z(e),a=s==="y",m=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,p=n[c]/2-i[c]/2;let f;switch(l){case"top":f={x:m,y:n.y-i.height};break;case"bottom":f={x:m,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-i.width,y:u};break;default:f={x:n.x,y:n.y}}switch(et(e)){case"start":f[r]-=p*(o&&a?-1:1);break;case"end":f[r]+=p*(o&&a?-1:1);break}return f}const Yt=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:r}=o,c=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:m,y:u}=wt(a,n,l),p=n,f={},d=0;for(let g=0;g<c.length;g++){const{name:w,fn:h}=c[g],{x,y,data:b,reset:v}=await h({x:m,y:u,initialPlacement:n,placement:p,strategy:i,middlewareData:f,rects:a,platform:r,elements:{reference:t,floating:e}});m=x??m,u=y??u,f={...f,[w]:{...f[w],...b}},v&&d<=50&&(d++,typeof v=="object"&&(v.placement&&(p=v.placement),v.rects&&(a=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:m,y:u}=wt(a,p,l)),g=-1)}return{x:m,y:u,placement:p,strategy:i,middlewareData:f}};async function _t(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:m="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=tt(e,t),d=Rt(f),w=c[p?u==="floating"?"reference":"floating":u],h=st(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(w)))==null||o?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:m,strategy:l})),x=u==="floating"?{x:n,y:i,width:r.floating.width,height:r.floating.height}:r.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},v=st(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|