Loading
function(e,t,n){"use strict";n.d(t,{W:()=>y});var r=n(755325);function i(e,t,n){s(e,t),t.set(e,n)}function s(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=c(e,t,"get");return l(e,n)}function l(e,t){return t.get?t.get.call(e):t.value}function u(e,t,n){var r=c(e,t,"set");return d(e,r,n),n}function c(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function d(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=n}}var _=new WeakMap,f=new WeakMap,p=new WeakMap,h=new WeakMap,m=new WeakMap,E=new WeakMap,g=new WeakMap,A=new WeakMap,I=new WeakMap,T=new WeakMap,S=new WeakMap;class y{constructor(e,t,n){if(i(this,_,{writable:!0,value:void 0}),i(this,f,{writable:!0,value:void 0}),i(this,p,{writable:!0,value:void 0}),i(this,h,{writable:!0,value:void 0}),i(this,m,{writable:!0,value:void 0}),i(this,E,{writable:!0,value:(e,t,n)=>{var r,i;if(!n.backend)throw Error("You must specify a 'backend' property in your Backend entry: ".concat(JSON.stringify(n)));let s=n.backend(e,t,n.options),a=n.id,l=!n.id&&s&&s.constructor;if(l&&(a=s.constructor.name),a)l&&console.warn("Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.\n This might be unsupported in the future, please specify 'id' explicitely for every backend.");else throw Error("You must specify an 'id' property in your Backend entry: ".concat(JSON.stringify(n),"\n see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx"));if(o(this,p)[a])throw Error("You must specify a unique 'id' property in your Backend entry:\n ".concat(JSON.stringify(n)," (conflicts with: ").concat(JSON.stringify(o(this,p)[a]),")"));return{id:a,instance:s,preview:null!=(r=n.preview)&&r,transition:n.transition,skipDispatchOnTransition:null!=(i=n.skipDispatchOnTransition)&&i}}}),a(this,"setup",()=>{if("u">typeof window){if(y.isSetUp)throw Error("Cannot have two MultiBackends at the same time.");y.isSetUp=!0,o(this,g).call(this,window),o(this,p)[o(this,_)].instance.setup()}}),a(this,"teardown",()=>{"u">typeof window&&(y.isSetUp=!1,o(this,A).call(this,window),o(this,p)[o(this,_)].instance.teardown())}),a(this,"connectDragSource",(e,t,n)=>o(this,S).call(this,"connectDragSource",e,t,n)),a(this,"connectDragPreview",(e,t,n)=>o(this,S).call(this,"connectDragPreview",e,t,n)),a(this,"connectDropTarget",(e,t,n)=>o(this,S).call(this,"connectDropTarget",e,t,n)),a(this,"profile",()=>o(this,p)[o(this,_)].instance.profile()),a(this,"previewEnabled",()=>o(this,p)[o(this,_)].preview),a(this,"previewsList",()=>o(this,f)),a(this,"backendsList",()=>o(this,h)),i(this,g,{writable:!0,value:e=>{o(this,h).forEach(t=>{t.transition&&e.addEventListener(t.transition.event,o(this,I))})}}),i(this,A,{writable:!0,value:e=>{o(this,h).forEach(t=>{t.transition&&e.removeEventListener(t.transition.event,o(this,I))})}}),i(this,I,{writable:!0,value:e=>{let t=o(this,_);if(o(this,h).some(t=>!!(t.id!==o(this,_)&&t.transition&&t.transition.check(e))&&(u(this,_,t.id),!0)),o(this,_)!==t){var n;o(this,p)[t].instance.teardown(),Object.keys(o(this,m)).forEach(e=>{let t=o(this,m)[e];t.unsubscribe(),t.unsubscribe=o(this,T).call(this,t.func,...t.args)}),o(this,f).backendChanged(this);let r=o(this,p)[o(this,_)];if(r.instance.setup(),r.skipDispatchOnTransition)return;let i=new e.constructor(e.type,e);null==(n=e.target)||n.dispatchEvent(i)}}}),i(this,T,{writable:!0,value:(e,t,n,r)=>o(this,p)[o(this,_)].instance[e](t,n,r)}),i(this,S,{writable:!0,value:(e,t,n,r)=>{let i="".concat(e,"_").concat(t),s=o(this,T).call(this,e,t,n,r);return o(this,m)[i]={func:e,args:[t,n,r],unsubscribe:s},()=>{o(this,m)[i].unsubscribe(),delete o(this,m)[i]}}}),!n||!n.backends||n.backends.length<1)throw Error("You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)\n see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx");u(this,f,new r.V),u(this,p,{}),u(this,h,[]),n.backends.forEach(n=>{let r=o(this,E).call(this,e,t,n);o(this,p)[r.id]=r,o(this,h).push(r)}),u(this,_,o(this,h)[0].id),u(this,m,{})}}a(y,"isSetUp",!1)}