Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.108/Options/DnD.es",["module","exports","require","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dnd","liferay!frontend-js-react-web$react-dnd-html5-backend"],(function(e,t,r){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({children:t,index:r,onDragEnd:n=(()=>{}),option:f}){const[{isDragging:l},d,u]=(0,c.useDrag)({collect:e=>({isDragging:e.isDragging()}),end:(e,t)=>{const r=t.getDropResult();e&&r&&n(r)},item:{option:f,position:r,type:e.OPTION}}),[{canDrop:p,isOver:O},g]=(0,c.useDrop)({accept:e.OPTION,collect:e=>({canDrop:e.canDrop(),isOver:e.isOver()}),drop:e=>({itemPosition:e.position,targetPosition:r})});return(0,a.useEffect)((()=>{u((0,i.getEmptyImage)(),{captureDraggingState:!0})}),[u]),a.default.createElement(a.default.Fragment,null,a.default.createElement("div",{className:(0,o.default)("ddm-options-target",{targetOver:O&&p}),ref:g}),a.default.cloneElement(t,s(s({},t.props),{},{className:{"dragged ddm-source-dragging":l},ref:d})))},t.OPTIONS_TYPES=void 0;var o=(n=r("liferay!frontend-js-react-web$classnames"))&&n.__esModule?n:{default:n},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),c=r("liferay!frontend-js-react-web$react-dnd"),i=r("liferay!frontend-js-react-web$react-dnd-html5-backend");function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e={OPTION:"option"};t.OPTIONS_TYPES=e}}));
//# sourceMappingURL=DnD.es.js.map