1var e={d:(T,w)=>{for(var E in w)e.o(w,E)&&!e.o(T,E)&&Object.defineProperty(T,E,{enumerable:!0,get:w[E]})},o:(T,w)=>Object.prototype.hasOwnProperty.call(T,w),r:T=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(T,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(T,"__esModule",{value:!0})}},t={};e.d(t,{PD:()=>p,hm:()=>r,rX:()=>getEmptyImage});var r={};function memoize(T){var w=null;return function memoized(){return null==w&&(w=T()),w}}function _defineProperties(T,w){for(var E=0;E<w.length;E++){var O=w[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(T,O.key,O)}}e.r(r),e.d(r,{FILE:()=>u,TEXT:()=>d,URL:()=>c});var n=function(){function EnterLeaveCounter(T){!function _classCallCheck(T,w){if(!(T instanceof w))throw new TypeError("Cannot call a class as a function")}(this,EnterLeaveCounter),this.entered=[],this.isNodeInDocument=T}return function _createClass(T,w,E){w&&_defineProperties(T.prototype,w),E&&_defineProperties(T,E)}(EnterLeaveCounter,[{key:"enter",value:function enter(T){var w=this,E=this.entered.length;return this.entered=function union(T,w){var E=new Set,O=function insertItem(T){return E.add(T)};T.forEach(O),w.forEach(O);var N=[];return E.forEach((function(T){return N.push(T)})),N}(this.entered.filter((function isNodeEntered(E){return w.isNodeInDocument(E)&&(!E.contains||E.contains(T))})),[T]),0===E&&this.entered.length>0}},{key:"leave",value:function leave(T){var w=this.entered.length;return this.entered=function without(T,w){return T.filter((function(T){return T!==w}))}(this.entered.filter(this.isNodeInDocument),T),w>0&&0===this.entered.length}},{key:"reset",value:function reset(){this.entered=[]}}]),EnterLeaveCounter}(),a=memoize((function(){return/firefox/i.test(navigator.userAgent)})),o=memoize((function(){return Boolean(window.safari)}));function MonotonicInterpolant_defineProperties(T,w){for(var E=0;E<w.length;E++){var O=w[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(T,O.key,O)}}var i=function(){function MonotonicInterpolant(T,w){!function MonotonicInterpolant_classCallCheck(T,w){if(!(T instanceof w))throw new TypeError("Cannot call a class as a function")}(this,MonotonicInterpolant);for(var E=T.length,O=[],N=0;N<E;N++)O.push(N);O.sort((function(w,E){return T[w]<T[E]?-1:1}));for(var S,I,b=[],C=[],P=[],L=0;L<E-1;L++)S=T[L+1]-T[L],I=w[L+1]-w[L],C.push(S),b.push(I),P.push(I/S);for(var k=[P[0]],_=0;_<C.length-1;_++){var M=P[_],A=P[_+1];if(M*A<=0)k.push(0);else{S=C[_];var x=C[_+1],j=S+x;k.push(3*j/((j+x)/M+(j+S)/A))}}k.push(P[P.length-1]);for(var R,B=[],H=[],F=0;F<k.length-1;F++){R=P[F];var X=k[F],z=1/C[F],K=X+k[F+1]-R-R;B.push((R-X-K)*z),H.push(K*z*z)}this.xs=T,this.ys=w,this.c1s=k,this.c2s=B,this.c3s=H}return function MonotonicInterpolant_createClass(T,w,E){w&&MonotonicInterpolant_defineProperties(T.prototype,w),E&&MonotonicInterpolant_defineProperties(T,E)}(MonotonicInterpolant,[{key:"interpolate",value:function interpolate(T){var w=this.xs,E=this.ys,O=this.c1s,N=this.c2s,S=this.c3s,I=w.length-1;if(T===w[I])return E[I];for(var b,C=0,P=S.length-1;C<=P;){var L=w[b=Math.floor(.5*(C+P))];if(L<T)C=b+1;else{if(!(L>T))return E[b];P=b-1}}var k=T-w[I=Math.max(0,P)],_=k*k;return E[I]+O[I]*k+N[I]*_+S[I]*k*_}}]),MonotonicInterpolant}();function getNodeClientOffset(T){var w=1===T.nodeType?T:T.parentElement;if(!w)return null;var E=w.getBoundingClientRect(),O=E.top;return{x:E.left,y:O}}function getEventClientOffset(T){return{x:T.clientX,y:T.clientY}}function getDragPreviewOffset(T,w,E,O,N){var S=function isImageNode(T){var w;return"IMG"===T.nodeName&&(a()||!(null===(w=document.documentElement)||void 0===w?void 0:w.contains(T)))}(w),I=getNodeClientOffset(S?T:w),b={x:E.x-I.x,y:E.y-I.y},C=T.offsetWidth,P=T.offsetHeight,L=O.anchorX,k=O.anchorY,_=function getDragPreviewSize(T,w,E,O){var N=T?w.width:E,S=T?w.height:O;return o()&&T&&(S/=window.devicePixelRatio,N/=window.devicePixelRatio),{dragPreviewWidth:N,dragPreviewHeight:S}}(S,w,C,P),M=_.dragPreviewWidth,A=_.dragPreviewHeight,x=N.offsetX,j=N.offsetY,R=0===j||j;return{x:0===x||x?x:function calculateXOffset(){return new i([0,.5,1],[b.x,b.x/C*M,b.x+M-C]).interpolate(L)}(),y:R?j:function calculateYOffset(){var T=new i([0,.5,1],[b.y,b.y/P*A,b.y+A-P]).interpolate(k);return o()&&S&&(T+=(window.devicePixelRatio-1)*A),T}()}}var s,u="__NATIVE_FILE__",c="__NATIVE_URL__",d="__NATIVE_TEXT__";function getDataFromDataTransfer(T,w,E){var O=w.reduce((function(w,E){return w||T.getData(E)}),"");return null!=O?O:E}function _defineProperty(T,w,E){return w in T?Object.defineProperty(T,w,{value:E,enumerable:!0,configurable:!0,writable:!0}):T[w]=E,T}var l=(_defineProperty(s={},u,{exposeProperties:{files:function files(T){return Array.prototype.slice.call(T.files)},items:function items(T){return T.items}},matchesTypes:["Files"]}),_defineProperty(s,c,{exposeProperties:{urls:function urls(T,w){return getDataFromDataTransfer(T,w,"").split("\n")}}
1,matchesTypes:["Url","text/uri-list"]}),_defineProperty(s,d,{exposeProperties:{text:function text(T,w){return getDataFromDataTransfer(T,w,"")}},matchesTypes:["Text","text/plain"]}),s);function NativeDragSource_defineProperties(T,w){for(var E=0;E<w.length;E++){var O=w[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(T,O.key,O)}}var g=function(){function NativeDragSource(T){!function NativeDragSource_classCallCheck(T,w){if(!(T instanceof w))throw new TypeError("Cannot call a class as a function")}(this,NativeDragSource),this.config=T,this.item={},this.initializeExposedProperties()}return function NativeDragSource_createClass(T,w,E){w&&NativeDragSource_defineProperties(T.prototype,w),E&&NativeDragSource_defineProperties(T,E)}(NativeDragSource,[{key:"initializeExposedProperties",value:function initializeExposedProperties(){var T=this;Object.keys(this.config.exposeProperties).forEach((function(w){Object.defineProperty(T.item,w,{configurable:!0,enumerable:!0,get:function get(){return console.warn("Browser doesn't allow reading \"".concat(w,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function loadDataTransfer(T){var w=this;if(T){var E={};Object.keys(this.config.exposeProperties).forEach((function(O){E[O]={value:w.config.exposeProperties[O](T,w.config.matchesTypes),configurable:!0,enumerable:!0}})),Object.defineProperties(this.item,E)}}},{key:"canDrag",value:function canDrag(){return!0}},{key:"beginDrag",value:function beginDrag(){return this.item}},{key:"isDragging",value:function isDragging(T,w){return w===T.getSourceId()}},{key:"endDrag",value:function endDrag(){}}]),NativeDragSource}();function matchNativeItemType(T){if(!T)return null;var w=Array.prototype.slice.call(T.types||[]);return Object.keys(l).filter((function(T){return l[T].matchesTypes.some((function(T){return w.indexOf(T)>-1}))}))[0]||null}function OptionsReader_defineProperties(T,w){for(var E=0;E<w.length;E++){var O=w[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(T,O.key,O)}}var f=function(){function OptionsReader(T){!function OptionsReader_classCallCheck(T,w){if(!(T instanceof w))throw new TypeError("Cannot call a class as a function")}(this,OptionsReader),this.globalContext=T}return function OptionsReader_createClass(T,w,E){w&&OptionsReader_defineProperties(T.prototype,w),E&&OptionsReader_defineProperties(T,E)}(OptionsReader,[{key:"window",get:function get(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}},{key:"document",get:function get(){if(this.window)return this.window.document}}]),OptionsReader}();function ownKeys(T,w){var E=Object.keys(T);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(T);w&&(O=O.filter((function(w){return Object.getOwnPropertyDescriptor(T,w).enumerable}))),E.push.apply(E,O)}return E}function _objectSpread(T){for(var w=1;w<arguments.length;w++){var E=null!=arguments[w]?arguments[w]:{};w%2?ownKeys(Object(E),!0).forEach((function(w){HTML5BackendImpl_defineProperty(T,w,E[w])})):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(E)):ownKeys(Object(E)).forEach((function(w){Object.defineProperty(T,w,Object.getOwnPropertyDescriptor(E,w))}))}return T}function HTML5BackendImpl_defineProperty(T,w,E){return w in T?Object.defineProperty(T,w,{value:E,enumerable:!0,configurable:!0,writable:!0}):T[w]=E,T}function HTML5BackendImpl_defineProperties(T,w){for(var E=0;E<w.length;E++){var O=w[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(T,O.key,O)}}var v,h=function(){function HTML5BackendImpl(T,w){var E=this;!function HTML5BackendImpl_classCallCheck(T,w){if(!(T instanceof w))throw new TypeError("Cannot call a class as a function")}(this,HTML5BackendImpl),this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.get
1SourceClientOffset=function(T){var w=E.sourceNodes.get(T);return w&&getNodeClientOffset(w)||null},this.endDragNativeItem=function(){E.isDraggingNativeItem()&&(E.actions.endDrag(),E.currentNativeHandle&&E.registry.removeSource(E.currentNativeHandle),E.currentNativeHandle=null,E.currentNativeSource=null)},this.isNodeInDocument=function(T){return Boolean(T&&E.document&&E.document.body&&document.body.contains(T))},this.endDragIfSourceWasRemovedFromDOM=function(){var T=E.currentDragSourceNode;E.isNodeInDocument(T)||E.clearCurrentDragSourceNode()&&E.actions.endDrag()},this.handleTopDragStartCapture=function(){E.clearCurrentDragSourceNode(),E.dragStartSourceIds=[]},this.handleTopDragStart=function(T){if(!T.defaultPrevented){var w=E.dragStartSourceIds;E.dragStartSourceIds=null;var O=getEventClientOffset(T);E.monitor.isDragging()&&E.actions.endDrag(),E.actions.beginDrag(w||[],{publishSource:!1,getSourceClientOffset:E.getSourceClientOffset,clientOffset:O});var N=T.dataTransfer,S=matchNativeItemType(N);if(E.monitor.isDragging()){if(N&&"function"==typeof N.setDragImage){var I=E.monitor.getSourceId(),b=E.sourceNodes.get(I),C=E.sourcePreviewNodes.get(I)||b;if(C){var P=E.getCurrentSourcePreviewNodeOptions(),L=getDragPreviewOffset(b,C,O,{anchorX:P.anchorX,anchorY:P.anchorY},{offsetX:P.offsetX,offsetY:P.offsetY});N.setDragImage(C,L.x,L.y)}}try{null==N||N.setData("application/json",{})}catch(T){}E.setCurrentDragSourceNode(T.target),E.getCurrentSourcePreviewNodeOptions().captureDraggingState?E.actions.publishDragSource():setTimeout((function(){return E.actions.publishDragSource()}),0)}else if(S)E.beginDragNativeItem(S);else{if(N&&!N.types&&(T.target&&!T.target.hasAttribute||!T.target.hasAttribute("draggable")))return;T.preventDefault()}}},this.handleTopDragEndCapture=function(){E.clearCurrentDragSourceNode()&&E.actions.endDrag()},this.handleTopDragEnterCapture=function(T){if(E.dragEnterTargetIds=[],E.enterLeaveCounter.enter(T.target)&&!E.monitor.isDragging()){var w=T.dataTransfer,O=matchNativeItemType(w);O&&E.beginDragNativeItem(O,w)}},this.handleTopDragEnter=function(T){var w=E.dragEnterTargetIds;E.dragEnterTargetIds=[],E.monitor.isDragging()&&(E.altKeyPressed=T.altKey,a()||E.actions.hover(w,{clientOffset:getEventClientOffset(T)}),w.some((function(T){return E.monitor.canDropOnTarget(T)}))&&(T.preventDefault(),T.dataTransfer&&(T.dataTransfer.dropEffect=E.getCurrentDropEffect())))},this.handleTopDragOverCapture=function(){E.dragOverTargetIds=[]},this.handleTopDragOver=function(T){var w=E.dragOverTargetIds;if(E.dragOverTargetIds=[],!E.monitor.isDragging())return T.preventDefault(),void(T.dataTransfer&&(T.dataTransfer.dropEffect="none"));E.altKeyPressed=T.altKey,E.actions.hover(w||[],{clientOffset:getEventClientOffset(T)}),(w||[]).some((function(T){return E.monitor.canDropOnTarget(T)}))?(T.preventDefault(),T.dataTransfer&&(T.dataTransfer.dropEffect=E.getCurrentDropEffect())):E.isDraggingNativeItem()?T.preventDefault():(T.preventDefault(),T.dataTransfer&&(T.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=function(T){E.isDraggingNativeItem()&&T.preventDefault(),E.enterLeaveCounter.leave(T.target)&&E.isDraggingNativeItem()&&E.endDragNativeItem()},this.handleTopDropCapture=function(T){var w;E.dropTargetIds=[],T.preventDefault(),E.isDraggingNativeItem()&&(null===(w=E.currentNativeSource)||void 0===w||w.loadDataTransfer(T.dataTransfer)),E.enterLeaveCounter.reset()},this.handleTopDrop=function(T){var w=E.dropTargetIds;E.dropTargetIds=[],E.actions.hover(w,{clientOffset:getEventClientOffset(T)}),E.actions.drop({dropEffect:E.getCurrentDropEffect()}),E.isDraggingNativeItem()?E.endDragNativeItem():E.endDragIfSourceWasRemovedFromDOM()},this.handleSelectStart=function(T){var w=T.target;"function"==typeof w.dragDrop&&("INPUT"===w.tagName||"SELECT"===w.tagName||"TEXTAREA"===w.tagName||w.isContentEditable||(T.preventDefault(),w.dragDrop()))},this.options=new f(w),this.actions=T.getActions(),this.monitor=T.getMonitor(),this.registry=T.getRegistry(),this.enterLeaveCounter=new n(this.isNodeInDocument)}return function HTML5BackendImpl_createClass(T,w,E){w&&HTML5BackendImpl_defineProperties(T.prototype,w),E&&HTML5BackendImpl_defineProperties(T,E)}(HTML5BackendImpl,[{key:"profile",value:function profile(){var T,w;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(T=this.dragStartSourceIds)||void 0===T?void 0:T.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(w=this.dragOverTargetIds)||void 0===w?void 0:w.length)||0}}},{key:"setup",value:function setup(){if(void 0!==this.window){if(this.window.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");this.window.__isReactDndBackendSetUp=!0,this.addEventListeners(this.window)}}},{key:"teardown",value:function teardown(){void 0!==this.window&&(this.window.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.window),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&this.window.cancelAnimationFrame(this.asyncEndDragFrameId))}},{key:"connectDragPreview",value:function connectDragPreview(T,w,E){var O=this;return this.sourcePreviewNodeOptions.set(T,E),this.sourcePreviewNodes.set(T,w),function(){O.sourcePreviewNodes.delete(T),O.sourcePreviewNodeOptions.delete(T)}}},{key:"connectDragSource",value:function connectDragSource(T,w,E){var O=this;this.sourceNodes.set(T,w),this.sourceNodeOptions.set(T,E);var N=function handleDragStart(w){return O.handleDragStart(w,T)},S=function handleSelectStart(T){return O.handleSelectStart(T)};return w.setAttribute("draggable","true"),w.addEventListener("dragstart",N),w.addEventListener("selectstart",S),function(){O.sourceNodes.delete(T),O.sourceNodeOptions.delete(T),w.removeEventListener("dragstart",N),w.removeEventListener("selectstart",S),w.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function connectDropTarget(T,w){var E=this,O=function handleDragEnter(w){return E.handleDragEnter(w,T)},N=function handleDragOver(w){return E.handleDragOver(w,T)},S=function handleDrop(w){return E.handleDrop(w,T)};return w.addEventListener("dragenter",O),w.addEventListener("dragover",N),w.addEventListener("drop",S),function(){w.removeEventListener("dragenter",O),w.removeEventListener("dragover",N),w.removeEventListener("drop",S)}}},{key:"addEventListeners",value:function addEventListeners(T){T.addEventListener&&(T.addEventListener("dragstart",this.handleTopDragStart),T.addEventListener("dragstart",this.handleTopDragStartCapture,!0),T.addEventListener("dragend",this.handleTopDragEndCapture,!0),T.addEventListener("dragenter",this.handleTopDragEnter),T.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),T.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),T.addEventListener("dragover",this.handleTopDragOver),T.addEventListener("dragover",this.handleTopDragOverCapture,!0),T.addEventListener("drop",this.handleTopDrop),T.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function removeEventListeners(T){T.removeEventListener&&(T.removeEventListener("dragstart",this.handleTopDragStart),T.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),T.removeEventListener("dragend",this.handleTopDragEndCapture,!0),T.removeEventListener("dragenter",this.handleTopDragEnter),T.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),T.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),T.removeEventListener("dragover",this.handleTopDragOver),T.removeEventListener("dragover",this.handleTopDragOverCapture,!0),T.removeEventListener("drop",this.handleTopDrop),T.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function getCurrentSourceNodeOptions(){var T=this.monitor.getSourceId(),w=this.sourceNodeOptions.get(T);return _objectSpread({dropEffect:this.altKeyPressed?"copy":"move"},w||{})}},{key:"getCurrentDropEffect",value:function getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function getCurrentSourcePreviewNodeOptions(){var T=this.monitor.getSourceId();
1return _objectSpread({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(T)||{})}},{key:"isDraggingNativeItem",value:function isDraggingNativeItem(){var T=this.monitor.getItemType();return Object.keys(r).some((function(w){return r[w]===T}))}},{key:"beginDragNativeItem",value:function beginDragNativeItem(T,w){this.clearCurrentDragSourceNode(),this.currentNativeSource=function createNativeDragSource(T,w){var E=new g(l[T]);return E.loadDataTransfer(w),E}(T,w),this.currentNativeHandle=this.registry.addSource(T,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function setCurrentDragSourceNode(T){var w=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=T,this.mouseMoveTimeoutTimer=setTimeout((function(){return w.window&&w.window.addEventListener("mousemove",w.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}},{key:"clearCurrentDragSourceNode",value:function clearCurrentDragSourceNode(){return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.window&&(this.window.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}},{key:"handleDragStart",value:function handleDragStart(T,w){T.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(w))}},{key:"handleDragEnter",value:function handleDragEnter(T,w){this.dragEnterTargetIds.unshift(w)}},{key:"handleDragOver",value:function handleDragOver(T,w){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(w)}},{key:"handleDrop",value:function handleDrop(T,w){this.dropTargetIds.unshift(w)}},{key:"window",get:function get(){return this.options.window}},{key:"document",get:function get(){return this.options.document}}]),HTML5BackendImpl}();function getEmptyImage(){return v||((v=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),v}var p=function createBackend(T,w){return new h(T,w)},m=t.PD,D=t.hm,y=t.rX;export{m as HTML5Backend,D as NativeTypes,y as getEmptyImage}; 2//# sourceMappingURL=react-dnd-html5-backend.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.