fluid-dnd 1.3.1-beta.0 → 1.3.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HandlerPublisher-BK0HGzXk.js → HandlerPublisher-BjHK5JWM.js} +1 -1
- package/dist/{HandlerPublisher-CJjcAWlb.cjs → HandlerPublisher-DopQmmiO.cjs} +1 -1
- package/dist/index/index.cjs +1 -1
- package/dist/index/index.mjs +1 -1
- package/dist/{index-Cm06gxy7.js → index-Br5-BQhK.js} +512 -511
- package/dist/index-DtPM9-d-.cjs +1 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.mjs +2 -2
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.mjs +2 -2
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/index-D1uENWRM.cjs +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var Ee=Object.defineProperty;var ye=(t,e,n)=>e in t?Ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var j=(t,e,n)=>ye(t,typeof e!="symbol"?e+"":e,n);const U="draggable",Xt="droppable",Mt="handler-class",Ft="dragging",Wt="dragging-handler-class",_t="dropping",oe="grabbing",re="grab",Kt="disable-transition",st=(t,e)=>t.classList.contains(e),gt=(t,e,n=!1)=>{t.classList.toggle(e,n)},tt=(t,e)=>{t.classList.add(e)},Ct=(t,e)=>{t.classList.remove(e)},Ce=(t,e)=>At(e).every(n=>st(t,n)),pt=t=>t?`.${At(t).join(".")}`:"",Ae=(t,e)=>{if(!e)return;const n=At(e);t.classList.add(...n)},At=t=>t?t.split(" ").filter(e=>e):[],_="horizontal",et="vertical",xe=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},zt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),we=t=>t?parseInt(t):-1,Be=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},ie=(t,e)=>t.x1>e.x1?ie(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,ht=(t,e)=>!Re(t,e),Re=(t,e)=>{const n=Ot(t),s=Ot(e),o=Qt(n,s,et),r=Qt(n,s,_);return o>=Math.min(n.height,s.height)/2&&r>=Math.min(n.width,s.width)/2},Qt=(t,e,n)=>{const{before:s,distance:o}=B(n);return ie({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},M=(t,e)=>t?zt(getComputedStyle(t)[e]):0,Ut=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Ot=t=>t.getBoundingClientRect(),B=t=>{const e=t==_;return{beforeMargin:e?"marginLeft":"marginTop",afterMargin:e?"marginRight":"marginBottom",borderBeforeWidth:e?"borderLeftWidth":"borderTopWidth",before:e?"left":"top",after:e?"right":"down",gap:e?"columnGap":"rowGap",distance:e?"width":"height",axis:e?"x":"y",offset:e?"offsetX":"offsetY",scroll:e?"scrollX":"scrollY",scrollElement:e?"scrollLeft":"scrollTop",page:e?"pageX":"pageY",inner:e?"innerWidth":"innerHeight",offsetElement:e?"offsetLeft":"offsetTop",scrollDistance:e?"scrollWidth":"scrollHeight",clientDistance:e?"clientWidth":"clientHeight",paddingBefore:e?"paddingLeft":"paddingTop",getRect:Ot}},Rt=(t,e)=>Le(t,e),ce=t=>[...t.children].filter(n=>st(n,U)),Le=(t,e)=>{const n=[...e.children].filter(o=>st(o,U)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Me=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ae=(t,e)=>{const{before:n,borderBeforeWidth:s}=B(e),o=Me(t);return o?Ot(o)[n]+M(o,s):0},Tt=t=>window.TouchEvent&&t instanceof TouchEvent,it=t=>t instanceof HTMLElement,le=t=>t instanceof MouseEvent,Oe=["onmouseup","onmousedown","onmousemove"],Ne=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},Et=(t,e,n)=>{!t||!it(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},Fe=(t,e,n,s)=>{t[e]=o=>{if(o.defaultPrevented)return;s&&s(o);const r=Vt(o);n(r)}},It=(t,e,n,s)=>{n&&(Pe(e)?t[e]=n:Fe(t,e,n,s))},Pe=t=>Oe.includes(t),$e=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Ge=(t,e)=>{const n=(s,o)=>Ye(e,window,o,s);if(le(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,_),n(s,et)]}},Vt=t=>{const e=Ie(t);if(!e)return $e(t);const[n,s]=Ge(t,e),{clientX:o,clientY:r,pageX:c,pageY:l,screenX:f,screenY:g,target:m}=e;return{clientX:o,clientY:r,pageX:c,pageY:l,screenX:f,screenY:g,target:m,offsetX:n,offsetY:s}},Ie=t=>{if(Tt(t))return t.touches[0]??t.changedTouches[0];if(le(t))return t},Ye=(t,e,n,s)=>{const{page:o,scroll:r,before:c,borderBeforeWidth:l,getRect:f}=B(n),g=f(s);return t[o]-e[r]-g[c]-M(s,l)},Pt=(t,e,n="ease-out",s="transform")=>{it(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},ue=(t,e,n)=>{!t||!it(t)||(t[e]=()=>{n()})},Xe=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},We=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[r]=o.cssText.match(n)||[];if(s===r)return!0}return!1},_e=(t,e)=>{e.forEach(n=>{Ve(t,n)})},Ve=(t,e)=>{var s;var n=Xe(t);n.sheet&&(We(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},fe=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&He(t,`--${n}`,s)}},He=(t,e,n)=>t&&t.style.setProperty(e,n),de="startDrag",Nt="drag",jt="startDrop",qe="drop",at="temp-child",ge="cubic-bezier(0.2, 0, 0, 1)",ze=t=>t===qe||t===jt,Ht=t=>!t||t.length==0?0:zt(t.replace("px","")),je=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=zt(n.replace("%","")),{width:r}=t.getBoundingClientRect();return r*(o/100)}return Ht(n)},Zt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=je(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},Ze=t=>{const{top:e,left:n}=getComputedStyle(t);return[Ht(e),Ht(n)]},ke=(t,e)=>{const{gap:n}=B(e),[s,o]=Zt(t,n);return o?s:0};function yt(t,e,n,s,o=t.previousElementSibling,r=t.nextElementSibling){let{height:c,width:l}=Je(n,t,o,r);return ht(t,s)&&e==Nt&&(c=0,l=0),{height:c,width:l}}const Je=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:r,distance:c,gap:l,getRect:f}=B(t),g=M(e,o),m=M(e,r),b=M(s,r),[R,O]=Zt(e.parentElement,l),F=f(e)[c];if(O)return te(F,m,g,R,0,t);const[y,p,T]=Ke(n,b,g,m,o);return te(F,p,y,0,T,t)},Ke=(t,e,n,s,o)=>{const r=Math.max(e,n);let c=s,l=e;if(t){const f=M(t,o);c=Math.max(f,s),l=Math.max(l,f)}return[r,c,l]},te=(t,e,n,s,o,r)=>Qe(r,t+e+n+s-o),Qe=(t,e)=>t==_?{width:e,height:0}:{width:0,height:e},ee=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:r}=B(t),c=M(e,n),l=M(e,s),f=r(e)[o];return c+l+f},Ue=(t,e)=>{const[n,s]=Ze(e),o=ee(et,t);return[ee(_,t)-s,o-n]};function tn(t,e,n,s,o,r,c,l,f){let g=0,m=0;const b=!!(n<0&&f);if(n===s&&!b)return ne({height:g,width:m},t,o,c,b);const[R,O,F,y]=sn(e,n,s,f);if(b){const[nt,ut]=Ue(l,f);g+=ut,m+=nt}const{scrollElement:p,beforeMargin:T,afterMargin:L,distance:w,gap:P}=B(t),[X,Z]=Zt(l,P),[V,H,$]=rn(T,L,R,O==null?void 0:O.previousElementSibling,y,Z,b),[k,q,J]=on(T,L,w,F,X,Z),I=nn(q,k,J,H,V,X),z=b?l[p]:en(p,l,r),Y=(y?I-$:$-I)-z;return t===et?g+=Y:t===_&&(m+=Y),ne({height:g,width:m},t,o,c,b)}const en=(t,e,n)=>{const s=e[t],o=n[t];return s-o},nn=(t,e,n,s,o,r)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+r},sn=(t,e,n,s)=>{const o=e<n,[r,c]=[e,n].toSorted((m,b)=>m-b),l=t[e]??s,f=t[n];let g=o?t.slice(r+1,c+1):t.slice(r,c);return r<0&&s&&(g=t.slice(r+1,c)),[l,f,g,o]},on=(t,e,n,s,o,r)=>{if(s.length==0)return[0,0,0];const c=M(s[0],t);let l=0,f=-c;for(const[g,m]of s.entries()){const b=m.getBoundingClientRect()[n],R=M(m,t);r&&(l+=R),r&&g>0?l+=o:l=Math.max(l,R),f+=l+b,l=M(m,e)}return[c,f,l]},ne=(t,e,n,s,o)=>{const{scroll:r,distance:c}=B(e),l=window[r],f=n[r],g=o?0:f-2*l+s[r];return t[c]+=g,t},rn=(t,e,n,s,o,r,c)=>{const l=o?n.previousElementSibling:s;return cn(t,e,l,n,r,c)},cn=(t,e,n,s,o,r)=>{if(o)return[0,0,0];const c=M(r?null:n,e),l=M(s,t);let f=Math.max(c,l);return[c,l,f]},kt=(t,e,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const c=r[0];t(o,c)}});return o.observe(e,n),o},an=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},ln=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:r}=B(t);return n[r]/(e[s]-e[o])},un="startDrag",pe="cubic-bezier(0.2, 0, 0, 1)",he=50,qt=t=>it(t)?t.classList.contains(at):!1,fn=(t,e,n)=>{let s=yt(e,un,n,t);const o=ke(t,n),{distance:r}=B(n);s[r]-=o;const[c,l]=dn(n,e);return s[l]=c,s},dn=(t,e)=>{const n=t==_?et:_,{distance:s,getRect:o}=B(n);return[o(e)[s],s]},mt=(t,e,n)=>{Ne(t,e,n),t.style.minWidth=`${n}px`},gn=(t,e,n)=>s=>{e.contains(t)&&(mt(t,n.height,n.width),s.disconnect())},pn=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:r}=s,c=ln(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:f,scrollElement:g}=B(r);c&&(n[g]=n[l]-n[f])},me=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:r}=n,{direction:c,animationDuration:l}=r;if(pn(n,e),o.querySelector(`.${at}`)||!t)return;var f=t.tagName=="LI"?"DIV":t.tagName,g=document.createElement(f);tt(g,at),mt(g,0,0);const m=fn(o,t,c);return Pt(g,l,pe,"width, min-width, height"),[g,m,o]},Yt=(t,e,n,s,o)=>{const r=me(t,n,s);if(!r)return;const[c,l,f]=r;e.isSameNode(f)&&mt(c,l.height,l.width),kt(gn(c,f,l),f,{childList:!0,subtree:!0}),f.appendChild(c)},hn=(t,e,n)=>{const s=me(t,e,n);if(!s)return;const[o,r,c]=s;c.appendChild(o),mn(o,r)},mn=(t,e)=>requestAnimationFrame(()=>{mt(t,e.height,e.width),requestAnimationFrame(()=>{Pt(t,0,pe,"width, min-width, height")})}),Sn=(t,e,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${pt(n)} > .${at}`);r.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(e)||!o&&(l!=null&&l.isSameNode(t)))return;mt(c,0,0),setTimeout(()=>{var g;(g=c.parentNode)==null||g.removeChild(c)},s+he)})}},bt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${at}`);s.forEach(o=>{const r=o;n?(mt(r,0,0),setTimeout(()=>{t.contains(r)&&t.removeChild(r)},e+he)):t.removeChild(o)})},Dn=50;function vn(t,e,n,s,o,r){let c=e;const{direction:l,handlerSelector:f,onRemoveAtEvent:g,animationDuration:m,delayBeforeInsert:b,draggingClass:R}=t,O=(u,a,h,D,C)=>{if(!D)return;const{droppable:E,config:v}=D,A=yt(u,a,v.direction,E);ze(a)?Z(u,a,A,h,D,C):T(u,a,A,D)},F=(u,a,h,D,C)=>{const E=yt(a,"insert",t.direction,h),{onInsertEvent:v}=t,A=ce(h);for(const[N,x]of A.entries())st(x,U)&&N>=u&&X(x,E);C(),setTimeout(()=>{v(u,D),Se(u,h,t),nt(a),W(a,n),bt(n,0,!0)},b)},y=(u,a,h,D)=>{if(!h||!h.droppable||!h.config)return;const{droppable:C,config:E}=h;let[v]=Rt(a,C);v=[a,...v].toReversed();const A=yt(a,"remove",E.direction,C);for(const[N,x]of v.entries())N>=u&&(P(x,A),setTimeout(()=>{D(x)},m))},p=u=>{bt(n,m,!0),setTimeout(()=>{nt(u),W(u,n)},m)},T=(u,a,h,D)=>{const{config:C,droppable:E}=D,[v]=Rt(u,E),A=ht(u,E);v.length==0&&w(h,1,C.direction,v);for(const[N,x]of v.entries()){if(!st(x,U))continue;const G=L(C.direction,u,x,h);if(!A&&G)h=G;else if(!A)continue;const K=v.length-N;w(h,K,C.direction,v),a===de?P(x,h):a===Nt&&X(x,h)}},L=(u,a,h,D)=>{const{before:C,distance:E,axis:v,getRect:A}=B(u),N=A(a),x=A(h),G=N[C],K=x[C],St=x[E],ft=K+St/2,Dt=Be(h)[v],rt=ft-Dt;return G>rt?{height:0,width:0}:D},w=(u,a,h,D)=>{const C=D.filter(v=>st(v,U)).length,{distance:E}=B(h);u[E]==0?c=Math.max(c,a):c=Math.min(c,a-1),c=Math.min(c,C)},P=(u,a)=>{const{width:h,height:D}=a;Et(u,D,h)},X=(u,a)=>{const{width:h,height:D}=a;Et(u,D,h),Pt(u,m,ge)},Z=(u,a,h,D,C,E)=>{const{droppable:v,scroll:A,config:N}=C,[x,G]=Rt(u,v),K=x.toReversed(),St=G===-1?K.length:G;K.splice(St,0,u);const[ft,Dt,rt]=V(u,G,K,v);h=yt(u,a,N.direction,n,ft,Dt);const $t=xe(),xt=tn(N.direction,K,G,rt,$t,A,D,v,u);x.length==0&&H(void 0,h,u,xt);for(const[Gt,wt]of x.toReversed().entries()){let Bt=h;rt-1>=Gt&&(Bt={height:0,width:0}),a===jt&&!st(wt,at)&&H(wt,Bt,u,xt)}$(rt,u,N,v,E)},V=(u,a,h,D)=>{const E=ht(u,D)?a:c,v=()=>a<E?[E,E+1]:a>E?[E-1,E]:[E-1,E+1],[A,N]=v(),x=h[A]??null,G=h[N]??null;return[x,G,E]},H=(u,a,h,D)=>{Et(u,a.height,a.width),Et(h,D.height,D.width)},$=(u,a,h,D,C)=>{const{onInsertEvent:E,onDragEnd:v}=h;tt(a,_t),J(a,n,D,()=>{if(Ct(a,_t),C!=null){const A=g(C,!0);A!=null&&(E(u,A,!0),v({value:A,index:u})),q(a),k()}})},k=()=>{if(s){var u=document.querySelectorAll(`${pt(s)} > .${U}`);for(const a of u)Y(a)}},q=u=>{setTimeout(()=>{Ct(u,R)},Dn)},J=(u,a,h,D)=>{setTimeout(()=>{D&&D(),I(a,h),z(h),nt(u),W(u,a),W(u,h)},m)},I=(u,a)=>{u.isSameNode(a)?bt(u,m):(bt(u,m,!0),bt(a,m))},z=u=>{if(n.isSameNode(u))return;var[a]=n.querySelectorAll(`.${at}`);if(!a)return;const{distance:h}=B(l);it(a)&&(a.style[h]="0px")},W=(u,a)=>{const[h]=Rt(u,a);for(const D of[...h,u])Y(D)},Y=u=>{it(u)&&(u.style.transition="",u.style.transform="")},nt=u=>{r(),ot(u,!1),u.style.transform="",u.style.transition="",u.style.top="",u.style.left="",fe(u,{fixedHeight:"",fixedWidth:""})},ut=(u,a)=>{const h=a.querySelector(f);gt(document.body,oe,u),gt(h||a,Wt,u)},ot=(u,a)=>{gt(u,Ft,a),ut(a,u),o.toggleGrabClass(!a)};return[O,y,F,p,ot]}const bn=t=>t.addedNodes.values().filter(n=>!qt(n)).toArray().length>0,Se=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,r=kt(()=>{const l=ce(e)[t];tt(l,s),tt(l,Kt),setTimeout(()=>{Ct(l,Kt),Ct(l,s),r.disconnect()},o)},e,{childList:!0},bn)},Tn=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:r}=t;setTimeout(()=>{o(n,s),Se(n,e,t)},r)},En=(t,e)=>{const n=(l,f)=>t.removeAtEvent(l,f),s=(l,f,g)=>t.insertEvent(l,f,g),o=()=>t.getLength(),r=l=>t.getValue(l),c=l=>l;return{direction:(e==null?void 0:e.direction)??et,handlerSelector:(e==null?void 0:e.handlerSelector)??U,draggingClass:(e==null?void 0:e.draggingClass)??"dragging",droppableClass:(e==null?void 0:e.droppableClass)??"droppable-hover",isDraggable:(e==null?void 0:e.isDraggable)??(()=>!0),onDragStart:(e==null?void 0:e.onDragStart)??(()=>{}),onDragEnd:(e==null?void 0:e.onDragEnd)??(()=>{}),droppableGroup:e==null?void 0:e.droppableGroup,onRemoveAtEvent:n,onInsertEvent:s,onGetLegth:o,onGetValue:r,animationDuration:(e==null?void 0:e.animationDuration)??200,removingClass:(e==null?void 0:e.removingClass)??"removing",insertingFromClass:(e==null?void 0:e.insertingFromClass)??"from-inserting",delayBeforeRemove:(e==null?void 0:e.delayBeforeRemove)??200,delayBeforeInsert:(e==null?void 0:e.delayBeforeInsert)??200,mapFrom:(e==null?void 0:e.mapFrom)??c}},yn=(t,e)=>{const{config:n,droppable:s}=t,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:f=>{const{index:g,value:m}=f;r({index:g,value:e(m,s)})},onInsertEvent:(f,g)=>o(f,e(g,s),!0)}},Cn=t=>{let e={offsetX:0,offsetY:0},n={top:0,left:0},s={x:0,y:0};const o=f=>{t.style.transform=`translate( ${f.x}px, ${f.y}px)`},r=f=>{t.style.top=`${f.top}px`,t.style.left=`${f.left}px`};return[(f,g,m,b)=>{const R=y=>{const{beforeMargin:p,borderBeforeWidth:T,before:L,offset:w,scroll:P,page:X,inner:Z,distance:V,axis:H,getRect:$}=B(y),k=m[X],q=window[P],J=window[Z],I=$(f)[V],z=M(f,T),W=M(f,p),Y=k-e[w],nt=ae(f,y);if(Y>=q-I/2&&Y<=q+J){const ot=Y-n[L]-z-W-q-nt;return O(y),ot}return s[H]},O=y=>{if(f&&st(f,Ft)&&y===b){const{before:p,distance:T,axis:L,getRect:w}=B(b),P=w(f)[T],X=w(g),Z=n[p]-X[p]+s[L],H=X[T]-P,$=Z/H,k=P/H,q=.1,J=.2,I=.8;let z=0;const W=ht(f,g);!W&&$<J&&$>-k?z=$/J-1:!W&&$>I&&$<1+k&&(z=1/(1-I)*($-I));const Y=q*P*z;an(g,b,Y)}},F=y=>{const{axis:p}=B(y);s[p]=R(y),o(s)};F(_),F(et)},(f,g)=>{const[m,b,R,O]=wn(f,g,t);n={top:m,left:b},r(n),e={offsetX:R,offsetY:O}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:r}=B(t);return r(e)[o]-r(n)[o]-M(n,s)},An=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,r=xn(o,e);const c=o;return c&&r&&!c.isSameNode(r)&&(n+=Lt(_,c,r),s+=Lt(et,c,r)),r&&e!=o&&(n+=Lt(_,r,e),s+=Lt(et,r,e)),[n,s]},xn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Mt}`);return n&&n.isSameNode(e)?t:n},se=(t,e,n,s)=>{const{offset:o,beforeMargin:r,page:c,borderBeforeWidth:l,scroll:f}=B(t),g=ae(n,t);return e[c]-s[o]-M(n,r)-M(n,l)-window[f]-g},wn=(t,e,n)=>{const[s,o]=An(t,n);return[se(et,t,e,{offsetX:s,offsetY:o}),se(_,t,e,{offsetX:s,offsetY:o}),s,o]},Q=class Q{static addConfig(e,n){const s=Q.configs.filter(r=>!r.droppable.isSameNode(e)),o=Ut(e);s.push({droppable:e,config:n,scroll:o}),Q.configs=s}static updateScrolls(e,n){for(const s of Q.configs){const{droppable:o}=s;(n&&Ce(o,n)||o.isSameNode(e))&&(s.scroll=Ut(o))}}static getConfig(e){return Q.configs.find(({droppable:s})=>s.isSameNode(e))}};j(Q,"configs",[]),j(Q,"removeObsoleteConfigs",()=>{const e=Q.configs.filter(({droppable:n})=>document.contains(n));Q.configs=e});let lt=Q;class Bn{constructor(e,n,s,o,r,c){j(this,"initial");j(this,"current");j(this,"parent");j(this,"draggableElement");j(this,"groupClass");j(this,"dragEvent");j(this,"changeDroppable");j(this,"mapFrom");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.mapFrom=c,this.initial=s?lt.getConfig(s):void 0,this.changeDroppable=r}getDraggableAncestor(e,n,s){return document.elementsFromPoint(e,n).filter(o=>!o.isSameNode(s))}getElementBelow(e,n,s=!0){const o=c=>{const[l]=c.getDraggableAncestor(n.clientX,n.clientY,e);return l};let r=null;return s?(e.hidden=!0,r=o(this),e.hidden=!1):r=o(this),r}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(pt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(pt(this.groupClass))):[this.parent]).every(s=>ht(e,s))}isNotInsideAnotherDroppable(e,n){return!ht(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){ue(e,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(e){const n=lt.getConfig(e);if(n)return e.isSameNode(this.parent)?n:{...n,config:yn(n,this.mapFrom)}}getCurrentConfig(e){var o;const n=this.draggableElement;if(this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable))return this.current;const s=this.getCurrent(n,e);return s?(it(s)&&!s.onscroll&&this.setOnScroll(s),this.getConfigFrom(s)):this.getConfigFrom(this.parent)}updateConfig(e){const n=this.current;this.current=this.getCurrentConfig(e),this.changeDroppable(this.current,n)}isOutside(e,n=!0){const s=this.draggableElement;return!this.getCurrent(s,e,n)}}function Rn(t,e,n,s,o){const{handlerSelector:r,isDraggable:c,droppableGroup:l,animationDuration:f,delayBeforeRemove:g,draggingClass:m,removingClass:b,onRemoveAtEvent:R,droppableClass:O,onDragStart:F}=n,y=At(l).map(i=>`droppable-group-${i}`).join(" ");let p=0,T={scrollX:0,scrollY:0},L={pageX:0,pageY:0},w,P;const[X,Z]=Cn(t),[V,H,$,k,q]=vn(n,e,s,y,o,()=>p=0),J=()=>{tt(t,U)},I=i=>{tt(i,Mt),o.addSubscriber(i)},z=()=>{if(c(t)){const i=t.querySelector(r);I(i||t)}},W=()=>{z(),J()},Y=i=>{const d=i==null?void 0:i.querySelector(`.${Mt}`),S=d==null?void 0:d.parentElement;return d&&S&&st(S,Xt)&&!S.isSameNode(s)?null:d},nt=i=>{const d=Y(i)??i;d&&c(i)&&(It(d,"onmousedown",G("mousemove","mouseup")),It(d,"ontouchstart",G("touchmove","touchend"),S=>{P={x:S.touches[0].clientX,y:S.touches[0].clientY}}),ut(d)),i!=null&&i.isSameNode(d)||It(i,"onmousedown",K),tt(s,Xt)},ut=i=>{const d=i.querySelectorAll("img");Array.from(d).forEach(S=>{S.onmousedown=()=>!1})},ot=()=>{if(L.pageX==0&&L.pageY==0||!a.current)return;const{droppable:i,config:d}=a.current;X(t,i,L,d.direction),V(t,Nt,T,a.current)},u=(i,d)=>{d&&p==2&&!(i!=null&&i.droppable.isSameNode(d.droppable))&&V(t,Nt,T,d)},a=new Bn(t,y,s,ot,u,n.mapFrom),h=i=>{if(!a.current)return;const d=y?Array.from(document.querySelectorAll(pt(y))):[s];for(const S of d)S.classList.toggle(O,!i&&S.isSameNode(a.current.droppable))},D=(i,d=!1)=>{a.updateConfig(i);const S=a.isOutside(i);h(S),p===1&&!d?rt(i):p===2&&(C(S),xt(i))},C=(i=!0)=>{if(!a.current)return;const{droppable:d}=a.current;Sn(d,s,y,f,i),!i&&Yt(t,s,p==1,a.current)},E=i=>{if(Tt(i)&&P&&p==1){const d=Math.abs(i.touches[0].clientX-P.x),S=Math.abs(i.touches[0].clientY-P.y);if(Math.abs(d)>5&&Math.abs(S)>5)return clearTimeout(w),!1}return!0},v=i=>{clearTimeout(w);const d=Vt(i);if(Tt(i)&&i.cancelable&&i.preventDefault(),Tt(i)&&!i.cancelable||!E(i)){ft("touchmove",i);return}D(d,Tt(i))},A=(i,d)=>{i=="touchmove"?w=setTimeout(()=>{d()},150):d()},N=(i,d)=>{const{clientX:S,clientY:dt}=i,ct=document.elementFromPoint(S,dt),vt=ct==null?void 0:ct.closest(`.${U}`);return vt&&d.isSameNode(vt)},x=i=>{const d=n.onGetValue(e);return{index:e,element:i,value:d}},G=(i,d)=>S=>{if(!N(S,t))return;lt.updateScrolls(s,y);const{scrollX:dt,scrollY:ct}=window;if(T={scrollX:dt,scrollY:ct},p===0){p=1;const vt=x(t);vt&&F(vt),A(i,()=>{i=="touchmove"&&(a.updateConfig(S),h(a.isOutside(S)),rt(S))}),document.addEventListener(i,v,{passive:!1}),Gt(s),document.addEventListener(d,St(i),{once:!0})}},K=i=>a.updateConfig(i),St=i=>d=>{ft(i,d)},ft=(i,d)=>{h(!0);const S=Vt(d);Bt(a.isOutside(S,!1)),clearTimeout(w),document.removeEventListener(i,v),a.updateConfig(S);const dt=a.getCurrentConfig(S);if(dt){const{droppable:ct}=dt;Dt(ct)}s.onscroll=null},Dt=i=>{if(i.onscroll=null,!y)return;const d=Array.from(document.querySelectorAll(pt(y)));for(const S of d)it(S)&&(S.onscroll=null)},rt=i=>{Yt(t,s,p==1,a.current),$t(),V(t,de,T,a.current),De(t),Z(i,t)},$t=()=>{p=2},xt=i=>{const{pageX:d,pageY:S}=i;L={pageX:d,pageY:S},ot()},Gt=i=>ue(i,"onscroll",wt),wt=()=>ot(),Bt=i=>{if(p!==2&&p!==1){p=0;return}p=3,Jt(t),t.classList.contains(Ft)&&V(t,jt,T,i?a.initial:a.current,e)},Jt=i=>{Pt(i,f,ge),Et(i,0,0)},De=i=>{const{height:d,width:S}=i.getBoundingClientRect();fe(i,{fixedHeight:`${d}px`,fixedWidth:`${S}px`}),q(i,!0),gt(i,m,!0),i.style.transition=""},ve=(i,d)=>{Ct(t,b),Yt(t,s,p==1,a.initial),H(i,t,d,S=>{Jt(S),k(t)}),R(e,!0)},be=i=>{if(!a.initial)return;const d=a.initial;i==e&&(tt(t,b),setTimeout(()=>{ve(i,d)},g))},Te=(i,d)=>{(i===e||i===n.onGetLegth()&&e===i-1)&&$(i,t,s,d,()=>{hn(t,p==1,a.initial)})};return W(),nt(t),[be,Te]}const Ln=(t,e)=>{t&&Ae(e,t)},Mn=()=>{_e(document.body,[`.${U}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Mt}{pointer-events:auto!important;}`,`.${re}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ft}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${_t}{pointer-events:none!important;}`,`.${oe}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"])};function On(t,e,n,s="index"){const o=s;let r=[],c=[];const{droppableGroup:l}=t;if(!n)return[r,c];const f=At(l).map(g=>`droppable-group-${g}`).join(" ");Mn(),Ln(f,n);for(const g of n.children){const m=g.getAttribute(o),b=we(m),R=g;if(R&&b>=0){const[O,F]=Rn(R,b,t,n,e);r.push(O),c.push(F)}}return[r,c]}function Nn(t,e,n,s="index",o=!0){let r=[],c=[];const l=En(t,n),f=p=>{for(const T of r)T(p)},g=(p,T)=>{if(l.onGetLegth()===0)t.insertToListEmpty(l,p,T);else for(const w of c)w(p,T)},m=p=>{const[T,L]=On(l,e,p,s);r=T,c=L},b=p=>{const T=p.addedNodes.values().filter(w=>!qt(w)).toArray(),L=p.removedNodes.values().filter(w=>!qt(w)).toArray();return T.length>0||L.length>0},R=p=>{kt(T=>{m(p),o||T.disconnect()},p,{childList:!0},b)},O=p=>{tt(p,Xt)},F=p=>{lt.addConfig(p,l)};return[f,g,p=>{p&&(O(p),F(p),R(p),m(p),lt.removeObsoleteConfigs())}]}exports.GRAB_CLASS=re;exports.addClass=tt;exports.dragAndDrop=Nn;exports.insertToListEmpty=Tn;exports.toggleClass=gt;
|
package/dist/react/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),y=require("../HandlerPublisher-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),y=require("../HandlerPublisher-DopQmmiO.cjs"),S=require("../index-DtPM9-d-.cjs"),h=require("react-dom");function A(a,l){const[e,n]=u.useState(a),i=u.useRef(e);u.useEffect(()=>{i.current=e},[e]);function f(t,r=!1){const s=i.current[t],c=()=>{n(o=>[...o.slice(0,t),...o.slice(t+1)])};return r?h.flushSync(c):c(),s}function d(t,r,s=!1){const c=()=>{n(o=>[...o.slice(0,t),r,...o.slice(t)])};s?h.flushSync(c):c()}function g(){return e.length}function m(t){return e[t]}function b(t,r,s){S.insertToListEmpty(t,l.current,r,s)}return[e,n,{removeAtEvent:f,insertEvent:d,getLength:g,getValue:m,insertToListEmpty:b}]}const D=new y.HandlerPublisher;function E(a,l){const e=u.useRef(null),[n,i,f]=A(a,e),[d,g,m]=S.dragAndDrop(f,D,l,"data-index",!1);return u.useEffect(()=>{m(e.current)}),[e,n,i,g,d]}exports.useDragAndDrop=E;
|
package/dist/react/index.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useState as S, useRef as d, useEffect as h } from "react";
|
2
|
-
import { H as A } from "../HandlerPublisher-
|
3
|
-
import { i as C, d as L } from "../index-
|
2
|
+
import { H as A } from "../HandlerPublisher-BjHK5JWM.js";
|
3
|
+
import { i as C, d as L } from "../index-Br5-BQhK.js";
|
4
4
|
import { flushSync as p } from "react-dom";
|
5
5
|
function b(a, u) {
|
6
6
|
const [t, n] = S(a), c = d(t);
|
package/dist/svelte/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var u=Object.defineProperty;var d=(n,t,e)=>t in n?u(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../HandlerPublisher-
|
1
|
+
"use strict";var u=Object.defineProperty;var d=(n,t,e)=>t in n?u(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../HandlerPublisher-DopQmmiO.cjs"),o=require("../index-DtPM9-d-.cjs");class g{constructor(t){s(this,"items");s(this,"parent");this.items=t}setParent(t){this.parent=t}removeAtEvent(t){const e=this.items;if(e.length<=0)return;const[r]=e.splice(t,1);return r}insertEvent(t,e){this.items.splice(t,0,e)}getLength(){return this.items.length}getValue(t){return this.items[t]}insertToListEmpty(t,e,r){o.insertToListEmpty(t,this.parent,e,r)}}const h=new c.HandlerPublisher;function m(n,t){const e=new g(n),[r,l,a]=o.dragAndDrop(e,h,t,"data-index");return[i=>(e.setParent(i),a(i),{destroy(){}}),l,r]}exports.useDragAndDrop=m;
|
package/dist/svelte/index.mjs
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
var l = Object.defineProperty;
|
2
2
|
var d = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
3
3
|
var r = (n, t, e) => d(n, typeof t != "symbol" ? t + "" : t, e);
|
4
|
-
import { H as c } from "../HandlerPublisher-
|
5
|
-
import { i as m, d as u } from "../index-
|
4
|
+
import { H as c } from "../HandlerPublisher-BjHK5JWM.js";
|
5
|
+
import { i as m, d as u } from "../index-Br5-BQhK.js";
|
6
6
|
class h {
|
7
7
|
constructor(t) {
|
8
8
|
r(this, "items");
|
package/dist/vue/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var c=Object.defineProperty;var h=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../HandlerPublisher-
|
1
|
+
"use strict";var c=Object.defineProperty;var h=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../HandlerPublisher-DopQmmiO.cjs"),u=require("../index-DtPM9-d-.cjs"),v=(n,e)=>{const t=n.value;if(t.length<=0)return;const[r]=t.splice(e,1);return r},d=(n,e,t)=>{n.value.splice(e,0,t)},m=n=>n.value.length,p=(n,e)=>n.value[e];class V{constructor(e,t){s(this,"items");s(this,"parent");this.items=e,this.parent=t}removeAtEvent(e){return v(this.items,e)}insertEvent(e,t){return d(this.items,e,t)}getLength(){return m(this.items)}getValue(e){return p(this.items,e)}insertToListEmpty(e,t,r){u.insertToListEmpty(e,this.parent.value,t,r)}}const A=new g.HandlerPublisher;function L(n,e){const t=i.ref();var r=new V(n,t);const[l,o,a]=u.dragAndDrop(r,A,e);return i.watch(t,()=>{a(t.value)}),[t,o,l]}exports.useDragAndDrop=L;
|
package/dist/vue/index.mjs
CHANGED
@@ -2,8 +2,8 @@ var l = Object.defineProperty;
|
|
2
2
|
var u = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
3
3
|
var r = (n, t, e) => u(n, typeof t != "symbol" ? t + "" : t, e);
|
4
4
|
import { ref as c, watch as m } from "vue";
|
5
|
-
import { H as h } from "../HandlerPublisher-
|
6
|
-
import { i as p, d as v } from "../index-
|
5
|
+
import { H as h } from "../HandlerPublisher-BjHK5JWM.js";
|
6
|
+
import { i as p, d as v } from "../index-Br5-BQhK.js";
|
7
7
|
const g = (n, t) => {
|
8
8
|
const e = n.value;
|
9
9
|
if (e.length <= 0)
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "fluid-dnd",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.2-beta.0",
|
4
4
|
"description": "An agnostic drag and drop library to sort all kind of lists. With current support for vue, react and svelte",
|
5
5
|
"type": "module",
|
6
6
|
"homepage": "https://fluid-dnd.netlify.app",
|
package/dist/index-D1uENWRM.cjs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";var Ce=Object.defineProperty;var ye=(t,e,n)=>e in t?Ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Z=(t,e,n)=>ye(t,typeof e!="symbol"?e+"":e,n);const U="draggable",It="droppable",Ot="handler-class",qt="dragging",Xt="dragging-handler-class",Wt="dropping",oe="grabbing",re="grab",Kt="disable-transition",st=(t,e)=>t.classList.contains(e),gt=(t,e,n=!1)=>{t.classList.toggle(e,n)},tt=(t,e)=>{t.classList.add(e)},Ct=(t,e)=>{t.classList.remove(e)},Ae=(t,e)=>yt(e).every(n=>st(t,n)),pt=t=>t?`.${yt(t).join(".")}`:"",xe=(t,e)=>{if(!e)return;const n=yt(e);t.classList.add(...n)},yt=t=>t?t.split(" ").filter(e=>e):[],_="horizontal",et="vertical",Be=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},zt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),we=t=>t?parseInt(t):-1,Re=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},ie=(t,e)=>t.x1>e.x1?ie(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,ht=(t,e)=>!Le(t,e),Le=(t,e)=>{const n=Mt(t),s=Mt(e),o=Qt(n,s,et),r=Qt(n,s,_);return o>=Math.min(n.height,s.height)/2&&r>=Math.min(n.width,s.width)/2},Qt=(t,e,n)=>{const{before:s,distance:o}=w(n);return ie({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},O=(t,e)=>t?zt(getComputedStyle(t)[e]):0,Ut=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Mt=t=>t.getBoundingClientRect(),w=t=>{const e=t==_;return{beforeMargin:e?"marginLeft":"marginTop",afterMargin:e?"marginRight":"marginBottom",borderBeforeWidth:e?"borderLeftWidth":"borderTopWidth",before:e?"left":"top",after:e?"right":"down",gap:e?"columnGap":"rowGap",distance:e?"width":"height",axis:e?"x":"y",offset:e?"offsetX":"offsetY",scroll:e?"scrollX":"scrollY",scrollElement:e?"scrollLeft":"scrollTop",page:e?"pageX":"pageY",inner:e?"innerWidth":"innerHeight",offsetElement:e?"offsetLeft":"offsetTop",scrollDistance:e?"scrollWidth":"scrollHeight",clientDistance:e?"clientWidth":"clientHeight",paddingBefore:e?"paddingLeft":"paddingTop",getRect:Mt}},wt=(t,e)=>Oe(t,e),ce=t=>[...t.children].filter(n=>st(n,U)),Oe=(t,e)=>{const n=[...e.children].filter(o=>st(o,U)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Me=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ae=(t,e)=>{const{before:n,borderBeforeWidth:s}=w(e),o=Me(t);return o?Mt(o)[n]+O(o,s):0},Lt=t=>window.TouchEvent&&t instanceof TouchEvent,rt=t=>t instanceof HTMLElement,le=t=>t instanceof MouseEvent,Ne=["onmouseup","onmousedown","onmousemove"],Fe=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},Tt=(t,e,n)=>{!t||!rt(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},Pe=(t,e,n,s)=>{t[e]=o=>{if(o.defaultPrevented)return;s&&s(o);const r=_t(o);n(r)}},Gt=(t,e,n,s)=>{n&&($e(e)?t[e]=n:Pe(t,e,n,s))},$e=t=>Ne.includes(t),Ge=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Ye=(t,e)=>{const n=(s,o)=>Xe(e,window,o,s);if(le(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,_),n(s,et)]}},_t=t=>{const e=Ie(t);if(!e)return Ge(t);const[n,s]=Ye(t,e),{clientX:o,clientY:r,pageX:c,pageY:a,screenX:f,screenY:g,target:m}=e;return{clientX:o,clientY:r,pageX:c,pageY:a,screenX:f,screenY:g,target:m,offsetX:n,offsetY:s}},Ie=t=>{if(Lt(t))return t.touches[0]??t.changedTouches[0];if(le(t))return t},Xe=(t,e,n,s)=>{const{page:o,scroll:r,before:c,borderBeforeWidth:a,getRect:f}=w(n),g=f(s);return t[o]-e[r]-g[c]-O(s,a)},Ft=(t,e,n="ease-out",s="transform")=>{rt(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},ue=(t,e,n)=>{!t||!rt(t)||(t[e]=()=>{n()})},We=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},_e=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[r]=o.cssText.match(n)||[];if(s===r)return!0}return!1},Ve=(t,e)=>{e.forEach(n=>{He(t,n)})},He=(t,e)=>{var s;var n=We(t);n.sheet&&(_e(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},fe=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&qe(t,`--${n}`,s)}},qe=(t,e,n)=>t&&t.style.setProperty(e,n),de="startDrag",Nt="drag",jt="startDrop",ze="drop",lt="temp-child",ge="cubic-bezier(0.2, 0, 0, 1)",je=t=>t===ze||t===jt,Vt=t=>!t||t.length==0?0:zt(t.replace("px","")),Ze=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=zt(n.replace("%","")),{width:r}=t.getBoundingClientRect();return r*(o/100)}return Vt(n)},Zt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=Ze(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},ke=t=>{const{top:e,left:n}=getComputedStyle(t);return[Vt(e),Vt(n)]},Je=(t,e)=>{const{gap:n}=w(e),[s,o]=Zt(t,n);return o?s:0};function Et(t,e,n,s,o=t.previousElementSibling,r=t.nextElementSibling){let{height:c,width:a}=Ke(n,t,o,r);return ht(t,s)&&e==Nt&&(c=0,a=0),{height:c,width:a}}const Ke=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:r,distance:c,gap:a,getRect:f}=w(t),g=O(e,o),m=O(e,r),v=O(s,r),[R,M]=Zt(e.parentElement,a),F=f(e)[c];if(M)return te(F,m,g,R,0,t);const[C,p,b]=Qe(n,v,g,m,o);return te(F,p,C,0,b,t)},Qe=(t,e,n,s,o)=>{const r=Math.max(e,n);let c=s,a=e;if(t){const f=O(t,o);c=Math.max(f,s),a=Math.max(a,f)}return[r,c,a]},te=(t,e,n,s,o,r)=>Ue(r,t+e+n+s-o),Ue=(t,e)=>t==_?{width:e,height:0}:{width:0,height:e},ee=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:r}=w(t),c=O(e,n),a=O(e,s),f=r(e)[o];return c+a+f},tn=(t,e)=>{const[n,s]=ke(e),o=ee(et,t);return[ee(_,t)-s,o-n]};function en(t,e,n,s,o,r,c,a,f){let g=0,m=0;const v=!!(n<0&&f);if(n===s&&!v)return ne({height:g,width:m},t,o,c,v);const[R,M,F,C]=on(e,n,s,f);if(v){const[nt,ft]=tn(a,f);g+=ft,m+=nt}const{scrollElement:p,beforeMargin:b,afterMargin:L,distance:B,gap:$}=w(t),[X,k]=Zt(a,$),[V,H,P]=cn(b,L,R,M==null?void 0:M.previousElementSibling,C,k,v),[J,q,K]=rn(b,L,B,F,X,k),G=sn(q,J,K,H,V,X),z=v?a[p]:nn(p,a,r),Y=(C?G-P:P-G)-z;return t===et?g+=Y:t===_&&(m+=Y),ne({height:g,width:m},t,o,c,v)}const nn=(t,e,n)=>{const s=e[t],o=n[t];return s-o},sn=(t,e,n,s,o,r)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+r},on=(t,e,n,s)=>{const o=e<n,[r,c]=[e,n].toSorted((m,v)=>m-v),a=t[e]??s,f=t[n];let g=o?t.slice(r+1,c+1):t.slice(r,c);return r<0&&s&&(g=t.slice(r+1,c)),[a,f,g,o]},rn=(t,e,n,s,o,r)=>{if(s.length==0)return[0,0,0];const c=O(s[0],t);let a=0,f=-c;for(const[g,m]of s.entries()){const v=m.getBoundingClientRect()[n],R=O(m,t);r&&(a+=R),r&&g>0?a+=o:a=Math.max(a,R),f+=a+v,a=O(m,e)}return[c,f,a]},ne=(t,e,n,s,o)=>{const{scroll:r,distance:c}=w(e),a=window[r],f=n[r],g=o?0:f-2*a+s[r];return t[c]+=g,t},cn=(t,e,n,s,o,r,c)=>{const a=o?n.previousElementSibling:s;return an(t,e,a,n,r,c)},an=(t,e,n,s,o,r)=>{if(o)return[0,0,0];const c=O(r?null:n,e),a=O(s,t);let f=Math.max(c,a);return[c,a,f]},kt=(t,e,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const c=r[0];t(o,c)}});return o.observe(e,n),o},ln=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},un=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:r}=w(t);return n[r]/(e[s]-e[o])},fn="startDrag",pe="cubic-bezier(0.2, 0, 0, 1)",he=50,Ht=t=>rt(t)?t.classList.contains(lt):!1,dn=(t,e,n)=>{let s=Et(e,fn,n,t);const o=Je(t,n),{distance:r}=w(n);s[r]-=o;const[c,a]=gn(n,e);return s[a]=c,s},gn=(t,e)=>{const n=t==_?et:_,{distance:s,getRect:o}=w(n);return[o(e)[s],s]},mt=(t,e,n)=>{Fe(t,e,n),t.style.minWidth=`${n}px`},pn=(t,e,n)=>s=>{e.contains(t)&&(mt(t,n.height,n.width),s.disconnect())},hn=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:r}=s,c=un(s.direction,n,o)>.99,{scrollDistance:a,clientDistance:f,scrollElement:g}=w(r);c&&(n[g]=n[a]-n[f])},me=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:r}=n,{direction:c,animationDuration:a}=r;if(hn(n,e),o.querySelector(`.${lt}`)||!t)return;var f=t.tagName=="LI"?"DIV":t.tagName,g=document.createElement(f);tt(g,lt),mt(g,0,0);const m=dn(o,t,c);return Ft(g,a,pe,"width, min-width, height"),[g,m,o]},Yt=(t,e,n,s,o)=>{const r=me(t,n,s);if(!r)return;const[c,a,f]=r;e.isSameNode(f)&&mt(c,a.height,a.width),kt(pn(c,f,a),f,{childList:!0,subtree:!0}),f.appendChild(c)},mn=(t,e,n)=>{const s=me(t,e,n);if(!s)return;const[o,r,c]=s;c.appendChild(o),Sn(o,r)},Sn=(t,e)=>requestAnimationFrame(()=>{mt(t,e.height,e.width),requestAnimationFrame(()=>{Ft(t,0,pe,"width, min-width, height")})}),Dn=(t,e,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${pt(n)} > .${lt}`);r.forEach(c=>{const a=c.parentElement;if(a!=null&&a.isSameNode(e)||!o&&(a!=null&&a.isSameNode(t)))return;mt(c,0,0),setTimeout(()=>{var g;(g=c.parentNode)==null||g.removeChild(c)},s+he)})}},bt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${lt}`);s.forEach(o=>{const r=o;n?(mt(r,0,0),setTimeout(()=>{t.contains(r)&&t.removeChild(r)},e+he)):t.removeChild(o)})},vn=50;function bn(t,e,n,s,o,r){let c=e;const{direction:a,handlerSelector:f,onRemoveAtEvent:g,animationDuration:m,delayBeforeInsert:v,draggingClass:R}=t,M=(u,l,h,S,y)=>{if(!S)return;const{droppable:T,config:E}=S,A=Et(u,l,E.direction,T);je(l)?k(u,l,A,h,S,y):b(u,l,A,S)},F=(u,l,h,S,y)=>{const T=Et(l,"insert",t.direction,h),{onInsertEvent:E}=t,A=ce(h);for(const[N,x]of A.entries())st(x,U)&&N>=u&&X(x,T);y(),setTimeout(()=>{E(u,S),Se(u,h,t),nt(l),W(l,n),bt(n,0,!0)},v)},C=(u,l,h,S)=>{if(!h||!h.droppable||!h.config)return;const{droppable:y,config:T}=h;let[E]=wt(l,y);E=[l,...E].toReversed();const A=Et(l,"remove",T.direction,y);for(const[N,x]of E.entries())N>=u&&($(x,A),setTimeout(()=>{S(x)},m))},p=u=>{bt(n,m,!0),setTimeout(()=>{nt(u),W(u,n)},m)},b=(u,l,h,S)=>{const{config:y,droppable:T}=S,[E]=wt(u,T),A=ht(u,T);E.length==0&&B(h,1,y.direction,E);for(const[N,x]of E.entries()){if(!st(x,U))continue;const I=L(y.direction,u,x,h);if(!A&&I)h=I;else if(!A)continue;const j=E.length-N;B(h,j,y.direction,E),l===de?$(x,h):l===Nt&&X(x,h)}},L=(u,l,h,S)=>{const{before:y,distance:T,axis:E,getRect:A}=w(u),N=A(l),x=A(h),I=N[y],j=x[y],St=x[T],Dt=j+St/2,it=Re(h)[E],ct=Dt-it;return I>ct?{height:0,width:0}:S},B=(u,l,h,S)=>{const y=S.filter(E=>st(E,U)).length,{distance:T}=w(h);u[T]==0?c=Math.max(c,l):c=Math.min(c,l-1),c=Math.min(c,y)},$=(u,l)=>{const{width:h,height:S}=l;Tt(u,S,h)},X=(u,l)=>{const{width:h,height:S}=l;Tt(u,S,h),Ft(u,m,ge)},k=(u,l,h,S,y,T)=>{const{droppable:E,scroll:A,config:N}=y,[x,I]=wt(u,E),j=x.toReversed(),St=I===-1?j.length:I;j.splice(St,0,u);const[Dt,it,ct]=V(u,I,j,E);h=Et(u,l,N.direction,n,Dt,it);const Pt=Be(),At=en(N.direction,j,I,ct,Pt,A,S,E,u);x.length==0&&H(void 0,h,u,At);for(const[$t,xt]of x.toReversed().entries()){let Bt=h;ct-1>=$t&&(Bt={height:0,width:0}),l===jt&&!st(xt,lt)&&H(xt,Bt,u,At)}P(ct,u,N,E,T)},V=(u,l,h,S)=>{const T=ht(u,S)?l:c,E=()=>l<T?[T,T+1]:l>T?[T-1,T]:[T-1,T+1],[A,N]=E(),x=h[A]??null,I=h[N]??null;return[x,I,T]},H=(u,l,h,S)=>{Tt(u,l.height,l.width),Tt(h,S.height,S.width)},P=(u,l,h,S,y)=>{const{onInsertEvent:T,onDragEnd:E}=h;tt(l,Wt),K(l,n,S,()=>{if(Ct(l,Wt),y!=null){const A=g(y,!0);A!=null&&(T(u,A,!0),E({value:A,index:u})),q(l),J()}})},J=()=>{if(s){var u=document.querySelectorAll(`${pt(s)} > .${U}`);for(const l of u)Y(l)}},q=u=>{setTimeout(()=>{Ct(u,R)},vn)},K=(u,l,h,S)=>{setTimeout(()=>{S&&S(),G(l,h),z(h),nt(u),W(u,l),W(u,h)},m)},G=(u,l)=>{u.isSameNode(l)?bt(u,m):(bt(u,m,!0),bt(l,m))},z=u=>{if(n.isSameNode(u))return;var[l]=n.querySelectorAll(`.${lt}`);if(!l)return;const{distance:h}=w(a);rt(l)&&(l.style[h]="0px")},W=(u,l)=>{const[h]=wt(u,l);for(const S of[...h,u])Y(S)},Y=u=>{rt(u)&&(u.style.transition="",u.style.transform="")},nt=u=>{r(),ot(u,!1),u.style.transform="",u.style.transition="",u.style.top="",u.style.left="",fe(u,{fixedHeight:"",fixedWidth:""})},ft=(u,l)=>{const h=l.querySelector(f);gt(document.body,oe,u),gt(h||l,Xt,u)},ot=(u,l)=>{gt(u,qt,l),ft(l,u),o.toggleGrabClass(!l)};return[M,C,F,p,ot]}const Tn=t=>t.addedNodes.values().filter(n=>!Ht(n)).toArray().length>0,Se=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,r=kt(()=>{const a=ce(e)[t];tt(a,s),tt(a,Kt),setTimeout(()=>{Ct(a,Kt),Ct(a,s),r.disconnect()},o)},e,{childList:!0},Tn)},En=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:r}=t;setTimeout(()=>{o(n,s),Se(n,e,t)},r)},Cn=(t,e)=>{const n=(a,f)=>t.removeAtEvent(a,f),s=(a,f,g)=>t.insertEvent(a,f,g),o=()=>t.getLength(),r=a=>t.getValue(a),c=a=>a;return{direction:(e==null?void 0:e.direction)??et,handlerSelector:(e==null?void 0:e.handlerSelector)??U,draggingClass:(e==null?void 0:e.draggingClass)??"dragging",droppableClass:(e==null?void 0:e.droppableClass)??"droppable-hover",isDraggable:(e==null?void 0:e.isDraggable)??(()=>!0),onDragStart:(e==null?void 0:e.onDragStart)??(()=>{}),onDragEnd:(e==null?void 0:e.onDragEnd)??(()=>{}),droppableGroup:e==null?void 0:e.droppableGroup,onRemoveAtEvent:n,onInsertEvent:s,onGetLegth:o,onGetValue:r,animationDuration:(e==null?void 0:e.animationDuration)??200,removingClass:(e==null?void 0:e.removingClass)??"removing",insertingFromClass:(e==null?void 0:e.insertingFromClass)??"from-inserting",delayBeforeRemove:(e==null?void 0:e.delayBeforeRemove)??200,delayBeforeInsert:(e==null?void 0:e.delayBeforeInsert)??200,mapFrom:(e==null?void 0:e.mapFrom)??c}},yn=(t,e)=>{const{config:n,droppable:s}=t,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:f=>{const{index:g,value:m}=f;r({index:g,value:e(m,s)})},onInsertEvent:(f,g)=>o(f,e(g,s),!0)}},An=t=>{let e={offsetX:0,offsetY:0},n={top:0,left:0},s={x:0,y:0};const o=f=>{t.style.transform=`translate( ${f.x}px, ${f.y}px)`},r=f=>{t.style.top=`${f.top}px`,t.style.left=`${f.left}px`};return[(f,g,m,v)=>{const R=C=>{const{beforeMargin:p,borderBeforeWidth:b,before:L,offset:B,scroll:$,page:X,inner:k,distance:V,axis:H,getRect:P}=w(C),J=m[X],q=window[$],K=window[k],G=P(f)[V],z=O(f,b),W=O(f,p),Y=J-e[B],nt=ae(f,C);if(Y>=q-G/2&&Y<=q+K){const ot=Y-n[L]-z-W-q-nt;return M(C),ot}return s[H]},M=C=>{if(f&&st(f,qt)&&C===v){const{before:p,distance:b,axis:L,getRect:B}=w(v),$=B(f)[b],X=B(g),k=n[p]-X[p]+s[L],H=X[b]-$,P=k/H,J=$/H,q=.1,K=.2,G=.8;let z=0;const W=ht(f,g);!W&&P<K&&P>-J?z=P/K-1:!W&&P>G&&P<1+J&&(z=1/(1-G)*(P-G));const Y=q*$*z;ln(g,v,Y)}},F=C=>{const{axis:p}=w(C);s[p]=R(C),o(s)};F(_),F(et)},(f,g)=>{const[m,v,R,M]=wn(f,g,t);n={top:m,left:v},r(n),e={offsetX:R,offsetY:M}}]},Rt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:r}=w(t);return r(e)[o]-r(n)[o]-O(n,s)},xn=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,r=Bn(o,e);const c=o;return c&&r&&!c.isSameNode(r)&&(n+=Rt(_,c,r),s+=Rt(et,c,r)),r&&e!=o&&(n+=Rt(_,r,e),s+=Rt(et,r,e)),[n,s]},Bn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Ot}`);return n&&n.isSameNode(e)?t:n},se=(t,e,n,s)=>{const{offset:o,beforeMargin:r,page:c,borderBeforeWidth:a,scroll:f}=w(t),g=ae(n,t);return e[c]-s[o]-O(n,r)-O(n,a)-window[f]-g},wn=(t,e,n)=>{const[s,o]=xn(t,n);return[se(et,t,e,{offsetX:s,offsetY:o}),se(_,t,e,{offsetX:s,offsetY:o}),s,o]},Q=class Q{static addConfig(e,n){const s=Q.configs.filter(r=>!r.droppable.isSameNode(e)),o=Ut(e);s.push({droppable:e,config:n,scroll:o}),Q.configs=s}static updateScrolls(e,n){for(const s of Q.configs){const{droppable:o}=s;(n&&Ae(o,n)||o.isSameNode(e))&&(s.scroll=Ut(o))}}static getConfig(e){return Q.configs.find(({droppable:s})=>s.isSameNode(e))}};Z(Q,"configs",[]),Z(Q,"removeObsoleteConfigs",()=>{const e=Q.configs.filter(({droppable:n})=>document.contains(n));Q.configs=e});let ut=Q;class Rn{constructor(e,n,s,o,r,c){Z(this,"initial");Z(this,"current");Z(this,"parent");Z(this,"draggableElement");Z(this,"groupClass");Z(this,"dragEvent");Z(this,"changeDroppable");Z(this,"mapFrom");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.mapFrom=c,this.initial=s?ut.getConfig(s):void 0,this.changeDroppable=r}getDraggableAncestor(e,n,s){return document.elementsFromPoint(e,n).filter(o=>!o.isSameNode(s))}getElementBelow(e,n,s=!0){const o=c=>{const[a]=c.getDraggableAncestor(n.clientX,n.clientY,e);return a};let r=null;return s?(e.hidden=!0,r=o(this),e.hidden=!1):r=o(this),r}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(pt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(pt(this.groupClass))):[this.parent]).every(s=>ht(e,s))}isNotInsideAnotherDroppable(e,n){return!ht(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){ue(e,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(e){const n=ut.getConfig(e);if(n)return e.isSameNode(this.parent)?n:{...n,config:yn(n,this.mapFrom)}}getCurrentConfig(e){var o;const n=this.draggableElement;if(this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable))return this.current;const s=this.getCurrent(n,e);return s?(rt(s)&&!s.onscroll&&this.setOnScroll(s),this.getConfigFrom(s)):this.getConfigFrom(this.parent)}updateConfig(e){const n=this.current;this.current=this.getCurrentConfig(e),this.changeDroppable(this.current,n)}isOutside(e,n=!0){const s=this.draggableElement;return!this.getCurrent(s,e,n)}}function Ln(t,e,n,s,o){const{handlerSelector:r,isDraggable:c,droppableGroup:a,animationDuration:f,delayBeforeRemove:g,draggingClass:m,removingClass:v,onRemoveAtEvent:R,droppableClass:M,onDragStart:F}=n,C=yt(a).map(i=>`droppable-group-${i}`).join(" ");let p=0,b={scrollX:0,scrollY:0},L={pageX:0,pageY:0},B,$;const[X,k]=An(t),[V,H,P,J,q]=bn(n,e,s,C,o,()=>p=0),K=()=>{tt(t,U)},G=i=>{tt(i,Ot),o.addSubscriber(i)},z=()=>{if(c(t)){const i=t.querySelector(r);G(i||t)}},W=()=>{z(),K()},Y=i=>{const d=i==null?void 0:i.querySelector(`.${Ot}`),D=d==null?void 0:d.parentElement;return d&&D&&st(D,It)&&!D.isSameNode(s)?null:d},nt=i=>{const d=Y(i)??i;d&&c(i)&&(Gt(d,"onmousedown",j("mousemove","mouseup")),Gt(d,"ontouchstart",j("touchmove","touchend"),D=>{B=D.changedTouches[0].clientY}),ft(d)),i!=null&&i.isSameNode(d)||Gt(i,"onmousedown",St),tt(s,It)},ft=i=>{const d=i.querySelectorAll("img");Array.from(d).forEach(D=>{D.onmousedown=()=>!1})},ot=()=>{if(L.pageX==0&&L.pageY==0||!l.current)return;const{droppable:i,config:d}=l.current;X(t,i,L,d.direction),V(t,Nt,b,l.current)},u=(i,d)=>{d&&p==2&&!(i!=null&&i.droppable.isSameNode(d.droppable))&&V(t,Nt,b,d)},l=new Rn(t,C,s,ot,u,n.mapFrom),h=i=>{if(!l.current)return;const d=C?Array.from(document.querySelectorAll(pt(C))):[s];for(const D of d)D.classList.toggle(M,!i&&D.isSameNode(l.current.droppable))},S=i=>{l.updateConfig(i);const d=l.isOutside(i);h(d),p===1?Pt(i):p===2&&(y(d),$t(i))},y=(i=!0)=>{if(!l.current)return;const{droppable:d}=l.current;Dn(d,s,C,f,i),!i&&Yt(t,s,p==1,l.current)},T=i=>{const d=t.getBoundingClientRect();return i.clientX>=d.left&&i.clientX<=d.right&&i.clientY>=d.top&&i.clientY<=d.bottom},E=i=>{if(Lt(i)&&B&&p==1){const d=i.touches[0].clientY,D=d-B;if(B=d,Math.abs(D)>5)return it("touchmove",i),!0}return!1},A=i=>{const d=_t(i);if(Lt(i)&&i.cancelable&&i.preventDefault(),Lt(i)&&!i.cancelable||!T(d)||E(i)){it("touchmove",i);return}S(d)},N=(i,d)=>{i=="touchmove"?$=setTimeout(()=>{d()},200):d()},x=(i,d)=>{const{clientX:D,clientY:dt}=i,at=document.elementFromPoint(D,dt),vt=at==null?void 0:at.closest(`.${U}`);return vt&&d.isSameNode(vt)},I=i=>{const d=n.onGetValue(e);return{index:e,element:i,value:d}},j=(i,d)=>D=>{if(!x(D,t))return;ut.updateScrolls(s,C);const{scrollX:dt,scrollY:at}=window;if(b={scrollX:dt,scrollY:at},p===0){p=1;const vt=I(t);vt&&F(vt),N(i,()=>{document.addEventListener(i,A,{passive:!1})}),xt(s),document.addEventListener(d,Dt(i),{once:!0})}},St=i=>l.updateConfig(i),Dt=i=>d=>{it(i,d)},it=(i,d)=>{h(!0);const D=_t(d);clearTimeout($),De(l.isOutside(D,!1)),document.removeEventListener(i,A),l.updateConfig(D);const dt=l.getCurrentConfig(D);if(dt){const{droppable:at}=dt;ct(at)}s.onscroll=null},ct=i=>{if(i.onscroll=null,!C)return;const d=Array.from(document.querySelectorAll(pt(C)));for(const D of d)rt(D)&&(D.onscroll=null)},Pt=i=>{Yt(t,s,p==1,l.current),At(),V(t,de,b,l.current),ve(t),k(i,t)},At=()=>{p=2},$t=i=>{const{pageX:d,pageY:D}=i;L={pageX:d,pageY:D},ot()},xt=i=>ue(i,"onscroll",Bt),Bt=()=>ot(),De=i=>{if(p!==2){p=0;return}p=3,Jt(t),V(t,jt,b,i?l.initial:l.current,e)},Jt=i=>{Ft(i,f,ge),Tt(i,0,0)},ve=i=>{const{height:d,width:D}=i.getBoundingClientRect();fe(i,{fixedHeight:`${d}px`,fixedWidth:`${D}px`}),q(i,!0),gt(i,m,!0),i.style.transition=""},be=(i,d)=>{Ct(t,v),Yt(t,s,p==1,l.initial),H(i,t,d,D=>{Jt(D),J(t)}),R(e,!0)},Te=i=>{if(!l.initial)return;const d=l.initial;i==e&&(tt(t,v),setTimeout(()=>{be(i,d)},g))},Ee=(i,d)=>{(i===e||i===n.onGetLegth()&&e===i-1)&&P(i,t,s,d,()=>{mn(t,p==1,l.initial)})};return W(),nt(t),[Te,Ee]}const On=(t,e)=>{t&&xe(e,t)},Mn=()=>{Ve(document.body,[`.${U}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Ot}{pointer-events:auto!important;}`,`.${re}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${qt}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Xt}{pointer-events:none!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${oe}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"])};function Nn(t,e,n,s="index"){const o=s;let r=[],c=[];const{droppableGroup:a}=t;if(!n)return[r,c];const f=yt(a).map(g=>`droppable-group-${g}`).join(" ");Mn(),On(f,n);for(const g of n.children){const m=g.getAttribute(o),v=we(m),R=g;if(R&&v>=0){const[M,F]=Ln(R,v,t,n,e);r.push(M),c.push(F)}}return[r,c]}function Fn(t,e,n,s="index",o=!0){let r=[],c=[];const a=Cn(t,n),f=p=>{for(const b of r)b(p)},g=(p,b)=>{if(a.onGetLegth()===0)t.insertToListEmpty(a,p,b);else for(const B of c)B(p,b)},m=p=>{const[b,L]=Nn(a,e,p,s);r=b,c=L},v=p=>{const b=p.addedNodes.values().filter(B=>!Ht(B)).toArray(),L=p.removedNodes.values().filter(B=>!Ht(B)).toArray();return b.length>0||L.length>0},R=p=>{kt(b=>{m(p),o||b.disconnect()},p,{childList:!0},v)},M=p=>{tt(p,It)},F=p=>{ut.addConfig(p,a)};return[f,g,p=>{p&&(M(p),F(p),R(p),m(p),ut.removeObsoleteConfigs())}]}exports.GRAB_CLASS=re;exports.addClass=tt;exports.dragAndDrop=Fn;exports.insertToListEmpty=En;exports.toggleClass=gt;
|