import*as e from"react";import{ManagerReferenceNodeContext as t}from"./Manager.js";import{setRef as r,unwrapArray as o}from"./utils.js";import{usePopper as n}from"./usePopper.js";var a=function(){},i=function(){return Promise.resolve(null)},s=[];function p(p){var d=p.placement,u=void 0===d?"bottom":d,f=p.strategy,l=void 0===f?"absolute":f,m=p.modifiers,c=void 0===m?s:m,h=p.referenceElement,v=p.onFirstUpdate,y=p.innerRef,P=p.children,D=e.useContext(t),E=e.useState(null),U=E[0],b=E[1],g=e.useState(null),j=g[0],w=g[1];e.useEffect((function(){r(y,U)}),[y,U]);var M=e.useMemo((function(){return{placement:u,strategy:l,onFirstUpdate:v,modifiers:[].concat(c,[{name:"arrow",enabled:null!=j,options:{element:j}}])}}),[u,l,v,c,j]),R=n(h||D,U,M),x=R.state,F=R.styles,H=R.forceUpdate,S=R.update,C=e.useMemo((function(){return{ref:b,style:F.popper,placement:x?x.placement:u,hasPopperEscaped:x&&x.modifiersData.hide?x.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:x&&x.modifiersData.hide?x.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:F.arrow,ref:w},forceUpdate:H||a,update:S||i}}),[b,w,u,x,F,S,H]);return o(P)(C)}export{p as Popper};
//# sourceMappingURL=Popper.js.map
