1
0
web/static/slide/assets/modules/shiki-tduQW0Ms.js

2 lines
48 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 14:14:52 +00:00
import{p as Vt,a as qt,d as Te,n as Gt,o as I,c as Se,w as Yt,r as ae,b as le,e as Z,F as Xt,f as we,g as Ge,h as ke,i as Ie,j as Ut,k as ve,l as ft,m as mt,q as He,s as Kt,t as Zt,u as Qt,v as Jt,x as eo}from"./vue-CSR4ejk2.js";const to=["top","right","bottom","left"],Ye=["start","end"],Xe=to.reduce((e,t)=>e.concat(t,t+"-"+Ye[0],t+"-"+Ye[1]),[]),de=Math.min,K=Math.max,oo={left:"right",right:"left",bottom:"top",top:"bottom"},io={start:"end",end:"start"};function Re(e,t,o){return K(e,de(t,o))}function J(e,t){return typeof e=="function"?e(t):e}function E(e){return e.split("-")[0]}function L(e){return e.split("-")[1]}function gt(e){return e==="x"?"y":"x"}function je(e){return e==="y"?"height":"width"}function Q(e){return["top","bottom"].includes(E(e))?"y":"x"}function We(e){return gt(Q(e))}function wt(e,t,o){o===void 0&&(o=!1);const i=L(e),n=We(e),s=je(n);let r=n==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=$e(r)),[r,$e(r)]}function no(e){const t=$e(e);return[ye(e),t,ye(t)]}function ye(e){return e.replace(/start|end/g,t=>io[t])}function so(e,t,o){const i=["left","right"],n=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return o?t?n:i:t?i:n;case"left":case"right":return t?s:r;default:return[]}}function ro(e,t,o,i){const n=L(e);let s=so(E(e),o==="start",i);return n&&(s=s.map(r=>r+"-"+n),t&&(s=s.concat(s.map(ye)))),s}function $e(e){return e.replace(/left|right|bottom|top/g,t=>oo[t])}function ao(e){return{top:0,right:0,bottom:0,left:0,...e}}function vt(e){return typeof e!="number"?ao(e):{top:e,right:e,bottom:e,left:e}}function ie(e){const{x:t,y:o,width:i,height:n}=e;return{width:i,height:n,top:o,left:t,right:t+i,bottom:o+n,x:t,y:o}}function Ue(e,t,o){let{reference:i,floating:n}=e;const s=Q(t),r=We(t),a=je(r),l=E(t),d=s==="y",c=i.x+i.width/2-n.width/2,p=i.y+i.height/2-n.height/2,u=i[a]/2-n[a]/2;let h;switch(l){case"top":h={x:c,y:i.y-n.height};break;case"bottom":h={x:c,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:p};break;case"left":h={x:i.x-n.width,y:p};break;default:h={x:i.x,y:i.y}}switch(L(t)){case"start":h[r]-=u*(o&&d?-1:1);break;case"end":h[r]+=u*(o&&d?-1:1);break}return h}const lo=async(e,t,o)=>{const{placement:i="bottom",strategy:n="absolute",middleware:s=[],platform:r}=o,a=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let d=await r.getElementRects({reference:e,floating:t,strategy:n}),{x:c,y:p}=Ue(d,i,l),u=i,h={},f=0;for(let m=0;m<a.length;m++){const{name:w,fn:g}=a[m],{x:v,y:$,data:b,reset:_}=await g({x:c,y:p,initialPlacement:i,placement:u,strategy:n,middlewareData:h,rects:d,platform:r,elements:{reference:e,floating:t}});c=v??c,p=$??p,h={...h,[w]:{...h[w],...b}},_&&f<=50&&(f++,typeof _=="object"&&(_.placement&&(u=_.placement),_.rects&&(d=_.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:n}):_.rects),{x:c,y:p}=Ue(d,u,l)),m=-1)}return{x:c,y:p,placement:u,strategy:n,middlewareData:h}};async function Pe(e,t){var o;t===void 0&&(t={});const{x:i,y:n,platform:s,rects:r,elements:a,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=J(t,e),f=vt(h),w=a[u?p==="floating"?"reference":"floating":p],g=ie(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(a.floating)),boundary:d,rootBoundary:c,strategy:l})),v=p==="floating"?{x:i,y:n,width:r.floating.width,height:r.floating.height}:r.reference,$=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),b=await(s.isElement==null?void 0:s.isElement($))?await(s.getScale==null?void 0:s.getScale($))||{x:1,y:1}:{x:1,y:1},_=ie(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:$,strategy:l}):v);return{top:(g.top-_.top+f.top)/b.y,bottom:(_.bottom-g.bottom+f.bottom)/b.y,left:(g.left-_.left+f.left)/b.x,right:(_.right-g.right+f.right)/b.x}}const po=e=>