Liferay.Loader.define("layout-admin-web@5.0.117/js/miller_columns/DragPreview",["module","exports","require","frontend-js-web","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dnd"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function DragPreview({rtl:e}){const t=(0,i.useRef)(),{currentOffset:r,isDragging:c,items:l}=(0,a.useDragLayer)((e=>{var t;return{currentOffset:e.getClientOffset(),isDragging:e.isDragging(),items:null===(t=e.getItem())||void 0===t?void 0:t.items}})),[u,f]=(0,i.useState)();if((0,i.useEffect)((()=>{if(l)if(l.length>1)f((0,n.sub)(Liferay.Language.get("x-elements"),l.length));else{const[e]=l;f(e.title)}}),[l]),!c)return null;return i.default.createElement("div",{className:"miller-columns__drag-preview"},i.default.createElement("div",{className:"miller-columns__drag-preview__content",ref:t,style:getItemStyles(r,t,e)},u))};var n=r("frontend-js-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");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const getItemStyles=(e,t,r)=>{if(!e||!t.current)return{display:"none"};const n=t.current.getBoundingClientRect(),i=r?e.x+.5*n.width-window.innerWidth:e.x-.5*n.width,a=e.y-.5*n.height,c="translate(".concat(i,"px, ").concat(a,"px)");return{WebkitTransform:c,transform:c}}}}));
//# sourceMappingURL=DragPreview.js.map