Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.152/Options/DragPreview.es",["module","exports","require","@liferay/frontend-js-react-web","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dnd","./DnD.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function DragPreview({children:t,component:r}){const f=(0,i.useRef)(),{currentOffset:c,initialOffset:l,isDragging:s,item:d}=(0,a.useDragLayer)((e=>({currentOffset:e.getClientOffset(),initialOffset:e.getInitialClientOffset(),isDragging:e.isDragging(),item:e.getItem()})));if(!s||s&&d.type!==o.OPTIONS_TYPES.OPTION)return null;return i.default.createElement(n.ReactPortal,null,i.default.createElement("div",{style:e},i.default.createElement(r,_extends({},d.option,{className:"dragging",ref:f,style:getItemStyles(c,f,l)}),t({index:d.position,option:d.option}))))};var n=r("@liferay/frontend-js-react-web"),i=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),a=r("liferay!frontend-js-react-web$react-dnd"),o=r("./DnD.es");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}const e={height:"100%",left:0,pointerEvents:"none",position:"fixed",top:0,width:"100%",zIndex:100},getItemStyles=(e,t,r)=>{if(!e||!t.current||!r)return{display:"none"};const n="translate(".concat(r.x,"px, ").concat(e.y,"px)");return{WebkitTransform:n,transform:n}}}}));
//# sourceMappingURL=DragPreview.es.js.map