import e from"./getBasePlacement.js";import t from"./getVariation.js";import a from"./getMainAxisFromPlacement.js";import{left as r,right as i,bottom as h,top as l,end as o,start as n}from"../enums.js";function s(s){var c,m=s.reference,f=s.element,x=s.placement,y=x?e(x):null,u=x?t(x):null,g=m.x+m.width/2-f.width/2,d=m.y+m.height/2-f.height/2;switch(y){case l:c={x:g,y:m.y-f.height};break;case h:c={x:g,y:m.y+m.height};break;case i:c={x:m.x+m.width,y:d};break;case r:c={x:m.x-f.width,y:d};break;default:c={x:m.x,y:m.y}}var w=y?a(y):null;if(null!=w){var p="y"===w?"height":"width";switch(u){case n:c[w]=Math.floor(c[w])-Math.floor(m[p]/2-f[p]/2);break;case o:c[w]=Math.floor(c[w])+Math.ceil(m[p]/2-f[p]/2)}}return c}export default s;
//# sourceMappingURL=computeOffsets.js.map
