text: /* interact.js v1.1.2 | https://raw.github.com/taye/interact.js/master/LICENSE */
  !function(){"use strict";function e(){}function t(e){return!!e&&"object"==typeof e&&(/object|function/.test(typeof Element)?e instanceof Element:1===e.nodeType&&"string"==typeof e.nodeName)}function i(e){return e instanceof Object}function r(e){return e instanceof Array}function n(e){return"function"==typeof e}function s(e){return"number"==typeof e}function o(e){return"boolean"==typeof e}function a(e){return"string"==typeof e}function h(e){return a(e)?(rt.querySelector(e),!0):!1}function p(e,t){for(var i in t)e[i]=t[i];return e}function l(e,t){e.page=e.page||{},e.page.x=t.page.x,e.page.y=t.page.y,e.client=e.client||{},e.client.x=t.client.x,e.client.y=t.client.y,e.timeStamp=t.timeStamp}function d(e,t,i){t||(t=i.pointerIds.length>1?S(i.pointers):i.pointers[0]),g(t,lt,i),e.page.x=lt.x,e.page.y=lt.y,v(t,lt,i),e.client.x=lt.x,e.client.y=lt.y,e.timeStamp=(new Date).getTime()}function c(e,t,i){e.page.x=i.page.x-t.page.x,e.page.y=i.page.y-t.page.y,e.client.x=i.client.x-t.client.x,e.client.y=i.client.y-t.client.y,e.timeStamp=(new Date).getTime()-t.timeStamp;var r=Math.max(e.timeStamp/1e3,.001);e.page.speed=pt(e.page.x,e.page.y)/r,e.page.vx=e.page.x/r,e.page.vy=e.page.y/r,e.client.speed=pt(e.client.x,e.page.y)/r,e.client.vx=e.client.x/r,e.client.vy=e.client.y/r}function u(e,t,i){return i=i||{},e=e||"page",i.x=t[e+"X"],i.y=t[e+"Y"],i}function g(e,t,i){return t=t||{},e instanceof q?/inertiastart/.test(e.type)?(i=i||e.interaction,p(t,i.inertiaStatus.upCoords.page),t.x+=i.inertiaStatus.sx,t.y+=i.inertiaStatus.sy):(t.x=e.pageX,t.y=e.pageY):Ct?(u("screen",e,t),t.x+=window.scrollX,t.y+=window.scrollY):u("page",e,t),t}function v(e,t,i){return t=t||{},e instanceof q?/inertiastart/.test(e.type)?(p(t,i.inertiaStatus.upCoords.client),t.x+=i.inertiaStatus.sx,t.y+=i.inertiaStatus.sy):(t.x=e.clientX,t.y=e.clientY):u(Ct?"screen":"client",e,t),t}function m(){return{x:window.scrollX||rt.documentElement.scrollLeft,y:window.scrollY||rt.documentElement.scrollTop}}function f(e){return s(e.pointerId)?e.pointerId:e.identifier}function y(e){return e instanceof ot?e.correspondingUseElement:e}function x(e){var t=Ot?{x:0,y:0}:m(),i=e instanceof nt?e.getBoundingClientRect():e.getClientRects()[0];return i&&{left:i.left+t.x,right:i.right+t.x,top:i.top+t.y,bottom:i.bottom+t.y,width:i.width||i.right-i.left,height:i.heigh||i.bottom-i.top}}function E(e){var t=[];return r(e)?(t[0]=e[0],t[1]=e[1]):"touchend"===e.type?1===e.touches.length?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):0===e.touches.length&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function S(e){var t=E(e);return{pageX:(t[0].pageX+t[1].pageX)/2,pageY:(t[0].pageY+t[1].pageY)/2,clientX:(t[0].clientX+t[1].clientX)/2,clientY:(t[0].clientY+t[1].clientY)/2}}function w(e){if(e.length||e.touches&&e.touches.length>1){var t=E(e),i=Math.min(t[0].pageX,t[1].pageX),r=Math.min(t[0].pageY,t[1].pageY),n=Math.max(t[0].pageX,t[1].pageX),s=Math.max(t[0].pageY,t[1].pageY);return{x:i,y:r,left:i,top:r,width:n-i,height:s-r}}}function b(e,t){t=t||vt.deltaSource;var i=t+"X",r=t+"Y",n=E(e),s=n[0][i]-n[1][i],o=n[0][r]-n[1][r];return pt(s,o)}function D(e,t,i){i=i||vt.deltaSource;var r=i+"X",n=i+"Y",o=E(e),a=o[0][r]-o[1][r],h=o[0][n]-o[1][n],p=180*Math.atan(h/a)/Math.PI;if(s(t)){var l=p-t,d=l%360;d>315?p-=360+p/360|0:d>135?p-=180+p/360|0:-315>d?p+=360+p/360|0:-135>d&&(p+=180+p/360|0)}return p}function z(e,i){var r=e?e.options.origin:vt.origin;return"parent"===r?r=i.parentNode:"self"===r?r=e.getRect(i):h(r)&&(r=P(i,r)||{x:0,y:0}),n(r)&&(r=r(e&&i)),t(r)&&(r=x(r)),r.x="x"in r?r.x:r.left,r.y="y"in r?r.y:r.top,r}function T(e,t,i,r){var n=1-e;return n*n*t+2*n*e*i+e*e*r}function C(e,t,i,r,n,s,o){return{x:T(o,e,i,n),y:T(o,t,r,s)}}function O(e,t,i,r){return e/=r,-i*e*(e-2)+t}function M(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1}function P(e,i){for(var r=e.parentNode;t(r);){if(et(r,i))return r;r=r.parentNode}return null}function A(e,t){return e._context===rt||M(e._context,t)}function R(e,i,r){var n=e.options.ignoreFrom;return n&&t(r)&&r!==i.parentNode?a(n)?et(r,n)||R(e,r.parentNode):t(n)?r===n||M(n,r):!1:!1}function X(e,i,r){var n=e.options.allowFrom;return n?t(r)&&r!==i.parentNode?a(n)?et(r,n)||X(e,r.parentNode):t(n)?r===n||M(n,r):!1:!1:!0}function Y(e,t){if(!t)return!1;var i=t.options.dragAxis;return"xy"===e||"xy"===i||i===e}function k(e,t){var i=e.options;return/^resize/.test(t)&&(t="resize"),"gesture"!==t&&i.snapEnabled&&Z(i.snap.actions,t)}function _(e,t){var i=e.options;return/^resize/.test(t)&&(t="resize"),i.restrictEnabled&&i.restrict[t]}function I(e,t,i){i=/resize/.test(i)?"resize":i;for(var r=e.options,n=r[i+"Max"],s=r[i+"MaxPerElement"],o=0,a=0,h=0,p=0,l=ct.length;l>p;p++){var d=ct[p],c=/resize/.test(d.prepared)?"resize":d.prepared,u=d.interacting();if(u){if(o++,o>=St)return!1;if(d.target===e){if(a+=c===i|0,a>=n)return!1;if(d.element===t&&(h++,c!==i||h>=s))return!1}}}return St>0}function F(e){var t,i,r,n,s,o=e[0],a=o?0:-1,h=[],p=[];for(n=1;n<e.length;n++)if(t=e[n],t&&t!==o)if(o){if(t.parentNode!==rt)if(o.parentNode!==rt){if(!h.length)for(i=o;i.parentNode&&i.parentNode!==rt;)h.unshift(i),i=i.parentNode;if(o instanceof at&&t instanceof nt&&!(t instanceof st)){if(t===o.parentNode)continue;i=t.ownerSVGElement}else i=t;for(p=[];i.parentNode!==rt;)p.unshift(i),i=i.parentNode;for(s=0;p[s]&&p[s]===h[s];)s++;var l=[p[s-1],p[s],h[s]];for(r=l[0].lastChild;r;){if(r===l[1]){o=t,a=n,h=[];break}if(r===l[2])break;r=r.previousSibling}}else o=t,a=n}else o=t,a=n;return a}function $(){if(this.target=null,this.element=null,this.dropTarget=null,this.dropElement=null,this.prevDropTarget=null,this.prevDropElement=null,this.prepared=null,this.matches=[],this.matchElements=[],this.inertiaStatus={active:!1,smoothEnd:!1,startEvent:null,upCoords:{},xe:0,ye:0,sx:0,sy:0,t0:0,vx0:0,vys:0,duration:0,resumeDx:0,resumeDy:0,lambda_v0:0,one_ve_v0:0,i:null},n(Function.prototype.bind))this.boundInertiaFrame=this.inertiaFrame.bind(this),this.boundSmoothEndFrame=this.smoothEndFrame.bind(this);else{var e=this;this.boundInertiaFrame=function(){return e.inertiaFrame()},this.boundSmoothEndFrame=function(){return e.smoothEndFrame()}}this.activeDrops={dropzones:[],elements:[],rects:[]},this.pointers=[],this.pointerIds=[],this.prevCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},this.curCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},this.startCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},this.pointerDelta={page:{x:0,y:0,vx:0,vy:0,speed:0},client:{x:0,y:0,vx:0,vy:0,speed:0},timeStamp:0},this.downTime=0,this.downEvent=null,this.downPointer={},this.downTarget=null,this.prevEvent=null,this.tapTime=0,this.prevTap=null,this.startOffset={left:0,right:0,top:0,bottom:0},this.restrictOffset={left:0,right:0,top:0,bottom:0},this.snapOffset={x:0,y:0},this.gesture={start:{x:0,y:0},startDistance:0,prevDistance:0,distance:0,scale:1,startAngle:0,prevAngle:0},this.snapStatus={x:0,y:0,dx:0,dy:0,realX:0,realY:0,snappedX:0,snappedY:0,anchors:[],paths:[],locked:!1,changed:!1},this.restrictStatus={dx:0,dy:0,restrictedX:0,restrictedY:0,snap:null,restricted:!1,changed:!1},this.restrictStatus.snap=this.snapStatus,this.pointerIsDown=!1,this.pointerWasMoved=!1,this.gesturing=!1,this.dragging=!1,this.resizing=!1,this.resizeAxes="xy",this.mouse=!1,ct.push(this)}function N(e,t,i){var r,n=0,s=ct.length,o=/mouse/i.test(e.pointerType||t)||4===e.pointerType,a=f(e);if(/down|start/i.test(t))for(n=0;s>n;n++){r=ct[n];var h=i;if(r.inertiaStatus.active&&r.mouse===o)for(;h;){if(h===r.element)return r.removePointer(r.pointers[0]),r.addPointer(e),r;h=h.parentNode}}if(o||!ft&&!yt){for(n=0;s>n;n++)if(ct[n].mouse&&!ct[n].inertiaStatus.active)return ct[n];for(n=0;s>n;n++)if(ct[n].mouse&&(!/down/.test(t)||!ct[n].inertiaStatus.active))return r;return r=new $,r.mouse=!0,r}for(n=0;s>n;n++)if(Z(ct[n].pointerIds,a))return ct[n];if(/up|end|out/i.test(t))return null;for(n=0;s>n;n++)if(r=ct[n],!(r.prepared&&!r.target.gesturable()||r.interacting()||!o&&r.mouse))return r.addPointer(e),r;return new $}function U(e){return function(t){var i,r,n=y(t.target),s=y(t.currentTarget);if(ft&&/touch/.test(t.type))for(r=0;r<t.changedTouches.length;r++){var o=t.changedTouches[r];i=N(o,t.type,n),i&&i[e](o,t,n,s)}else{if(!yt&&/mouse/.test(t.type))for(r=0;r<ct.length;r++)if(!ct[r].mouse&&ct[r].pointerIsDown)return;if(i=N(t,t.type,n),!i)return;i[e](t,t,n,s)}}}function q(e,t,i,r,n,s){var o,a,h=e.target,l=e.snapStatus,d=e.restrictStatus,c=e.pointers,u=(h&&h.options||vt).deltaSource,g=u+"X",v=u+"Y",m=h?h.options:vt,f=z(h,n),y="start"===r,x="end"===r,E=y?e.startCoords:e.curCoords;n=n||e.element,a=p({},E.page),o=p({},E.client),a.x-=f.x,a.y-=f.y,o.x-=f.x,o.y-=f.y,!k(h,i)||y&&m.snap.elementOrigin||(this.snap={range:l.range,locked:l.locked,x:l.snappedX,y:l.snappedY,realX:l.realX,realY:l.realY,dx:l.dx,dy:l.dy},l.locked&&(a.x+=l.dx,a.y+=l.dy,o.x+=l.dx,o.y+=l.dy)),!_(h,i)||y&&m.restrict.elementRect||!d.restricted||(a.x+=d.dx,a.y+=d.dy,o.x+=d.dx,o.y+=d.dy,this.restrict={dx:d.dx,dy:d.dy}),this.pageX=a.x,this.pageY=a.y,this.clientX=o.x,this.clientY=o.y,this.x0=e.startCoords.page.x,this.y0=e.startCoords.page.y,this.clientX0=e.startCoords.client.x,this.clientY0=e.startCoords.client.y,this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.button=t.button,this.target=n,this.t0=e.downTime,this.type=i+(r||""),this.interaction=e,this.interactable=h;var S=e.inertiaStatus;if(S.active&&(this.detail="inertia"),s&&(this.relatedTarget=s),x||"drop"===i?"client"===u?(this.dx=o.x-e.startCoords.client.x,this.dy=o.y-e.startCoords.client.y):(this.dx=a.x-e.startCoords.page.x,this.dy=a.y-e.startCoords.page.y):y?(this.dx=0,this.dy=0):"inertiastart"===r?(this.dx=e.prevEvent.dx,this.dy=e.prevEvent.dy):"client"===u?(this.dx=o.x-e.prevEvent.clientX,this.dy=o.y-e.prevEvent.clientY):(this.dx=a.x-e.prevEvent.pageX,this.dy=a.y-e.prevEvent.pageY),e.prevEvent&&"inertia"===e.prevEvent.detail&&!S.active&&m.inertia.zeroResumeDelta&&(S.resumeDx+=this.dx,S.resumeDy+=this.dy,this.dx=this.dy=0),"resize"===i?m.squareResize||t.shiftKey?("y"===e.resizeAxes?this.dx=this.dy:this.dy=this.dx,this.axes="xy"):(this.axes=e.resizeAxes,"x"===e.resizeAxes?this.dy=0:"y"===e.resizeAxes&&(this.dx=0)):"gesture"===i&&(this.touches=[c[0],c[1]],y?(this.distance=b(c,u),this.box=w(c),this.scale=1,this.ds=0,this.angle=D(c,void 0,u),this.da=0):x||t instanceof q?(this.distance=e.prevEvent.distance,this.box=e.prevEvent.box,this.scale=e.prevEvent.scale,this.ds=this.scale-1,this.angle=e.prevEvent.angle,this.da=this.angle-e.gesture.startAngle):(this.distance=b(c,u),this.box=w(c),this.scale=this.distance/e.gesture.startDistance,this.angle=D(c,e.gesture.prevAngle,u),this.ds=this.scale-e.gesture.prevScale,this.da=this.angle-e.gesture.prevAngle)),y)this.timeStamp=e.downTime,this.dt=0,this.duration=0,this.speed=0,this.velocityX=0,this.velocityY=0;else if("inertiastart"===r)this.timeStamp=e.prevEvent.timeStamp,this.dt=e.prevEvent.dt,this.duration=e.prevEvent.duration,this.speed=e.prevEvent.speed,this.velocityX=e.prevEvent.velocityX,this.velocityY=e.prevEvent.velocityY;else if(this.timeStamp=(new Date).getTime(),this.dt=this.timeStamp-e.prevEvent.timeStamp,this.duration=this.timeStamp-e.downTime,t instanceof q){var T=this[g]-e.prevEvent[g],C=this[v]-e.prevEvent[v],O=this.dt/1e3;this.speed=pt(T,C)/O,this.velocityX=T/O,this.velocityY=C/O}else this.speed=e.pointerDelta[u].speed,this.velocityX=e.pointerDelta[u].vx,this.velocityY=e.pointerDelta[u].vy;if((x||"inertiastart"===r)&&e.prevEvent.speed>600&&this.timeStamp-e.prevEvent.timeStamp<150){var M=180*Math.atan2(e.prevEvent.velocityY,e.prevEvent.velocityX)/Math.PI,P=22.5;0>M&&(M+=360);var A=M>=135-P&&225+P>M,R=M>=225-P&&315+P>M,X=!A&&(M>=315-P||45+P>M),Y=!R&&M>=45-P&&135+P>M;this.swipe={up:R,down:Y,left:A,right:X,angle:M,speed:e.prevEvent.speed,velocity:{x:e.prevEvent.velocityX,y:e.prevEvent.velocityY}}}}function H(){this.originalEvent.preventDefault()}function W(e,t,i){var r,n,s=this.getRect(i),o=null,a=p({},t.curCoords.page),h=this.options;return s?(bt.resize&&h.resizable&&(r="y"!==h.resizeAxis&&a.x>s.right-xt,n="x"!==h.resizeAxis&&a.y>s.bottom-xt),t.resizeAxes=(r?"x":"")+(n?"y":""),o=t.resizeAxes?"resize"+t.resizeAxes:bt.drag&&h.draggable?"drag":null,bt.gesture&&t.pointerIds.length>=2&&!t.dragging&&!t.resizing&&(o="gesture"),o):null}function L(e,t){if(!a(e))return null;var i=-1!==e.search("resize")?"resize":e,r=t;return("resize"===i&&r.resizable||"drag"===e&&r.draggable||"gesture"===e&&r.gesturable)&&bt[i]?(("resize"===e||"resizeyx"===e)&&(e="resizexy"),e):null}function B(e,t){var i={},r=gt[e.type],n=e.target;t=t?!0:!1;for(var s in e)i[s]=e[s];for(i.originalEvent=e,i.preventDefault=H;n&&n!==rt;){for(var o=0;o<r.selectors.length;o++){var a=r.selectors[o],h=r.contexts[o];if(et(n,a)&&h===e.currentTarget&&M(h,n)){var p=r.listeners[o];i.currentTarget=n;for(var l=0;l<p.length;l++)p[l][1]===t&&p[l][0](i)}}n=n.parentNode}}function K(e){return B.call(this,e,!0)}function V(e,t){return dt.get(e,t)||new G(e,t)}function j(e){for(var t in vt)e.hasOwnProperty(t)&&typeof e[t]==typeof vt[t]&&(this[t]=e[t])}function G(e,i){this._element=e,this._iEvents=this._iEvents||{},h(e)?(this.selector=e,i&&i.context&&(window.Node?i.context instanceof window.Node:t(i.context)||i.context===rt)&&(this._context=i.context)):t(e)&&(ht?(_t.add(this,tt.down,It.pointerDown),_t.add(this,tt.move,It.pointerHover)):(_t.add(this,"mousedown",It.pointerDown),_t.add(this,"mousemove",It.pointerHover),_t.add(this,"touchstart",It.pointerDown),_t.add(this,"touchmove",It.pointerHover))),dt.push(this),this.set(i)}function J(e){for(var t=0;t<ct.length;t++)ct[t].pointerUp(e,e)}function Q(e,t){for(var i=0,r=e.length;r>i;i++)if(e[i]===t)return i;return-1}function Z(e,t){return-1!==Q(e,t)}function et(e,t,i){return it?it(e,t,i):e[Mt](t)}var tt,it,rt=window.document,nt=window.SVGElement||e,st=window.SVGSVGElement||e,ot=window.SVGElementInstance||e,at=window.HTMLElement||window.Element,ht=window.PointerEvent||window.MSPointerEvent,pt=Math.hypot||function(e,t){return Math.sqrt(e*e+t*t)},lt={},dt=[],ct=[],ut=!1,gt={},vt={draggable:!1,dragAxis:"xy",dropzone:!1,accept:null,dropOverlap:"pointer",resizable:!1,squareResize:!1,resizeAxis:"xy",gesturable:!1,dragMax:1,resizeMax:1,gestureMax:1,dragMaxPerElement:1,resizeMaxPerElement:1,gestureMaxPerElement:1,pointerMoveTolerance:1,actionChecker:null,styleCursor:!0,preventDefault:"auto",snap:{mode:"grid",endOnly:!1,actions:["drag"],range:1/0,grid:{x:100,y:100},gridOffset:{x:0,y:0},anchors:[],paths:[],elementOrigin:null,arrayTypes:/^anchors$|^paths$|^actions$/,objectTypes:/^grid$|^gridOffset$|^elementOrigin$/,stringTypes:/^mode$/,numberTypes:/^range$/,boolTypes:/^endOnly$/},snapEnabled:!1,restrict:{drag:null,resize:null,gesture:null,endOnly:!1},restrictEnabled:!1,autoScroll:{container:window,margin:60,speed:300,numberTypes:/^margin$|^speed$/},autoScrollEnabled:!1,inertia:{resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,zeroResumeDelta:!1,smoothEndDuration:300,actions:["drag","resize"],numberTypes:/^resistance$|^minSpeed$|^endSpeed$|^smoothEndDuration$/,arrayTypes:/^actions$/,boolTypes:/^(allowResume|zeroResumeDelta)$/},inertiaEnabled:!1,origin:{x:0,y:0},deltaSource:"page",context:rt},mt={target:null,i:null,x:0,y:0,scroll:function(){var e=mt.target.options.autoScroll,t=e.container,i=(new Date).getTime(),r=(i-mt.prevTime)/1e3,n=e.speed*r;n>=1&&(t instanceof window.Window?t.scrollBy(mt.x*n,mt.y*n):t&&(t.scrollLeft+=mt.x*n,t.scrollTop+=mt.y*n),mt.prevTime=i),mt.isScrolling&&(At(mt.i),mt.i=Pt(mt.scroll))},edgeMove:function(e){for(var t,i=!1,r=0;r<ct.length;r++){var n=ct[r];if(t=n.target,t&&t.options.autoScrollEnabled&&(n.dragging||n.resizing)){i=!0;break}}if(i){var s,o,a,h,p=t.options.autoScroll;if(p.container instanceof window.Window)h=e.clientX<mt.margin,s=e.clientY<mt.margin,o=e.clientX>p.container.innerWidth-mt.margin,a=e.clientY>p.container.innerHeight-mt.margin;else{var l=x(p.container);h=e.clientX<l.left+mt.margin,s=e.clientY<l.top+mt.margin,o=e.clientX>l.right-mt.margin,a=e.clientY>l.bottom-mt.margin}mt.x=o?1:h?-1:0,mt.y=a?1:s?-1:0,mt.isScrolling||(mt.margin=p.margin,mt.speed=p.speed,mt.start(t))}},isScrolling:!1,prevTime:0,start:function(e){mt.isScrolling=!0,At(mt.i),mt.target=e,mt.prevTime=(new Date).getTime(),mt.i=Pt(mt.scroll)},stop:function(){mt.isScrolling=!1,At(mt.i)}},ft="ontouchstart"in window||window.DocumentTouch&&rt instanceof window.DocumentTouch,yt=!!ht,xt=ft||yt?20:10,Et=0,St=1,wt={drag:"move",resizex:"e-resize",resizey:"s-resize",resizexy:"se-resize",gesture:""},bt={drag:!0,resize:!0,gesture:!0},Dt="onmousewheel"in rt?"mousewheel":"wheel",zt=["dragstart","dragmove","draginertiastart","dragend","dragenter","dragleave","dropactivate","dropdeactivate","dropmove","drop","resizestart","resizemove","resizeinertiastart","resizeend","gesturestart","gesturemove","gestureinertiastart","gestureend","tap","doubletap"],Tt={},Ct="Opera"==navigator.appName&&ft&&navigator.userAgent.match("Presto"),Ot=/iP(hone|od|ad)/.test(navigator.platform)&&/OS [1-7][^\d]/.test(navigator.appVersion),Mt="matchesSelector"in Element.prototype?"matchesSelector":"webkitMatchesSelector"in Element.prototype?"webkitMatchesSelector":"mozMatchesSelector"in Element.prototype?"mozMatchesSelector":"oMatchesSelector"in Element.prototype?"oMatchesSelector":"msMatchesSelector",Pt=window.requestAnimationFrame,At=window.cancelAnimationFrame,Rt={_element:window,events:{}},Xt={_element:rt,events:{}},Yt={_element:window.parent,events:{}},kt={_element:null,events:{}},_t=function(){function e(e,t,a,c){var u=Q(p,e),g=l[u];if(g||(g={events:{},typeCount:0},u=p.push(e)-1,l.push(g),d.push(s?{supplied:[],wrapped:[],useCount:[]}:null)),g.events[t]||(g.events[t]=[],g.typeCount++),!Z(g.events[t],a)){var v;if(s){var m=d[u],f=Q(m.supplied,a),y=m.wrapped[f]||function(t){t.immediatePropagationStopped||(t.target=t.srcElement,t.currentTarget=e,t.preventDefault=t.preventDefault||i,t.stopPropagation=t.stopPropagation||r,t.stopImmediatePropagation=t.stopImmediatePropagation||n,/mouse|click/.test(t.type)&&(t.pageX=t.clientX+rt.documentElement.scrollLeft,t.pageY=t.clientY+rt.documentElement.scrollTop),a(t))};v=e[o](h+t,y,Boolean(c)),-1===f?(m.supplied.push(a),m.wrapped.push(y),m.useCount.push(1)):m.useCount[f]++}else v=e[o](t,a,c||!1);return g.events[t].push(a),v}}function t(e,i,r,n){var o,c,u,g=Q(p,e),v=l[g],m=r;if(v&&v.events)if(s&&(c=d[g],u=Q(c.supplied,r),m=c.wrapped[u]),"all"!==i){if(v.events[i]){var f=v.events[i].length;if("all"===r)for(o=0;f>o;o++)t(e,i,v.events[i][o],Boolean(n));else for(o=0;f>o;o++)if(v.events[i][o]===r){e[a](h+i,m,n||!1),v.events[i].splice(o,1),s&&c&&(c.useCount[u]--,0===c.useCount[u]&&(c.supplied.splice(u,1),c.wrapped.splice(u,1),c.useCount.splice(u,1)));break}v.events[i]&&0===v.events[i].length&&(v.events[i]=null,v.typeCount--)}v.typeCount||(l.splice(g),p.splice(g),d.splice(g))}else for(i in v.events)v.events.hasOwnProperty(i)&&t(e,i,"all")}function i(){this.returnValue=!1}function r(){this.cancelBubble=!0}function n(){this.cancelBubble=!0,this.immediatePropagationStopped=!0}var s="attachEvent"in window&&!("addEventListener"in window),o=s?"attachEvent":"addEventListener",a=s?"detachEvent":"removeEventListener",h=s?"on":"",p=[],l=[],d=[];return{add:function(t,i,r,n){e(t._element,i,r,n)},remove:function(e,i,r,n){t(e._element,i,r,n)},addToElement:e,removeFromElement:t,useAttachEvent:s,_elements:p,_targets:l,_attachedListeners:d}}();$.prototype={getPageXY:function(e,t){return g(e,t,this)},getClientXY:function(e,t){return v(e,t,this)},setEventXY:function(e,t){return d(e,t,this)},pointerOver:function(e,t,i){function r(e,t){e&&A(e,i)&&!R(e,i,i)&&X(e,i,i)&&et(i,t)&&(n.push(e),s.push(i))}if(!this.prepared&&this.mouse){var n=[],s=[],o=this.element;this.addPointer(e),!this.target||!R(this.target,this.element,i)&&X(this.target,this.element,i)&&I(this.target,this.element,this.prepared)||(this.target=null,this.element=null,this.matches=[],this.matchElements=[]);var a=dt.get(i),h=a&&!R(a,i,i)&&X(a,i,i)&&L(a.getAction(e,this,i),a);h=a&&I(a,i,h)?h:null,h?(this.target=a,this.element=i,this.matches=[],this.matchElements=[]):(dt.forEachSelector(r),this.validateSelector(e,n,s)?(this.matches=n,this.matchElements=s,this.pointerHover(e,t,this.matches,this.matchElements),_t.addToElement(i,ht?tt.move:"mousemove",It.pointerHover)):this.target&&(M(o,i)?(this.pointerHover(e,t,this.matches,this.matchElements),_t.addToElement(this.element,ht?tt.move:"mousemove",It.pointerHover)):(this.target=null,this.element=null,this.matches=[],this.matchElements=[])))}},pointerHover:function(e,t,i,r,n,s){var o=this.target;if(!this.prepared&&this.mouse){var a;this.setEventXY(this.curCoords,e),n?a=this.validateSelector(e,n,s):o&&(a=L(o.getAction(this.pointers[0],this,this.element),this.target)),o&&o.options.styleCursor&&(rt.documentElement.style.cursor=a?wt[a]:"")}else this.prepared&&this.checkAndPreventDefault(t,o,this.element)},pointerOut:function(e,t,i){this.prepared||(dt.get(i)||_t.removeFromElement(i,ht?tt.move:"mousemove",It.pointerHover),this.target&&this.target.options.styleCursor&&!this.interacting()&&(rt.documentElement.style.cursor=""))},selectorDown:function(e,t,i,r){function n(e,t,r){var n=it?r.querySelectorAll(t):void 0;A(e,o)&&!R(e,o,i)&&X(e,o,i)&&et(o,t,n)&&(a.matches.push(e),a.matchElements.push(o))}this.pointerIsDown=!0;var s,o=i;if(this.addPointer(e),this.inertiaStatus.active&&this.target.selector)for(;o&&o!==rt;){if(o===this.element&&L(this.target.getAction(e,this,this.element),this.target)===this.prepared)return At(this.inertiaStatus.i),void(this.inertiaStatus.active=!1);o=o.parentNode}if(!this.interacting()){var a=this;if(this.setEventXY(this.curCoords,e),this.matches.length&&this.mouse)s=this.validateSelector(e,this.matches,this.matchElements);else for(;o&&o!==rt&&!s;)this.matches=[],this.matchElements=[],dt.forEachSelector(n),s=this.validateSelector(e,this.matches,this.matchElements),o=o.parentNode;return s?(this.prepared=s,this.pointerDown(e,t,i,r,s)):(this.downTime=(new Date).getTime(),this.downTarget=i,this.downEvent=t,p(this.downPointer,e),l(this.prevCoords,this.curCoords),this.pointerWasMoved=!1,void 0)}},pointerDown:function(e,t,i,r,n){if(!n&&!this.inertiaStatus.active&&this.pointerWasMoved&&this.prepared)return void this.checkAndPreventDefault(t,this.target,this.element);this.pointerIsDown=!0,this.addPointer(e);var s;if(this.pointerIds.length<2&&!this.target||!this.prepared){var o=dt.get(r);o&&!R(o,r,i)&&X(o,r,i)&&(s=L(n||o.getAction(e,this),o,i))&&I(o,r,s)&&(this.target=o,this.element=r)}var a=this.target,h=a&&a.options;if(a&&!this.interacting()){if(s=s||L(n||a.getAction(e,this),a,this.element),this.setEventXY(this.startCoords),!s)return;h.styleCursor&&(rt.documentElement.style.cursor=wt[s]),this.resizeAxes="resizexy"===s?"xy":"resizex"===s?"x":"resizey"===s?"y":"","gesture"===s&&this.pointerIds.length<2&&(s=null),this.prepared=s,this.snapStatus.snappedX=this.snapStatus.snappedY=this.restrictStatus.restrictedX=this.restrictStatus.restrictedY=0/0,this.downTime=(new Date).getTime(),this.downTarget=i,this.downEvent=t,p(this.downPointer,e),this.setEventXY(this.prevCoords),this.pointerWasMoved=!1,this.checkAndPreventDefault(t,a,this.element)}else this.inertiaStatus.active&&this.target.options.inertia.allowResume&&r===this.element&&L(a.getAction(e,this,this.element),a)===this.prepared&&(At(this.inertiaStatus.i),this.inertiaStatus.active=!1,this.checkAndPreventDefault(t,a,this.element))},pointerMove:function(e,t,i,r,n){if(this.pointerIsDown){if(this.setEventXY(this.curCoords,e instanceof q?this.inertiaStatus.startEvent:void 0),this.pointerWasMoved&&!n&&this.curCoords.page.x===this.prevCoords.page.x&&this.curCoords.page.y===this.prevCoords.page.y&&this.curCoords.client.x===this.prevCoords.client.x&&this.curCoords.client.y===this.prevCoords.client.y)return void this.checkAndPreventDefault(t,this.target,this.element);c(this.pointerDelta,this.prevCoords,this.curCoords);var s,o;if(this.pointerWasMoved||(s=this.curCoords.client.x-this.startCoords.client.x,o=this.curCoords.client.y-this.startCoords.client.y,this.pointerWasMoved=pt(s,o)>vt.pointerMoveTolerance),this.prepared){if(this.pointerWasMoved&&(!this.inertiaStatus.active||e instanceof q&&/inertiastart/.test(e.type))){if(!this.interacting()&&(c(this.pointerDelta,this.prevCoords,this.curCoords),"drag"===this.prepared)){var a=Math.abs(s),h=Math.abs(o),p=this.target.options.dragAxis,d=a>h?"x":h>a?"y":"xy";if("xy"!==d&&"xy"!==p&&p!==d){this.prepared=null;for(var u=i;u&&u!==rt;){var g=dt.get(u);if(g&&g!==this.target&&"drag"===g.getAction(this.downPointer,this,u)&&Y(d,g)){this.prepared="drag",this.target=g,this.element=u;break}u=u.parentNode}if(!this.prepared){var v=function(e,t,r){var n=it?r.querySelectorAll(t):void 0;if(e!==this.target)return A(e,i)&&!R(e,u,i)&&X(e,u,i)&&et(u,t,n)&&"drag"===e.getAction(this.downPointer,this,u)&&Y(d,e)&&I(e,u,"drag")?e:void 0};for(u=i;u&&u!==rt;){var m=dt.forEachSelector(v);if(m){this.prepared="drag",this.target=m,this.element=u;break}u=u.parentNode}}}}var f=!!this.prepared&&!this.interacting();if(f&&!I(this.target,this.element,this.prepared))return void this.stop();if(this.prepared&&this.target){var y=this.target,x=k(y,this.prepared)&&(!y.options.snap.endOnly||n),E=_(y,this.prepared)&&(!y.options.restrict.endOnly||n);if(f){var S,w,b=y.getRect(this.element),D=y.options.snap,z=y.options.restrict;b?(this.startOffset.left=this.startCoords.page.x-b.left,this.startOffset.top=this.startCoords.page.y-b.top,this.startOffset.right=b.right-this.startCoords.page.x,this.startOffset.bottom=b.bottom-this.startCoords.page.y,S="width"in b?b.width:b.right-b.left,w="height"in b?b.height:b.bottom-b.top):this.startOffset.left=this.startOffset.top=this.startOffset.right=this.startOffset.bottom=0,b&&D.elementOrigin?(this.snapOffset.x=this.startOffset.left-S*D.elementOrigin.x,this.snapOffset.y=this.startOffset.top-w*D.elementOrigin.y):this.snapOffset.x=this.snapOffset.y=0,b&&z.elementRect?(this.restrictOffset.left=this.startOffset.left-S*z.elementRect.left,this.restrictOffset.top=this.startOffset.top-w*z.elementRect.top,this.restrictOffset.right=this.startOffset.right-S*(1-z.elementRect.right),this.restrictOffset.bottom=this.startOffset.bottom-w*(1-z.elementRect.bottom)):this.restrictOffset.left=this.restrictOffset.top=this.restrictOffset.right=this.restrictOffset.bottom=0}var T=f?this.startCoords.page:this.curCoords.page;x?this.setSnapping(T):this.snapStatus.locked=!1,E?this.setRestriction(T):this.restrictStatus.restricted=!1;var C=(x?this.snapStatus.changed||!this.snapStatus.locked:!0)&&(E?!this.restrictStatus.restricted||this.restrictStatus.restricted&&this.restrictStatus.changed:!0);if(C){var O=/resize/.test(this.prepared)?"resize":this.prepared;if(f){var M=this[O+"Start"](this.downEvent);this.prevEvent=M,this.activeDrops.dropzones=[],this.activeDrops.elements=[],this.activeDrops.rects=[],this.dynamicDrop||this.setActiveDrops(this.element);var P=this.getDropEvents(t,M);P.activate&&this.fireActiveDrops(P.activate),T=this.curCoords.page,x&&this.setSnapping(T),E&&this.setRestriction(T)}this.prevEvent=this[O+"Move"](t)}this.checkAndPreventDefault(t,this.target,this.element)}}l(this.prevCoords,this.curCoords),(this.dragging||this.resizing)&&mt.edgeMove(t)}}},dragStart:function(e){var t=new q(this,e,"drag","start",this.element);return this.dragging=!0,this.target.fire(t),t},dragMove:function(e){var t=this.target,i=new q(this,e,"drag","move",this.element),r=this.element,n=this.getDrop(i,r);this.dropTarget=n.dropzone,this.dropElement=n.element;var s=this.getDropEvents(e,i);return t.fire(i),s.leave&&this.prevDropTarget.fire(s.leave),s.enter&&this.dropTarget.fire(s.enter),s.move&&this.dropTarget.fire(s.move),this.prevDropTarget=this.dropTarget,this.prevDropElement=this.dropElement,i},resizeStart:function(e){var t=new q(this,e,"resize","start",this.element);return this.target.fire(t),this.resizing=!0,t},resizeMove:function(e){var t=new q(this,e,"resize","move",this.element);return this.target.fire(t),t},gestureStart:function(e){var t=new q(this,e,"gesture","start",this.element);return t.ds=0,this.gesture.startDistance=this.gesture.prevDistance=t.distance,this.gesture.startAngle=this.gesture.prevAngle=t.angle,this.gesture.scale=1,this.gesturing=!0,this.target.fire(t),t},gestureMove:function(e){if(!this.pointerIds.length)return this.prevEvent;var t;return t=new q(this,e,"gesture","move",this.element),t.ds=t.scale-this.gesture.scale,this.target.fire(t),this.gesture.prevAngle=t.angle,this.gesture.prevDistance=t.distance,1/0===t.scale||null===t.scale||void 0===t.scale||isNaN(t.scale)||(this.gesture.scale=t.scale),t},pointerUp:function(e,t,i,r){var n,s=this.target,o=s&&s.options,a=o&&o.inertia,h=this.inertiaStatus;if(this.interacting()){if(h.active)return;var d,c,u=(new Date).getTime(),g=!1,v=!1,m=!1,f=k(s,this.prepared)&&o.snap.endOnly,y=_(s,this.prepared)&&o.restrict.endOnly,x=0,E=0;if(this.dragging&&(d="x"===o.dragAxis?Math.abs(this.pointerDelta.client.vx):"y"===o.dragAxis?Math.abs(this.pointerDelta.client.vy):this.pointerDelta.client.speed),g=o.inertiaEnabled&&"gesture"!==this.prepared&&Z(a.actions,this.prepared)&&t!==h.startEvent,v=g&&u-this.curCoords.timeStamp<50&&d>a.minSpeed&&d>a.endSpeed,g&&!v&&(f||y)){var S={};S.snap=S.restrict=S,f&&(this.setSnapping(this.curCoords.page,S),S.locked&&(x+=S.dx,E+=S.dy)),y&&(this.setRestriction(this.curCoords.page,S),S.restricted&&(x+=S.dx,E+=S.dy)),(x||E)&&(m=!0)}if(v||m){if(l(h.upCoords,this.curCoords),this.pointers[0]=h.startEvent=c=new q(this,t,this.prepared,"inertiastart",this.element),h.t0=u,s.fire(h.startEvent),v){h.vx0=this.pointerDelta.client.vx,h.vy0=this.pointerDelta.client.vy,h.v0=d,this.calcInertia(h);var w,b=p({},this.curCoords.page),D=z(s,this.element);if(b.x=b.x+h.xe-D.x,b.y=b.y+h.ye-D.y,w={useStatusXY:!0,x:b.x,y:b.y,dx:0,dy:0,snap:null},w.snap=w,x=E=0,f){var T=this.setSnapping(this.curCoords.page,w);T.locked&&(x+=T.dx,E+=T.dy)}if(y){var C=this.setRestriction(this.curCoords.page,w);C.restricted&&(x+=C.dx,E+=C.dy)}h.modifiedXe+=x,h.modifiedYe+=E,h.i=Pt(this.boundInertiaFrame)}else h.smoothEnd=!0,h.xe=x,h.ye=E,h.sx=h.sy=0,h.i=Pt(this.boundSmoothEndFrame);return void(h.active=!0)}(f||y)&&this.pointerMove(e,t,i,r,!0)}if(this.dragging){n=new q(this,t,"drag","end",this.element);var O=this.element,M=this.getDrop(n,O);this.dropTarget=M.dropzone,this.dropElement=M.element;var P=this.getDropEvents(t,n);P.leave&&this.prevDropTarget.fire(P.leave),P.enter&&this.dropTarget.fire(P.enter),P.drop&&this.dropTarget.fire(P.drop),P.deactivate&&this.fireActiveDrops(P.deactivate),s.fire(n)}else this.resizing?(n=new q(this,t,"resize","end",this.element),s.fire(n)):this.gesturing&&(n=new q(this,t,"gesture","end",this.element),s.fire(n));this.stop(t)},collectDrops:function(e){var i,r=[],n=[];for(e=e||this.element,i=0;i<dt.length;i++)if(dt[i].options.dropzone){var s=dt[i];if(!(t(s.options.accept)&&s.options.accept!==e||a(s.options.accept)&&!et(e,s.options.accept)))for(var o=s.selector?s._context.querySelectorAll(s.selector):[s._element],h=0,p=o.length;p>h;h++){var l=o[h];l!==e&&(r.push(s),n.push(l))}}return{dropzones:r,elements:n}},fireActiveDrops:function(e){var t,i,r,n;for(t=0;t<this.activeDrops.dropzones.length;t++)i=this.activeDrops.dropzones[t],r=this.activeDrops.elements[t],r!==n&&(e.target=r,i.fire(e)),n=r},setActiveDrops:function(e){var t=this.collectDrops(e,!0);this.activeDrops.dropzones=t.dropzones,this.activeDrops.elements=t.elements,this.activeDrops.rects=[];for(var i=0;i<this.activeDrops.dropzones.length;i++)this.activeDrops.rects[i]=this.activeDrops.dropzones[i].getRect(this.activeDrops.elements[i])},getDrop:function(e,t){var i=[];ut&&this.setActiveDrops(t);for(var r=0;r<this.activeDrops.dropzones.length;r++){var n=this.activeDrops.dropzones[r],s=this.activeDrops.elements[r],o=this.activeDrops.rects[r];i.push(n.dropCheck(this.pointers[0],this.target,t,s,o)?s:null)}var a=F(i),h=this.activeDrops.dropzones[a]||null,p=this.activeDrops.elements[a]||null;return{dropzone:h,element:p}},getDropEvents:function(e,t){var i=null,r=null,n=null,s=null,o=null,a=null;
  return this.dropElement!==this.prevDropElement&&(this.prevDropTarget&&(i=new q(this,e,"drag","leave",this.prevDropElement,t.target),i.draggable=t.interactable,t.dragLeave=this.prevDropElement,t.prevDropzone=this.prevDropTarget),this.dropTarget&&(r=new q(this,e,"drag","enter",this.dropElement,t.target),r.draggable=t.interactable,t.dragEnter=this.dropElement,t.dropzone=this.dropTarget)),"dragend"===t.type&&this.dropTarget&&(a=new q(this,e,"drop",null,this.dropElement,t.target),a.draggable=t.interactable,t.dropzone=this.dropTarget),"dragstart"===t.type&&(n=new q(this,e,"drop","activate",this.element,t.target),n.draggable=t.interactable),"dragend"===t.type&&(s=new q(this,e,"drop","deactivate",this.element,t.target),s.draggable=t.interactable),"dragmove"===t.type&&this.dropTarget&&(o={target:this.dropElement,relatedTarget:t.target,draggable:t.interactable,dragmove:t,type:"dropmove",timeStamp:t.timeStamp},t.dropzone=this.dropTarget),{enter:r,leave:i,activate:n,deactivate:s,move:o,drop:a}},currentAction:function(){return this.dragging&&"drag"||this.resizing&&"resize"||this.gesturing&&"gesture"||null},interacting:function(){return this.dragging||this.resizing||this.gesturing},clearTargets:function(){this.target&&!this.target.selector&&(this.target=this.element=null),this.dropTarget=this.dropElement=this.prevDropTarget=this.prevDropElement=null},stop:function(e){if(this.interacting()){mt.stop(),this.matches=[],this.matchElements=[];var t=this.target;t.options.styleCursor&&(rt.documentElement.style.cursor=""),e&&n(e.preventDefault)&&this.checkAndPreventDefault(e,t,this.element),this.dragging&&(this.activeDrops.dropzones=this.activeDrops.elements=this.activeDrops.rects=null),this.clearTargets()}this.pointerIsDown=this.snapStatus.locked=this.dragging=this.resizing=this.gesturing=!1,this.prepared=this.prevEvent=null,this.inertiaStatus.resumeDx=this.inertiaStatus.resumeDy=0,this.pointerIds.splice(0),ct.length>1&&ct.splice(Q(ct,this),1)},inertiaFrame:function(){var e=this.inertiaStatus,t=this.target.options.inertia,i=t.resistance,r=(new Date).getTime()/1e3-e.t0;if(r<e.te){var n=1-(Math.exp(-i*r)-e.lambda_v0)/e.one_ve_v0;if(e.modifiedXe===e.xe&&e.modifiedYe===e.ye)e.sx=e.xe*n,e.sy=e.ye*n;else{var s=C(0,0,e.xe,e.ye,e.modifiedXe,e.modifiedYe,n);e.sx=s.x,e.sy=s.y}this.pointerMove(e.startEvent,e.startEvent),e.i=Pt(this.boundInertiaFrame)}else e.sx=e.modifiedXe,e.sy=e.modifiedYe,this.pointerMove(e.startEvent,e.startEvent),e.active=!1,this.pointerUp(e.startEvent,e.startEvent)},smoothEndFrame:function(){var e=this.inertiaStatus,t=(new Date).getTime()-e.t0,i=this.target.options.inertia.smoothEndDuration;i>t?(e.sx=O(t,0,e.xe,i),e.sy=O(t,0,e.ye,i),this.pointerMove(e.startEvent,e.startEvent),e.i=Pt(this.boundSmoothEndFrame)):(e.sx=e.xe,e.sy=e.ye,this.pointerMove(e.startEvent,e.startEvent),e.active=!1,e.smoothEnd=!1,this.pointerUp(e.startEvent,e.startEvent))},addPointer:function(e){var t=f(e),i=this.mouse?0:Q(this.pointerIds,t);-1===i?(i=this.pointerIds.length,this.pointerIds.push(t),this.pointers[i]=e):this.pointers[i]=e},removePointer:function(e){var t=f(e),i=this.mouse?0:Q(this.pointerIds,t);-1!==i&&this.pointerIds.splice(i,1)},recordPointer:function(e){if(!this.inertiaStatus.active){var t=this.mouse?0:Q(this.pointerIds,f(e));-1!==t&&(this.pointers[t]=e)}},fireTaps:function(e,t,i,r){var n,s={};p(s,t),p(s,e),s.preventDefault=H,s.stopPropagation=q.prototype.stopPropagation,s.stopImmediatePropagation=q.prototype.stopImmediatePropagation,s.timeStamp=(new Date).getTime(),s.originalEvent=t,s.dt=s.timeStamp-this.downTime,s.type="tap";var o=s.timeStamp-this.tapTime,a=this.prevTap&&"doubletap"!==this.prevTap.type&&this.prevTap.target===s.target&&500>o;for(this.tapTime=s.timeStamp,this.mouse||(Et=this.tapTime),n=0;n<i.length;n++){var h=z(i[n],r[n]);if(s.pageX-=h.x,s.pageY-=h.y,s.clientX-=h.x,s.clientY-=h.y,s.currentTarget=r[n],i[n].fire(s),s.immediatePropagationStopped||s.propagationStopped&&i[n+1]!==s.currentTarget)break}if(a){var l={};for(p(l,s),l.dt=o,l.type="doubletap",n=0;n<i.length&&(l.currentTarget=r[n],i[n].fire(l),!(l.immediatePropagationStopped||l.propagationStopped&&i[n+1]!==l.currentTarget));n++);this.prevTap=l}else this.prevTap=s},collectTaps:function(e,t,i){function r(e,t,r){var a=it?r.querySelectorAll(t):void 0;o!==rt&&A(e,o)&&!R(e,o,i)&&X(e,o,i)&&et(o,t,a)&&(n.push(e),s.push(o))}if(!(this.pointerWasMoved||!this.downTarget||this.downTarget!==i||this.mouse&&(new Date).getTime()-Et<300)){for(var n=[],s=[],o=i;o;)V.isSet(o)&&(n.push(V(o)),s.push(o)),dt.forEachSelector(r),o=o.parentNode;n.length&&this.fireTaps(e,t,n,s)}},validateSelector:function(e,t,i){for(var r=0,n=t.length;n>r;r++){var s=t[r],o=i[r],a=L(s.getAction(e,this,o),s);if(a&&I(s,o,a))return this.target=s,this.element=o,a}},setSnapping:function(e,t){var i,r,o,a,h,l,d,c,u,g,v=this.target.options.snap,m=v.anchors;if(t=t||this.snapStatus,t.useStatusXY)i={x:t.x,y:t.y};else{var f=z(this.target,this.element);i=p({},e),i.x-=f.x,i.y-=f.y}if(i.x-=this.inertiaStatus.resumeDx,i.y-=this.inertiaStatus.resumeDy,t.realX=i.x,t.realY=i.y,v.range<0&&(v.range=1/0),"path"===v.mode)for(m=[],u=0,g=v.paths.length;g>u;u++){var y=v.paths[u];n(y)&&(y=y(i.x,i.y)),m.push({x:s(y.x)?y.x:i.x,y:s(y.y)?y.y:i.y,range:s(y.range)?y.range:v.range})}if("anchor"!==v.mode&&"path"!==v.mode||!m.length){if("grid"===v.mode){var x=Math.round((i.x-v.gridOffset.x-this.snapOffset.x)/v.grid.x),E=Math.round((i.y-v.gridOffset.y-this.snapOffset.y)/v.grid.y),S=x*v.grid.x+v.gridOffset.x+this.snapOffset.x,w=E*v.grid.y+v.gridOffset.y+this.snapOffset.y;l=S-i.x,d=w-i.y,c=pt(l,d),a=c<v.range,h=S!==t.snappedX||w!==t.snappedY,t.snappedX=S,t.snappedY=w,t.dx=l,t.dy=d,t.range=v.range}}else{for(r={anchor:null,distance:0,range:0,dx:0,dy:0},u=0,g=m.length;g>u;u++){var b=m[u];o=s(b.range)?b.range:v.range,l=b.x-i.x+this.snapOffset.x,d=b.y-i.y+this.snapOffset.y,c=pt(l,d),a=o>c,1/0===o&&r.inRange&&1/0!==r.range&&(a=!1),(!r.anchor||(a?r.inRange&&1/0!==o?c/o<r.distance/r.range:c<r.distance:!r.inRange&&c<r.distance))&&(1/0===o&&(a=!0),r.anchor=b,r.distance=c,r.range=o,r.inRange=a,r.dx=l,r.dy=d,t.range=o)}a=r.inRange,h=r.anchor.x!==t.x||r.anchor.y!==t.y,t.snappedX=r.anchor.x,t.snappedY=r.anchor.y,t.dx=r.dx,t.dy=r.dy}return t.changed=h||a&&!t.locked,t.locked=a,t},setRestriction:function(e,i){var r,s=this.target,o=/resize/.test(this.prepared)?"resize":this.prepared,h=s&&s.options.restrict,l=h&&h[o];if(!l)return i;i=i||this.restrictStatus,r=r=i.useStatusXY?{x:i.x,y:i.y}:p({},e),i.snap&&i.snap.locked&&(r.x+=i.snap.dx||0,r.y+=i.snap.dy||0),r.x-=this.inertiaStatus.resumeDx,r.y-=this.inertiaStatus.resumeDy,i.dx=0,i.dy=0,i.restricted=!1;var d,c,u;return a(l)&&(l="parent"===l?this.element.parentNode:"self"===l?s.getRect(this.element):P(this.element,l),!l)?i:(n(l)&&(l=l(r.x,r.y,this.element)),t(l)&&(l=x(l)),d=l,"x"in l&&"y"in l?(c=Math.max(Math.min(d.x+d.width-this.restrictOffset.right,r.x),d.x+this.restrictOffset.left),u=Math.max(Math.min(d.y+d.height-this.restrictOffset.bottom,r.y),d.y+this.restrictOffset.top)):(c=Math.max(Math.min(d.right-this.restrictOffset.right,r.x),d.left+this.restrictOffset.left),u=Math.max(Math.min(d.bottom-this.restrictOffset.bottom,r.y),d.top+this.restrictOffset.top)),i.dx=c-r.x,i.dy=u-r.y,i.changed=i.restrictedX!==c||i.restrictedY!==u,i.restricted=!(!i.dx&&!i.dy),i.restrictedX=c,i.restrictedY=u,i)},checkAndPreventDefault:function(e,t,i){if(t=t||this.target){var r=t.options,n=r.preventDefault;if("auto"===n&&i&&!/^input$|^textarea$/i.test(i.nodeName)){if(/down|start/i.test(e.type)&&"drag"===this.prepared&&"xy"!==r.dragAxis)return;return void e.preventDefault()}return n===!0?void e.preventDefault():void 0}},calcInertia:function(e){var t=this.target.options.inertia,i=t.resistance,r=-Math.log(t.endSpeed/e.v0)/i;e.x0=this.prevEvent.pageX,e.y0=this.prevEvent.pageY,e.t0=e.startEvent.timeStamp/1e3,e.sx=e.sy=0,e.modifiedXe=e.xe=(e.vx0-r)/i,e.modifiedYe=e.ye=(e.vy0-r)/i,e.te=r,e.lambda_v0=i/e.v0,e.one_ve_v0=1-t.endSpeed/e.v0}},q.prototype={preventDefault:e,stopImmediatePropagation:function(){this.immediatePropagationStopped=this.propagationStopped=!0},stopPropagation:function(){this.propagationStopped=!0}};for(var It={},Ft=["dragStart","dragMove","resizeStart","resizeMove","gestureStart","gestureMove","pointerOver","pointerOut","pointerHover","selectorDown","pointerDown","pointerMove","pointerUp","addPointer","removePointer","recordPointer","collectTaps"],$t=0,Nt=Ft.length;Nt>$t;$t++){var Ut=Ft[$t];It[Ut]=U(Ut)}dt.indexOfElement=function(e,t){for(var i=0;i<this.length;i++){var r=this[i];if(r.selector===e&&r._context===(t||rt)||!r.selector&&r._element===e)return i}return-1},dt.get=function(e,t){return this[this.indexOfElement(e,t&&t.context)]},dt.forEachSelector=function(e){for(var t=0;t<this.length;t++){var i=this[t];if(i.selector){var r=e(i,i.selector,i._context,t,this);if(void 0!==r)return r}}},j.prototype=vt,G.prototype={setOnEvents:function(e,t){if("drop"===e){var i=t.ondrop||t.onDrop||t.drop,r=t.ondropactivate||t.onDropActivate||t.dropactivate||t.onactivate||t.onActivate||t.activate,s=t.ondropdeactivate||t.onDropDeactivate||t.dropdeactivate||t.ondeactivate||t.onDeactivate||t.deactivate,o=t.ondragenter||t.onDropEnter||t.dragenter||t.onenter||t.onEnter||t.enter,a=t.ondragleave||t.onDropLeave||t.dragleave||t.onleave||t.onLeave||t.leave,h=t.ondropmove||t.onDropMove||t.dropmove||t.onmove||t.onMove||t.move;n(i)&&(this.ondrop=i),n(r)&&(this.ondropactivate=r),n(s)&&(this.ondropdeactivate=s),n(o)&&(this.ondragenter=o),n(a)&&(this.ondragleave=a),n(h)&&(this.ondropmove=h)}else{var p=t.onstart||t.onStart||t.start,l=t.onmove||t.onMove||t.move,d=t.onend||t.onEnd||t.end,c=t.oninertiastart||t.onInertiaStart||t.inertiastart;e="on"+e,n(p)&&(this[e+"start"]=p),n(l)&&(this[e+"move"]=l),n(d)&&(this[e+"end"]=d),n(c)&&(this[e+"inertiastart"]=c)}return this},draggable:function(e){return i(e)?(this.options.draggable=!0,this.setOnEvents("drag",e),s(e.max)&&(this.options.dragMax=e.max),s(e.maxPerElement)&&(this.options.dragMaxPerElement=e.maxPerElement),/^x$|^y$|^xy$/.test(e.axis)?this.options.dragAxis=e.axis:null===e.axis&&delete this.options.dragAxis,this):o(e)?(this.options.draggable=e,this):null===e?(delete this.options.draggable,this):this.options.draggable},dropzone:function(e){return i(e)?(this.options.dropzone=!0,this.setOnEvents("drop",e),this.accept(e.accept),/^(pointer|center)$/.test(e.overlap)?this.options.dropOverlap=e.overlap:s(e.overlap)&&(this.options.dropOverlap=Math.max(Math.min(1,e.overlap),0)),this):o(e)?(this.options.dropzone=e,this):null===e?(delete this.options.dropzone,this):this.options.dropzone},dropCheck:function(e,t,i,r,n){if(!(n=n||this.getRect(r)))return!1;var o=this.options.dropOverlap;if("pointer"===o){var a,h,p=g(e),l=z(t,i);return p.x+=l.x,p.y+=l.y,a=p.x>n.left&&p.x<n.right,h=p.y>n.top&&p.y<n.bottom,a&&h}var d=t.getRect(i);if("center"===o){var c=d.left+d.width/2,u=d.top+d.height/2;return c>=n.left&&c<=n.right&&u>=n.top&&u<=n.bottom}if(s(o)){var v=Math.max(0,Math.min(n.right,d.right)-Math.max(n.left,d.left))*Math.max(0,Math.min(n.bottom,d.bottom)-Math.max(n.top,d.top)),m=v/(d.width*d.height);return m>=o}},dropChecker:function(e){return n(e)?(this.dropCheck=e,this):this.dropCheck},accept:function(e){return t(e)?(this.options.accept=e,this):h(e)?(this.options.accept=e,this):null===e?(delete this.options.accept,this):this.options.accept},resizable:function(e){return i(e)?(this.options.resizable=!0,this.setOnEvents("resize",e),s(e.max)&&(this.options.resizeMax=e.max),s(e.maxPerElement)&&(this.options.resizeMaxPerElement=e.maxPerElement),/^x$|^y$|^xy$/.test(e.axis)?this.options.resizeAxis=e.axis:null===e.axis&&(this.options.resizeAxis=vt.resizeAxis),this):o(e)?(this.options.resizable=e,this):this.options.resizable},resizeable:e,squareResize:function(e){return o(e)?(this.options.squareResize=e,this):null===e?(delete this.options.squareResize,this):this.options.squareResize},gesturable:function(e){return i(e)?(this.options.gesturable=!0,this.setOnEvents("gesture",e),s(e.max)&&(this.options.gestureMax=e.max),s(e.maxPerElement)&&(this.options.gestureMaxPerElement=e.maxPerElement),this):o(e)?(this.options.gesturable=e,this):null===e?(delete this.options.gesturable,this):this.options.gesturable},gestureable:e,autoScroll:function(e){var r=vt.autoScroll;if(i(e)){var n=this.options.autoScroll;return n===r&&(n=this.options.autoScroll={margin:r.margin,distance:r.distance,interval:r.interval,container:r.container}),n.margin=this.validateSetting("autoScroll","margin",e.margin),n.speed=this.validateSetting("autoScroll","speed",e.speed),n.container=t(e.container)||e.container instanceof window.Window?e.container:r.container,this.options.autoScrollEnabled=!0,this.options.autoScroll=n,this}return o(e)?(this.options.autoScrollEnabled=e,this):null===e?(delete this.options.autoScrollEnabled,delete this.options.autoScroll,this):this.options.autoScrollEnabled?this.options.autoScroll:!1},snap:function(e){var t=vt.snap;if(i(e)){var r=this.options.snap;return r===t&&(r={}),r.mode=this.validateSetting("snap","mode",e.mode),r.endOnly=this.validateSetting("snap","endOnly",e.endOnly),r.actions=this.validateSetting("snap","actions",e.actions),r.range=this.validateSetting("snap","range",e.range),r.paths=this.validateSetting("snap","paths",e.paths),r.grid=this.validateSetting("snap","grid",e.grid),r.gridOffset=this.validateSetting("snap","gridOffset",e.gridOffset),r.anchors=this.validateSetting("snap","anchors",e.anchors),r.elementOrigin=this.validateSetting("snap","elementOrigin",e.elementOrigin),this.options.snapEnabled=!0,this.options.snap=r,this}return o(e)?(this.options.snapEnabled=e,this):null===e?(delete this.options.snapEnabled,delete this.options.snap,this):this.options.snapEnabled?this.options.snap:!1},inertia:function(e){var t=vt.inertia;if(i(e)){var r=this.options.inertia;return r===t&&(r=this.options.inertia={resistance:t.resistance,minSpeed:t.minSpeed,endSpeed:t.endSpeed,actions:t.actions,allowResume:t.allowResume,zeroResumeDelta:t.zeroResumeDelta,smoothEndDuration:t.smoothEndDuration}),r.resistance=this.validateSetting("inertia","resistance",e.resistance),r.minSpeed=this.validateSetting("inertia","minSpeed",e.minSpeed),r.endSpeed=this.validateSetting("inertia","endSpeed",e.endSpeed),r.actions=this.validateSetting("inertia","actions",e.actions),r.allowResume=this.validateSetting("inertia","allowResume",e.allowResume),r.zeroResumeDelta=this.validateSetting("inertia","zeroResumeDelta",e.zeroResumeDelta),r.smoothEndDuration=this.validateSetting("inertia","smoothEndDuration",e.smoothEndDuration),this.options.inertiaEnabled=!0,this.options.inertia=r,this}return o(e)?(this.options.inertiaEnabled=e,this):null===e?(delete this.options.inertiaEnabled,delete this.options.inertia,this):this.options.inertiaEnabled?this.options.inertia:!1},getAction:function(e,t,i){var r=this.defaultActionChecker(e,t,i);return this.options.actionChecker&&(r=this.options.actionChecker(e,r,this,i,t)),r},defaultActionChecker:W,actionChecker:function(e){return n(e)?(this.options.actionChecker=e,this):null===e?(delete this.options.actionChecker,this):this.options.actionChecker},getRect:function(e){return e=e||this._element,this.selector&&!t(e)&&(e=this._context.querySelector(this.selector)),x(e)},rectChecker:function(e){return n(e)?(this.getRect=e,this):null===e?(delete this.options.getRect,this):this.getRect},styleCursor:function(e){return o(e)?(this.options.styleCursor=e,this):null===e?(delete this.options.styleCursor,this):this.options.styleCursor},preventDefault:function(e){return o(e)||"auto"===e?(this.options.preventDefault=e,this):null===e?(delete this.options.preventDefault,this):this.options.preventDefault},origin:function(e){return h(e)?(this.options.origin=e,this):i(e)?(this.options.origin=e,this):null===e?(delete this.options.origin,this):this.options.origin},deltaSource:function(e){return"page"===e||"client"===e?(this.options.deltaSource=e,this):null===e?(delete this.options.deltaSource,this):this.options.deltaSource},restrict:function(e){if(void 0===e)return this.options.restrict;if(o(e))vt.restrictEnabled=e;else if(i(e)){var t={};(i(e.drag)||h(e.drag))&&(t.drag=e.drag),(i(e.resize)||h(e.resize))&&(t.resize=e.resize),(i(e.gesture)||h(e.gesture))&&(t.gesture=e.gesture),o(e.endOnly)&&(t.endOnly=e.endOnly),i(e.elementRect)&&(t.elementRect=e.elementRect),this.options.restrictEnabled=!0,this.options.restrict=t}else null===e&&(delete this.options.restrict,delete this.options.restrictEnabled);return this},context:function(){return this._context},_context:rt,ignoreFrom:function(e){return h(e)?(this.options.ignoreFrom=e,this):t(e)?(this.options.ignoreFrom=e,this):null===e?(delete this.options.ignoreFrom,this):this.options.ignoreFrom},allowFrom:function(e){return h(e)?(this.options.allowFrom=e,this):t(e)?(this.options.allowFrom=e,this):null===e?(delete this.options.allowFrom,this):this.options.allowFrom},validateSetting:function(e,n,h){var p=vt[e],l=this.options[e];if(void 0!==p&&void 0!==p[n]){if("objectTypes"in p&&p.objectTypes.test(n))return i(h)?h:n in l&&i(l[n])?l[n]:p[n];if("arrayTypes"in p&&p.arrayTypes.test(n))return r(h)?h:n in l&&r(l[n])?l[n]:p[n];if("stringTypes"in p&&p.stringTypes.test(n))return a(h)?h:n in l&&a(l[n])?l[n]:p[n];if("numberTypes"in p&&p.numberTypes.test(n))return s(h)?h:n in l&&s(l[n])?l[n]:p[n];if("boolTypes"in p&&p.boolTypes.test(n))return o(h)?h:n in l&&o(l[n])?l[n]:p[n];if("elementTypes"in p&&p.elementTypes.test(n))return t(h)?h:n in l&&t(l[n])?l[n]:p[n]}return null},element:function(){return this._element},fire:function(e){if(!e||!e.type||!Z(zt,e.type))return this;var t,i,r,s="on"+e.type,o="";if(e.type in this._iEvents)for(t=this._iEvents[e.type],i=0,r=t.length;r>i&&!e.immediatePropagationStopped;i++)o=t[i].name,t[i](e);if(n(this[s])&&(o=this[s].name,this[s](e)),e.type in Tt&&(t=Tt[e.type]))for(i=0,r=t.length;r>i&&!e.immediatePropagationStopped;i++)o=t[i].name,t[i](e);return this},on:function(e,t,i){if("wheel"===e&&(e=Dt),i=i?!0:!1,Z(zt,e))e in this._iEvents?Z(this._iEvents[e],t)||this._iEvents[e].push(t):this._iEvents[e]=[t];else if(this.selector){gt[e]||(gt[e]={selectors:[],contexts:[],listeners:[]},_t.addToElement(this._context,e,B),_t.addToElement(this._context,e,K,!0));var r,n=gt[e];for(r=n.selectors.length-1;r>=0&&(n.selectors[r]!==this.selector||n.contexts[r]!==this._context);r--);-1===r&&(r=n.selectors.length,n.selectors.push(this.selector),n.contexts.push(this._context),n.listeners.push([])),n.listeners[r].push([t,i])}else _t.add(this,e,t,i);return this},off:function(e,t,i){var r,n=-1;if(i=i?!0:!1,"wheel"===e&&(e=Dt),Z(zt,e))r=this._iEvents[e],r&&-1!==(n=Q(r,t))&&this._iEvents[e].splice(n,1);else if(this.selector){var s=gt[e],o=!1;if(!s)return this;for(n=s.selectors.length-1;n>=0;n--)if(s.selectors[n]===this.selector&&s.contexts[n]===this._context){for(var a=s.listeners[n],h=a.length-1;h>=0;h--){var p=a[h][0],l=a[h][1];if(p===t&&l===i){a.splice(h,1),a.length||(s.selectors.splice(n,1),s.contexts.splice(n,1),s.listeners.splice(n,1),_t.removeFromElement(this._context,e,B),_t.removeFromElement(this._context,e,K,!0),s.selectors.length||(gt[e]=null)),o=!0;break}}if(o)break}}else _t.remove(this,t,i);return this},set:function(e){e&&i(e)||(e={}),this.options=new j(e),this.draggable("draggable"in e?e.draggable:this.options.draggable),this.dropzone("dropzone"in e?e.dropzone:this.options.dropzone),this.resizable("resizable"in e?e.resizable:this.options.resizable),this.gesturable("gesturable"in e?e.gesturable:this.options.gesturable);for(var t=["accept","actionChecker","allowFrom","autoScroll","deltaSource","dropChecker","ignoreFrom","inertia","origin","preventDefault","rectChecker","restrict","snap","styleCursor"],r=0,n=t.length;n>r;r++){var s=t[r];s in e&&this[s](e[s])}return this},unset:function(){if(_t.remove(this,"all"),a(this.selector))for(var e in gt)for(var t=gt[e],i=0;i<t.selectors.length;i++){t.selectors[i]===this.selector&&t.contexts[i]===this._context&&(t.selectors.splice(i,1),t.contexts.splice(i,1),t.listeners.splice(i,1),t.selectors.length||(gt[e]=null)),_t.removeFromElement(this._context,e,B),_t.removeFromElement(this._context,e,K,!0);break}else _t.remove(this,"all"),this.options.styleCursor&&(this._element.style.cursor="");return this.dropzone(!1),dt.splice(Q(dt,this),1),V}},G.prototype.gestureable=G.prototype.gesturable,G.prototype.resizeable=G.prototype.resizable,V.isSet=function(e,t){return-1!==dt.indexOfElement(e,t&&t.context)},V.on=function(e,t,i){return Z(zt,e)?Tt[e]?Z(Tt[e],t)||Tt[e].push(t):Tt[e]=[t]:_t.add(Xt,e,t,i),V},V.off=function(e,t,i){if(Z(zt,e)){var r;e in Tt&&-1!==(r=Q(Tt[e],t))&&Tt[e].splice(r,1)}else _t.remove(Xt,e,t,i);return V},V.simulate=function(t,i,r){var n,s={};return"resize"===t&&(t="resizexy"),/^(drag|resizexy|resizex|resizey)$/.test(t)?(r?p(s,r):(n=i instanceof nt?i.getBoundingClientRect():n=i.getClientRects()[0],"drag"===t?(s.pageX=n.left+n.width/2,s.pageY=n.top+n.height/2):(s.pageX=n.right,s.pageY=n.bottom)),s.target=s.currentTarget=i,s.preventDefault=s.stopPropagation=e,It.pointerDown(s,t),V):V},V.enableDragging=function(e){return null!==e&&void 0!==e?(bt.drag=e,V):bt.drag},V.enableResizing=function(e){return null!==e&&void 0!==e?(bt.resize=e,V):bt.resize},V.enableGesturing=function(e){return null!==e&&void 0!==e?(bt.gesture=e,V):bt.gesture},V.eventTypes=zt,V.debug=function(){var e=ct[0]||new $;return{interactions:ct,target:e.target,dragging:e.dragging,resizing:e.resizing,gesturing:e.gesturing,prepared:e.prepared,matches:e.matches,matchElements:e.matchElements,prevCoords:e.prevCoords,startCoords:e.startCoords,pointerIds:e.pointerIds,pointers:e.pointers,addPointer:It.addPointer,removePointer:It.removePointer,recordPointer:It.recordPointer,snap:e.snapStatus,restrict:e.restrictStatus,inertia:e.inertiaStatus,downTime:e.downTime,downEvent:e.downEvent,downPointer:e.downPointer,prevEvent:e.prevEvent,Interactable:G,IOptions:j,interactables:dt,pointerIsDown:e.pointerIsDown,defaultOptions:vt,defaultActionChecker:W,actionCursors:wt,dragMove:It.dragMove,resizeMove:It.resizeMove,gestureMove:It.gestureMove,pointerUp:It.pointerUp,pointerDown:It.pointerDown,pointerMove:It.pointerMove,pointerHover:It.pointerHover,events:_t,globalEvents:Tt,delegatedEvents:gt}},V.getTouchAverage=S,V.getTouchBBox=w,V.getTouchDistance=b,V.getTouchAngle=D,V.getElementRect=x,V.matchesSelector=et,V.margin=function(e){return s(e)?(xt=e,V):xt},V.styleCursor=function(e){return o(e)?(vt.styleCursor=e,V):vt.styleCursor},V.autoScroll=function(e){var r=vt.autoScroll;return i(e)?(vt.autoScrollEnabled=!0,s(e.margin)&&(r.margin=e.margin),s(e.speed)&&(r.speed=e.speed),r.container=t(e.container)||e.container instanceof window.Window?e.container:r.container,V):o(e)?(vt.autoScrollEnabled=e,V):vt.autoScrollEnabled?r:!1},V.snap=function(e){var t=vt.snap;return i(e)?(vt.snapEnabled=!0,a(e.mode)&&(t.mode=e.mode),o(e.endOnly)&&(t.endOnly=e.endOnly),s(e.range)&&(t.range=e.range),r(e.actions)&&(t.actions=e.actions),r(e.anchors)&&(t.anchors=e.anchors),i(e.grid)&&(t.grid=e.grid),i(e.gridOffset)&&(t.gridOffset=e.gridOffset),i(e.elementOrigin)&&(t.elementOrigin=e.elementOrigin),V):o(e)?(vt.snapEnabled=e,V):vt.snapEnabled},V.inertia=function(e){var t=vt.inertia;return i(e)?(vt.inertiaEnabled=!0,s(e.resistance)&&(t.resistance=e.resistance),s(e.minSpeed)&&(t.minSpeed=e.minSpeed),s(e.endSpeed)&&(t.endSpeed=e.endSpeed),s(e.smoothEndDuration)&&(t.smoothEndDuration=e.smoothEndDuration),o(e.allowResume)&&(t.allowResume=e.allowResume),o(e.zeroResumeDelta)&&(t.zeroResumeDelta=e.zeroResumeDelta),r(e.actions)&&(t.actions=e.actions),V):o(e)?(vt.inertiaEnabled=e,V):{enabled:vt.inertiaEnabled,resistance:t.resistance,minSpeed:t.minSpeed,endSpeed:t.endSpeed,actions:t.actions,allowResume:t.allowResume,zeroResumeDelta:t.zeroResumeDelta}},V.supportsTouch=function(){return ft},V.supportsPointerEvent=function(){return yt},V.currentAction=function(){for(var e=0,t=ct.length;t>e;e++){var i=ct[e].currentAction();if(i)return i}return null},V.stop=function(e){for(var t=ct.length-1;t>0;t--)ct[t].stop(e);return V},V.dynamicDrop=function(e){return o(e)?(ut=e,V):ut},V.deltaSource=function(e){return"page"===e||"client"===e?(vt.deltaSource=e,this):vt.deltaSource},V.restrict=function(e){var t=vt.restrict;return void 0===e?vt.restrict:(o(e)?vt.restrictEnabled=e:i(e)?((i(e.drag)||/^parent$|^self$/.test(e.drag))&&(t.drag=e.drag),(i(e.resize)||/^parent$|^self$/.test(e.resize))&&(t.resize=e.resize),(i(e.gesture)||/^parent$|^self$/.test(e.gesture))&&(t.gesture=e.gesture),o(e.endOnly)&&(t.endOnly=e.endOnly),i(e.elementRect)&&(t.elementRect=e.elementRect),vt.restrictEnabled=!0):null===e&&(t.drag=t.resize=t.gesture=null,t.endOnly=!1),this)},V.pointerMoveTolerance=function(e){return s(e)?(vt.pointerMoveTolerance=e,this):vt.pointerMoveTolerance},V.maxInteractions=function(e){return s(e)?(St=e,this):St},ht?(tt=ht===window.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"},_t.add(Xt,tt.up,It.collectTaps),_t.add(Xt,tt.move,It.recordPointer),_t.add(Xt,tt.down,It.selectorDown),_t.add(Xt,tt.move,It.pointerMove),_t.add(Xt,tt.up,It.pointerUp),_t.add(Xt,tt.over,It.pointerOver),_t.add(Xt,tt.out,It.pointerOut),_t.add(Xt,tt.up,It.removePointer),_t.add(Xt,tt.cancel,It.removePointer),_t.add(Xt,tt.move,mt.edgeMove)):(_t.add(Xt,"mouseup",It.collectTaps),_t.add(Xt,"touchend",It.collectTaps),_t.add(Xt,"mousemove",It.recordPointer),_t.add(Xt,"touchmove",It.recordPointer),_t.add(Xt,"mousedown",It.selectorDown),_t.add(Xt,"mousemove",It.pointerMove),_t.add(Xt,"mouseup",It.pointerUp),_t.add(Xt,"mouseover",It.pointerOver),_t.add(Xt,"mouseout",It.pointerOut),_t.add(Xt,"touchstart",It.selectorDown),_t.add(Xt,"touchmove",It.pointerMove),_t.add(Xt,"touchend",It.pointerUp),_t.add(Xt,"touchcancel",It.pointerUp),_t.add(Xt,"touchend",It.removePointer),_t.add(Xt,"touchcancel",It.removePointer),_t.add(Xt,"mousemove",mt.edgeMove),_t.add(Xt,"touchmove",mt.edgeMove)),_t.add(Rt,"blur",J);try{window.frameElement&&(kt._element=window.frameElement.ownerDocument,_t.add(kt,"mouseup",It.pointerUp),_t.add(kt,"touchend",It.pointerUp),_t.add(kt,"touchcancel",It.pointerUp),_t.add(kt,"pointerup",It.pointerUp),_t.add(kt,"MSPointerUp",It.pointerUp),_t.add(Yt,"blur",J))}catch(qt){V.windowParentError=qt}_t.useAttachEvent&&_t.add(Xt,"selectstart",function(e){var t=ct[0];t.currentAction()&&t.checkAndPreventDefault(e)}),Mt in Element.prototype&&n(Element.prototype[Mt])||(it=function(e,t,i){i=i||e.parentNode.querySelectorAll(t);for(var r=0,n=i.length;n>r;r++)if(i[r]===e)return!0;return!1}),function(){for(var e=0,t=["ms","moz","webkit","o"],i=0;i<t.length&&!window.requestAnimationFrame;++i)Pt=window[t[i]+"RequestAnimationFrame"],At=window[t[i]+"CancelAnimationFrame"]||window[t[i]+"CancelRequestAnimationFrame"];Pt||(Pt=function(t){var i=(new Date).getTime(),r=Math.max(0,16-(i-e)),n=window.setTimeout(function(){t(i+r)},r);return e=i+r,n}),At||(At=function(e){clearTimeout(e)})}(),"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=V),exports.interact=V):"function"==typeof define&&define.amd?define("interact",function(){return V}):window.interact=V}();
  