@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
4 lines • 17.8 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import{y as t}from"./common-BXXICkFX.js";const n=Math.min,e=Math.max,o=Math.round,i=Math.floor,r=t=>({x:t,y:t}),s={left:"right",right:"left",bottom:"top",top:"bottom"},c={start:"end",end:"start"};function l(t,o,i){return e(t,n(o,i))}function f(t,e){return"function"==typeof t?t(e):t}function a(t){return t.split("-")[0]}function u(t){return t.split("-")[1]}function d(t){return"x"===t?"y":"x"}function m(t){return"y"===t?"height":"width"}const p=new Set(["top","bottom"]);function y(t){return p.has(a(t))?"y":"x"}function h(t){return d(y(t))}function w(t,e,n){void 0===n&&(n=!1);const o=u(t),i=h(t),r=m(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=R(l)),[l,R(l)]}function x(t){const e=R(t);return[g(t),e,g(e)]}function g(t){return t.replace(/start|end/g,t=>c[t])}const v=["left","right"],b=["right","left"],A=["top","bottom"],S=["bottom","top"];function k(t,e,n){switch(t){case"top":case"bottom":return n?e?b:v:e?v:b;case"left":case"right":return e?A:S;default:return[]}}function F(t,e,n,o){const i=u(t);let r=k(a(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(g)))),r}function R(t){return t.replace(/left|right|bottom|top/g,t=>s[t])}function O(t){return{top:0,right:0,bottom:0,left:0,...t}}function C(t){return"number"!=typeof t?O(t):{top:t,right:t,bottom:t,left:t}}function $(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 D(t,e,n){let{reference:o,floating:i}=t;const r=y(e),l=h(e),c=m(l),s=a(e),f="y"===r,d=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,g=o[c]/2-i[c]/2;let w;switch(s){case"top":w={x:d,y:o.y-i.height};break;case"bottom":w={x:d,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:p};break;case"left":w={x:o.x-i.width,y:p};break;default:w={x:o.x,y:o.y}}switch(u(e)){case"start":w[l]-=g*(n&&f?-1:1);break;case"end":w[l]+=g*(n&&f?-1:1)}return w}const T=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 a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=D(a,o,s),d=o,h={},m=0;for(let n=0;n<c.length;n++){const{name:r,fn:p}=c[n],{x:g,y:y,data:w,reset:x}=await p({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:h,rects:a,platform:l,elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=y?y:u,h={...h,[r]:{...h[r],...w}},x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(a=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):x.rects),({x:f,y:u}=D(a,d,s))),n=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:h}};async function E(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:c,strategy:s}=t,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=f(e,t),p=C(m),g=c[h?"floating"===d?"reference":"floating":d],y=$(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(c.floating)),boundary:a,rootBoundary:u,strategy:s})),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(c.floating)),v=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},b=$(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:x,strategy:s}):w);return{top:(y.top-b.top+p.top)/v.y,bottom:(b.bottom-y.bottom+p.bottom)/v.y,left:(y.left-b.left+p.left)/v.x,right:(b.right-y.right+p.right)/v.x}}const M=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:i,placement:r,rects:c,platform:s,elements:a,middlewareData:d}=e,{element:p,padding:g=0}=f(t,e)||{};if(null==p)return{};const y=C(g),w={x:o,y:i},x=h(r),v=m(x),b=await s.getDimensions(p),R="y"===x,L=R?"top":"left",T=R?"bottom":"right",E=R?"clientHeight":"clientWidth",S=c.reference[v]+c.reference[x]-w[x]-c.floating[v],A=w[x]-c.reference[x],D=await(null==s.getOffsetParent?void 0:s.getOffsetParent(p));let W=D?D[E]:0;W&&await(null==s.isElement?void 0:s.isElement(D))||(W=a.floating[E]||c.floating[v]);const O=S/2-A/2,N=W/2-b[v]/2-1,V=n(y[L],N),F=n(y[T],N),P=V,H=W-b[v]-F,k=W/2-b[v]/2+O,B=l(P,k,H),q=!d.arrow&&null!=u(r)&&k!==B&&c.reference[v]/2-(k<P?V:F)-b[v]/2<0,M=q?k<P?k-P:k-H:0;return{[x]:w[x]+M,data:{[x]:B,centerOffset:k-B-M,...q&&{alignmentOffset:M}},reset:q}}}),P=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:c,platform:s,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...b}=f(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const L=a(i),T=y(c),S=a(c)===c,A=await(null==s.isRTL?void 0:s.isRTL(u.floating)),D=m||(S||!v?[R(c)]:x(c)),W="none"!==g;!m&&W&&D.push(...F(c,v,g,A));const O=[c,...D],C=await E(e,b),N=[];let V=(null==(o=r.flip)?void 0:o.overflows)||[];if(d&&N.push(C[L]),h){const t=w(i,l,A);N.push(C[t[0]],C[t[1]])}if(V=[...V,{placement:i,overflows:N}],!N.every(t=>t<=0)){var P,H;const t=((null==(P=r.flip)?void 0:P.index)||0)+1,e=O[t];if(e){if(!("alignment"===h&&T!==y(e))||V.every(t=>y(t.placement)!==T||t.overflows[0]>0))return{data:{index:t,overflows:V},reset:{placement:e}}}let n=null==(H=V.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:H.placement;if(!n)switch(p){case"bestFit":{var k;const t=null==(k=V.filter(t=>{if(W){const e=y(t.placement);return e===T||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:k[0];t&&(n=t);break}case"initialPlacement":n=c}if(i!==n)return{reset:{placement:n}}}return{}}}},j=new Set(["left","top"]);async function z(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=a(n),c=u(n),s="y"===y(n),d=j.has(l)?-1:1,h=r&&s?-1:1,m=f(e,t);let{mainAxis:p,crossAxis:g,alignmentAxis:w}="number"==typeof m?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&"number"==typeof w&&(g="end"===c?-1*w:w),s?{x:g*h,y:p*d}:{x:p*d,y:g*h}}const B=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:l,middlewareData:c}=e,s=await z(e,t);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:i+s.x,y:r+s.y,data:{...s,placement:l}}}}},L=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:c=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=f(t,e),h={x:n,y:o},m=await E(e,u),p=y(a(i)),g=d(p);let w=h[g],x=h[p];if(r){const t="y"===g?"bottom":"right";w=l(w+m["y"===g?"top":"left"],w,w-m[t])}if(c){const t="y"===p?"bottom":"right";x=l(x+m["y"===p?"top":"left"],x,x-m[t])}const v=s.fn({...e,[g]:w,[p]:x});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[g]:r,[p]:c}}}}}};function I(){return"undefined"!=typeof window}function X(t){return H(t)?(t.nodeName||"").toLowerCase():"#document"}function N(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function q(t){var e;return null==(e=(H(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function H(t){return!!I()&&(t instanceof Node||t instanceof N(t).Node)}function V(t){return!!I()&&(t instanceof Element||t instanceof N(t).Element)}function W(t){return!!I()&&(t instanceof HTMLElement||t instanceof N(t).HTMLElement)}function Y(t){return!(!I()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof N(t).ShadowRoot)}const _=new Set(["inline","contents"]);function G(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=ct(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!_.has(i)}const J=new Set(["table","td","th"]);function K(t){return J.has(X(t))}const Q=[":popover-open",":modal"];function U(t){return Q.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const Z=["transform","translate","scale","rotate","perspective"],tt=["transform","translate","scale","rotate","perspective","filter"],nt=["paint","layout","strict","content"];function et(t){const e=it(),n=V(t)?ct(t):t;return Z.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||tt.some(t=>(n.willChange||"").includes(t))||nt.some(t=>(n.contain||"").includes(t))}function ot(t){let e=ft(t);for(;W(e)&&!st(e);){if(et(e))return e;if(U(e))return null;e=ft(e)}return null}function it(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const rt=new Set(["html","body","#document"]);function st(t){return rt.has(X(t))}function ct(t){return N(t).getComputedStyle(t)}function lt(t){return V(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ft(t){if("html"===X(t))return t;const e=t.assignedSlot||t.parentNode||Y(t)&&t.host||q(t);return Y(e)?e.host:e}function at(t){const e=ft(t);return st(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&G(e)?e:at(e)}function ut(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=at(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=N(i);if(r){const t=dt(l);return e.concat(l,l.visualViewport||[],G(i)?i:[],t&&n?ut(t):[])}return e.concat(i,ut(i,[],n))}function dt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function mt(t){const e=ct(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=W(t),l=r?t.offsetWidth:n,c=r?t.offsetHeight:i,s=o(n)!==l||o(i)!==c;return s&&(n=l,i=c),{width:n,height:i,$:s}}function pt(t){return V(t)?t:t.contextElement}function yt(t){const e=pt(t);if(!W(e))return r(1);const n=e.getBoundingClientRect(),{width:i,height:l,$:c}=mt(e);let s=(c?o(n.width):n.width)/i,a=(c?o(n.height):n.height)/l;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const ht=r(0);function wt(t){const e=N(t);return it()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ht}function xt(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==N(t))&&e}function gt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),l=pt(t);let c=r(1);e&&(o?V(o)&&(c=yt(o)):c=yt(t));const s=xt(l,n,o)?wt(l):r(0);let a=(i.left+s.x)/c.x,f=(i.top+s.y)/c.y,u=i.width/c.x,d=i.height/c.y;if(l){const t=N(l),e=o&&V(o)?N(o):o;let n=t,i=dt(n);for(;i&&o&&e!==n;){const t=yt(i),e=i.getBoundingClientRect(),o=ct(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=N(i),i=dt(n)}}return $({width:u,height:d,x:a,y:f})}function vt(t,e){const n=lt(t).scrollLeft;return e?e.left+n:gt(q(t)).left+n}function bt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-vt(t,n),y:n.top+e.scrollTop}}function At(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const l="fixed"===i,c=q(o),s=!!e&&U(e.floating);if(o===c||s&&l)return n;let a={scrollLeft:0,scrollTop:0},f=r(1);const u=r(0),d=W(o);if((d||!d&&!l)&&(("body"!==X(o)||G(c))&&(a=lt(o)),W(o))){const t=gt(o);f=yt(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!c||d||l?r(0):bt(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}}function St(t){return Array.from(t.getClientRects())}function kt(t){const n=q(t),o=lt(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+vt(t);const s=-o.scrollTop;return"rtl"===ct(i).direction&&(c+=e(n.clientWidth,i.clientWidth)-r),{width:r,height:l,x:c,y:s}}const Ft=25;function Rt(t,e){const n=N(t),o=q(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=it();(!t||t&&"fixed"===e)&&(c=i.offsetLeft,s=i.offsetTop)}const a=vt(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}}const Ot=new Set(["absolute","fixed"]);function Ct(t,e){const n=gt(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,l=W(t)?yt(t):r(1);return{width:t.clientWidth*l.x,height:t.clientHeight*l.y,x:i*l.x,y:o*l.y}}function $t(t,e,n){let o;if("viewport"===e)o=Rt(t,n);else if("document"===e)o=kt(q(t));else if(V(e))o=Ct(e,n);else{const n=wt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return $(o)}function Dt(t,e){const n=ft(t);return!(n===e||!V(n)||st(n))&&("fixed"===ct(n).position||Dt(n,e))}function Tt(t,e){const n=e.get(t);if(n)return n;let o=ut(t,[],!1).filter(t=>V(t)&&"body"!==X(t)),i=null;const r="fixed"===ct(t).position;let l=r?ft(t):t;for(;V(l)&&!st(l);){const e=ct(l),n=et(l);n||"fixed"!==e.position||(i=null);(r?!n&&!i:!n&&"static"===e.position&&!!i&&Ot.has(i.position)||G(l)&&!n&&Dt(t,l))?o=o.filter(t=>t!==l):i=e,l=ft(l)}return e.set(t,o),o}function Et(t){let{element:o,boundary:i,rootBoundary:r,strategy:l}=t;const c=[..."clippingAncestors"===i?U(o)?[]:Tt(o,this._c):[].concat(i),r],s=c[0],a=c.reduce((t,i)=>{const r=$t(o,i,l);return t.top=e(r.top,t.top),t.right=n(r.right,t.right),t.bottom=n(r.bottom,t.bottom),t.left=e(r.left,t.left),t},$t(o,s,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Mt(t){const{width:e,height:n}=mt(t);return{width:e,height:n}}function Pt(t,e,n){const o=W(e),i=q(e),l="fixed"===n,c=gt(t,!0,l,e);let s={scrollLeft:0,scrollTop:0};const a=r(0);function f(){a.x=vt(i)}if(o||!o&&!l)if(("body"!==X(e)||G(i))&&(s=lt(e)),o){const t=gt(e,!0,l,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&f();l&&!o&&i&&f();const u=!i||o||l?r(0):bt(i,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 jt(t){return"static"===ct(t).position}function zt(t,e){if(!W(t)||"fixed"===ct(t).position)return null;if(e)return e(t);let n=t.offsetParent;return q(t)===n&&(n=n.ownerDocument.body),n}function Bt(t,e){const n=N(t);if(U(t))return n;if(!W(t)){let e=ft(t);for(;e&&!st(e);){if(V(e)&&!jt(e))return e;e=ft(e)}return n}let o=zt(t,e);for(;o&&K(o)&&jt(o);)o=zt(o,e);return o&&st(o)&&jt(o)&&!et(o)?n:o||ot(t)||n}const Lt=async function(t){const e=this.getOffsetParent||Bt,n=this.getDimensions,o=await n(t.floating);return{reference:Pt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function It(t){return"rtl"===ct(t).direction}const Xt={convertOffsetParentRelativeRectToViewportRelativeRect:At,getDocumentElement:q,getClippingRect:Et,getOffsetParent:Bt,getElementRects:Lt,getClientRects:St,getDimensions:Mt,getScale:yt,isElement:V,isRTL:It};function Nt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qt(t,o){let r,l=null;const c=q(t);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=t.getBoundingClientRect(),{left:h,top:m,width:p,height:g}=d;if(f||o(),!p||!g)return;const y={rootMargin:-i(m)+"px "+-i(c.clientWidth-(h+p))+"px "+-i(c.clientHeight-(m+g))+"px "+-i(h)+"px",threshold:e(0,n(1,u))||1};let w=!0;function x(e){const n=e[0].intersectionRatio;if(n!==u){if(!w)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||Nt(d,t.getBoundingClientRect())||a(),w=!1}try{l=new IntersectionObserver(x,{...y,root:c.ownerDocument})}catch(t){l=new IntersectionObserver(x,y)}l.observe(t)}(!0),s}function Ht(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,a=pt(t),f=i||r?[...a?ut(a):[],...ut(e)]:[];f.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)});const u=a&&c?qt(a,n):null;let d,h=-1,m=null;l&&(m=new ResizeObserver(t=>{let[o]=t;o&&o.target===a&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var t;null==(t=m)||t.observe(e)})),n()}),a&&!s&&m.observe(a),m.observe(e));let p=s?gt(t):null;return s&&function e(){const o=gt(t);p&&!Nt(p,o)&&n();p=o,d=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)}),null==u||u(),null==(t=m)||t.disconnect(),m=null,s&&cancelAnimationFrame(d)}}const Vt=B,Wt=L,Yt=P,_t=M,Gt=(t,e,n)=>{const o=new Map,i={platform:Xt,...n},r={...i.platform,_c:o};return T(t,e,{...i,platform:r})},Jt=async({floatingElement:e,referenceElement:n,arrowElement:o,align:i="top"})=>{var r,l,c;if(!t()){const t=[Vt(null!==(r=null==o?void 0:o.offsetHeight)&&void 0!==r?r:10),Yt(),Wt()];o&&t.push(_t({element:o}));const{x:s,y:a,middlewareData:f,placement:u}=await Gt(n,e,{placement:i,middleware:t,strategy:"fixed"});Object.assign(e.style,{left:`${s}px`,top:`${a}px`,visibility:"visible"}),o&&((null===(l=f.arrow)||void 0===l?void 0:l.x)?Object.assign(o.style,{left:`${f.arrow.x}px`,top:"bottom"===u?-o.offsetHeight/2+"px":"",bottom:"top"===u?-o.offsetHeight/2+"px":""}):(null===(c=f.arrow)||void 0===c?void 0:c.y)&&Object.assign(o.style,{left:"right"===u?-o.offsetWidth/2+"px":"",right:"left"===u?-o.offsetWidth/2+"px":"",top:`${f.arrow.y}px`}))}};export{Jt as a,Ht as b};