1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
!function(e,t){var n=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=466)}({102:function(e,t,n){"use strict";(function(t){var r=n(467),o=n(471),i=n(474),u=document,c=u.documentElement;function a(e,n,r,i){t.navigator.pointerEnabled?o[n](e,{mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"}[r],i):t.navigator.msPointerEnabled?o[n](e,{mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"}[r],i):(o[n](e,{mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"}[r],i),o[n](e,r,i))}function l(e){if(void 0!==e.touches)return e.touches.length;if(void 0!==e.which&&0!==e.which)return e.which;if(void 0!==e.buttons)return e.buttons;var t=e.button;return void 0!==t?1&t?1:2&t?3:4&t?2:0:void 0}function f(e,n){return void 0!==t[n]?t[n]:c.clientHeight?c[e]:u.body[e]}function s(e,t,n){var r,o=e||{},i=o.className;return o.className+=" gu-hide",r=u.elementFromPoint(t,n),o.className=i,r}function d(){return!1}function v(){return!0}function m(e){return e.width||e.right-e.left}function p(e){return e.height||e.bottom-e.top}function h(e){return e.parentNode===u?null:e.parentNode}function g(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||function e(t){return!!t&&("false"!==t.contentEditable&&("true"===t.contentEditable||e(h(t))))}(e)}function y(e){return e.nextElementSibling||function(){var t=e;do{t=t.nextSibling}while(t&&1!==t.nodeType);return t}()}function b(e,t){var n=function(e){return e.targetTouches&&e.targetTouches.length?e.targetTouches[0]:e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e}(t),r={pageX:"clientX",pageY:"clientY"};return e in r&&!(e in n)&&r[e]in n&&(e=r[e]),n[e]}e.exports=function(e,t){var n,w,T,E,S,x,C,O,I,_,j;1===arguments.length&&!1===Array.isArray(e)&&(t=e,e=[]);var M,N=null,P=t||{};void 0===P.moves&&(P.moves=v),void 0===P.accepts&&(P.accepts=v),void 0===P.invalid&&(P.invalid=function(){return!1}),void 0===P.containers&&(P.containers=e||[]),void 0===P.isContainer&&(P.isContainer=d),void 0===P.copy&&(P.copy=!1),void 0===P.copySortSource&&(P.copySortSource=!1),void 0===P.revertOnSpill&&(P.revertOnSpill=!1),void 0===P.removeOnSpill&&(P.removeOnSpill=!1),void 0===P.direction&&(P.direction="vertical"),void 0===P.ignoreInputTextSelection&&(P.ignoreInputTextSelection=!0),void 0===P.mirrorContainer&&(P.mirrorContainer=u.body);var L=r({containers:P.containers,start:function(e){var t=R(e);t&&$(t)},end:K,cancel:q,remove:V,destroy:function(){X(!0),z({})},canMove:function(e){return!!R(e)},dragging:!1});return!0===P.removeOnSpill&&L.on("over",function(e){i.rm(e,"gu-hide")}).on("out",function(e){L.dragging&&i.add(e,"gu-hide")}),X(),L;function k(e){return-1!==L.containers.indexOf(e)||P.isContainer(e)}function X(e){var t=e?"remove":"add";a(c,t,"mousedown",F),a(c,t,"mouseup",z)}function Y(e){var t=e?"remove":"add";a(c,t,"mousemove",D)}function A(e){var t=e?"remove":"add";o[t](c,"selectstart",B),o[t](c,"click",B)}function B(e){M&&e.preventDefault()}function F(e){x=e.clientX,C=e.clientY;var t=1!==l(e)||e.metaKey||e.ctrlKey;if(!t){var n=e.target,r=R(n);r&&(M=r,Y(),"mousedown"===e.type&&(g(n)?n.focus():e.preventDefault()))}}function D(e){if(M)if(0!==l(e)){if(void 0===e.clientX||e.clientX!==x||void 0===e.clientY||e.clientY!==C){if(P.ignoreInputTextSelection){var t=b("clientX",e),r=b("clientY",e),o=u.elementFromPoint(t,r);if(g(o))return}var s=M;Y(!0),A(),K(),$(s);var d,v={left:(d=T.getBoundingClientRect()).left+f("scrollLeft","pageXOffset"),top:d.top+f("scrollTop","pageYOffset")};E=b("pageX",e)-v.left,S=b("pageY",e)-v.top,i.add(_||T,"gu-transit"),function(){if(!n){var e=T.getBoundingClientRect();(n=T.cloneNode(!0)).style.width=m(e)+"px",n.style.height=p(e)+"px",i.rm(n,"gu-transit"),i.add(n,"gu-mirror"),P.mirrorContainer.appendChild(n),a(c,"add","mousemove",W),i.add(P.mirrorContainer,"gu-unselectable"),L.emit("cloned",n,T,"mirror")}}(),W(e)}}else z({})}function R(e){if(!(L.dragging&&n||k(e))){for(var t=e;h(e)&&!1===k(h(e));){if(P.invalid(e,t))return;if(!(e=h(e)))return}var r=h(e);if(r&&!P.invalid(e,t)){var o=P.moves(e,r,t,y(e));if(o)return{item:e,source:r}}}}function $(e){var t,n;t=e.item,n=e.source,("boolean"==typeof P.copy?P.copy:P.copy(t,n))&&(_=e.item.cloneNode(!0),L.emit("cloned",_,e.item,"copy")),w=e.source,T=e.item,O=I=y(e.item),L.dragging=!0,L.emit("drag",T,w)}function K(){if(L.dragging){var e=_||T;H(e,h(e))}}function U(){M=!1,Y(!0),A(!0)}function z(e){if(U(),L.dragging){var t=_||T,r=b("clientX",e),o=b("clientY",e),i=s(n,r,o),u=Q(i,r,o);u&&(_&&P.copySortSource||!_||u!==w)?H(t,u):P.removeOnSpill?V():q()}}function H(e,t){var n=h(e);_&&P.copySortSource&&t===w&&n.removeChild(T),J(t)?L.emit("cancel",e,w,w):L.emit("drop",e,t,w,I),G()}function V(){if(L.dragging){var e=_||T,t=h(e);t&&t.removeChild(e),L.emit(_?"cancel":"remove",e,t,w),G()}}function q(e){if(L.dragging){var t=arguments.length>0?e:P.revertOnSpill,n=_||T,r=h(n),o=J(r);!1===o&&t&&(_?r&&r.removeChild(_):w.insertBefore(n,O)),o||t?L.emit("cancel",n,w,w):L.emit("drop",n,r,w,I),G()}}function G(){var e=_||T;U(),n&&(i.rm(P.mirrorContainer,"gu-unselectable"),a(c,"remove","mousemove",W),h(n).removeChild(n),n=null),e&&i.rm(e,"gu-transit"),j&&clearTimeout(j),L.dragging=!1,N&&L.emit("out",e,N,w),L.emit("dragend",e),w=T=_=O=I=j=N=null}function J(e,t){var r;return r=void 0!==t?t:n?I:y(_||T),e===w&&r===O}function Q(e,t,n){for(var r=e;r&&!o();)r=h(r);return r;function o(){var o=k(r);if(!1===o)return!1;var i=Z(r,e),u=ee(r,i,t,n),c=J(r,u);return!!c||P.accepts(T,r,w,u)}}function W(e){if(n){e.preventDefault();var t=b("clientX",e),r=b("clientY",e),o=t-E,i=r-S;n.style.left=o+"px",n.style.top=i+"px";var u=_||T,c=s(n,t,r),a=Q(c,t,r),l=null!==a&&a!==N;(l||null===a)&&(N&&m("out"),N=a,l&&m("over"));var f=h(u);if(a!==w||!_||P.copySortSource){var d,v=Z(a,c);if(null!==v)d=ee(a,v,t,r);else{if(!0!==P.revertOnSpill||_)return void(_&&f&&f.removeChild(u));d=O,a=w}(null===d&&l||d!==u&&d!==y(u))&&(I=d,a.insertBefore(u,d),L.emit("shadow",u,a,w))}else f&&f.removeChild(u)}function m(e){L.emit(e,u,N,w)}}function Z(e,t){for(var n=t;n!==e&&h(n)!==e;)n=h(n);return n===c?null:n}function ee(e,t,n,r){var o,i="horizontal"===P.direction,u=t!==e?(o=t.getBoundingClientRect(),c(i?n>o.left+m(o)/2:r>o.top+p(o)/2)):function(){var t,o,u,c=e.children.length;for(t=0;t<c;t++){if(o=e.children[t],u=o.getBoundingClientRect(),i&&u.left+u.width/2>n)return o;if(!i&&u.top+u.height/2>r)return o}return null}();return u;function c(e){return e?y(t):t}}}}).call(this,n(3))},24:function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var a,l=[],f=!1,s=-1;function d(){f&&a&&(f=!1,a.length?l=a.concat(l):s=-1,l.length&&v())}function v(){if(!f){var e=c(d);f=!0;for(var t=l.length;t;){for(a=l,l=[];++s<t;)a&&a[s].run();s=-1,t=l.length}a=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function p(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new m(e,t)),1!==l.length||f||c(v)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},3:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},466:function(e,t,n){"use strict";n.r(t);var r=n(102);n.n(r),n.d(t,"dragula",function(){return r})},467:function(e,t,n){"use strict";var r=n(468),o=n(469);e.exports=function(e,t){var n=t||{},i={};return void 0===e&&(e={}),e.on=function(t,n){return i[t]?i[t].push(n):i[t]=[n],e},e.once=function(t,n){return n._once=!0,e.on(t,n),e},e.off=function(t,n){var r=arguments.length;if(1===r)delete i[t];else if(0===r)i={};else{var o=i[t];if(!o)return e;o.splice(o.indexOf(n),1)}return e},e.emit=function(){var t=r(arguments);return e.emitterSnapshot(t.shift()).apply(this,t)},e.emitterSnapshot=function(t){var u=(i[t]||[]).slice(0);return function(){var i=r(arguments),c=this||e;if("error"===t&&!1!==n.throws&&!u.length)throw 1===i.length?i[0]:i;return u.forEach(function(r){n.async?o(r,i,c):r.apply(c,i),r._once&&e.off(t,r)}),e}},e}},468:function(e,t){e.exports=function(e,t){return Array.prototype.slice.call(e,t)}},469:function(e,t,n){"use strict";var r=n(470);e.exports=function(e,t,n){e&&r(function(){e.apply(n||null,t||[])})}},470:function(e,t,n){(function(t){var n,r="function"==typeof t;n=r?function(e){t(e)}:function(e){setTimeout(e,0)},e.exports=n}).call(this,n(60).setImmediate)},471:function(e,t,n){"use strict";(function(t){var r=n(472),o=n(473),i=t.document,u=function(e,t,n,r){return e.addEventListener(t,n,r)},c=function(e,t,n,r){return e.removeEventListener(t,n,r)},a=[];function l(e,t,n){var r=function(e,t,n){var r,o;for(r=0;r<a.length;r++)if((o=a[r]).element===e&&o.type===t&&o.fn===n)return r}(e,t,n);if(r){var o=a[r].wrapper;return a.splice(r,1),o}}t.addEventListener||(u=function(e,n,r){return e.attachEvent("on"+n,function(e,n,r){var o=l(e,n,r)||function(e,n,r){return function(n){var o=n||t.event;o.target=o.target||o.srcElement,o.preventDefault=o.preventDefault||function(){o.returnValue=!1},o.stopPropagation=o.stopPropagation||function(){o.cancelBubble=!0},o.which=o.which||o.keyCode,r.call(e,o)}}(e,0,r);return a.push({wrapper:o,element:e,type:n,fn:r}),o}(e,n,r))},c=function(e,t,n){var r=l(e,t,n);if(r)return e.detachEvent("on"+t,r)}),e.exports={add:u,remove:c,fabricate:function(e,t,n){var u=-1===o.indexOf(t)?new r(t,{detail:n}):function(){var e;return i.createEvent?(e=i.createEvent("Event")).initEvent(t,!0,!0):i.createEventObject&&(e=i.createEventObject()),e}();e.dispatchEvent?e.dispatchEvent(u):e.fireEvent("on"+t,u)}}}).call(this,n(3))},472:function(e,t,n){(function(t){var n=t.CustomEvent;e.exports=function(){try{var e=new n("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?n:"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}}).call(this,n(3))},473:function(e,t,n){"use strict";(function(t){var n=[],r="",o=/^on/;for(r in t)o.test(r)&&n.push(r.slice(2));e.exports=n}).call(this,n(3))},474:function(e,t,n){"use strict";var r={},o="(?:^|\\s)",i="(?:\\s|$)";function u(e){var t=r[e];return t?t.lastIndex=0:r[e]=t=new RegExp(o+e+i,"g"),t}e.exports={add:function(e,t){var n=e.className;n.length?u(t).test(n)||(e.className+=" "+t):e.className=t},rm:function(e,t){e.className=e.className.replace(u(t)," ").trim()}}},60:function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(61),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(3))},61:function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,u=1,c={},a=!1,l=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){m(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(s="setImmediate$"+Math.random()+"$",d=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&m(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",d,!1):e.attachEvent("onmessage",d),r=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){var t=e.data;m(t)},r=function(e){i.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(o=l.documentElement,r=function(e){var t=l.createElement("script");t.onreadystatechange=function(){m(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(m,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},f.clearImmediate=v}var s,d;function v(e){delete c[e]}function m(e){if(a)setTimeout(m,0,e);else{var t=c[e];if(t){a=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{v(e),a=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(3),n(24))}});if("object"==typeof n){var r=["object"==typeof module&&"object"==typeof module.exports?module.exports:null,"undefined"!=typeof window?window:null,e&&e!==window?e:null];for(var o in n)r[0]&&(r[0][o]=n[o]),r[1]&&"__esModule"!==o&&(r[1][o]=n[o]),r[2]&&(r[2][o]=n[o])}}(this); |