. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),D?(0,A.cloneElement)(E,{ref:function(O){L(D,O),L(j,O)}}):(0,A.cloneElement)(E,{ref:j})}},36963:function(W,Z,d){"use strict";d.d(Z,{PD:function(){return T}});var S={};d.r(S),d.d(S,{FILE:function(){return H},HTML:function(){return D},TEXT:function(){return j},URL:function(){return E}});function A(a){let i=null;return()=>(i==null&&(i=a()),i)}function x(a,i){return a.filter(p=>p!==i)}function w(a,i){const p=new Set,$=F=>p.add(F);a.forEach($),i.forEach($);const k=[];return p.forEach(F=>k.push(F)),k}class M{enter(i){const p=this.entered.length,$=k=>this.isNodeInDocument(k)&&(!k.contains||k.contains(i));return this.entered=w(this.entered.filter($),[i]),p===0&&this.entered.length>0}leave(i){const p=this.entered.length;return this.entered=x(this.entered.filter(this.isNodeInDocument),i),p>0&&this.entered.length===0}reset(){this.entered=[]}constructor(i){this.entered=[],this.isNodeInDocument=i}}class L{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(i=>{Object.defineProperty(this.item,i,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${i}" until the drop event.`),null}})})}loadDataTransfer(i){if(i){const p={};Object.keys(this.config.exposeProperties).forEach($=>{const k=this.config.exposeProperties[$];k!=null&&(p[$]={value:k(i,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,p)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(i,p){return p===i.getSourceId()}endDrag(){}constructor(i){this.config=i,this.item={},this.initializeExposedProperties()}}const H="__NATIVE_FILE__",E="__NATIVE_URL__",j="__NATIVE_TEXT__",D="__NATIVE_HTML__";function R(a,i,p){const $=i.reduce((k,F)=>k||a.getData(F),"");return $??p}const O={[H]:{exposeProperties:{files:a=>Array.prototype.slice.call(a.files),items:a=>a.items,dataTransfer:a=>a},matchesTypes:["Files"]},[D]:{exposeProperties:{html:(a,i)=>R(a,i,""),dataTransfer:a=>a},matchesTypes:["Html","text/html"]},[E]:{exposeProperties:{urls:(a,i)=>R(a,i,"").split(`
`),dataTransfer:a=>a},matchesTypes:["Url","text/uri-list"]},[j]:{exposeProperties:{text:(a,i)=>R(a,i,""),dataTransfer:a=>a},matchesTypes:["Text","text/plain"]}};function K(a,i){const p=O[a];if(!p)throw new Error(`native type ${a} has no configuration`);const $=new L(p);return $.loadDataTransfer(i),$}function Q(a){if(!a)return null;const i=Array.prototype.slice.call(a.types||[]);return Object.keys(O).filter(p=>{const $=O[p];return $!=null&&$.matchesTypes?$.matchesTypes.some(k=>i.indexOf(k)>-1):!1})[0]||null}const ee=A(()=>/firefox/i.test(navigator.userAgent)),ue=A(()=>Boolean(window.safari));class Re{interpolate(i){const{xs:p,ys:$,c1s:k,c2s:F,c3s:he}=this;let ae=p.length-1;if(i===p[ae])return $[ae];let me=0,se=he.length-1,Ce;for(;me<=se;){Ce=Math.floor(.5*(me+se));const et=p[Ce];if(et
i)se=Ce-1;else return $[Ce]}ae=Math.max(0,se);const Fe=i-p[ae],Ie=Fe*Fe;return $[ae]+k[ae]*Fe+F[ae]*Ie+he[ae]*Fe*Ie}constructor(i,p){const{length:$}=i,k=[];for(let De=0;De<$;De++)k.push(De);k.sort((De,Ze)=>i[De]{let Xe=new Re([0,.5,1],[me.y,me.y/Ce*De,me.y+De-Ce]).interpolate(Ie);return ue()&&F&&(Xe+=(window.devicePixelRatio-1)*De),Xe},Be=()=>new Re([0,.5,1],[me.x,me.x/se*et,me.x+et-se]).interpolate(Fe),{offsetX:Ve,offsetY:it}=k,ft=Ve===0||Ve,pt=it===0||it;return{x:ft?Ve:Be(),y:pt?it:Ze()}}class f{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var i;return!((i=this.globalContext)===null||i===void 0)&&i.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var i;return((i=this.optionsArgs)===null||i===void 0?void 0:i.rootElement)||this.window}constructor(i,p){this.ownerDocument=null,this.globalContext=i,this.optionsArgs=p}}function h(a,i,p){return i in a?Object.defineProperty(a,i,{value:p,enumerable:!0,configurable:!0,writable:!0}):a[i]=p,a}function m(a){for(var i=1;i{this.sourcePreviewNodes.delete(i),this.sourcePreviewNodeOptions.delete(i)}}connectDragSource(i,p,$){this.sourceNodes.set(i,p),this.sourceNodeOptions.set(i,$);const k=he=>this.handleDragStart(he,i),F=he=>this.handleSelectStart(he);return p.setAttribute("draggable","true"),p.addEventListener("dragstart",k),p.addEventListener("selectstart",F),()=>{this.sourceNodes.delete(i),this.sourceNodeOptions.delete(i),p.removeEventListener("dragstart",k),p.removeEventListener("selectstart",F),p.setAttribute("draggable","false")}}connectDropTarget(i,p){const $=he=>this.handleDragEnter(he,i),k=he=>this.handleDragOver(he,i),F=he=>this.handleDrop(he,i);return p.addEventListener("dragenter",$),p.addEventListener("dragover",k),p.addEventListener("drop",F),()=>{p.removeEventListener("dragenter",$),p.removeEventListener("dragover",k),p.removeEventListener("drop",F)}}addEventListeners(i){!i.addEventListener||(i.addEventListener("dragstart",this.handleTopDragStart),i.addEventListener("dragstart",this.handleTopDragStartCapture,!0),i.addEventListener("dragend",this.handleTopDragEndCapture,!0),i.addEventListener("dragenter",this.handleTopDragEnter),i.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),i.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),i.addEventListener("dragover",this.handleTopDragOver),i.addEventListener("dragover",this.handleTopDragOverCapture,!0),i.addEventListener("drop",this.handleTopDrop),i.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(i){!i.removeEventListener||(i.removeEventListener("dragstart",this.handleTopDragStart),i.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),i.removeEventListener("dragend",this.handleTopDragEndCapture,!0),i.removeEventListener("dragenter",this.handleTopDragEnter),i.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),i.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),i.removeEventListener("dragover",this.handleTopDragOver),i.removeEventListener("dragover",this.handleTopDragOverCapture,!0),i.removeEventListener("drop",this.handleTopDrop),i.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const i=this.monitor.getSourceId(),p=this.sourceNodeOptions.get(i);return m({dropEffect:this.altKeyPressed?"copy":"move"},p||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const i=this.monitor.getSourceId(),p=this.sourcePreviewNodeOptions.get(i);return m({anchorX:.5,anchorY:.5,captureDraggingState:!1},p||{})}isDraggingNativeItem(){const i=this.monitor.getItemType();return Object.keys(S).some(p=>S[p]===i)}beginDragNativeItem(i,p){this.clearCurrentDragSourceNode(),this.currentNativeSource=K(i,p),this.currentNativeHandle=this.registry.addSource(i,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(i){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=i;const p=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var $;return($=this.rootElement)===null||$===void 0?void 0:$.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},p)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var i;(i=this.window)===null||i===void 0||i.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(i,p){i.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(p))}handleDragEnter(i,p){this.dragEnterTargetIds.unshift(p)}handleDragOver(i,p){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(p)}handleDrop(i,p){this.dropTargetIds.unshift(p)}constructor(i,p,$){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.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=k=>{const F=this.sourceNodes.get(k);return F&&Ae(F)||null},this.endDragNativeItem=()=>{!this.isDraggingNativeItem()||(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=k=>Boolean(k&&this.document&&this.document.body&&this.document.body.contains(k)),this.endDragIfSourceWasRemovedFromDOM=()=>{const k=this.currentDragSourceNode;k==null||this.isNodeInDocument(k)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=k=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(k||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=k=>{if(k.defaultPrevented)return;const{dragStartSourceIds:F}=this;this.dragStartSourceIds=null;const he=Te(k);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(F||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:he});const{dataTransfer:ae}=k,me=Q(ae);if(this.monitor.isDragging()){if(ae&&typeof ae.setDragImage=="function"){const Ce=this.monitor.getSourceId(),Fe=this.sourceNodes.get(Ce),Ie=this.sourcePreviewNodes.get(Ce)||Fe;if(Ie){const{anchorX:et,anchorY:De,offsetX:Ze,offsetY:Be}=this.getCurrentSourcePreviewNodeOptions(),ft=g(Fe,Ie,he,{anchorX:et,anchorY:De},{offsetX:Ze,offsetY:Be});ae.setDragImage(Ie,ft.x,ft.y)}}try{ae==null||ae.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(k.target);const{captureDraggingState:se}=this.getCurrentSourcePreviewNodeOptions();se?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(me)this.beginDragNativeItem(me);else{if(ae&&!ae.types&&(k.target&&!k.target.hasAttribute||!k.target.hasAttribute("draggable")))return;k.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=k=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var F;(F=this.currentNativeSource)===null||F===void 0||F.loadDataTransfer(k.dataTransfer)}if(!this.enterLeaveCounter.enter(k.target)||this.monitor.isDragging())return;const{dataTransfer:ae}=k,me=Q(ae);me&&this.beginDragNativeItem(me,ae)},this.handleTopDragEnter=k=>{const{dragEnterTargetIds:F}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=k.altKey,F.length>0&&this.actions.hover(F,{clientOffset:Te(k)}),F.some(ae=>this.monitor.canDropOnTarget(ae))&&(k.preventDefault(),k.dataTransfer&&(k.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=k=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var F;(F=this.currentNativeSource)===null||F===void 0||F.loadDataTransfer(k.dataTransfer)}},this.handleTopDragOver=k=>{const{dragOverTargetIds:F}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){k.preventDefault(),k.dataTransfer&&(k.dataTransfer.dropEffect="none");return}this.altKeyPressed=k.altKey,this.lastClientOffset=Te(k),this.scheduleHover(F),(F||[]).some(ae=>this.monitor.canDropOnTarget(ae))?(k.preventDefault(),k.dataTransfer&&(k.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?k.preventDefault():(k.preventDefault(),k.dataTransfer&&(k.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=k=>{this.isDraggingNativeItem()&&k.preventDefault(),this.enterLeaveCounter.leave(k.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=k=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var F;k.preventDefault(),(F=this.currentNativeSource)===null||F===void 0||F.loadDataTransfer(k.dataTransfer)}else Q(k.dataTransfer)&&k.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=k=>{const{dropTargetIds:F}=this;this.dropTargetIds=[],this.actions.hover(F,{clientOffset:Te(k)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=k=>{const F=k.target;typeof F.dragDrop=="function"&&(F.tagName==="INPUT"||F.tagName==="SELECT"||F.tagName==="TEXTAREA"||F.isContentEditable||(k.preventDefault(),F.dragDrop()))},this.options=new f(p,$),this.actions=i.getActions(),this.monitor=i.getMonitor(),this.registry=i.getRegistry(),this.enterLeaveCounter=new M(this.isNodeInDocument)}}const T=function(i,p,$){return new N(i,p,$)}}}]);