import e from"../utils/getBasePlacement.js";import t from"../dom-utils/getLayoutRect.js";import r from"../dom-utils/contains.js";import o from"../dom-utils/getOffsetParent.js";import s from"../utils/getMainAxisFromPlacement.js";import i from"../utils/within.js";import n from"../utils/mergePaddingObject.js";import a from"../utils/expandToHashMap.js";import{basePlacements as p,top as m,left as f,bottom as l,right as d}from"../enums.js";import{isHTMLElement as c}from"../dom-utils/instanceOf.js";var u={name:"arrow",enabled:!0,phase:"main",fn:function(r){var n,a=r.state,p=r.name,c=a.elements.arrow,u=a.modifiersData.popperOffsets,j=e(a.placement),w=s(j),g=[f,d].indexOf(j)>=0?"height":"width";if(c&&u){var h=a.modifiersData[p+"#persistent"].padding,v=t(c),O="y"===w?m:f,E="y"===w?l:d,y=a.rects.reference[g]+a.rects.reference[w]-u[w]-a.rects.popper[g],b=u[w]-a.rects.reference[w],D=o(c),P=D?"y"===w?D.clientHeight||0:D.clientWidth||0:0,x=y/2-b/2,H=h[O],M=P-v[g]-h[E],N=P/2-v[g]/2+x,T=i(H,N,M),V=w;a.modifiersData[p]=((n={})[V]=T,n.centerOffset=T-N,n)}},effect:function(e){var t=e.state,o=e.options,s=e.name,i=o.element,m=void 0===i?"[data-popper-arrow]":i,f=o.padding,l=void 0===f?0:f;null!=m&&("string"!=typeof m||(m=t.elements.popper.querySelector(m)))&&("production"!==process.env.NODE_ENV&&(c(m)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),r(t.elements.popper,m)?(t.elements.arrow=m,t.modifiersData[s+"#persistent"]={padding:n("number"!=typeof l?l:a(l,p))}):"production"!==process.env.NODE_ENV&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};export default u;
//# sourceMappingURL=arrow.js.map
