(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{10:function(t,e,l){"use strict";l.r(e);var n=l(0),o=l(1);class a extends n.a{static getConfig(){return{className:"Neo.main.addon.DragDrop",boundaryContainerRect:null,dragProxyElement:null,dragProxyRect:null,clientX:0,clientY:0,initialScrollLeft:0,initialScrollTop:0,offsetX:0,offsetY:0,remote:{app:["setBoundaryContainer","setDragProxyElement","setScrollContainer","setScrollFactorLeft","setScrollFactorTop"]},scrollContainerElement:null,scrollContainerRect:null,scrollFactorLeft:1,scrollFactorTop:1,singleton:!0}}constructor(t){super(t);let e=[];this.addGlobalEventListeners(),Neo.config.hasTouchEvents?e.push(l.e(11).then(l.bind(null,17))):e.push(l.e(10).then(l.bind(null,18))),Promise.all(e).then(t=>{Neo.create({module:t[0].default})})}addGlobalEventListeners(){let t=this;document.addEventListener("drag:end",t.onDragEnd.bind(t),!0),document.addEventListener("drag:move",t.onDragMove.bind(t),!0),document.addEventListener("drag:start",t.onDragStart.bind(t),!0)}getEventData(t){const e=t.path||t.composedPath(),l={...o.a.getEventData(t.detail.originalEvent),clientX:t.detail.clientX,clientY:t.detail.clientY};return t.detail.eventPath?l.targetPath=t.detail.eventPath.map(t=>o.a.getTargetData(t)):l.targetPath=l.path||l.composedPath(),l.path=e.map(t=>o.a.getTargetData(t)),l}onDragEnd(t){Object.assign(this,{boundaryContainerRect:null,dragProxyElement:null,dragProxyRect:null,initialScrollLeft:0,initialScrollTop:0,scrollContainerElement:null,scrollContainerRect:null,setScrollFactorLeft:1,scrollFactorTop:1}),o.a.sendMessageToApp({...this.getEventData(t),type:"drag:end"})}onDragMove(t){let e,l,n,a=this,i=a.dragProxyRect,r=a.boundaryContainerRect;a.scrollContainerElement&&(e=a.scrollContainer({clientX:t.detail.clientX,clientY:t.detail.clientY}),t.detail.clientX=e.clientX,t.detail.clientY=e.clientY),a.dragProxyElement?(l=t.detail.clientX-a.offsetX,n=t.detail.clientY-a.offsetY,r&&(l<r.left?l=r.left:l>r.right-i.width&&(l=r.right-i.width),n<r.top?n=r.top:n>r.bottom-i.height&&(n=r.bottom-i.height)),a.dragProxyElement.style.left=l+"px",a.dragProxyElement.style.top=n+"px"):o.a.sendMessageToApp({...a.getEventData(t),type:"drag:move"})}onDragStart(t){let e=this.dragProxyRect=t.target.getBoundingClientRect();this.offsetX=t.detail.clientX-e.left,this.offsetY=t.detail.clientY-e.top,o.a.sendMessageToApp({...this.getEventData(t),type:"drag:start"})}scrollContainer(t){let e=this,l=t.clientX-e.clientX,n=t.clientY-e.clientY,o=e.scrollContainerElement,a=e.scrollContainerRect;return e.clientX=t.clientX,e.clientY=t.clientY,(l<0&&t.clientX<a.left+250||l>0&&t.clientX>a.right-250)&&(o.scrollLeft+=l*e.scrollFactorLeft),(n<0&&t.clientY<a.top+250||n>0&&t.clientY>a.bottom-250)&&(o.scrollTop+=n*e.scrollFactorTop),{clientX:e.clientX+o.scrollLeft-e.initialScrollLeft,clientY:e.clientY+o.scrollTop-e.initialScrollTop}}setBoundaryContainer(t){let e="document.body"===t.id?document.body:document.getElementById(t.id);this.boundaryContainerRect=e.getBoundingClientRect()}setDragProxyElement(t){this.dragProxyElement=document.getElementById(t.id)}setScrollContainer(t){let e="document.body"===t.id?document.body:document.getElementById(t.id);Object.assign(this,{scrollContainerElement:e,scrollContainerRect:e.getBoundingClientRect(),initialScrollLeft:e.scrollLeft,initialScrollTop:e.scrollTop})}setScrollFactorLeft(t){this.scrollFactorLeft=t.value}setScrollFactorTop(t){this.scrollFactorTop=t.value}}Neo.applyClassConfig(a);let i=Neo.create(a);Neo.applyToGlobalNs(i),e.default=i}}]);