"use strict";Liferay.Loader.define("portal-workflow-kaleo-designer-web$react-draggable@4.4.4/build/cjs/utils/positionFns",["module","exports","require","./shims","./domFns"],(function(t,e,o){window;{Object.defineProperty(e,"__esModule",{value:!0}),e.getBoundPosition=function getBoundPosition(t,e,o){if(!t.props.bounds)return[e,o];var a=t.props.bounds;a="string"==typeof a?a:function cloneBounds(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}(a);var i=findDOMNode(t);if("string"==typeof a){var s,d=i.ownerDocument,u=d.defaultView;if(!((s="parent"===a?i.parentNode:d.querySelector(a))instanceof u.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');var l=s,f=u.getComputedStyle(i),p=u.getComputedStyle(l);a={left:-i.offsetLeft+(0,n.int)(p.paddingLeft)+(0,n.int)(f.marginLeft),top:-i.offsetTop+(0,n.int)(p.paddingTop)+(0,n.int)(f.marginTop),right:(0,r.innerWidth)(l)-(0,r.outerWidth)(i)-i.offsetLeft+(0,n.int)(p.paddingRight)-(0,n.int)(f.marginRight),bottom:(0,r.innerHeight)(l)-(0,r.outerHeight)(i)-i.offsetTop+(0,n.int)(p.paddingBottom)-(0,n.int)(f.marginBottom)}}return(0,n.isNum)(a.right)&&(e=Math.min(e,a.right)),(0,n.isNum)(a.bottom)&&(o=Math.min(o,a.bottom)),(0,n.isNum)(a.left)&&(e=Math.max(e,a.left)),(0,n.isNum)(a.top)&&(o=Math.max(o,a.top)),[e,o]},e.snapToGrid=function snapToGrid(t,e,o){return[Math.round(e/t[0])*t[0],Math.round(o/t[1])*t[1]]},e.canDragX=function canDragX(t){return"both"===t.props.axis||"x"===t.props.axis},e.canDragY=function canDragY(t){return"both"===t.props.axis||"y"===t.props.axis},e.getControlPosition=function getControlPosition(t,e,o){var n="number"==typeof e?(0,r.getTouch)(t,e):null;if("number"==typeof e&&!n)return null;var a=findDOMNode(o),i=o.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,r.offsetXYFromParent)(n||t,i,o.props.scale)},e.createCoreData=function createCoreData(t,e,o){var r=t.state,a=!(0,n.isNum)(r.lastX),i=findDOMNode(t);return a?{node:i,deltaX:0,deltaY:0,lastX:e,lastY:o,x:e,y:o}:{node:i,deltaX:e-r.lastX,deltaY:o-r.lastY,lastX:r.lastX,lastY:r.lastY,x:e,y:o}},e.createDraggableData=function createDraggableData(t,e){var o=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/o,y:t.state.y+e.deltaY/o,deltaX:e.deltaX/o,deltaY:e.deltaY/o,lastX:t.state.x,lastY:t.state.y}};var n=o("./shims"),r=o("./domFns");function findDOMNode(t){var e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}}}));
//# sourceMappingURL=positionFns.js.map