import e from"../dom-utils/getNodeName.js";import{isHTMLElement as t}from"../dom-utils/instanceOf.js";var s={name:"applyStyles",enabled:!0,phase:"write",fn:function(s){var r=s.state;Object.keys(r.elements).forEach((function(s){var n=r.styles[s]||{},o=r.attributes[s]||{},a=r.elements[s];t(a)&&e(a)&&(Object.assign(a.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?a.removeAttribute(e):a.setAttribute(e,!0===t?"":t)})))}))},effect:function(s){var r=s.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(r.elements.popper.style,n.popper),r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow),function(){Object.keys(r.elements).forEach((function(s){var o=r.elements[s],a=r.attributes[s]||{},i=Object.keys(r.styles.hasOwnProperty(s)?r.styles[s]:n[s]).reduce((function(e,t){return e[t]="",e}),{});t(o)&&e(o)&&(Object.assign(o.style,i),Object.keys(a).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};export default s;
//# sourceMappingURL=applyStyles.js.map
