12 lines
33 KiB
JavaScript
12 lines
33 KiB
JavaScript
/*!
|
|
* Draggable 3.5.1
|
|
* https://greensock.com
|
|
*
|
|
* @license Copyright 2020, GreenSock. All rights reserved.
|
|
* Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership.
|
|
* @author: Jack Doyle, jack@greensock.com
|
|
*/
|
|
|
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).window=e.window||{})}(this,function(e){"use strict";function v(e,t){if(e.parentNode&&(p||w(e))){var n=S(e),o=n?n.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",r=n?t?"rect":"g":"div",i=2!==t?0:100,a=3===t?100:0,l="position:absolute;display:block;pointer-events:none;",s=p.createElementNS?p.createElementNS(o.replace(/^https/,"http"),r):p.createElement(r);return t&&(n?(h=h||v(e),s.setAttribute("width",.01),s.setAttribute("height",.01),s.setAttribute("transform","translate("+i+","+a+")"),h.appendChild(s)):(u||((u=v(e)).style.cssText=l),s.style.cssText=l+"width:0.1px;height:0.1px;top:"+a+"px;left:"+i+"px",u.appendChild(s))),s}throw"Need document and parent."}function y(e,t,n,o,r,i,a){return e.a=t,e.b=n,e.c=o,e.d=r,e.e=i,e.f=a,e}var p,d,r,i,u,h,f,g,t,x="transform",m=x+"Origin",w=function _setDoc(e){var t=e.ownerDocument||e;!(x in e.style)&&"msTransform"in e.style&&(m=(x="msTransform")+"Origin");for(;t.parentNode&&(t=t.parentNode););if(d=window,f=new fe,t){r=(p=t).documentElement,i=t.body;var n=t.createElement("div"),o=t.createElement("div");i.appendChild(n),n.appendChild(o),n.style.position="static",n.style[x]="translate3d(0,0,1px)",g=o.offsetParent!==n,i.removeChild(n)}return t},b=function _forceNonZeroScale(e){for(var t,n;e&&e!==i;)(n=e._gsap)&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),t?t.push(n):t=[n]),e=e.parentNode;return t},D=[],L=[],M=function _getDocScrollTop(){return d.pageYOffset||p.scrollTop||r.scrollTop||i.scrollTop||0},E=function _getDocScrollLeft(){return d.pageXOffset||p.scrollLeft||r.scrollLeft||i.scrollLeft||0},S=function _svgOwner(e){return e.ownerSVGElement||("svg"===(e.tagName+"").toLowerCase()?e:null)},P=function _isFixed(e){return"fixed"===d.getComputedStyle(e).position||((e=e.parentNode)&&1===e.nodeType?_isFixed(e):void 0)},k=function _placeSiblings(e,t){var n,o,r,i,a,l=S(e),s=e===l,c=l?D:L;if(e===d)return e;if(c.length||c.push(v(e,1),v(e,2),v(e,3)),n=l?h:u,l)r=s?{x:0,y:0}:e.getBBox(),a=(o=e.transform?e.transform.baseVal:{}).numberOfItems?(i=(o=1<o.numberOfItems?function _consolidate(e){for(var t=new fe,n=0;n<e.numberOfItems;n++)t.multiply(e.getItem(n).matrix);return t}(o):o.getItem(0).matrix).a*r.x+o.c*r.y,o.b*r.x+o.d*r.y):(o=f,i=r.x,r.y),t&&"g"===e.tagName.toLowerCase()&&(i=a=0),n.setAttribute("transform","matrix("+o.a+","+o.b+","+o.c+","+o.d+","+(o.e+i)+","+(o.f+a)+")"),(s?l:e.parentNode).appendChild(n);else{if(i=a=0,g)for(o=e.offsetParent,r=e;(r=r&&r.parentNode)&&r!==o&&r.parentNode;)4<(d.getComputedStyle(r)[x]+"").length&&(i=r.offsetLeft,a=r.offsetTop,r=0);(r=n.style).top=e.offsetTop-a+"px",r.left=e.offsetLeft-i+"px",o=d.getComputedStyle(e),r[x]=o[x],r[m]=o[m],r.border=o.border,r.borderLeftStyle=o.borderLeftStyle,r.borderTopStyle=o.borderTopStyle,r.borderLeftWidth=o.borderLeftWidth,r.borderTopWidth=o.borderTopWidth,r.position="fixed"===o.position?"fixed":"absolute",e.parentNode.appendChild(n)}return n},fe=((t=Matrix2D.prototype).inverse=function inverse(){var e=this.a,t=this.b,n=this.c,o=this.d,r=this.e,i=this.f,a=e*o-t*n||1e-10;return y(this,o/a,-t/a,-n/a,e/a,(n*i-o*r)/a,-(e*i-t*r)/a)},t.multiply=function multiply(e){var t=this.a,n=this.b,o=this.c,r=this.d,i=this.e,a=this.f,l=e.a,s=e.c,c=e.b,d=e.d,u=e.e,p=e.f;return y(this,l*t+c*o,l*n+c*r,s*t+d*o,s*n+d*r,i+u*t+p*o,a+u*n+p*r)},t.clone=function clone(){return new Matrix2D(this.a,this.b,this.c,this.d,this.e,this.f)},t.equals=function equals(e){var t=this.a,n=this.b,o=this.c,r=this.d,i=this.e,a=this.f;return t===e.a&&n===e.b&&o===e.c&&r===e.d&&i===e.e&&a===e.f},t.apply=function apply(e,t){void 0===t&&(t={});var n=e.x,o=e.y,r=this.a,i=this.b,a=this.c,l=this.d,s=this.e,c=this.f;return t.x=n*r+o*a+s||0,t.y=n*i+o*l+c||0,t},Matrix2D);function Matrix2D(e,t,n,o,r,i){void 0===e&&(e=1),void 0===t&&(t=0),void 0===n&&(n=0),void 0===o&&(o=1),void 0===r&&(r=0),void 0===i&&(i=0),y(this,e,t,n,o,r,i)}function getGlobalMatrix(e,t,n){if(!e||!e.parentNode||(p||w(e)).documentElement===e)return new fe;var o=b(e.parentNode),r=S(e)?D:L,i=k(e,n),a=r[0].getBoundingClientRect(),l=r[1].getBoundingClientRect(),s=r[2].getBoundingClientRect(),c=i.parentNode,d=P(e),u=new fe((l.left-a.left)/100,(l.top-a.top)/100,(s.left-a.left)/100,(s.top-a.top)/100,a.left+(d?0:E()),a.top+(d?0:M()));if(c.removeChild(i),o)for(a=o.length;a--;)(l=o[a]).scaleX=l.scaleY=0,l.renderTransform(1,l);return t?u.inverse():u}function T(){return"undefined"!=typeof window}function U(){return ge||T()&&(ge=window.gsap)&&ge.registerPlugin&&ge}function V(e){return"function"==typeof e}function W(e){return"object"==typeof e}function X(e){return void 0===e}function Y(){return!1}function _(e){return Math.round(1e4*e)/1e4}function ba(e,t){var n=me.createElementNS?me.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):me.createElement(e);return n.style?n:me.createElement(e)}function na(e,t){var n,o={};for(n in e)o[n]=t?e[n]*t:e[n];return o}function pa(){return Ne.forEach(function(e){return e()})}function ra(){return!Ne.length&&ge.ticker.remove(pa)}function sa(e){for(var t=Ne.length;t--;)Ne[t]===e&&Ne.splice(t,1);ge.to(ra,{overwrite:!0,delay:15,duration:0,onComplete:ra,data:"_draggable"})}function ua(e,t,n,o){if(e.addEventListener){var r=Te[t];o=o||(N?{passive:!1}:null),e.addEventListener(r||t,n,o),r&&t!==r&&e.addEventListener(t,n,o)}}function va(e,t,n){if(e.removeEventListener){var o=Te[t];e.removeEventListener(o||t,n),o&&t!==o&&e.removeEventListener(t,n)}}function wa(e){e.preventDefault&&e.preventDefault(),e.preventManipulation&&e.preventManipulation()}function ya(e){Le=e.touches&&De<e.touches.length,va(e.target,"touchend",ya)}function za(e){Le=e.touches&&De<e.touches.length,ua(e.target,"touchend",ya)}function Aa(e){return xe.pageYOffset||e.scrollTop||e.documentElement.scrollTop||e.body.scrollTop||0}function Ba(e){return xe.pageXOffset||e.scrollLeft||e.documentElement.scrollLeft||e.body.scrollLeft||0}function Ca(e,t){ua(e,"scroll",t),We(e.parentNode)||Ca(e.parentNode,t)}function Da(e,t){va(e,"scroll",t),We(e.parentNode)||Da(e.parentNode,t)}function Fa(e,t){var n="x"===t?"Width":"Height",o="scroll"+n,r="client"+n;return Math.max(0,We(e)?Math.max(ve[o],l[o])-(xe["inner"+n]||ve[r]||l[r]):e[o]-e[r])}function Ga(e,t){var n=Fa(e,"x"),o=Fa(e,"y");We(e)?e=Ie:Ga(e.parentNode,t),e._gsMaxScrollX=n,e._gsMaxScrollY=o,t||(e._gsScrollX=e.scrollLeft||0,e._gsScrollY=e.scrollTop||0)}function Ha(e,t,n){var o=e.style;o&&(X(o[t])&&(t=C(t,e)||t),null==n?o.removeProperty&&o.removeProperty(t.replace(/([A-Z])/g,"-$1").toLowerCase()):o[t]=n)}function Ia(e){return xe.getComputedStyle(e instanceof Element?e:e.host||(e.parentNode||{}).host||e)}function Ka(e){if(e===xe)return A.left=A.top=0,A.width=A.right=ve.clientWidth||e.innerWidth||l.clientWidth||0,A.height=A.bottom=(e.innerHeight||0)-20<ve.clientHeight?ve.clientHeight:e.innerHeight||l.clientHeight||0,A;var t=e.ownerDocument||me,n=X(e.pageX)?e.nodeType||X(e.left)||X(e.top)?we(e)[0].getBoundingClientRect():e:{left:e.pageX-Ba(t),top:e.pageY-Aa(t),right:e.pageX-Ba(t)+1,bottom:e.pageY-Aa(t)+1};return X(n.right)&&!X(n.width)?(n.right=n.left+n.width,n.bottom=n.top+n.height):X(n.width)&&(n={width:n.right-n.left,height:n.bottom-n.top,right:n.right,left:n.left,bottom:n.bottom,top:n.top}),n}function La(e,t,n){var o,r=e.vars,i=r[n],a=e._listeners[t];return V(i)&&(o=i.apply(r.callbackScope||e,r[n+"Params"]||[e.pointerEvent])),a&&!1===e.dispatchEvent(t)&&(o=!1),o}function Ma(e,t){var n,o,r,i=we(e)[0];return i.nodeType||i===xe?I(i,t):X(e.left)?{left:o=e.min||e.minX||e.minRotation||0,top:n=e.min||e.minY||0,width:(e.max||e.maxX||e.maxRotation||0)-o,height:(e.max||e.maxY||0)-n}:(r={x:0,y:0},{left:e.left-r.x,top:e.top-r.y,width:e.width,height:e.height})}function Pa(r,i,e,t,a,n){var o,l,s,c={};if(i)if(1!==a&&i instanceof Array){if(c.end=o=[],s=i.length,W(i[0]))for(l=0;l<s;l++)o[l]=na(i[l],a);else for(l=0;l<s;l++)o[l]=i[l]*a;e+=1.1,t-=1.1}else V(i)?c.end=function(e){var t,n,o=i.call(r,e);if(1!==a)if(W(o)){for(n in t={},o)t[n]=o[n]*a;o=t}else o*=a;return o}:c.end=i;return!e&&0!==e||(c.max=e),!t&&0!==t||(c.min=t),n&&(c.velocity=0),c}function Qa(e){var t;return!(!e||!e.getAttribute||e===l)&&(!("true"!==(t=e.getAttribute("data-clickable"))&&("false"===t||!e.onclick&&!o.test(e.nodeName+"")&&"true"!==e.getAttribute("contentEditable")))||Qa(e.parentNode))}function Ra(e,t){for(var n,o=e.length;o--;)(n=e[o]).ondragstart=n.onselectstart=t?null:Y,ge.set(n,{lazy:!0,userSelect:t?"text":"none"})}function Va(i,r){i=ge.utils.toArray(i)[0],r=r||{};var a,l,s,e,c,d,u=document.createElement("div"),p=u.style,t=i.firstChild,h=0,f=0,g=i.scrollTop,x=i.scrollLeft,m=i.scrollWidth,v=i.scrollHeight,y=0,w=0,b=0;R&&!1!==r.force3D?(c="translate3d(",d="px,0px)"):O&&(c="translate(",d="px)"),this.scrollTop=function(e,t){if(!arguments.length)return-this.top();this.top(-e,t)},this.scrollLeft=function(e,t){if(!arguments.length)return-this.left();this.left(-e,t)},this.left=function(e,t){if(!arguments.length)return-(i.scrollLeft+f);var n=i.scrollLeft-x,o=f;if((2<n||n<-2)&&!t)return x=i.scrollLeft,ge.killTweensOf(this,{left:1,scrollLeft:1}),this.left(-x),void(r.onKill&&r.onKill());(e=-e)<0?(f=e-.5|0,e=0):w<e?(f=e-w|0,e=w):f=0,(f||o)&&(this._skip||(p[O]=c+-f+"px,"+-h+d),0<=f+y&&(p.paddingRight=f+y+"px")),i.scrollLeft=0|e,x=i.scrollLeft},this.top=function(e,t){if(!arguments.length)return-(i.scrollTop+h);var n=i.scrollTop-g,o=h;if((2<n||n<-2)&&!t)return g=i.scrollTop,ge.killTweensOf(this,{top:1,scrollTop:1}),this.top(-g),void(r.onKill&&r.onKill());(e=-e)<0?(h=e-.5|0,e=0):b<e?(h=e-b|0,e=b):h=0,(h||o)&&(this._skip||(p[O]=c+-f+"px,"+-h+d)),i.scrollTop=0|e,g=i.scrollTop},this.maxScrollTop=function(){return b},this.maxScrollLeft=function(){return w},this.disable=function(){for(t=u.firstChild;t;)e=t.nextSibling,i.appendChild(t),t=e;i===u.parentNode&&i.removeChild(u)},this.enable=function(){if((t=i.firstChild)!==u){for(;t;)e=t.nextSibling,u.appendChild(t),t=e;i.appendChild(u),this.calibrate()}},this.calibrate=function(e){var t,n,o,r=i.clientWidth===a;g=i.scrollTop,x=i.scrollLeft,r&&i.clientHeight===l&&u.offsetHeight===s&&m===i.scrollWidth&&v===i.scrollHeight&&!e||((h||f)&&(n=this.left(),o=this.top(),this.left(-i.scrollLeft),this.top(-i.scrollTop)),t=Ia(i),r&&!e||(p.display="block",p.width="auto",p.paddingRight="0px",(y=Math.max(0,i.scrollWidth-i.clientWidth))&&(y+=parseFloat(t.paddingLeft)+(B?parseFloat(t.paddingRight):0))),p.display="inline-block",p.position="relative",p.overflow="visible",p.verticalAlign="top",p.boxSizing="content-box",p.width="100%",p.paddingRight=y+"px",B&&(p.paddingBottom=t.paddingBottom),a=i.clientWidth,l=i.clientHeight,m=i.scrollWidth,v=i.scrollHeight,w=i.scrollWidth-a,b=i.scrollHeight-l,s=u.offsetHeight,p.display="block",(n||o)&&(this.left(n),this.top(o)))},this.content=u,this.element=i,this._skip=!1,this.enable()}function Wa(e){if(T()&&document.body){var t=window&&window.navigator;xe=window,me=document,ve=me.documentElement,l=me.body,s=ba("div"),Se=!!window.PointerEvent,(ye=ba("div")).style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab",Xe="grab"===ye.style.cursor?"grab":"move",Me=t&&-1!==t.userAgent.toLowerCase().indexOf("android"),be="ontouchstart"in ve&&"orientation"in xe||t&&(0<t.MaxTouchPoints||0<t.msMaxTouchPoints),o=ba("div"),r=ba("div"),i=r.style,a=l,i.display="inline-block",i.position="relative",o.style.cssText=r.innerHTML="width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden",o.appendChild(r),a.appendChild(o),n=r.offsetHeight+18>o.scrollHeight,a.removeChild(o),B=n,Te=function(e){for(var t=e.split(","),n=(("onpointerdown"in s?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in s?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":e).split(",")),o={},r=4;-1<--r;)o[t[r]]=n[r],o[n[r]]=t[r];try{ve.addEventListener("test",null,Object.defineProperty({},"passive",{get:function get(){N=1}}))}catch(e){}return o}("touchstart,touchmove,touchend,touchcancel"),ua(me,"touchcancel",Y),ua(xe,"touchmove",Y),l&&l.addEventListener("touchstart",Y),ua(me,"contextmenu",function(){for(var e in Re)Re[e].isPressed&&Re[e].endDrag()}),ge=c=U()}var n,o,r,i,a;ge?(Ee=ge.plugins.inertia,C=ge.utils.checkPrefix,O=C(O),Ye=C(Ye),we=ge.utils.toArray,R=!!C("perspective")):e&&console.warn("Please gsap.registerPlugin(Draggable)")}var ge,xe,me,ve,l,s,ye,c,C,we,N,be,Te,De,Le,Me,Ee,Xe,Se,R,B,n,O="transform",Ye="transformOrigin",_e=Array.isArray,Pe=180/Math.PI,ke=1e20,a=new fe,Ce=Date.now||function(){return(new Date).getTime()},Ne=[],Re={},Be=0,o=/^(?:a|input|textarea|button|select)$/i,Oe=0,Ae={},Ie={},We=function _isRoot(e){return!(e&&e!==ve&&9!==e.nodeType&&e!==me.body&&e!==xe&&e.nodeType&&e.parentNode)},A={},Fe={},I=function _getElementBounds(e,t){t=we(t)[0];var n,o,r,i,a,l,s,c,d,u,p,h,f,g,x=e.getBBox&&e.ownerSVGElement,m=e.ownerDocument||me;if(e===xe)r=Aa(m),o=(n=Ba(m))+(m.documentElement.clientWidth||e.innerWidth||m.body.clientWidth||0),i=r+((e.innerHeight||0)-20<m.documentElement.clientHeight?m.documentElement.clientHeight:e.innerHeight||m.body.clientHeight||0);else{if(t===xe||X(t))return e.getBoundingClientRect();n=r=0,x?(p=(u=e.getBBox()).width,h=u.height):(e.viewBox&&(u=e.viewBox.baseVal)&&(n=u.x||0,r=u.y||0,p=u.width,h=u.height),p||(u="border-box"===(f=Ia(e)).boxSizing,p=(parseFloat(f.width)||e.clientWidth||0)+(u?0:parseFloat(f.borderLeftWidth)+parseFloat(f.borderRightWidth)),h=(parseFloat(f.height)||e.clientHeight||0)+(u?0:parseFloat(f.borderTopWidth)+parseFloat(f.borderBottomWidth)))),o=p,i=h}return e===t?{left:n,top:r,width:o-n,height:i-r}:(l=(a=getGlobalMatrix(t,!0).multiply(getGlobalMatrix(e))).apply({x:n,y:r}),s=a.apply({x:o,y:r}),c=a.apply({x:o,y:i}),d=a.apply({x:n,y:i}),n=Math.min(l.x,s.x,c.x,d.x),r=Math.min(l.y,s.y,c.y,d.y),{left:n+((g=t.parentNode||{}).scrollLeft||0),top:r+(g.scrollTop||0),width:Math.max(l.x,s.x,c.x,d.x)-n,height:Math.max(l.y,s.y,c.y,d.y)-r})},F=((n=EventDispatcher.prototype).addEventListener=function addEventListener(e,t){var n=this._listeners[e]||(this._listeners[e]=[]);~n.indexOf(t)||n.push(t)},n.removeEventListener=function removeEventListener(e,t){var n=this._listeners[e],o=n&&n.indexOf(t)||-1;-1<o&&n.splice(o,1)},n.dispatchEvent=function dispatchEvent(t){var n,o=this;return(this._listeners[t]||[]).forEach(function(e){return!1===e.call(o,{type:t,target:o.target})&&(n=!1)}),n},EventDispatcher);function EventDispatcher(e){this._listeners={},this.target=e||this}var He,H=(function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}(Draggable,He=F),Draggable.register=function register(e){ge=e,Wa()},Draggable.create=function create(e,t){return c||Wa(!0),we(e).map(function(e){return new Draggable(e,t)})},Draggable.get=function get(e){return Re[(we(e)[0]||{})._gsDragID]},Draggable.timeSinceDrag=function timeSinceDrag(){return(Ce()-Oe)/1e3},Draggable.hitTest=function hitTest(e,t,n){if(e===t)return!1;var o,r,i,a=Ka(e),l=Ka(t),s=a.top,c=a.left,d=a.right,u=a.bottom,p=a.width,h=a.height,f=l.left>d||l.right<c||l.top>u||l.bottom<s;return f||!n?!f:(i=-1!==(n+"").indexOf("%"),n=parseFloat(n)||0,(o={left:Math.max(c,l.left),top:Math.max(s,l.top)}).width=Math.min(d,l.right)-o.left,o.height=Math.min(u,l.bottom)-o.top,!(o.width<0||o.height<0)&&(i?p*h*(n*=.01)<=(r=o.width*o.height)||r>=l.width*l.height*n:o.width>n&&o.height>n))},Draggable);function Draggable(h,u){var e;e=He.call(this)||this,ge||Wa(1),h=we(h)[0],Ee=Ee||ge.plugins.inertia,e.vars=u=na(u||{}),e.target=h,e.x=e.y=e.rotation=0,e.dragResistance=parseFloat(u.dragResistance)||0,e.edgeResistance=isNaN(u.edgeResistance)?1:parseFloat(u.edgeResistance)||0,e.lockAxis=u.lockAxis,e.autoScroll=u.autoScroll||0,e.lockedAxis=null,e.allowEventDefault=!!u.allowEventDefault,ge.getProperty(h,"x");function Bg(e,t){return parseFloat(le.get(h,e,t))}function gh(e){return wa(e),e.stopImmediatePropagation&&e.stopImmediatePropagation(),!1}function hh(e){if(Z.autoScroll&&Z.isDragging&&(ee||k)){var t,n,o,r,i,a,l,s,c=h,d=15*Z.autoScroll;for(ee=!1,Ie.scrollTop=null!=xe.pageYOffset?xe.pageYOffset:null!=ce.documentElement.scrollTop?ce.documentElement.scrollTop:ce.body.scrollTop,Ie.scrollLeft=null!=xe.pageXOffset?xe.pageXOffset:null!=ce.documentElement.scrollLeft?ce.documentElement.scrollLeft:ce.body.scrollLeft,r=Z.pointerX-Ie.scrollLeft,i=Z.pointerY-Ie.scrollTop;c&&!n;)t=(n=We(c.parentNode))?Ie:c.parentNode,o=n?{bottom:Math.max(ve.clientHeight,xe.innerHeight||0),right:Math.max(ve.clientWidth,xe.innerWidth||0),left:0,top:0}:t.getBoundingClientRect(),a=l=0,U&&((s=t._gsMaxScrollY-t.scrollTop)<0?l=s:i>o.bottom-oe&&s?(ee=!0,l=Math.min(s,d*(1-Math.max(0,o.bottom-i)/oe)|0)):i<o.top+te&&t.scrollTop&&(ee=!0,l=-Math.min(t.scrollTop,d*(1-Math.max(0,i-o.top)/te)|0)),l&&(t.scrollTop+=l)),q&&((s=t._gsMaxScrollX-t.scrollLeft)<0?a=s:r>o.right-ne&&s?(ee=!0,a=Math.min(s,d*(1-Math.max(0,o.right-r)/ne)|0)):r<o.left+re&&t.scrollLeft&&(ee=!0,a=-Math.min(t.scrollLeft,d*(1-Math.max(0,r-o.left)/re)|0)),a&&(t.scrollLeft+=a)),n&&(a||l)&&(xe.scrollTo(t.scrollLeft,t.scrollTop),pe(Z.pointerX+a,Z.pointerY+l)),c=t}if(k){var u=Z.x,p=Z.y;K?(Z.deltaX=u-parseFloat(le.rotation),Z.rotation=u,le.rotation=u+"deg",le.renderTransform(1,le)):f?(U&&(Z.deltaY=p-f.top(),f.top(p)),q&&(Z.deltaX=u-f.left(),f.left(u))):G?(U&&(Z.deltaY=p-parseFloat(le.y),le.y=p+"px"),q&&(Z.deltaX=u-parseFloat(le.x),le.x=u+"px"),le.renderTransform(1,le)):(U&&(Z.deltaY=p-parseFloat(h.style.top||0),h.style.top=p+"px"),q&&(Z.deltaY=u-parseFloat(h.style.left||0),h.style.left=u+"px")),!g||e||F||(!(F=!0)===La(Z,"drag","onDrag")&&(q&&(Z.x-=Z.deltaX),U&&(Z.y-=Z.deltaY),hh(!0)),F=!1)}k=!1}function ih(e,t){var n,o,r=Z.x,i=Z.y;h._gsap||(le=ge.core.getCache(h)),G?(Z.x=parseFloat(le.x),Z.y=parseFloat(le.y)):K?Z.x=Z.rotation=parseFloat(le.rotation):f?(Z.y=f.top(),Z.x=f.left()):(Z.y=parseInt(h.style.top||(o=Ia(h))&&o.top,10)||0,Z.x=parseInt(h.style.left||(o||{}).left,10)||0),(C||N||R)&&!t&&(Z.isDragging||Z.isThrowing)&&(R&&(Ae.x=Z.x,Ae.y=Z.y,(n=R(Ae)).x!==Z.x&&(Z.x=n.x,k=!0),n.y!==Z.y&&(Z.y=n.y,k=!0)),C&&(n=C(Z.x))!==Z.x&&(Z.x=n,K&&(Z.rotation=n),k=!0),N&&((n=N(Z.y))!==Z.y&&(Z.y=n),k=!0)),k&&hh(!0),e||(Z.deltaX=Z.x-r,Z.deltaY=Z.y-i,La(Z,"throwupdate","onThrowUpdate"))}function jh(a,l,s,n){return null==l&&(l=-ke),null==s&&(s=ke),V(a)?function(e){var t=Z.isPressed?1-Z.edgeResistance:1;return a.call(Z,s<e?s+(e-s)*t:e<l?l+(e-l)*t:e)*n}:_e(a)?function(e){for(var t,n,o=a.length,r=0,i=ke;-1<--o;)(n=(t=a[o])-e)<0&&(n=-n),n<i&&l<=t&&t<=s&&(r=o,i=n);return a[r]}:isNaN(a)?function(e){return e}:function(){return a*n}}function lh(){var e,t,n,o;L=!1,f?(f.calibrate(),Z.minX=E=-f.maxScrollLeft(),Z.minY=Y=-f.maxScrollTop(),Z.maxX=M=Z.maxY=S=0,L=!0):u.bounds&&(e=Ma(u.bounds,h.parentNode),K?(Z.minX=E=e.left,Z.maxX=M=e.left+e.width,Z.minY=Y=Z.maxY=S=0):X(u.bounds.maxX)&&X(u.bounds.maxY)?(t=Ma(h,h.parentNode),Z.minX=E=Math.round(Bg(d,"px")+e.left-t.left-.5),Z.minY=Y=Math.round(Bg(j,"px")+e.top-t.top-.5),Z.maxX=M=Math.round(E+(e.width-t.width)),Z.maxY=S=Math.round(Y+(e.height-t.height))):(e=u.bounds,Z.minX=E=e.minX,Z.minY=Y=e.minY,Z.maxX=M=e.maxX,Z.maxY=S=e.maxY),M<E&&(Z.minX=M,Z.maxX=M=E,E=Z.minX),S<Y&&(Z.minY=S,Z.maxY=S=Y,Y=Z.minY),K&&(Z.minRotation=E,Z.maxRotation=M),L=!0),u.liveSnap&&(n=!0===u.liveSnap?u.snap||{}:u.liveSnap,o=_e(n)||V(n),K?(C=jh(o?n:n.rotation,E,M,1),N=null):n.points?R=function buildPointSnapFunc(s,l,c,d,u,p,h){return p=p&&p<ke?p*p:ke,V(s)?function(e){var t,n,o,r=Z.isPressed?1-Z.edgeResistance:1,i=e.x,a=e.y;return e.x=i=c<i?c+(i-c)*r:i<l?l+(i-l)*r:i,e.y=a=u<a?u+(a-u)*r:a<d?d+(a-d)*r:a,(t=s.call(Z,e))!==e&&(e.x=t.x,e.y=t.y),1!==h&&(e.x*=h,e.y*=h),p<ke&&(n=e.x-i,o=e.y-a,p<n*n+o*o&&(e.x=i,e.y=a)),e}:_e(s)?function(e){for(var t,n,o,r,i=s.length,a=0,l=ke;-1<--i;)(r=(t=(o=s[i]).x-e.x)*t+(n=o.y-e.y)*n)<l&&(a=i,l=r);return l<=p?s[a]:e}:function(e){return e}}(o?n:n.points,E,M,Y,S,n.radius,f?-1:1):(q&&(C=jh(o?n:n.x||n.left||n.scrollLeft,E,M,f?-1:1)),U&&(N=jh(o?n:n.y||n.top||n.scrollTop,Y,S,f?-1:1))))}function mh(){Z.isThrowing=!1,La(Z,"throwcomplete","onThrowComplete")}function nh(){Z.isThrowing=!1}function oh(e,t){var n,o,r,i;e&&Ee?(!0===e&&(n=u.snap||u.liveSnap||{},o=_e(n)||V(n),e={resistance:(u.throwResistance||u.resistance||1e3)/(K?10:1)},K?e.rotation=Pa(Z,o?n:n.rotation,M,E,1,t):(q&&(e[d]=Pa(Z,o?n:n.points||n.x||n.left,M,E,f?-1:1,t||"x"===Z.lockedAxis)),U&&(e[j]=Pa(Z,o?n:n.points||n.y||n.top,S,Y,f?-1:1,t||"y"===Z.lockedAxis)),(n.points||_e(n)&&W(n[0]))&&(e.linkedProps=d+","+j,e.radius=n.radius))),Z.isThrowing=!0,i=isNaN(u.overshootTolerance)?1===u.edgeResistance?0:1-Z.edgeResistance+.2:u.overshootTolerance,e.duration||(e.duration={max:Math.max(u.minDuration||0,"maxDuration"in u?u.maxDuration:2),min:isNaN(u.minDuration)?0===i||W(e)&&1e3<e.resistance?0:.5:u.minDuration,overshoot:i}),Z.tween=r=ge.to(f||h,{inertia:e,data:"_draggable",onComplete:mh,onInterrupt:nh,onUpdate:u.fastMode?La:ih,onUpdateParams:u.fastMode?[Z,"onthrowupdate","onThrowUpdate"]:n&&n.radius?[!1,!0]:[]}),u.fastMode||(f&&(f._skip=!0),r.render(1e9,!0,!0),ih(!0,!0),Z.endX=Z.x,Z.endY=Z.y,K&&(Z.endRotation=Z.x),r.play(0),ih(!0,!0),f&&(f._skip=!1))):L&&Z.applyBounds()}function ph(e){var t,n=B;B=getGlobalMatrix(h.parentNode,!0),e&&Z.isPressed&&!B.equals(n||new fe)&&(t=n.inverse().apply({x:w,y:b}),B.apply(t,t),w=t.x,b=t.y),B.equals(a)&&(B=null)}function qh(){var e,t,n,o=1-Z.edgeResistance,r=se?Ba(ce):0,i=se?Aa(ce):0;ph(!1),B&&(Fe.x=Z.pointerX-r,Fe.y=Z.pointerY-i,B.apply(Fe,Fe),w=Fe.x,b=Fe.y),k&&(pe(Z.pointerX,Z.pointerY),hh(!0)),f?(lh(),D=f.top(),T=f.left()):(de()?(ih(!0,!0),lh()):Z.applyBounds(),K?(e=h.ownerSVGElement?[le.xOrigin-h.getBBox().x,le.yOrigin-h.getBBox().y]:(Ia(h)[Ye]||"0 0").split(" "),P=Z.rotationOrigin=getGlobalMatrix(h).apply({x:parseFloat(e[0])||0,y:parseFloat(e[1])||0}),ih(!0,!0),t=Z.pointerX-P.x-r,n=P.y-Z.pointerY+i,T=Z.x,D=Z.y=Math.atan2(n,t)*Pe):(D=Bg(j,"px"),T=Bg(d,"px"))),L&&o&&(M<T?T=M+(T-M)/o:T<E&&(T=E-(E-T)/o),K||(S<D?D=S+(D-S)/o:D<Y&&(D=Y-(Y-D)/o))),Z.startX=T,Z.startY=D}function sh(){!ye.parentNode||de()||Z.isDragging||ye.parentNode.removeChild(ye)}function th(e,t){var n;if(!p||Z.isPressed||!e||!("mousedown"!==e.type&&"pointerdown"!==e.type||t)&&Ce()-ae<30&&Te[Z.pointerEvent.type])z&&e&&p&&wa(e);else{if(O=de(),Z.pointerEvent=e,Te[e.type]?(y=~e.type.indexOf("touch")?e.currentTarget||e.target:ce,ua(y,"touchend",he),ua(y,"touchmove",ue),ua(y,"touchcancel",he),ua(ce,"touchstart",za)):(y=null,ua(ce,"mousemove",ue)),I=null,Se&&y||(ua(ce,"mouseup",he),e&&e.target&&ua(e.target,"mouseup",he)),v=ie.call(Z,e.target)&&!1===u.dragClickables&&!t)return ua(e.target,"change",he),La(Z,"pressInit","onPressInit"),La(Z,"press","onPress"),void Ra($,!0);if(A=!(!y||q==U||!1===Z.vars.allowNativeTouchScrolling||Z.vars.allowContextMenu&&e&&(e.ctrlKey||2<e.which))&&(q?"y":"x"),(z=!A&&!Z.allowEventDefault)&&(wa(e),ua(xe,"touchforcechange",wa)),e.changedTouches?(e=x=e.changedTouches[0],m=e.identifier):e.pointerId?m=e.pointerId:x=m=null,De++,function _addToRenderQueue(e){Ne.push(e),1===Ne.length&&ge.ticker.add(pa)}(hh),b=Z.pointerY=e.pageY,w=Z.pointerX=e.pageX,La(Z,"pressInit","onPressInit"),(A||Z.autoScroll)&&Ga(h.parentNode),!h.parentNode||!Z.autoScroll||f||K||!h.parentNode._gsMaxScrollX||ye.parentNode||h.getBBox||(ye.style.width=h.parentNode.scrollWidth+"px",h.parentNode.appendChild(ye)),qh(),Z.tween&&Z.tween.kill(),Z.isThrowing=!1,ge.killTweensOf(f||h,o,!0),f&&ge.killTweensOf(h,{scrollTo:1},!0),Z.tween=Z.lockedAxis=null,!u.zIndexBoost&&(K||f||!1===u.zIndexBoost)||(h.style.zIndex=Draggable.zIndex++),Z.isPressed=!0,g=!(!u.onDrag&&!Z._listeners.drag),s=!(!u.onMove&&!Z._listeners.move),!K&&(!1!==u.cursor||u.activeCursor))for(n=$.length;-1<--n;)ge.set($[n],{cursor:u.activeCursor||u.cursor||("grab"===Xe?"grabbing":Xe)});La(Z,"press","onPress")}}function xh(e){if(e&&Z.isDragging&&!f){var t=e.target||h.parentNode,n=t.scrollLeft-t._gsScrollX,o=t.scrollTop-t._gsScrollY;(n||o)&&(B?(w-=n*B.a+o*B.c,b-=o*B.d+n*B.b):(w-=n,b-=o),t._gsScrollX+=n,t._gsScrollY+=o,pe(Z.pointerX,Z.pointerY))}}function yh(e){var t=Ce(),n=t-ae<40,o=t-J<40,r=n&&H===ae,i=Z.pointerEvent&&Z.pointerEvent.defaultPrevented,a=n&&c===ae,l=e.isTrusted||null==e.isTrusted&&n&&r;if((r||o&&!1!==Z.vars.suppressClickOnDrag)&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),n&&(!Z.pointerEvent||!Z.pointerEvent.defaultPrevented)&&(!r||l&&!a))return l&&r&&(c=ae),void(H=ae);(Z.isPressed||o||n)&&(l&&e.detail&&n&&!i||wa(e))}function zh(e){return B?{x:e.x*B.a+e.y*B.c+B.e,y:e.x*B.b+e.y*B.d+B.f}:{x:e.x,y:e.y}}var p,f,w,b,T,D,L,g,s,M,E,S,Y,x,m,P,k,t,C,N,R,v,y,B,O,A,I,F,H,c,z,n=(u.type||"x,y").toLowerCase(),G=~n.indexOf("x")||~n.indexOf("y"),K=-1!==n.indexOf("rotation"),d=K?"rotation":G?"x":"left",j=G?"y":"top",q=!(!~n.indexOf("x")&&!~n.indexOf("left")&&"scroll"!==n),U=!(!~n.indexOf("y")&&!~n.indexOf("top")&&"scroll"!==n),Q=u.minimumMovement||2,Z=function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e),$=we(u.trigger||u.handle||h),o={},J=0,ee=!1,te=u.autoScrollMarginTop||40,ne=u.autoScrollMarginRight||40,oe=u.autoScrollMarginBottom||40,re=u.autoScrollMarginLeft||40,ie=u.clickableTest||Qa,ae=0,le=h._gsap||ge.core.getCache(h),se=function _isFixed(e){return"fixed"===Ia(e).position||((e=e.parentNode)&&1===e.nodeType?_isFixed(e):void 0)}(h),ce=h.ownerDocument||me,de=function isTweening(){return Z.tween&&Z.tween.isActive()},ue=function onMove(e){var t,n,o,r,i,a,l=e;if(p&&!Le&&Z.isPressed&&e){if(t=(Z.pointerEvent=e).changedTouches){if((e=t[0])!==x&&e.identifier!==m){for(r=t.length;-1<--r&&(e=t[r]).identifier!==m;);if(r<0)return}}else if(e.pointerId&&m&&e.pointerId!==m)return;y&&A&&!I&&(Fe.x=e.pageX,Fe.y=e.pageY,B&&B.apply(Fe,Fe),n=Fe.x,o=Fe.y,((i=Math.abs(n-w))!==(a=Math.abs(o-b))&&(Q<i||Q<a)||Me&&A===I)&&(I=a<i&&q?"x":"y",A&&I!==A&&ua(xe,"touchforcechange",wa),!1!==Z.vars.lockAxisOnTouchScroll&&q&&U&&(Z.lockedAxis="x"===I?"y":"x",V(Z.vars.onLockAxis)&&Z.vars.onLockAxis.call(Z,l)),Me&&A===I))?he(l):(z=Z.allowEventDefault||A&&(!I||A===I)||!1===l.cancelable?z&&!1:(wa(l),!0),Z.autoScroll&&(ee=!0),pe(e.pageX,e.pageY,s))}else z&&e&&p&&wa(e)},pe=function setPointerPosition(e,t,n){var o,r,i,a,l,s,c=1-Z.dragResistance,d=1-Z.edgeResistance,u=Z.pointerX,p=Z.pointerY,h=D,f=Z.x,g=Z.y,x=Z.endX,m=Z.endY,v=Z.endRotation,y=k;Z.pointerX=e,Z.pointerY=t,se&&(e-=Ba(ce),t-=Aa(ce)),K?(a=Math.atan2(P.y-t,e-P.x)*Pe,180<(l=Z.y-a)?(D-=360,Z.y=a):l<-180&&(D+=360,Z.y=a),i=Z.x!==T||Math.abs(D-a)>Q?(Z.y=a,T+(D-a)*c):T):(B&&(s=e*B.a+t*B.c+B.e,t=e*B.b+t*B.d+B.f,e=s),(r=t-b)<Q&&-Q<r&&(r=0),(o=e-w)<Q&&-Q<o&&(o=0),(Z.lockAxis||Z.lockedAxis)&&(o||r)&&((s=Z.lockedAxis)||(Z.lockedAxis=s=q&&Math.abs(o)>Math.abs(r)?"y":U?"x":null,s&&V(Z.vars.onLockAxis)&&Z.vars.onLockAxis.call(Z,Z.pointerEvent)),"y"===s?r=0:"x"===s&&(o=0)),i=_(T+o*c),a=_(D+r*c)),(C||N||R)&&(Z.x!==i||Z.y!==a&&!K)?(R&&(Ae.x=i,Ae.y=a,s=R(Ae),i=_(s.x),a=_(s.y)),C&&(i=_(C(i))),N&&(a=_(N(a)))):L&&(M<i?i=M+Math.round((i-M)*d):i<E&&(i=E+Math.round((i-E)*d)),K||(S<a?a=Math.round(S+(a-S)*d):a<Y&&(a=Math.round(Y+(a-Y)*d)))),Z.x===i&&(Z.y===a||K)||(K?(Z.endRotation=Z.x=Z.endX=i,k=!0):(U&&(Z.y=Z.endY=a,k=!0),q&&(Z.x=Z.endX=i,k=!0)),n&&!1===La(Z,"move","onMove")?(Z.pointerX=u,Z.pointerY=p,D=h,Z.x=f,Z.y=g,Z.endX=x,Z.endY=m,Z.endRotation=v,k=y):!Z.isDragging&&Z.isPressed&&(Z.isDragging=!0,La(Z,"dragstart","onDragStart")))},he=function onRelease(e,t){if(p&&Z.isPressed&&(!e||null==m||t||!(e.pointerId&&e.pointerId!==m||e.changedTouches&&!function _hasTouchID(e,t){for(var n=e.length;n--;)if(e[n].identifier===t)return!0}(e.changedTouches,m)))){Z.isPressed=!1;var n,o,r,i,a,l=e,s=Z.isDragging,c=Z.vars.allowContextMenu&&e&&(e.ctrlKey||2<e.which),d=ge.delayedCall(.001,sh);if(y?(va(y,"touchend",onRelease),va(y,"touchmove",ue),va(y,"touchcancel",onRelease),va(ce,"touchstart",za)):va(ce,"mousemove",ue),va(xe,"touchforcechange",wa),Se&&y||(va(ce,"mouseup",onRelease),e&&e.target&&va(e.target,"mouseup",onRelease)),k=!1,v&&!c)return e&&(va(e.target,"change",onRelease),Z.pointerEvent=l),Ra($,!1),La(Z,"release","onRelease"),La(Z,"click","onClick"),void(v=!1);if(sa(hh),!K)for(o=$.length;-1<--o;)Ha($[o],"cursor",u.cursor||(!1!==u.cursor?Xe:null));if(s&&(J=Oe=Ce(),Z.isDragging=!1),De--,e){if((n=e.changedTouches)&&(e=n[0])!==x&&e.identifier!==m){for(o=n.length;-1<--o&&(e=n[o]).identifier!==m;);if(o<0)return}Z.pointerEvent=l,Z.pointerX=e.pageX,Z.pointerY=e.pageY}return c&&l?(wa(l),z=!0,La(Z,"release","onRelease")):l&&!s?(z=!1,O&&(u.snap||u.bounds)&&oh(u.inertia||u.throwProps),La(Z,"release","onRelease"),Me&&"touchmove"===l.type||-1!==l.type.indexOf("cancel")||(La(Z,"click","onClick"),Ce()-ae<300&&La(Z,"doubleclick","onDoubleClick"),i=l.target||h,ae=Ce(),a=function syntheticClick(){ae===H||!Z.enabled()||Z.isPressed||l.defaultPrevented||(i.click?i.click():ce.createEvent&&((r=ce.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,xe,1,Z.pointerEvent.screenX,Z.pointerEvent.screenY,Z.pointerX,Z.pointerY,!1,!1,!1,!1,0,null),i.dispatchEvent(r)))},Me||l.defaultPrevented||ge.delayedCall(.05,a))):(oh(u.inertia||u.throwProps),Z.allowEventDefault||!l||!1===u.dragClickables&&ie.call(Z,l.target)||!s||A&&(!I||A!==I)||!1===l.cancelable?z=!1:(z=!0,wa(l)),La(Z,"release","onRelease")),de()&&d.duration(Z.tween.duration()),s&&La(Z,"dragend","onDragEnd"),!0}z&&e&&p&&wa(e)};return(t=Draggable.get(h))&&t.kill(),e.startDrag=function(e,t){var n,o,r,i;th(e||Z.pointerEvent,!0),t&&!Z.hitTest(e||Z.pointerEvent)&&(n=Ka(e||Z.pointerEvent),o=Ka(h),r=zh({x:n.left+n.width/2,y:n.top+n.height/2}),i=zh({x:o.left+o.width/2,y:o.top+o.height/2}),w-=r.x-i.x,b-=r.y-i.y),Z.isDragging||(Z.isDragging=!0,La(Z,"dragstart","onDragStart"))},e.drag=ue,e.endDrag=function(e){return he(e||Z.pointerEvent,!0)},e.timeSinceDrag=function(){return Z.isDragging?0:(Ce()-J)/1e3},e.timeSinceClick=function(){return(Ce()-ae)/1e3},e.hitTest=function(e,t){return Draggable.hitTest(Z.target,e,t)},e.getDirection=function(e,t){var n,o,r,i,a,l,s="velocity"===e&&Ee?e:W(e)&&!K?"element":"start";return"element"===s&&(a=Ka(Z.target),l=Ka(e)),n="start"===s?Z.x-T:"velocity"===s?Ee.getVelocity(h,d):a.left+a.width/2-(l.left+l.width/2),K?n<0?"counter-clockwise":"clockwise":(t=t||2,o="start"===s?Z.y-D:"velocity"===s?Ee.getVelocity(h,j):a.top+a.height/2-(l.top+l.height/2),i=(r=Math.abs(n/o))<1/t?"":n<0?"left":"right",r<t&&(""!==i&&(i+="-"),i+=o<0?"up":"down"),i)},e.applyBounds=function(e,t){var n,o,r,i,a,l;if(e&&u.bounds!==e)return u.bounds=e,Z.update(!0,t);if(ih(!0),lh(),L&&!de()){if(n=Z.x,o=Z.y,M<n?n=M:n<E&&(n=E),S<o?o=S:o<Y&&(o=Y),(Z.x!==n||Z.y!==o)&&(r=!0,Z.x=Z.endX=n,K?Z.endRotation=n:Z.y=Z.endY=o,hh(k=!0),Z.autoScroll&&!Z.isDragging))for(Ga(h.parentNode),i=h,Ie.scrollTop=null!=xe.pageYOffset?xe.pageYOffset:null!=ce.documentElement.scrollTop?ce.documentElement.scrollTop:ce.body.scrollTop,Ie.scrollLeft=null!=xe.pageXOffset?xe.pageXOffset:null!=ce.documentElement.scrollLeft?ce.documentElement.scrollLeft:ce.body.scrollLeft;i&&!l;)a=(l=We(i.parentNode))?Ie:i.parentNode,U&&a.scrollTop>a._gsMaxScrollY&&(a.scrollTop=a._gsMaxScrollY),q&&a.scrollLeft>a._gsMaxScrollX&&(a.scrollLeft=a._gsMaxScrollX),i=a;Z.isThrowing&&(r||Z.endX>M||Z.endX<E||Z.endY>S||Z.endY<Y)&&oh(u.inertia||u.throwProps,r)}return Z},e.update=function(e,t,n){var o=Z.x,r=Z.y;return ph(!t),e?Z.applyBounds():(k&&n&&hh(!0),ih(!0)),t&&(pe(Z.pointerX,Z.pointerY),k&&hh(!0)),Z.isPressed&&!t&&(q&&.01<Math.abs(o-Z.x)||U&&.01<Math.abs(r-Z.y)&&!K)&&qh(),Z.autoScroll&&(Ga(h.parentNode,Z.isDragging),ee=Z.isDragging,hh(!0),Da(h,xh),Ca(h,xh)),Z},e.enable=function(e){var t,n,o,r={lazy:!0};if(K||!1===u.cursor||(r.cursor=u.cursor||Xe),ge.utils.checkPrefix("touchCallout")&&(r.touchCallout="none"),r.touchAction=q==U?"none":u.allowNativeTouchScrolling||u.allowEventDefault?"manipulation":q?"pan-y":"pan-x","soft"!==e){for(n=$.length;-1<--n;)o=$[n],Se||ua(o,"mousedown",th),ua(o,"touchstart",th),ua(o,"click",yh,!0),ge.set(o,r),o.getBBox&&o.ownerSVGElement&&ge.set(o.ownerSVGElement,{touchAction:q==U?"none":u.allowNativeTouchScrolling||u.allowEventDefault?"manipulation":q?"pan-y":"pan-x"}),u.allowContextMenu||ua(o,"contextmenu",gh);Ra($,!1)}return Ca(h,xh),p=!0,Ee&&"soft"!==e&&Ee.track(f||h,G?"x,y":K?"rotation":"top,left"),h._gsDragID=t="d"+Be++,Re[t]=Z,f&&(f.enable(),f.element._gsDragID=t),(u.bounds||K)&&qh(),u.bounds&&Z.applyBounds(),Z},e.disable=function(e){var t,n,o=Z.isDragging;if(!K)for(t=$.length;-1<--t;)Ha($[t],"cursor",null);if("soft"!==e){for(t=$.length;-1<--t;)n=$[t],Ha(n,"touchCallout",null),Ha(n,"touchAction",null),va(n,"mousedown",th),va(n,"touchstart",th),va(n,"click",yh),va(n,"contextmenu",gh);Ra($,!0),y&&(va(y,"touchcancel",he),va(y,"touchend",he),va(y,"touchmove",ue)),va(ce,"mouseup",he),va(ce,"mousemove",ue)}return Da(h,xh),p=!1,Ee&&"soft"!==e&&Ee.untrack(f||h,G?"x,y":K?"rotation":"top,left"),f&&f.disable(),sa(hh),Z.isDragging=Z.isPressed=v=!1,o&&La(Z,"dragend","onDragEnd"),Z},e.enabled=function(e,t){return arguments.length?e?Z.enable(t):Z.disable(t):p},e.kill=function(){return Z.isThrowing=!1,Z.tween&&Z.tween.kill(),Z.disable(),ge.set($,{clearProps:"userSelect"}),delete Re[h._gsDragID],Z},~n.indexOf("scroll")&&(f=e.scrollProxy=new Va(h,function _extend(e,t){for(var n in t)n in e||(e[n]=t[n]);return e}({onKill:function onKill(){Z.isPressed&&he(null)}},u)),h.style.overflowY=U&&!be?"auto":"hidden",h.style.overflowX=q&&!be?"auto":"hidden",h=f.content),K?o.rotation=1:(q&&(o[d]=1),U&&(o[j]=1)),le.force3D=!("force3D"in u)||u.force3D,e.enable(),e}!function _setDefaults(e,t){for(var n in t)n in e||(e[n]=t[n])}(H.prototype,{pointerX:0,pointerY:0,startX:0,startY:0,deltaX:0,deltaY:0,isDragging:!1,isPressed:!1}),H.zIndex=1e3,H.version="3.5.1",U()&&ge.registerPlugin(H),e.Draggable=H,e.default=H;if (typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})} else {delete e.default}});
|
|
|