@phanmn/plain-draggable
Advanced tools
Comparing version 2.5.13 to 2.5.14
@@ -0,1 +1,2 @@ | ||
var parcelRequire = undefined; | ||
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"kohH":[function(require,module,exports) { | ||
@@ -5,3 +6,3 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n=1e3/60,e=500,i=[],t=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,n)},o=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||function(n){return clearTimeout(n)},a=Date.now(),r=void 0;function u(){var n=void 0,l=void 0;r&&(o.call(window,r),r=null),i.forEach(function(e){var i;(i=e.event)&&(e.event=null,e.listener(i),n=!0)}),n?(a=Date.now(),l=!0):Date.now()-a<e&&(l=!0),l&&(r=t.call(window,u))}function l(n){var e=-1;return i.some(function(i,t){return i.listener===n&&(e=t,!0)}),e}var w={add:function(n){var e=void 0;return-1===l(n)?(i.push(e={listener:n}),function(n){e.event=n,r||u()}):null},remove:function(n){var e;(e=l(n))>-1&&(i.splice(e,1),!i.length&&r&&(o.call(window,r),r=null))}},m=w;exports.default=m; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("anim-event"));function e(t){return t&&t.__esModule?t:{default:t}}var n=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=400,o=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){o=!0}}))}catch(h){}function i(t,e,n,r){t.addEventListener(e,n,o?r:r.capture)}function u(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(t[n].identifier===e)return t[n];return null}function s(t){return t&&"number"==typeof t.clientX&&"number"==typeof t.clientY}function l(t){t.preventDefault()}var c=function(){function e(t){var n=this;r(this,e),this.startHandlers={},this.lastHandlerId=0,this.curPointerClass=null,this.curTouchId=null,this.lastPointerXY={clientX:0,clientY:0},this.lastTouchTime=0,this.options={preventDefault:!0,stopPropagation:!0},t&&["preventDefault","stopPropagation"].forEach(function(e){"boolean"==typeof t[e]&&(n.options[e]=t[e])})}return n(e,[{key:"regStartHandler",value:function(t){var e=this;return e.startHandlers[++e.lastHandlerId]=function(n){var r="mousedown"===n.type?"mouse":"touch",o=Date.now(),i=void 0,u=void 0;if("touch"===r)e.lastTouchTime=o,i=n.changedTouches[0],u=n.changedTouches[0].identifier;else{if(o-e.lastTouchTime<a)return;i=n}if(!s(i))throw new Error("No clientX/clientY");e.curPointerClass&&e.cancel(),t.call(e,i)&&(e.curPointerClass=r,e.curTouchId="touch"===r?u:null,e.lastPointerXY.clientX=i.clientX,e.lastPointerXY.clientY=i.clientY,e.options.preventDefault&&n.preventDefault(),e.options.stopPropagation&&n.stopPropagation())},e.lastHandlerId}},{key:"unregStartHandler",value:function(t){delete this.startHandlers[t]}},{key:"addStartHandler",value:function(t,e){if(!this.startHandlers[e])throw new Error("Invalid handlerId: "+e);return i(t,"mousedown",this.startHandlers[e],{capture:!1,passive:!1}),i(t,"touchstart",this.startHandlers[e],{capture:!1,passive:!1}),i(t,"dragstart",l,{capture:!1,passive:!1}),e}},{key:"removeStartHandler",value:function(t,e){if(!this.startHandlers[e])throw new Error("Invalid handlerId: "+e);return t.removeEventListener("mousedown",this.startHandlers[e],!1),t.removeEventListener("touchstart",this.startHandlers[e],!1),t.removeEventListener("dragstart",l,!1),e}},{key:"addMoveHandler",value:function(e,n){var r=this,a=t.default.add(function(t){var e="mousemove"===t.type?"mouse":"touch";if("touch"===e&&(r.lastTouchTime=Date.now()),e===r.curPointerClass){var n="touch"===e?u(t.changedTouches,r.curTouchId):t;s(n)&&(n.clientX===r.lastPointerXY.clientX&&n.clientY===r.lastPointerXY.clientY||r.move(n),r.options.preventDefault&&t.preventDefault(),r.options.stopPropagation&&t.stopPropagation())}});i(e,"mousemove",a,{capture:!1,passive:!1}),i(e,"touchmove",a,{capture:!1,passive:!1}),r.curMoveHandler=n}},{key:"move",value:function(t){s(t)&&(this.lastPointerXY.clientX=t.clientX,this.lastPointerXY.clientY=t.clientY),this.curMoveHandler&&this.curMoveHandler(this.lastPointerXY)}},{key:"addEndHandler",value:function(t,e){var n=this;function r(t){var e="mouseup"===t.type?"mouse":"touch";if("touch"===e&&(n.lastTouchTime=Date.now()),e===n.curPointerClass){var r="touch"===e?u(t.changedTouches,n.curTouchId)||(u(t.touches,n.curTouchId)?null:{}):t;r&&(n.end(r),n.options.preventDefault&&t.preventDefault(),n.options.stopPropagation&&t.stopPropagation())}}i(t,"mouseup",r,{capture:!1,passive:!1}),i(t,"touchend",r,{capture:!1,passive:!1}),n.curEndHandler=e}},{key:"end",value:function(t){s(t)&&(this.lastPointerXY.clientX=t.clientX,this.lastPointerXY.clientY=t.clientY),this.curEndHandler&&this.curEndHandler(this.lastPointerXY),this.curPointerClass=this.curTouchId=null}},{key:"addCancelHandler",value:function(t,e){var n=this;i(t,"touchcancel",function(t){n.lastTouchTime=Date.now(),null!=n.curPointerClass&&(u(t.changedTouches,n.curTouchId)||!u(t.touches,n.curTouchId))&&n.cancel()},{capture:!1,passive:!1}),n.curCancelHandler=e}},{key:"cancel",value:function(){this.curCancelHandler&&this.curCancelHandler(),this.curPointerClass=this.curTouchId=null}}],[{key:"addEventListenerWithOptions",get:function(){return i}}]),e}(),d=c;exports.default=d; | ||
},{"anim-event":"kohH"}],"9Fo6":[function(require,module,exports) { | ||
},{"anim-event":"kohH"}],"Fo6c":[function(require,module,exports) { | ||
"use strict";function e(e){return e.substr(0,1).toUpperCase()+e.substr(1)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var r=["webkit","moz","ms","o"],t=r.reduce(function(r,t){return r.push(t),r.push(e(t)),r},[]),n=r.map(function(e){return"-"+e+"-"}),u=function(){var e=void 0;return function(){return e=e||document.createElement("div").style}}(),o=function(){var e=new RegExp("^(?:"+r.join("|")+")(.)","i"),t=/[A-Z]/;return function(r){return"float"===(r=(r+"").replace(/\s/g,"").replace(/-([\da-z])/gi,function(e,r){return r.toUpperCase()}).replace(e,function(e,r){return t.test(r)?r.toLowerCase():e})).toLowerCase()?"cssFloat":r}}(),i=function(){var e=new RegExp("^(?:"+n.join("|")+")","i");return function(r){return(null!=r?r+"":"").replace(/\s/g,"").replace(e,"")}}(),a=function(e,r){var t=u();return e=e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}),t.setProperty(e,r),null!=t[e]&&t.getPropertyValue(e)===r},s={},c={};function l(r){if((r=o(r))&&null==s[r]){var n=u();if(null!=n[r])s[r]=r;else{var i=e(r);t.some(function(e){var t=e+i;return null!=n[t]&&(s[r]=t,!0)})||(s[r]=!1)}}return s[r]||void 0}function f(e,r){var t=void 0;return(e=l(e))?(c[e]=c[e]||{},(Array.isArray(r)?r:[r]).some(function(r){return r=i(r),null!=c[e][r]?!1!==c[e][r]&&(t=c[e][r],!0):a(e,r)?(t=c[e][r]=r,!0):!!n.some(function(n){var u=n+r;return!!a(e,u)&&(t=c[e][r]=u,!0)})||(c[e][r]=!1,!1)}),"string"==typeof t?t:void 0):t}var p={getName:l,getValue:f},v=p;exports.default=v; | ||
@@ -11,4 +12,4 @@ },{}],"O69e":[function(require,module,exports) { | ||
},{}],"tHsO":[function(require,module,exports) { | ||
"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};exports.__esModule=!0;var n=e(require("pointer-event")),r=e(require("cssprefix")),o=e(require("anim-event")),i=e(require("m-class-list"));i.default.ignoreNative=!0;var a,l,s,d,u,f,c,p,g,m,y,h,v,x=9e3,b=20,S="tl",w="both",E="both",B="containment",O=["tl","tr","bl","br"],T=["start","end"],C=["inside","outside"],_=[40,200,1e3],j=[100,40,0],I="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style&&!window.navigator.msPointerEnabled,P=!I&&!!document.uniqueID,W="MozAppearance"in document.documentElement.style,L=!(I||W||!window.chrome||!window.CSS),D=!I&&!P&&!W&&!L&&!window.chrome&&"WebkitAppearance"in document.documentElement.style,F=function(){var t={}.toString,e={}.hasOwnProperty.toString,n=e.call(Object);return function(r){var o,i;return r&&"[object Object]"===t.call(r)&&(!(o=Object.getPrototypeOf(r))||(i=o.hasOwnProperty("constructor")&&o.constructor)&&"function"==typeof i&&e.call(i)===n)}}(),H=Number.isFinite||function(t){return"number"==typeof t&&window.isFinite(t)},R={},A={},z=new n.default,M=0,X=D?["all-scroll","move"]:["grab","all-scroll","move"],Y=D?"move":["grabbing","move"],V="plain-draggable",N="plain-draggable-dragging",G="plain-draggable-moving",k={},q=1e3/60,U=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,q)},Z=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return clearTimeout(t)},$=function(){var t=Date.now();["x","y"].forEach(function(e){var n=K[e];if(n){var r=t-n.lastFrameTime,o=h(y,e),i=null!=n.lastValue&&Math.abs(n.lastValue-o)<10?n.lastValue:o;if(-1===n.dir?i>n.min:i<n.max){var a=i+n.speed*r*n.dir;a<n.min?a=n.min:a>n.max&&(a=n.max),h(y,e,a),n.lastValue=a}n.lastFrameTime=t}})},J=function t(){Z.call(window,v),$(),v=U.call(window,t)},K={};function Q(t,e,n){return void 0===n&&(n=null),null!=n&&("x"===e?t.scrollTo(n,t.pageYOffset):t.scrollTo(t.pageXOffset,n)),"x"===e?t.pageXOffset:t.pageYOffset}function tt(t,e,n){void 0===n&&(n=null);var r="x"===e?"scrollLeft":"scrollTop";return null!=n&&(t[r]=n),t[r]}function et(t,e,n){var r,o,i,a,l={};a=e?document.documentElement:t,l.clientWidth=a.clientWidth,l.clientHeight=a.clientHeight;var s,d=0,u=0;if(!n){var f=void 0,c=void 0;e?(f=Q(t,"x"),c=Q(t,"y"),r=getComputedStyle(document.documentElement,""),o=getComputedStyle(document.body,""),d=Q(t,"x",document.documentElement.scrollWidth+l.clientWidth+["marginLeft","marginRight","borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce(function(t,e){return t+(parseFloat(r[e])||0)+(parseFloat(o[e])||0)},0)),u=Q(t,"y",document.documentElement.scrollHeight+l.clientHeight+["marginTop","marginBottom","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"].reduce(function(t,e){return t+(parseFloat(r[e])||0)+(parseFloat(o[e])||0)},0)),Q(t,"x",f),Q(t,"y",c)):(f=tt(t,"x"),c=tt(t,"y"),i=getComputedStyle(t,""),d=tt(t,"x",t.scrollWidth+l.clientWidth+["marginLeft","marginRight","borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce(function(t,e){return t+(parseFloat(i[e])||0)},0)),u=tt(t,"y",t.scrollHeight+l.clientHeight+["marginTop","marginBottom","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"].reduce(function(t,e){return t+(parseFloat(i[e])||0)},0)),tt(t,"x",f),tt(t,"y",c))}return l.scrollWidth=l.clientWidth+d,l.scrollHeight=l.clientHeight+u,e?l.clientX=l.clientY=0:(s=t.getBoundingClientRect(),i||(i=getComputedStyle(t,"")),l.clientX=s.left+(parseFloat(i.borderLeftWidth)||0),l.clientY=s.top+(parseFloat(i.borderTopWidth)||0)),l}function nt(t){return t?F(t)?Object.keys(t).reduce(function(e,n){return e[n]=nt(t[n]),e},{}):Array.isArray(t)?t.map(nt):t:t}function rt(e,n){var r,o;return t(e)!==t(n)||(r=F(e)?"obj":Array.isArray(e)?"array":"")!=(F(n)?"obj":Array.isArray(n)?"array":"")||("obj"===r?rt(o=Object.keys(e).sort(),Object.keys(n).sort())||o.some(function(t){return rt(e[t],n[t])}):"array"===r?e.length!==n.length||e.some(function(t,e){return rt(t,n[e])}):e!==n)}function ot(t){return!(!t||t.nodeType!==Node.ELEMENT_NODE||"function"!=typeof t.getBoundingClientRect||t.compareDocumentPosition(document)&Node.DOCUMENT_POSITION_DISCONNECTED)}function it(t){if(!F(t))return null;var e;if(!H(e=t.left)&&!H(e=t.x))return null;if(t.left=t.x=e,!H(e=t.top)&&!H(e=t.y))return null;if(t.top=t.y=e,H(t.width)&&t.width>=0)t.right=t.left+t.width;else{if(!(H(t.right)&&t.right>=t.left))return null;t.width=t.right-t.left}if(H(t.height)&&t.height>=0)t.bottom=t.top+t.height;else{if(!(H(t.bottom)&&t.bottom>=t.top))return null;t.height=t.bottom-t.top}return t}function at(t){return H(t)?{value:t,isRatio:!1}:"string"==typeof t?function(t){var e,n,r=/^(.+?)(%)?$/.exec(t);return r&&H(e=parseFloat(r[1]))?{value:(n=!(!r[2]||!e))?e/100:e,isRatio:n}:null}(t.replace(/\s/g,"")):null}function lt(t){return t.isRatio?100*t.value+"%":t.value}function st(t,e,n){return"number"==typeof t?t:e+t.value*(t.isRatio?n:1)}function dt(t){if(!F(t))return null;var e;if(!(e=at(t.left))&&!(e=at(t.x)))return null;if(t.left=t.x=e,!(e=at(t.top))&&!(e=at(t.y)))return null;if(t.top=t.y=e,(e=at(t.width))&&e.value>=0)t.width=e,delete t.right;else{if(!(e=at(t.right)))return null;t.right=e,delete t.width}if((e=at(t.height))&&e.value>=0)t.height=e,delete t.bottom;else{if(!(e=at(t.bottom)))return null;t.bottom=e,delete t.height}return t}function ut(t){return Object.keys(t).reduce(function(e,n){return e[n]=lt(t[n]),e},{})}function ft(t,e){var n={left:"x",right:"x",x:"x",width:"x",top:"y",bottom:"y",y:"y",height:"y"},r={x:e.left,y:e.top},o={x:e.width,y:e.height};return it(Object.keys(t).reduce(function(e,i){return e[i]=st(t[i],"width"===i||"height"===i?0:r[n[i]],o[n[i]]),e},{}))}function ct(t,e){void 0===e&&(e=null);var n=t.getBoundingClientRect(),r={left:n.left,top:n.top,width:n.width,height:n.height};if(r.left+=window.pageXOffset,r.top+=window.pageYOffset,e){var o=window.getComputedStyle(t,""),i=parseFloat(o.borderTopWidth)||0,a=parseFloat(o.borderRightWidth)||0,l=parseFloat(o.borderBottomWidth)||0,s=parseFloat(o.borderLeftWidth)||0;r.left+=s,r.top+=i,r.width-=s+a,r.height-=i+l}return it(r)}function pt(t,e){var n=t.style;n.webkitTapHighlightColor="transparent";var o=r.default.getName("boxShadow"),i=window.getComputedStyle(t,"")[o];return i&&"none"!==i||(n[o]="0 0 1px transparent"),e&&p&&(n[p]="translateZ(0)"),t}function gt(t,e){null==d&&(!1!==X&&(d=r.default.getValue("cursor",X)),null==d&&(d=!1)),t.style.cursor=!1===d?e:d}function mt(t){null==u&&(!1!==Y&&(u=r.default.getValue("cursor",Y)),null==u&&(u=!1)),!1!==u&&(t.style.cursor=u)}function yt(t,e,n){var r=t.svgPoint;return r.x=e,r.y=n,r.matrixTransform(t.svgCtmElement.getScreenCTM().inverse())}function ht(t,e){var n=t.elementBBox;if(e.left!==n.left||e.top!==n.top){var r=t.htmlOffset;return t.elementStyle[p]="translate("+(e.left+r.left)+"px, "+(e.top+r.top)+"px)",!0}return!1}function vt(t,e){var n=t.elementBBox,r=t.elementStyle,o=t.htmlOffset,i=!1;return e.left!==n.left&&(r.left=e.left+o.left+"px",i=!0),e.top!==n.top&&(r.top=e.top+o.top+"px",i=!0),i}function xt(t,e){var n=t.elementBBox;if(e.left!==n.left||e.top!==n.top){var r=t.svgOffset,o=t.svgOriginBBox,i=yt(t,e.left-window.pageXOffset,e.top-window.pageYOffset);return t.svgTransform.setTranslate(i.x+r.x-o.x,i.y+r.y-o.y),!0}return!1}function bt(t,e,n){void 0===n&&(n=null);var r=t.elementBBox;function o(){t.minLeft>=t.maxLeft?e.left=r.left:e.left<t.minLeft?e.left=t.minLeft:e.left>t.maxLeft&&(e.left=t.maxLeft),t.minTop>=t.maxTop?e.top=r.top:e.top<t.minTop?e.top=t.minTop:e.top>t.maxTop&&(e.top=t.maxTop)}if(o(),n){if(!1===n(e))return!1;o()}var i=t.moveElm(t,e);return i&&(t.elementBBox=it({left:e.left,top:e.top,width:r.width,height:r.height})),i}function St(t){var e=t.element,n=t.elementStyle,r=ct(e),o=["display","marginTop","marginBottom","width","height"];o.unshift(p);var i=n[c];n[c]="none";var a=ct(e);t.orgStyle?o.forEach(function(e){null!=t.lastStyle[e]&&n[e]!==t.lastStyle[e]||(n[e]=t.orgStyle[e])}):(t.orgStyle=o.reduce(function(t,e){return t[e]=n[e]||"",t},{}),t.lastStyle={});var l=ct(e),s=window.getComputedStyle(e,"");"inline"===s.display&&(n.display="inline-block",["Top","Bottom"].forEach(function(t){var e=parseFloat(s["padding"+t]);n["margin"+t]=e?"-"+e+"px":"0"})),n[p]="translate(0, 0)";var d=ct(e),u=t.htmlOffset={left:d.left?-d.left:0,top:d.top?-d.top:0};return n[p]="translate("+(r.left+u.left)+"px, "+(r.top+u.top)+"px)",["width","height"].forEach(function(r){d[r]!==l[r]&&(n[r]=l[r]+"px",(d=ct(e))[r]!==l[r]&&(n[r]=l[r]-(d[r]-l[r])+"px")),t.lastStyle[r]=n[r]}),e.offsetWidth,n[c]=i,a.left===r.left&&a.top===r.top||(n[p]="translate("+(a.left+u.left)+"px, "+(a.top+u.top)+"px)"),a}function wt(t){var e=t.element,n=t.elementStyle,r=ct(e),o=["position","marginTop","marginRight","marginBottom","marginLeft","width","height"],i=n[c];n[c]="none";var a=ct(e);t.orgStyle?o.forEach(function(e){null!=t.lastStyle[e]&&n[e]!==t.lastStyle[e]||(n[e]=t.orgStyle[e])}):(t.orgStyle=o.reduce(function(t,e){return t[e]=n[e]||"",t},{}),t.lastStyle={});var l=ct(e);n.position="absolute",n.left=n.top=n.margin="0";var s=ct(e),d=t.htmlOffset={left:s.left?-s.left:0,top:s.top?-s.top:0};return n.left=r.left+d.left+"px",n.top=r.top+d.top+"px",["width","height"].forEach(function(r){s[r]!==l[r]&&(n[r]=l[r]+"px",(s=ct(e))[r]!==l[r]&&(n[r]=l[r]-(s[r]-l[r])+"px")),t.lastStyle[r]=n[r]}),e.offsetWidth,n[c]=i,a.left===r.left&&a.top===r.top||(n.left=a.left+d.left+"px",n.top=a.top+d.top+"px"),a}function Et(t){var e=t.element,n=t.svgTransform,r=e.getBoundingClientRect(),o=ct(e);n.setTranslate(0,0);var i=t.svgOriginBBox=e.getBBox(),a=e.getBoundingClientRect(),l=yt(t,a.left,a.top),s=t.svgOffset={x:i.x-l.x,y:i.y-l.y},d=yt(t,r.left,r.top);return n.setTranslate(d.x+s.x-i.x,d.y+s.y-i.y),o}function Bt(t,e){void 0===e&&(e="");var n=ct(document.documentElement),r=t.elementBBox=t.initElm(t),o=t.containmentBBox=t.containmentIsBBox?ft(t.options.containment,n)||n:ct(t.options.containment,!0);if(t.minLeft=o.left,t.maxLeft=o.right-r.width,t.minTop=o.top,t.maxTop=o.bottom-r.height,bt(t,{left:r.left,top:r.top}),t.parsedSnapTargets){var i={x:r.width,y:r.height},a={x:t.minLeft,y:t.minTop},l={x:t.maxLeft,y:t.maxTop},s={left:"x",right:"x",x:"x",width:"x",xStart:"x",xEnd:"x",xStep:"x",top:"y",bottom:"y",y:"y",height:"y",yStart:"y",yEnd:"y",yStep:"y"},d=t.parsedSnapTargets.reduce(function(t,e){var d,u="containment"===e.base?o:n,f={x:u.left,y:u.top},c={x:u.width,y:u.height};function p(n){if(null==n.center&&(n.center=e.center),null==n.xGravity&&(n.xGravity=e.gravity),null==n.yGravity&&(n.yGravity=e.gravity),null!=n.x&&null!=n.y)n.x=st(n.x,f.x,c.x),n.y=st(n.y,f.y,c.y),n.center&&(n.x-=i.x/2,n.y-=i.y/2,n.corners=["tl"]),(n.corners||e.corners).forEach(function(e){var r=n.x-("tr"===e||"br"===e?i.x:0),o=n.y-("bl"===e||"br"===e?i.y:0);if(r>=a.x&&r<=l.x&&o>=a.y&&o<=l.y){var s={x:r,y:o},d=r-n.xGravity,u=r+n.xGravity,f=o-n.yGravity,c=o+n.yGravity;d>a.x&&(s.gravityXStart=d),u<l.x&&(s.gravityXEnd=u),f>a.y&&(s.gravityYStart=f),c<l.y&&(s.gravityYEnd=c),t.push(s)}});else{var r=null!=n.x?"x":"y",o="x"===r?"y":"x",s=o+"Start",d=o+"End",u=r+"Gravity",p=r.toUpperCase(),g=o.toUpperCase(),m="gravity"+p+"Start",y="gravity"+p+"End",h="gravity"+g+"Start",v="gravity"+g+"End";if(n[r]=st(n[r],f[r],c[r]),n[s]=st(n[s],f[o],c[o]),n[d]=st(n[d],f[o],c[o])-i[o],n[s]>n[d]||n[s]>l[o]||n[d]<a[o])return;n.center&&(n[r]-=i[r]/2,n.sides=["start"]),(n.sides||e.sides).forEach(function(e){var f=n[r]-("end"===e?i[r]:0);if(f>=a[r]&&f<=l[r]){var c={},p=f-n[u],g=f+n[u];c[r]=f,p>a[r]&&(c[m]=p),g<l[r]&&(c[y]=g),n[s]>a[o]&&(c[h]=n[s]),n[d]<l[o]&&(c[v]=n[d]),t.push(c)}})}}if((d=e.element?ct(e.element):null)||e.ppBBox)e.ppBBox&&(d=ft(e.ppBBox,u)),d&&e.edges.forEach(function(t){var n=e.gravity,o=e.gravity;"outside"===t&&(n+=r.width,o+=r.height);var i=d.left-n,a=d.right+n,l=d.top-o,s=d.bottom+o,u="inside"===t?"start":"end";p({xStart:i,xEnd:a,y:d.top,sides:[u],center:!1}),p({x:d.left,yStart:l,yEnd:s,sides:[u],center:!1}),u="inside"===t?"end":"start",p({xStart:i,xEnd:a,y:d.bottom,sides:[u],center:!1}),p({x:d.right,yStart:l,yEnd:s,sides:[u],center:!1})});else{var g=[["x","y","xStart","xEnd","xStep","yStart","yEnd","yStep"].reduce(function(t,n){return e[n]&&(t[n]=st(e[n],"xStep"===n||"yStep"===n?0:f[s[n]],c[s[n]])),t},{})];["x","y"].forEach(function(t){var n=t+"Start",r=t+"End",o=t+"Step",i=t+"Gravity";g=g.reduce(function(a,l){var s=l[n],d=l[r],u=l[o];if(null!=s&&null!=d&&s>=d)return a;if(null!=u){if(u<2)return a;var f=u/2;f=e.gravity>f?f:null;for(var c=s;c<=d;c+=u){var p=Object.keys(l).reduce(function(t,e){return e!==n&&e!==r&&e!==o&&(t[e]=l[e]),t},{});p[t]=c,p[i]=f,a.push(p)}}else a.push(l);return a},[])}),g.forEach(function(t){p(t)})}return t},[]);t.snapTargets=d.length?d:null}var u={},f=t.options.autoScroll;if(f){u.isWindow=f.target===window,u.target=f.target;var c="scroll"===e,p=et(f.target,u.isWindow,c),g=it({left:p.clientX,top:p.clientY,width:p.clientWidth,height:p.clientHeight});u.scrollableBBox=g,c?t.autoScroll&&(u.scrollWidth=t.autoScroll.scrollWidth,u.scrollHeight=t.autoScroll.scrollHeight):(u.scrollWidth=p.scrollWidth,u.scrollHeight=p.scrollHeight),[["X","Width","left","right"],["Y","Height","top","bottom"]].forEach(function(t){var e=t[0],n=t[1],o=t[2],i=t[3],a=(u["scroll"+n]||0)-p["client"+n],l=f["min"+e]||0,s=H(f["max"+e])?f["max"+e]:a;if(l<s&&l<a){s>a&&(s=a);for(var d=[],c=r[n.toLowerCase()],m=f.sensitivity.length-1;m>=0;m--){var y=f.sensitivity[m],h=f.speed[m];d.push({dir:-1,speed:h,position:g[o]+y}),d.push({dir:1,speed:h,position:g[i]-y-c})}u[e.toLowerCase()]={min:l,max:s,lines:d}}})}t.autoScroll=u.x||u.y?u:null}function Ot(t){k.stop(),gt(t.options.handle,t.orgCursor),s.style.cursor=f,!1!==t.options.zIndex&&(t.elementStyle.zIndex=t.orgZIndex),g&&(s.style[g]=m);var e=i.default(t.element);G&&e.remove(G),N&&e.remove(N),a=null,z.cancel(),t.onDragEnd&&t.onDragEnd({left:t.elementBBox.left,top:t.elementBBox.top})}function Tt(t,e){return!t.disabled&&((!t.onDragStart||!1!==t.onDragStart(e))&&(a&&Ot(a),mt(t.options.handle),s.style.cursor=u||window.getComputedStyle(t.options.handle,"").cursor,!1!==t.options.zIndex&&(t.elementStyle.zIndex=t.options.zIndex),g&&(s.style[g]="none"),N&&i.default(t.element).add(N),a=t,l=!1,A.left=t.elementBBox.left-(e.clientX+window.pageXOffset),A.top=t.elementBBox.top-(e.clientY+window.pageYOffset),!0))}function Ct(t,e){var n,r=t.options;if(e.containment){var o=void 0;ot(e.containment)?e.containment!==r.containment&&(r.containment=e.containment,t.containmentIsBBox=!1,n=!0):(o=dt(nt(e.containment)))&&rt(o,r.containment)&&(r.containment=o,t.containmentIsBBox=!0,n=!0)}function i(t,e){function n(t){return"string"==typeof t?t.replace(/[, ]+/g," ").trim().toLowerCase():null}H(e.gravity)&&e.gravity>0&&(t.gravity=e.gravity);var r=n(e.corner);if(r){if("all"!==r){var o={},i=r.split(/\s/).reduce(function(t,e){return(e="tl"===(e=e.trim().replace(/^(.).*?-(.).*$/,"$1$2"))||"lt"===e?"tl":"tr"===e||"rt"===e?"tr":"bl"===e||"lb"===e?"bl":"br"===e||"rb"===e?"br":null)&&!o[e]&&(t.push(e),o[e]=!0),t},[]),a=i.length;r=a?4===a?"all":i.join(" "):null}r&&(t.corner=r)}var l=n(e.side);l&&("start"===l||"end"===l||"both"===l?t.side=l:"start end"!==l&&"end start"!==l||(t.side="both")),"boolean"==typeof e.center&&(t.center=e.center);var s=n(e.edge);s&&("inside"===s||"outside"===s||"both"===s?t.edge=s:"inside outside"!==s&&"outside inside"!==s||(t.edge="both"));var d="string"==typeof e.base?e.base.trim().toLowerCase():null;return!d||"containment"!==d&&"document"!==d||(t.base=d),t}if(null!=e.snap){var l=F(e.snap)&&null!=e.snap.targets?e.snap:{targets:e.snap},s=[],d=i({targets:s},l);d.gravity||(d.gravity=b),d.corner||(d.corner=S),d.side||(d.side=w),"boolean"!=typeof d.center&&(d.center=!1),d.edge||(d.edge=E),d.base||(d.base=B);var u=(Array.isArray(l.targets)?l.targets:[l.targets]).reduce(function(t,e){if(null==e)return t;var n,r=ot(e),o=dt(nt(e)),a=r||o?{boundingBox:e}:F(e)&&null==e.start&&null==e.end&&null==e.step?e:{x:e,y:e},l=[],u={},f=a.boundingBox;if(r||ot(f))l.push({element:f}),u.boundingBox=f;else if(n=o||dt(nt(f)))l.push({ppBBox:n}),u.boundingBox=ut(n);else{var c,p=["x","y"].reduce(function(t,e){var n,r=a[e];if(n=at(r))t[e]=n,u[e]=lt(n);else{var o=void 0,i=void 0,l=void 0;F(r)&&(o=at(r.start),i=at(r.end),l=at(r.step),o&&i&&o.isRatio===i.isRatio&&o.value>=i.value&&(c=!0)),o=t[e+"Start"]=o||{value:0,isRatio:!1},i=t[e+"End"]=i||{value:1,isRatio:!0},u[e]={start:lt(o),end:lt(i)},l&&((l.isRatio?l.value>0:l.value>=2)?(t[e+"Step"]=l,u[e].step=lt(l)):c=!0)}return t},{});if(c)return t;p.xStart&&!p.xStep&&p.yStart&&!p.yStep?l.push({xStart:p.xStart,xEnd:p.xEnd,y:p.yStart},{xStart:p.xStart,xEnd:p.xEnd,y:p.yEnd},{x:p.xStart,yStart:p.yStart,yEnd:p.yEnd},{x:p.xEnd,yStart:p.yStart,yEnd:p.yEnd}):l.push(p)}if(l.length){s.push(i(u,a));var g=u.corner||d.corner,m=u.side||d.side,y=u.edge||d.edge,h={gravity:u.gravity||d.gravity,base:u.base||d.base,center:"boolean"==typeof u.center?u.center:d.center,corners:"all"===g?O:g.split(" "),sides:"both"===m?T:[m],edges:"both"===y?C:[y]};l.forEach(function(e){["gravity","corners","sides","center","edges","base"].forEach(function(t){e[t]=h[t]}),t.push(e)})}return t},[]);u.length&&(r.snap=d,rt(u,t.parsedSnapTargets)&&(t.parsedSnapTargets=u,n=!0))}else e.hasOwnProperty("snap")&&t.parsedSnapTargets&&(r.snap=t.parsedSnapTargets=t.snapTargets=void 0);if(e.autoScroll){var f=F(e.autoScroll)?e.autoScroll:{target:!0===e.autoScroll?window:e.autoScroll},c={};c.target=ot(f.target)?f.target:window,c.speed=[],(Array.isArray(f.speed)?f.speed:[f.speed]).every(function(t,e){return!!(e<=2&&H(t))&&(c.speed[e]=t,!0)}),c.speed.length||(c.speed=_);var p=Array.isArray(f.sensitivity)?f.sensitivity:[f.sensitivity];c.sensitivity=c.speed.map(function(t,e){return H(p[e])?p[e]:j[e]}),["X","Y"].forEach(function(t){var e="min"+t,n="max"+t;H(f[e])&&f[e]>=0&&(c[e]=f[e]),H(f[n])&&f[n]>=0&&(!c[e]||f[n]>=c[e])&&(c[n]=f[n])}),rt(c,r.autoScroll)&&(r.autoScroll=c,n=!0)}else e.hasOwnProperty("autoScroll")&&(r.autoScroll&&(n=!0),r.autoScroll=void 0);if(n&&Bt(t),ot(e.handle)&&e.handle!==r.handle){r.handle&&(r.handle.style.cursor=t.orgCursor,g&&(r.handle.style[g]=t.orgUserSelect),z.removeStartHandler(r.handle,t.pointerEventHandlerId));var m=r.handle=e.handle;t.orgCursor=m.style.cursor,gt(m,t.orgCursor),g&&(t.orgUserSelect=m.style[g],m.style[g]="none"),z.addStartHandler(m,t.pointerEventHandlerId)}(H(e.zIndex)||!1===e.zIndex)&&(r.zIndex=e.zIndex,t===a&&(t.elementStyle.zIndex=!1===r.zIndex?t.orgZIndex:r.zIndex));var y,h={left:t.elementBBox.left,top:t.elementBBox.top};H(e.left)&&e.left!==h.left&&(h.left=e.left,y=!0),H(e.top)&&e.top!==h.top&&(h.top=e.top,y=!0),y&&bt(t,h),["onDrag","onMove","onDragStart","onMoveStart","onDragEnd"].forEach(function(n){"function"==typeof e[n]?(r[n]=e[n],t[n]=r[n].bind(t.ins)):e.hasOwnProperty(n)&&null==e[n]&&(r[n]=t[n]=void 0)})}k.move=function(t,e,n){Z.call(window,v),$(),y===t&&(e.x&&K.x&&(e.x.lastValue=K.x.lastValue),e.y&&K.y&&(e.y.lastValue=K.y.lastValue)),y=t,K=e,h=n;var r=Date.now();["x","y"].forEach(function(t){var e=K[t];e&&(e.lastFrameTime=r)}),v=U.call(window,J)},k.stop=function(){Z.call(window,v),$(),K={},y=null};var _t=function(){function t(t,e){var n={ins:this,options:{zIndex:x},disabled:!1};if(Object.defineProperty(this,"_id",{value:++M}),n._id=this._id,R[this._id]=n,n.initArguments=Array.prototype.slice.call(arguments),!ot(t)||t===s)throw new Error("This element is not accepted.");if(e){if(!F(e))throw new Error("Invalid options.")}else e={};var o,a=!0;if(t instanceof SVGElement&&(o=t.ownerSVGElement)){if(!t.getBBox)throw new Error("This element is not accepted. (SVGLocatable)");if(!t.transform)throw new Error("This element is not accepted. (SVGAnimatedTransformList)");n.svgTransform=t.transform.baseVal.appendItem(o.createSVGTransform()),n.svgPoint=o.createSVGPoint();var l=t.nearestViewportElement;n.svgCtmElement=W?l.appendChild(document.createElementNS(o.namespaceURI,"rect")):l,a=!1,n.initElm=Et,n.moveElm=xt}else{var d=r.default.getName("willChange");d&&(a=!1),!e.leftTop&&p?(d&&(t.style[d]="transform"),n.initElm=St,n.moveElm=ht):(d&&(t.style[d]="left, top"),n.initElm=wt,n.moveElm=vt)}if(n.element=pt(t,a),n.elementStyle=t.style,n.orgZIndex=n.elementStyle.zIndex,V&&i.default(t).add(V),n.pointerEventHandlerId=z.regStartHandler(function(t){return Tt(n,t)}),!e.containment){var u;e.containment=(u=t.parentNode)&&ot(u)?u:s}e.handle||(e.handle=t),Ct(n,e)}return t.prototype.remove=function(){var t=R[this._id];this.disabled=!0,z.unregStartHandler(z.removeStartHandler(t.options.handle,t.pointerEventHandlerId)),delete R[this._id]},t.prototype.setOptions=function(t){return F(t)&&Ct(R[this._id],t),this},t.prototype.position=function(){return Bt(R[this._id]),this},Object.defineProperty(t.prototype,"disabled",{get:function(){return R[this._id].disabled},set:function(t){var e=R[this._id];(t=!!t)!==e.disabled&&(e.disabled=t,e.disabled?(e===a&&Ot(e),e.options.handle.style.cursor=e.orgCursor,g&&(e.options.handle.style[g]=e.orgUserSelect),V&&i.default(e.element).remove(V)):(gt(e.options.handle,e.orgCursor),g&&(e.options.handle.style[g]="none"),V&&i.default(e.element).add(V)))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return R[this._id].element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return nt(R[this._id].elementBBox)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return R[this._id].elementBBox.left},set:function(t){Ct(R[this._id],{left:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return R[this._id].elementBBox.top},set:function(t){Ct(R[this._id],{top:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"containment",{get:function(){var t=R[this._id];return t.containmentIsBBox?ut(t.options.containment):t.options.containment},set:function(t){Ct(R[this._id],{containment:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snap",{get:function(){return nt(R[this._id].options.snap)},set:function(t){Ct(R[this._id],{snap:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoScroll",{get:function(){return nt(R[this._id].options.autoScroll)},set:function(t){Ct(R[this._id],{autoScroll:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"handle",{get:function(){return R[this._id].options.handle},set:function(t){Ct(R[this._id],{handle:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"zIndex",{get:function(){return R[this._id].options.zIndex},set:function(t){Ct(R[this._id],{zIndex:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDrag",{get:function(){return R[this._id].options.onDrag},set:function(t){Ct(R[this._id],{onDrag:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onMove",{get:function(){return R[this._id].options.onMove},set:function(t){Ct(R[this._id],{onMove:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDragStart",{get:function(){return R[this._id].options.onDragStart},set:function(t){Ct(R[this._id],{onDragStart:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onMoveStart",{get:function(){return R[this._id].options.onMoveStart},set:function(t){Ct(R[this._id],{onMoveStart:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDragEnd",{get:function(){return R[this._id].options.onDragEnd},set:function(t){Ct(R[this._id],{onDragEnd:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t,"draggableCursor",{get:function(){return X},set:function(t){X!==t&&(X=t,d=null,Object.keys(R).forEach(function(t){var e=R[t];e.disabled||e===a&&!1!==u||(gt(e.options.handle,e.orgCursor),e===a&&(s.style.cursor=f,s.style.cursor=window.getComputedStyle(e.options.handle,"").cursor))}))},enumerable:!0,configurable:!0}),Object.defineProperty(t,"draggingCursor",{get:function(){return Y},set:function(t){Y!==t&&(Y=t,u=null,a&&(mt(a.options.handle),!1===u&&(gt(a.options.handle,a.orgCursor),s.style.cursor=f),s.style.cursor=u||window.getComputedStyle(a.options.handle,"").cursor))},enumerable:!0,configurable:!0}),Object.defineProperty(t,"draggableClass",{get:function(){return V},set:function(t){(t=t?t+"":void 0)!==V&&(Object.keys(R).forEach(function(e){var n=R[e];if(!n.disabled){var r=i.default(n.element);V&&r.remove(V),t&&r.add(t)}}),V=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"draggingClass",{get:function(){return N},set:function(t){if((t=t?t+"":void 0)!==N){if(a){var e=i.default(a.element);N&&e.remove(N),t&&e.add(t)}N=t}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"movingClass",{get:function(){return G},set:function(t){if((t=t?t+"":void 0)!==G){if(a&&l){var e=i.default(a.element);G&&e.remove(G),t&&e.add(t)}G=t}},enumerable:!0,configurable:!0}),t}();z.addMoveHandler(document,function(t){if(a){var e={left:t.clientX+window.pageXOffset+A.left,top:t.clientY+window.pageYOffset+A.top};if(bt(a,e,a.snapTargets?function(t){var e,n=a.snapTargets.length,r=!1,o=!1;for(e=0;e<n&&(!r||!o);e++){var i=a.snapTargets[e];(null==i.gravityXStart||t.left>=i.gravityXStart)&&(null==i.gravityXEnd||t.left<=i.gravityXEnd)&&(null==i.gravityYStart||t.top>=i.gravityYStart)&&(null==i.gravityYEnd||t.top<=i.gravityYEnd)&&(r||null==i.x||(t.left=i.x,r=!0,e=-1),o||null==i.y||(t.top=i.y,o=!0,e=-1))}return t.snapped=r||o,!a.onDrag||a.onDrag(t)}:a.onDrag)){var n={},r=a.autoScroll;if(r){var o={x:a.elementBBox.left-window.pageXOffset,y:a.elementBBox.top-window.pageYOffset};["x","y"].forEach(function(t){if(r[t]){var e=r[t].min,i=r[t].max;r[t].lines.some(function(r){return(-1===r.dir?o[t]<=r.position:o[t]>=r.position)&&(n[t]={dir:r.dir,speed:r.speed/1e3,min:e,max:i},!0)})}})}n.x||n.y?(k.move(r.target,n,r.isWindow?Q:tt),e.autoScroll=!0):k.stop(),l||(l=!0,G&&i.default(a.element).add(G),a.onMoveStart&&a.onMoveStart(e)),a.onMove&&a.onMove(e)}}});var jt=function(){a&&Ot(a)};z.addEndHandler(document,jt),z.addCancelHandler(document,jt);var It=function(){c=r.default.getName("transitionProperty"),p=r.default.getName("transform"),f=s.style.cursor,(g=r.default.getName("userSelect"))&&(m=s.style[g]);var t,e={};function n(t,e){t.initElm?Bt(t,e):(console.log("instance may have an error:"),console.log(t))}var i=!1,l=o.default.add(function(r){i||(i=!0,a&&(n(a,r.type),z.move(),e[a._id]=!0),clearTimeout(t),t=setTimeout(function(){var o;o=r.type,clearTimeout(t),Object.keys(R).forEach(function(t){e[t]||n(R[t],o)}),e={}},200),i=!1)});window.addEventListener("resize",l,!0),window.addEventListener("scroll",l,!0)};(s=document.body)?It():document.addEventListener("DOMContentLoaded",function(){s=document.body,It()},!0),exports.default=_t; | ||
},{"pointer-event":"cjFF","cssprefix":"9Fo6","anim-event":"kohH","m-class-list":"O69e"}]},{},["tHsO"], null) | ||
//# sourceMappingURL=/plainDraggable.min.js.map | ||
"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("pointer-event")),r=e(require("cssprefix")),o=e(require("anim-event")),i=e(require("m-class-list"));i.default.ignoreNative=!0;var a,l,s,d,u,f,c,p,g,m,y,h,v,x=9e3,b=20,S="tl",w="both",E="both",B="containment",O=["tl","tr","bl","br"],T=["start","end"],C=["inside","outside"],_=[40,200,1e3],j=[100,40,0],I="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style&&!window.navigator.msPointerEnabled,P=!I&&!!document.uniqueID,W="MozAppearance"in document.documentElement.style,L=!(I||W||!window.chrome||!window.CSS),D=!I&&!P&&!W&&!L&&!window.chrome&&"WebkitAppearance"in document.documentElement.style,F=function(){var t={}.toString,e={}.hasOwnProperty.toString,n=e.call(Object);return function(r){var o,i;return r&&"[object Object]"===t.call(r)&&(!(o=Object.getPrototypeOf(r))||(i=o.hasOwnProperty("constructor")&&o.constructor)&&"function"==typeof i&&e.call(i)===n)}}(),H=Number.isFinite||function(t){return"number"==typeof t&&window.isFinite(t)},R={},A={},z=new n.default,M=0,X=D?["all-scroll","move"]:["grab","all-scroll","move"],Y=D?"move":["grabbing","move"],V="plain-draggable",N="plain-draggable-dragging",G="plain-draggable-moving",k={},q=1e3/60,U=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,q)},Z=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return clearTimeout(t)},$=function(){var t=Date.now();["x","y"].forEach(function(e){var n=K[e];if(n){var r=t-n.lastFrameTime,o=h(y,e),i=null!=n.lastValue&&Math.abs(n.lastValue-o)<10?n.lastValue:o;if(-1===n.dir?i>n.min:i<n.max){var a=i+n.speed*r*n.dir;a<n.min?a=n.min:a>n.max&&(a=n.max),h(y,e,a),n.lastValue=a}n.lastFrameTime=t}})},J=function t(){Z.call(window,v),$(),v=U.call(window,t)},K={};function Q(t,e,n){return void 0===n&&(n=null),null!=n&&("x"===e?t.scrollTo(n,t.pageYOffset):t.scrollTo(t.pageXOffset,n)),"x"===e?t.pageXOffset:t.pageYOffset}function tt(t,e,n){void 0===n&&(n=null);var r="x"===e?"scrollLeft":"scrollTop";return null!=n&&(t[r]=n),t[r]}function et(t,e,n){var r,o,i,a,l={};a=e?document.documentElement:t,l.clientWidth=a.clientWidth,l.clientHeight=a.clientHeight;var s,d=0,u=0;if(!n){var f=void 0,c=void 0;e?(f=Q(t,"x"),c=Q(t,"y"),r=getComputedStyle(document.documentElement,""),o=getComputedStyle(document.body,""),d=Q(t,"x",document.documentElement.scrollWidth+l.clientWidth+["marginLeft","marginRight","borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce(function(t,e){return t+(parseFloat(r[e])||0)+(parseFloat(o[e])||0)},0)),u=Q(t,"y",document.documentElement.scrollHeight+l.clientHeight+["marginTop","marginBottom","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"].reduce(function(t,e){return t+(parseFloat(r[e])||0)+(parseFloat(o[e])||0)},0)),Q(t,"x",f),Q(t,"y",c)):(f=tt(t,"x"),c=tt(t,"y"),i=getComputedStyle(t,""),d=tt(t,"x",t.scrollWidth+l.clientWidth+["marginLeft","marginRight","borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce(function(t,e){return t+(parseFloat(i[e])||0)},0)),u=tt(t,"y",t.scrollHeight+l.clientHeight+["marginTop","marginBottom","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"].reduce(function(t,e){return t+(parseFloat(i[e])||0)},0)),tt(t,"x",f),tt(t,"y",c))}return l.scrollWidth=l.clientWidth+d,l.scrollHeight=l.clientHeight+u,e?l.clientX=l.clientY=0:(s=t.getBoundingClientRect(),i||(i=getComputedStyle(t,"")),l.clientX=s.left+(parseFloat(i.borderLeftWidth)||0),l.clientY=s.top+(parseFloat(i.borderTopWidth)||0)),l}function nt(t){return t?F(t)?Object.keys(t).reduce(function(e,n){return e[n]=nt(t[n]),e},{}):Array.isArray(t)?t.map(nt):t:t}function rt(e,n){var r,o;return t(e)!==t(n)||(r=F(e)?"obj":Array.isArray(e)?"array":"")!=(F(n)?"obj":Array.isArray(n)?"array":"")||("obj"===r?rt(o=Object.keys(e).sort(),Object.keys(n).sort())||o.some(function(t){return rt(e[t],n[t])}):"array"===r?e.length!==n.length||e.some(function(t,e){return rt(t,n[e])}):e!==n)}function ot(t){return!(!t||t.nodeType!==Node.ELEMENT_NODE||"function"!=typeof t.getBoundingClientRect||t.compareDocumentPosition(document)&Node.DOCUMENT_POSITION_DISCONNECTED)}function it(t){if(!F(t))return null;var e;if(!H(e=t.left)&&!H(e=t.x))return null;if(t.left=t.x=e,!H(e=t.top)&&!H(e=t.y))return null;if(t.top=t.y=e,H(t.width)&&t.width>=0)t.right=t.left+t.width;else{if(!(H(t.right)&&t.right>=t.left))return null;t.width=t.right-t.left}if(H(t.height)&&t.height>=0)t.bottom=t.top+t.height;else{if(!(H(t.bottom)&&t.bottom>=t.top))return null;t.height=t.bottom-t.top}return t}function at(t){return H(t)?{value:t,isRatio:!1}:"string"==typeof t?function(t){var e,n,r=/^(.+?)(%)?$/.exec(t);return r&&H(e=parseFloat(r[1]))?{value:(n=!(!r[2]||!e))?e/100:e,isRatio:n}:null}(t.replace(/\s/g,"")):null}function lt(t){return t.isRatio?100*t.value+"%":t.value}function st(t,e,n){return"number"==typeof t?t:e+t.value*(t.isRatio?n:1)}function dt(t){if(!F(t))return null;var e;if(!(e=at(t.left))&&!(e=at(t.x)))return null;if(t.left=t.x=e,!(e=at(t.top))&&!(e=at(t.y)))return null;if(t.top=t.y=e,(e=at(t.width))&&e.value>=0)t.width=e,delete t.right;else{if(!(e=at(t.right)))return null;t.right=e,delete t.width}if((e=at(t.height))&&e.value>=0)t.height=e,delete t.bottom;else{if(!(e=at(t.bottom)))return null;t.bottom=e,delete t.height}return t}function ut(t){return Object.keys(t).reduce(function(e,n){return e[n]=lt(t[n]),e},{})}function ft(t,e){var n={left:"x",right:"x",x:"x",width:"x",top:"y",bottom:"y",y:"y",height:"y"},r={x:e.left,y:e.top},o={x:e.width,y:e.height};return it(Object.keys(t).reduce(function(e,i){return e[i]=st(t[i],"width"===i||"height"===i?0:r[n[i]],o[n[i]]),e},{}))}function ct(t,e){void 0===e&&(e=null);var n=t.getBoundingClientRect(),r={left:n.left,top:n.top,width:n.width,height:n.height};if(r.left+=window.pageXOffset,r.top+=window.pageYOffset,e){var o=window.getComputedStyle(t,""),i=parseFloat(o.borderTopWidth)||0,a=parseFloat(o.borderRightWidth)||0,l=parseFloat(o.borderBottomWidth)||0,s=parseFloat(o.borderLeftWidth)||0;r.left+=s,r.top+=i,r.width-=s+a,r.height-=i+l}return it(r)}function pt(t,e){var n=t.style;n.webkitTapHighlightColor="transparent";var o=r.default.getName("boxShadow"),i=window.getComputedStyle(t,"")[o];return i&&"none"!==i||(n[o]="0 0 1px transparent"),e&&p&&(n[p]="translateZ(0)"),t}function gt(t,e){null==d&&(!1!==X&&(d=r.default.getValue("cursor",X)),null==d&&(d=!1)),t.style.cursor=!1===d?e:d}function mt(t){null==u&&(!1!==Y&&(u=r.default.getValue("cursor",Y)),null==u&&(u=!1)),!1!==u&&(t.style.cursor=u)}function yt(t,e,n){var r=t.svgPoint;return r.x=e,r.y=n,r.matrixTransform(t.svgCtmElement.getScreenCTM().inverse())}function ht(t,e){var n=t.elementBBox;if(e.left!==n.left||e.top!==n.top){var r=t.htmlOffset;return t.elementStyle[p]="translate("+(e.left+r.left)+"px, "+(e.top+r.top)+"px)",!0}return!1}function vt(t,e){var n=t.elementBBox,r=t.elementStyle,o=t.htmlOffset,i=!1;return e.left!==n.left&&(r.left=e.left+o.left+"px",i=!0),e.top!==n.top&&(r.top=e.top+o.top+"px",i=!0),i}function xt(t,e){var n=t.elementBBox;if(e.left!==n.left||e.top!==n.top){var r=t.svgOffset,o=t.svgOriginBBox,i=yt(t,e.left-window.pageXOffset,e.top-window.pageYOffset);return t.svgTransform.setTranslate(i.x+r.x-o.x,i.y+r.y-o.y),!0}return!1}function bt(t,e,n){void 0===n&&(n=null);var r=t.elementBBox;function o(){t.minLeft>=t.maxLeft?e.left=r.left:e.left<t.minLeft?e.left=t.minLeft:e.left>t.maxLeft&&(e.left=t.maxLeft),t.minTop>=t.maxTop?e.top=r.top:e.top<t.minTop?e.top=t.minTop:e.top>t.maxTop&&(e.top=t.maxTop)}if(o(),n){if(!1===n(e))return!1;o()}var i=t.moveElm(t,e);return i&&(t.elementBBox=it({left:e.left,top:e.top,width:r.width,height:r.height})),i}function St(t){var e=t.element,n=t.elementStyle,r=ct(e),o=["display","marginTop","marginBottom","width","height"];o.unshift(p);var i=n[c];n[c]="none";var a=ct(e);t.orgStyle?o.forEach(function(e){null!=t.lastStyle[e]&&n[e]!==t.lastStyle[e]||(n[e]=t.orgStyle[e])}):(t.orgStyle=o.reduce(function(t,e){return t[e]=n[e]||"",t},{}),t.lastStyle={});var l=ct(e),s=window.getComputedStyle(e,"");"inline"===s.display&&(n.display="inline-block",["Top","Bottom"].forEach(function(t){var e=parseFloat(s["padding"+t]);n["margin"+t]=e?"-"+e+"px":"0"})),n[p]="translate(0, 0)";var d=ct(e),u=t.htmlOffset={left:d.left?-d.left:0,top:d.top?-d.top:0};return n[p]="translate("+(r.left+u.left)+"px, "+(r.top+u.top)+"px)",["width","height"].forEach(function(r){d[r]!==l[r]&&(n[r]=l[r]+"px",(d=ct(e))[r]!==l[r]&&(n[r]=l[r]-(d[r]-l[r])+"px")),t.lastStyle[r]=n[r]}),e.offsetWidth,n[c]=i,a.left===r.left&&a.top===r.top||(n[p]="translate("+(a.left+u.left)+"px, "+(a.top+u.top)+"px)"),a}function wt(t){var e=t.element,n=t.elementStyle,r=ct(e),o=["position","marginTop","marginRight","marginBottom","marginLeft","width","height"],i=n[c];n[c]="none";var a=ct(e);t.orgStyle?o.forEach(function(e){null!=t.lastStyle[e]&&n[e]!==t.lastStyle[e]||(n[e]=t.orgStyle[e])}):(t.orgStyle=o.reduce(function(t,e){return t[e]=n[e]||"",t},{}),t.lastStyle={});var l=ct(e);n.position="absolute",n.left=n.top=n.margin="0";var s=ct(e),d=t.htmlOffset={left:s.left?-s.left:0,top:s.top?-s.top:0};return n.left=r.left+d.left+"px",n.top=r.top+d.top+"px",["width","height"].forEach(function(r){s[r]!==l[r]&&(n[r]=l[r]+"px",(s=ct(e))[r]!==l[r]&&(n[r]=l[r]-(s[r]-l[r])+"px")),t.lastStyle[r]=n[r]}),e.offsetWidth,n[c]=i,a.left===r.left&&a.top===r.top||(n.left=a.left+d.left+"px",n.top=a.top+d.top+"px"),a}function Et(t){var e=t.element,n=t.svgTransform,r=e.getBoundingClientRect(),o=ct(e);n.setTranslate(0,0);var i=t.svgOriginBBox=e.getBBox(),a=e.getBoundingClientRect(),l=yt(t,a.left,a.top),s=t.svgOffset={x:i.x-l.x,y:i.y-l.y},d=yt(t,r.left,r.top);return n.setTranslate(d.x+s.x-i.x,d.y+s.y-i.y),o}function Bt(t,e){void 0===e&&(e="");var n=ct(document.documentElement),r=t.elementBBox=t.initElm(t),o=t.containmentBBox=t.containmentIsBBox?ft(t.options.containment,n)||n:ct(t.options.containment,!0);if(t.minLeft=o.left,t.maxLeft=o.right-r.width,t.minTop=o.top,t.maxTop=o.bottom-r.height,bt(t,{left:r.left,top:r.top}),t.parsedSnapTargets){var i={x:r.width,y:r.height},a={x:t.minLeft,y:t.minTop},l={x:t.maxLeft,y:t.maxTop},s={left:"x",right:"x",x:"x",width:"x",xStart:"x",xEnd:"x",xStep:"x",top:"y",bottom:"y",y:"y",height:"y",yStart:"y",yEnd:"y",yStep:"y"},d=t.parsedSnapTargets.reduce(function(t,e){var d,u="containment"===e.base?o:n,f={x:u.left,y:u.top},c={x:u.width,y:u.height};function p(n){if(null==n.center&&(n.center=e.center),null==n.xGravity&&(n.xGravity=e.gravity),null==n.yGravity&&(n.yGravity=e.gravity),null!=n.x&&null!=n.y)n.x=st(n.x,f.x,c.x),n.y=st(n.y,f.y,c.y),n.center&&(n.x-=i.x/2,n.y-=i.y/2,n.corners=["tl"]),(n.corners||e.corners).forEach(function(e){var r=n.x-("tr"===e||"br"===e?i.x:0),o=n.y-("bl"===e||"br"===e?i.y:0);if(r>=a.x&&r<=l.x&&o>=a.y&&o<=l.y){var s={x:r,y:o},d=r-n.xGravity,u=r+n.xGravity,f=o-n.yGravity,c=o+n.yGravity;d>a.x&&(s.gravityXStart=d),u<l.x&&(s.gravityXEnd=u),f>a.y&&(s.gravityYStart=f),c<l.y&&(s.gravityYEnd=c),t.push(s)}});else{var r=null!=n.x?"x":"y",o="x"===r?"y":"x",s=o+"Start",d=o+"End",u=r+"Gravity",p=r.toUpperCase(),g=o.toUpperCase(),m="gravity"+p+"Start",y="gravity"+p+"End",h="gravity"+g+"Start",v="gravity"+g+"End";if(n[r]=st(n[r],f[r],c[r]),n[s]=st(n[s],f[o],c[o]),n[d]=st(n[d],f[o],c[o])-i[o],n[s]>n[d]||n[s]>l[o]||n[d]<a[o])return;n.center&&(n[r]-=i[r]/2,n.sides=["start"]),(n.sides||e.sides).forEach(function(e){var f=n[r]-("end"===e?i[r]:0);if(f>=a[r]&&f<=l[r]){var c={},p=f-n[u],g=f+n[u];c[r]=f,p>a[r]&&(c[m]=p),g<l[r]&&(c[y]=g),n[s]>a[o]&&(c[h]=n[s]),n[d]<l[o]&&(c[v]=n[d]),t.push(c)}})}}if((d=e.element?ct(e.element):null)||e.ppBBox)e.ppBBox&&(d=ft(e.ppBBox,u)),d&&e.edges.forEach(function(t){var n=e.gravity,o=e.gravity;"outside"===t&&(n+=r.width,o+=r.height);var i=d.left-n,a=d.right+n,l=d.top-o,s=d.bottom+o,u="inside"===t?"start":"end";p({xStart:i,xEnd:a,y:d.top,sides:[u],center:!1}),p({x:d.left,yStart:l,yEnd:s,sides:[u],center:!1}),u="inside"===t?"end":"start",p({xStart:i,xEnd:a,y:d.bottom,sides:[u],center:!1}),p({x:d.right,yStart:l,yEnd:s,sides:[u],center:!1})});else{var g=[["x","y","xStart","xEnd","xStep","yStart","yEnd","yStep"].reduce(function(t,n){return e[n]&&(t[n]=st(e[n],"xStep"===n||"yStep"===n?0:f[s[n]],c[s[n]])),t},{})];["x","y"].forEach(function(t){var n=t+"Start",r=t+"End",o=t+"Step",i=t+"Gravity";g=g.reduce(function(a,l){var s=l[n],d=l[r],u=l[o];if(null!=s&&null!=d&&s>=d)return a;if(null!=u){if(u<2)return a;var f=u/2;f=e.gravity>f?f:null;for(var c=s;c<=d;c+=u){var p=Object.keys(l).reduce(function(t,e){return e!==n&&e!==r&&e!==o&&(t[e]=l[e]),t},{});p[t]=c,p[i]=f,a.push(p)}}else a.push(l);return a},[])}),g.forEach(function(t){p(t)})}return t},[]);t.snapTargets=d.length?d:null}var u={},f=t.options.autoScroll;if(f){u.isWindow=f.target===window,u.target=f.target;var c="scroll"===e,p=et(f.target,u.isWindow,c),g=it({left:p.clientX,top:p.clientY,width:p.clientWidth,height:p.clientHeight});u.scrollableBBox=g,c?t.autoScroll&&(u.scrollWidth=t.autoScroll.scrollWidth,u.scrollHeight=t.autoScroll.scrollHeight):(u.scrollWidth=p.scrollWidth,u.scrollHeight=p.scrollHeight),[["X","Width","left","right"],["Y","Height","top","bottom"]].forEach(function(t){var e=t[0],n=t[1],o=t[2],i=t[3],a=(u["scroll"+n]||0)-p["client"+n],l=f["min"+e]||0,s=H(f["max"+e])?f["max"+e]:a;if(l<s&&l<a){s>a&&(s=a);for(var d=[],c=r[n.toLowerCase()],m=f.sensitivity.length-1;m>=0;m--){var y=f.sensitivity[m],h=f.speed[m];d.push({dir:-1,speed:h,position:g[o]+y}),d.push({dir:1,speed:h,position:g[i]-y-c})}u[e.toLowerCase()]={min:l,max:s,lines:d}}})}t.autoScroll=u.x||u.y?u:null}function Ot(t){k.stop(),gt(t.options.handle,t.orgCursor),s.style.cursor=f,!1!==t.options.zIndex&&(t.elementStyle.zIndex=t.orgZIndex),g&&(s.style[g]=m);var e=i.default(t.element);G&&e.remove(G),N&&e.remove(N),a=null,z.cancel(),t.onDragEnd&&t.onDragEnd({left:t.elementBBox.left,top:t.elementBBox.top})}function Tt(t,e){return!t.disabled&&((!t.onDragStart||!1!==t.onDragStart(e))&&(a&&Ot(a),mt(t.options.handle),s.style.cursor=u||window.getComputedStyle(t.options.handle,"").cursor,!1!==t.options.zIndex&&(t.elementStyle.zIndex=t.options.zIndex),g&&(s.style[g]="none"),N&&i.default(t.element).add(N),a=t,l=!1,A.left=t.elementBBox.left-(e.clientX+window.pageXOffset),A.top=t.elementBBox.top-(e.clientY+window.pageYOffset),!0))}function Ct(t,e){var n,r=t.options;if(e.containment){var o=void 0;ot(e.containment)?e.containment!==r.containment&&(r.containment=e.containment,t.containmentIsBBox=!1,n=!0):(o=dt(nt(e.containment)))&&rt(o,r.containment)&&(r.containment=o,t.containmentIsBBox=!0,n=!0)}function i(t,e){function n(t){return"string"==typeof t?t.replace(/[, ]+/g," ").trim().toLowerCase():null}H(e.gravity)&&e.gravity>0&&(t.gravity=e.gravity);var r=n(e.corner);if(r){if("all"!==r){var o={},i=r.split(/\s/).reduce(function(t,e){return(e="tl"===(e=e.trim().replace(/^(.).*?-(.).*$/,"$1$2"))||"lt"===e?"tl":"tr"===e||"rt"===e?"tr":"bl"===e||"lb"===e?"bl":"br"===e||"rb"===e?"br":null)&&!o[e]&&(t.push(e),o[e]=!0),t},[]),a=i.length;r=a?4===a?"all":i.join(" "):null}r&&(t.corner=r)}var l=n(e.side);l&&("start"===l||"end"===l||"both"===l?t.side=l:"start end"!==l&&"end start"!==l||(t.side="both")),"boolean"==typeof e.center&&(t.center=e.center);var s=n(e.edge);s&&("inside"===s||"outside"===s||"both"===s?t.edge=s:"inside outside"!==s&&"outside inside"!==s||(t.edge="both"));var d="string"==typeof e.base?e.base.trim().toLowerCase():null;return!d||"containment"!==d&&"document"!==d||(t.base=d),t}if(null!=e.snap){var l=F(e.snap)&&null!=e.snap.targets?e.snap:{targets:e.snap},s=[],d=i({targets:s},l);d.gravity||(d.gravity=b),d.corner||(d.corner=S),d.side||(d.side=w),"boolean"!=typeof d.center&&(d.center=!1),d.edge||(d.edge=E),d.base||(d.base=B);var u=(Array.isArray(l.targets)?l.targets:[l.targets]).reduce(function(t,e){if(null==e)return t;var n,r=ot(e),o=dt(nt(e)),a=r||o?{boundingBox:e}:F(e)&&null==e.start&&null==e.end&&null==e.step?e:{x:e,y:e},l=[],u={},f=a.boundingBox;if(r||ot(f))l.push({element:f}),u.boundingBox=f;else if(n=o||dt(nt(f)))l.push({ppBBox:n}),u.boundingBox=ut(n);else{var c,p=["x","y"].reduce(function(t,e){var n,r=a[e];if(n=at(r))t[e]=n,u[e]=lt(n);else{var o=void 0,i=void 0,l=void 0;F(r)&&(o=at(r.start),i=at(r.end),l=at(r.step),o&&i&&o.isRatio===i.isRatio&&o.value>=i.value&&(c=!0)),o=t[e+"Start"]=o||{value:0,isRatio:!1},i=t[e+"End"]=i||{value:1,isRatio:!0},u[e]={start:lt(o),end:lt(i)},l&&((l.isRatio?l.value>0:l.value>=2)?(t[e+"Step"]=l,u[e].step=lt(l)):c=!0)}return t},{});if(c)return t;p.xStart&&!p.xStep&&p.yStart&&!p.yStep?l.push({xStart:p.xStart,xEnd:p.xEnd,y:p.yStart},{xStart:p.xStart,xEnd:p.xEnd,y:p.yEnd},{x:p.xStart,yStart:p.yStart,yEnd:p.yEnd},{x:p.xEnd,yStart:p.yStart,yEnd:p.yEnd}):l.push(p)}if(l.length){s.push(i(u,a));var g=u.corner||d.corner,m=u.side||d.side,y=u.edge||d.edge,h={gravity:u.gravity||d.gravity,base:u.base||d.base,center:"boolean"==typeof u.center?u.center:d.center,corners:"all"===g?O:g.split(" "),sides:"both"===m?T:[m],edges:"both"===y?C:[y]};l.forEach(function(e){["gravity","corners","sides","center","edges","base"].forEach(function(t){e[t]=h[t]}),t.push(e)})}return t},[]);u.length&&(r.snap=d,rt(u,t.parsedSnapTargets)&&(t.parsedSnapTargets=u,n=!0))}else e.hasOwnProperty("snap")&&t.parsedSnapTargets&&(r.snap=t.parsedSnapTargets=t.snapTargets=void 0);if(e.autoScroll){var f=F(e.autoScroll)?e.autoScroll:{target:!0===e.autoScroll?window:e.autoScroll},c={};c.target=ot(f.target)?f.target:window,c.speed=[],(Array.isArray(f.speed)?f.speed:[f.speed]).every(function(t,e){return!!(e<=2&&H(t))&&(c.speed[e]=t,!0)}),c.speed.length||(c.speed=_);var p=Array.isArray(f.sensitivity)?f.sensitivity:[f.sensitivity];c.sensitivity=c.speed.map(function(t,e){return H(p[e])?p[e]:j[e]}),["X","Y"].forEach(function(t){var e="min"+t,n="max"+t;H(f[e])&&f[e]>=0&&(c[e]=f[e]),H(f[n])&&f[n]>=0&&(!c[e]||f[n]>=c[e])&&(c[n]=f[n])}),rt(c,r.autoScroll)&&(r.autoScroll=c,n=!0)}else e.hasOwnProperty("autoScroll")&&(r.autoScroll&&(n=!0),r.autoScroll=void 0);if(n&&Bt(t),ot(e.handle)&&e.handle!==r.handle){r.handle&&(r.handle.style.cursor=t.orgCursor,g&&(r.handle.style[g]=t.orgUserSelect),z.removeStartHandler(r.handle,t.pointerEventHandlerId));var m=r.handle=e.handle;t.orgCursor=m.style.cursor,gt(m,t.orgCursor),g&&(t.orgUserSelect=m.style[g],m.style[g]="none"),z.addStartHandler(m,t.pointerEventHandlerId)}(H(e.zIndex)||!1===e.zIndex)&&(r.zIndex=e.zIndex,t===a&&(t.elementStyle.zIndex=!1===r.zIndex?t.orgZIndex:r.zIndex));var y,h={left:t.elementBBox.left,top:t.elementBBox.top};H(e.left)&&e.left!==h.left&&(h.left=e.left,y=!0),H(e.top)&&e.top!==h.top&&(h.top=e.top,y=!0),y&&bt(t,h),["onDrag","onMove","onDragStart","onMoveStart","onDragEnd"].forEach(function(n){"function"==typeof e[n]?(r[n]=e[n],t[n]=r[n].bind(t.ins)):e.hasOwnProperty(n)&&null==e[n]&&(r[n]=t[n]=void 0)})}k.move=function(t,e,n){Z.call(window,v),$(),y===t&&(e.x&&K.x&&(e.x.lastValue=K.x.lastValue),e.y&&K.y&&(e.y.lastValue=K.y.lastValue)),y=t,K=e,h=n;var r=Date.now();["x","y"].forEach(function(t){var e=K[t];e&&(e.lastFrameTime=r)}),v=U.call(window,J)},k.stop=function(){Z.call(window,v),$(),K={},y=null};var _t=function(){function t(t,e){var n={ins:this,options:{zIndex:x},disabled:!1};if(Object.defineProperty(this,"_id",{value:++M}),n._id=this._id,R[this._id]=n,n.initArguments=Array.prototype.slice.call(arguments),!ot(t)||t===s)throw new Error("This element is not accepted.");if(e){if(!F(e))throw new Error("Invalid options.")}else e={};var o,a=!0;if(t instanceof SVGElement&&(o=t.ownerSVGElement)){if(!t.getBBox)throw new Error("This element is not accepted. (SVGLocatable)");if(!t.transform)throw new Error("This element is not accepted. (SVGAnimatedTransformList)");n.svgTransform=t.transform.baseVal.appendItem(o.createSVGTransform()),n.svgPoint=o.createSVGPoint();var l=t.nearestViewportElement;n.svgCtmElement=W?l.appendChild(document.createElementNS(o.namespaceURI,"rect")):l,a=!1,n.initElm=Et,n.moveElm=xt}else{var d=r.default.getName("willChange");d&&(a=!1),!e.leftTop&&p?(d&&(t.style[d]="transform"),n.initElm=St,n.moveElm=ht):(d&&(t.style[d]="left, top"),n.initElm=wt,n.moveElm=vt)}if(n.element=pt(t,a),n.elementStyle=t.style,n.orgZIndex=n.elementStyle.zIndex,V&&i.default(t).add(V),n.pointerEventHandlerId=z.regStartHandler(function(t){return Tt(n,t)}),!e.containment){var u;e.containment=(u=t.parentNode)&&ot(u)?u:s}e.handle||(e.handle=t),Ct(n,e)}return t.prototype.remove=function(){var t=R[this._id];this.disabled=!0,z.unregStartHandler(z.removeStartHandler(t.options.handle,t.pointerEventHandlerId)),delete R[this._id]},t.prototype.setOptions=function(t){return F(t)&&Ct(R[this._id],t),this},t.prototype.position=function(){return Bt(R[this._id]),this},Object.defineProperty(t.prototype,"disabled",{get:function(){return R[this._id].disabled},set:function(t){var e=R[this._id];(t=!!t)!==e.disabled&&(e.disabled=t,e.disabled?(e===a&&Ot(e),e.options.handle.style.cursor=e.orgCursor,g&&(e.options.handle.style[g]=e.orgUserSelect),V&&i.default(e.element).remove(V)):(gt(e.options.handle,e.orgCursor),g&&(e.options.handle.style[g]="none"),V&&i.default(e.element).add(V)))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return R[this._id].element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return nt(R[this._id].elementBBox)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return R[this._id].elementBBox.left},set:function(t){Ct(R[this._id],{left:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return R[this._id].elementBBox.top},set:function(t){Ct(R[this._id],{top:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"containment",{get:function(){var t=R[this._id];return t.containmentIsBBox?ut(t.options.containment):t.options.containment},set:function(t){Ct(R[this._id],{containment:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snap",{get:function(){return nt(R[this._id].options.snap)},set:function(t){Ct(R[this._id],{snap:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoScroll",{get:function(){return nt(R[this._id].options.autoScroll)},set:function(t){Ct(R[this._id],{autoScroll:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"handle",{get:function(){return R[this._id].options.handle},set:function(t){Ct(R[this._id],{handle:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"zIndex",{get:function(){return R[this._id].options.zIndex},set:function(t){Ct(R[this._id],{zIndex:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDrag",{get:function(){return R[this._id].options.onDrag},set:function(t){Ct(R[this._id],{onDrag:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onMove",{get:function(){return R[this._id].options.onMove},set:function(t){Ct(R[this._id],{onMove:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDragStart",{get:function(){return R[this._id].options.onDragStart},set:function(t){Ct(R[this._id],{onDragStart:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onMoveStart",{get:function(){return R[this._id].options.onMoveStart},set:function(t){Ct(R[this._id],{onMoveStart:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDragEnd",{get:function(){return R[this._id].options.onDragEnd},set:function(t){Ct(R[this._id],{onDragEnd:t})},enumerable:!0,configurable:!0}),Object.defineProperty(t,"draggableCursor",{get:function(){return X},set:function(t){X!==t&&(X=t,d=null,Object.keys(R).forEach(function(t){var e=R[t];e.disabled||e===a&&!1!==u||(gt(e.options.handle,e.orgCursor),e===a&&(s.style.cursor=f,s.style.cursor=window.getComputedStyle(e.options.handle,"").cursor))}))},enumerable:!0,configurable:!0}),Object.defineProperty(t,"draggingCursor",{get:function(){return Y},set:function(t){Y!==t&&(Y=t,u=null,a&&(mt(a.options.handle),!1===u&&(gt(a.options.handle,a.orgCursor),s.style.cursor=f),s.style.cursor=u||window.getComputedStyle(a.options.handle,"").cursor))},enumerable:!0,configurable:!0}),Object.defineProperty(t,"draggableClass",{get:function(){return V},set:function(t){(t=t?t+"":void 0)!==V&&(Object.keys(R).forEach(function(e){var n=R[e];if(!n.disabled){var r=i.default(n.element);V&&r.remove(V),t&&r.add(t)}}),V=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"draggingClass",{get:function(){return N},set:function(t){if((t=t?t+"":void 0)!==N){if(a){var e=i.default(a.element);N&&e.remove(N),t&&e.add(t)}N=t}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"movingClass",{get:function(){return G},set:function(t){if((t=t?t+"":void 0)!==G){if(a&&l){var e=i.default(a.element);G&&e.remove(G),t&&e.add(t)}G=t}},enumerable:!0,configurable:!0}),t}();z.addMoveHandler(document,function(t){if(a){var e={left:t.clientX+window.pageXOffset+A.left,top:t.clientY+window.pageYOffset+A.top};if(bt(a,e,a.snapTargets?function(t){var e,n=a.snapTargets.length,r=!1,o=!1;for(e=0;e<n&&(!r||!o);e++){var i=a.snapTargets[e];(null==i.gravityXStart||t.left>=i.gravityXStart)&&(null==i.gravityXEnd||t.left<=i.gravityXEnd)&&(null==i.gravityYStart||t.top>=i.gravityYStart)&&(null==i.gravityYEnd||t.top<=i.gravityYEnd)&&(r||null==i.x||(t.left=i.x,r=!0,e=-1),o||null==i.y||(t.top=i.y,o=!0,e=-1))}return t.snapped=r||o,!a.onDrag||a.onDrag(t)}:a.onDrag)){var n={},r=a.autoScroll;if(r){var o={x:a.elementBBox.left-window.pageXOffset,y:a.elementBBox.top-window.pageYOffset};["x","y"].forEach(function(t){if(r[t]){var e=r[t].min,i=r[t].max;r[t].lines.some(function(r){return(-1===r.dir?o[t]<=r.position:o[t]>=r.position)&&(n[t]={dir:r.dir,speed:r.speed/1e3,min:e,max:i},!0)})}})}n.x||n.y?(k.move(r.target,n,r.isWindow?Q:tt),e.autoScroll=!0):k.stop(),l||(l=!0,G&&i.default(a.element).add(G),a.onMoveStart&&a.onMoveStart(e)),a.onMove&&a.onMove(e)}}});var jt=function(){a&&Ot(a)};z.addEndHandler(document,jt),z.addCancelHandler(document,jt);var It=function(){c=r.default.getName("transitionProperty"),p=r.default.getName("transform"),f=s.style.cursor,(g=r.default.getName("userSelect"))&&(m=s.style[g]);var t,e={};function n(t,e){t.initElm?Bt(t,e):(console.log("instance may have an error:"),console.log(t))}var i=!1,l=o.default.add(function(r){i||(i=!0,a&&(n(a,r.type),z.move(),e[a._id]=!0),clearTimeout(t),t=setTimeout(function(){var o;o=r.type,clearTimeout(t),Object.keys(R).forEach(function(t){e[t]||n(R[t],o)}),e={}},200),i=!1)});window.addEventListener("resize",l,!0),window.addEventListener("scroll",l,!0)};(s=document.body)?It():document.addEventListener("DOMContentLoaded",function(){s=document.body,It()},!0),exports.default=_t; | ||
},{"pointer-event":"cjFF","cssprefix":"Fo6c","anim-event":"kohH","m-class-list":"O69e"}]},{},["tHsO"], null) | ||
//# sourceMappingURL=/plainDraggable.min.js.map |
{ | ||
"name": "@phanmn/plain-draggable", | ||
"version": "2.5.13", | ||
"version": "2.5.14", | ||
"title": "PlainDraggable", | ||
@@ -23,4 +23,6 @@ "description": "The simple and high performance library to allow HTML/SVG element to be dragged.", | ||
"m-class-list": "^1.1.9", | ||
"parcel-bundler": "^1.12.4", | ||
"parcel-plugin-wrapper": "^0.2.2", | ||
"pointer-event": "^1.0.0", | ||
"typescript": "^3.5.3" | ||
"typescript": "^3.7.2" | ||
}, | ||
@@ -27,0 +29,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2331117
25
2700
7
5