vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
146 KiB

  1. /**
  2. * vis.js
  3. * https://github.com/almende/vis
  4. *
  5. * A dynamic, browser-based visualization library.
  6. *
  7. * @version 4.17.0
  8. * @date 2016-11-05
  9. *
  10. * @license
  11. * Copyright (C) 2011-2016 Almende B.V, http://almende.com
  12. *
  13. * Vis.js is dual licensed under both
  14. *
  15. * * The Apache 2.0 License
  16. * http://www.apache.org/licenses/LICENSE-2.0
  17. *
  18. * and
  19. *
  20. * * The MIT License
  21. * http://opensource.org/licenses/MIT
  22. *
  23. * Vis.js may be distributed under either license.
  24. */
  25. "use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){e.util=i(1),e.DOMutil=i(7),e.DataSet=i(8),e.DataView=i(10),e.Queue=i(9),e.Graph3d=i(11),e.graph3d={Camera:i(15),Filter:i(16),Point2d:i(14),Point3d:i(13),Slider:i(17),StepNumber:i(18)},e.moment=i(2),e.Hammer=i(21),e.keycharm=i(24)},function(t,e,i){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=i(2),o=i(6);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,i,n){if(e==t)return.5;var r=1/(e-t);return Math.max(0,(n-t)*r)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=s.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return o.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!==n(t[i])&&(t[i]=e)},e.fillIfDefined=function(t,i){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var o in t)void 0!==i[o]&&("object"!==n(i[o])?void 0!==i[o]&&null!==i[o]||void 0===t[o]||r!==!0?t[o]=i[o]:delete t[o]:"object"===n(t[o])&&e.fillIfDefined(t[o],i[o],r))},e.protoExtend=function(t,e){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var r in n)t[r]=n[r]}return t},e.extend=function(t,e){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t},e.selectiveExtend=function(t,e,i){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(var n=2;n<arguments.length;n++)for(var r=arguments[n],o=0;o<t.length;o++){var s=t[o];r.hasOwnProperty(s)&&(e[s]=r[s])}return e},e.selectiveDeepExtend=function(t,i,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var o=2;o<arguments.length;o++)for(var s=arguments[o],a=0;a<t.length;a++){var h=t[a];if(s.hasOwnProperty(h))if(n[h]&&n[h].constructor===Object)void 0===i[h]&&(i[h]={}),i[h].constructor===Object?e.deepExtend(i[h],n[h],!1,r):null===n[h]&&void 0!==i[h]&&r===!0?delete i[h]:i[h]=n[h];else{if(Array.isArray(n[h]))throw new TypeError("Arrays are not supported by deepExtend");null===n[h]&&void 0!==i[h]&&r===!0?delete i[h]:i[h]=n[h]}}return i},e.selectiveNotDeepExtend=function(t,i,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var o in n)if(n.hasOwnProperty(o)&&t.indexOf(o)==-1)if(n[o]&&n[o].constructor===Object)void 0===i[o]&&(i[o]={}),i[o].constructor===Object?e.deepExtend(i[o],n[o]):null===n[o]&&void 0!==i[o]&&r===!0?delete i[o]:i[o]=n[o];else if(Array.isArray(n[o])){i[o]=[];for(var s=0;s<n[o].length;s++)i[o].push(n[o][s])}else null===n[o]&&void 0!==i[o]&&r===!0?delete i[o]:i[o]=n[o];return i},e.deepExtend=function(t,i,n,r){for(var o in i)if(i.hasOwnProperty(o)||n===!0)if(i[o]&&i[o].constructor===Object)void 0===t[o]&&(t[o]={}),t[o].constructor===Object?e.deepExtend(t[o],i[o],n):null===i[o]&&void 0!==t[o]&&r===!0?delete t[o]:t[o]=i[o];else if(Array.isArray(i[o])){t[o]=[];for(var s=0;s<i[o].length;s++)t[o].push(i[o][s])}else null===i[o]&&void 0!==t[o]&&r===!0?delete t[o]:t[o]=i[o];return t},e.equalArray=function(t,e){if(t.length!=e.length)return!1;for(var i=0,n=t.length;i<n;i++)if(t[i]!=e[i])return!1;return!0},e.convert=function(t,i){var n;if(void 0!==t){if(null==
  26. c(t)._overflowWeekday&&e===-1&&(e=sr),c(t).overflow=e),t}function re(t){var e,i,n,r,o,s,a=t._i,h=Dr.exec(a)||kr.exec(a);if(h){for(c(t).iso=!0,e=0,i=Cr.length;e<i;e++)if(Cr[e][1].exec(h[1])){r=Cr[e][0],n=Cr[e][2]!==!1;break}if(null==r)return void(t._isValid=!1);if(h[3]){for(e=0,i=Er.length;e<i;e++)if(Er[e][1].exec(h[3])){o=(h[2]||" ")+Er[e][0];break}if(null==o)return void(t._isValid=!1)}if(!n&&null!=o)return void(t._isValid=!1);if(h[4]){if(!Mr.exec(h[4]))return void(t._isValid=!1);s="Z"}t._f=r+(o||"")+(s||""),ue(t)}else t._isValid=!1}function oe(t){var i=Or.exec(t._i);return null!==i?void(t._d=new Date(+i[1])):(re(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function se(t,e,i){return null!=t?t:null!=e?e:i}function ae(t){var i=new Date(e.now());return t._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function he(t){var e,i,n,r,o=[];if(!t._d){for(n=ae(t),t._w&&null==t._a[tr]&&null==t._a[Kn]&&le(t),t._dayOfYear&&(r=se(t._a[Jn],n[Jn]),t._dayOfYear>mt(r)&&(c(t)._overflowDayOfYear=!0),i=_t(r,0,t._dayOfYear),t._a[Kn]=i.getUTCMonth(),t._a[tr]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=o[e]=n[e];for(;e<7;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[er]&&0===t._a[ir]&&0===t._a[nr]&&0===t._a[rr]&&(t._nextDay=!0,t._a[er]=0),t._d=(t._useUTC?_t:gt).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[er]=24)}}function le(t){var e,i,n,r,o,s,a,h;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,s=4,i=se(e.GG,t._a[Jn],bt(ge(),1,4).year),n=se(e.W,1),r=se(e.E,1),(r<1||r>7)&&(h=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,i=se(e.gg,t._a[Jn],bt(ge(),o,s).year),n=se(e.w,1),null!=e.d?(r=e.d,(r<0||r>6)&&(h=!0)):null!=e.e?(r=e.e+o,(e.e<0||e.e>6)&&(h=!0)):r=o),n<1||n>St(i,o,s)?c(t)._overflowWeeks=!0:null!=h?c(t)._overflowWeekday=!0:(a=xt(i,n,r,o,s),t._a[Jn]=a.year,t._dayOfYear=a.dayOfYear)}function ue(t){if(t._f===e.ISO_8601)return void re(t);t._a=[],c(t).empty=!0;var i,n,r,o,s,a=""+t._i,h=a.length,l=0;for(r=Q(t._f,t._locale).match(En)||[],i=0;i<r.length;i++)o=r[i],n=(a.match(J(o,t))||[])[0],n&&(s=a.substr(0,a.indexOf(n)),s.length>0&&c(t).unusedInput.push(s),a=a.slice(a.indexOf(n)+n.length),l+=n.length),Ln[o]?(n?c(t).empty=!1:c(t).unusedTokens.push(o),nt(o,n,t)):t._strict&&!n&&c(t).unusedTokens.push(o);c(t).charsLeftOver=h-l,a.length>0&&c(t).unusedInput.push(a),t._a[er]<=12&&c(t).bigHour===!0&&t._a[er]>0&&(c(t).bigHour=void 0),c(t).parsedDateParts=t._a.slice(0),c(t).meridiem=t._meridiem,t._a[er]=de(t._locale,t._a[er],t._meridiem),he(t),ne(t)}function de(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(n=t.isPM(i),n&&e<12&&(e+=12),n||12!==e||(e=0),e):e}function ce(t){var e,i,n,r,o;if(0===t._f.length)return c(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;r<t._f.length;r++)o=0,e=v({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[r],ue(e),f(e)&&(o+=c(e).charsLeftOver,o+=10*c(e).unusedTokens.length,c(e).score=o,(null==n||o<n)&&(n=o,i=e));l(t,i||e)}function fe(t){if(!t._d){var e=W(t._i);t._a=a([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),he(t)}}function pe(t){var e=new y(ne(me(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function me(t){var e=t._i,i=t._f;return t._locale=t._locale||ee(t._l),null===e||void 0===i&&""===e?p({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),g(e)?new y(ne(e)):(n(i)?ce(t):s(e)?t._d=e:i?ue(t):ve(t),f(t)||(t._d=null),t))}function ve(t){var i=t._i;void 0===i?t._d=new Date(e.now()):s(i)?t._d=new Date(i.valueOf()):"string"==typeof i?oe(t):n(i)?(t._a=a(i.slice(0),function(t){return parseInt(t,10)}),he(t)):"object"==typeof i?fe(t):"number"==typeof i?t._d=new Date(i):e.createFromInputFallback(t)}function ye(t,e,i,s,a){var h={};return"boolean"==typeof i&&(s=i,i=void 0),(r(t)&&o(t)||n(t)&&0===t.length)&&(t=void 0),h._isAMomentObject=!0,h._useUTC=h._isUTC=a,h._l=i,h._i=t,h._f=e,h._strict=s,pe(h)}function ge(t,e,i,n){return ye(t,e,i,n,!1)}function _
  27. o[r++]=d>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(var c=t.node||p,f=0;f<6;f++)o[r+f]=c[f];return e?e:n(o)}function o(t,e,i){var r=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var o=t.random||(t.rng||s)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var a=0;a<16;a++)e[r+a]=o[a];return e||n(o)}var s,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);s=function(){return crypto.getRandomValues(h),h}}if(!s){var l=new Array(16);s=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),l[e]=t>>>((3&e)<<3)&255;return l}}for(var u=[],d={},c=0;c<256;c++)u[c]=(c+256).toString(16).substr(1),d[u[c]]=c;var f=s(),p=[1|f[0],f[1],f[2],f[3],f[4],f[5]],m=16383&(f[6]<<8|f[7]),v=0,y=0,g=o;g.v1=r,g.v4=o,g.parse=i,g.unparse=n,t.exports=g}).call(e,function(){return this}())},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i<t[e].redundant.length;i++)t[e].redundant[i].parentNode.removeChild(t[e].redundant[i]);t[e].redundant=[]}},e.resetElements=function(t){e.prepareElements(t),e.cleanupElements(t),e.prepareElements(t)},e.getSVGElement=function(t,e,i){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(n)):(n=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(n)),e[t].used.push(n),n},e.getDOMElement=function(t,e,i,n){var r;return e.hasOwnProperty(t)?e[t].redundant.length>0?(r=e[t].redundant[0],e[t].redundant.shift()):(r=document.createElement(t),void 0!==n?i.insertBefore(r,n):i.appendChild(r)):(r=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==n?i.insertBefore(r,n):i.appendChild(r)),e[t].used.push(r),r},e.drawPoint=function(t,i,n,r,o,s){var a;if("circle"==n.style?(a=e.getSVGElement("circle",r,o),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*n.size)):(a=e.getSVGElement("rect",r,o),a.setAttributeNS(null,"x",t-.5*n.size),a.setAttributeNS(null,"y",i-.5*n.size),a.setAttributeNS(null,"width",n.size),a.setAttributeNS(null,"height",n.size)),void 0!==n.styles&&a.setAttributeNS(null,"style",n.styles),a.setAttributeNS(null,"class",n.className+" vis-point"),s){var h=e.getSVGElement("text",r,o);s.xOffset&&(t+=s.xOffset),s.yOffset&&(i+=s.yOffset),s.content&&(h.textContent=s.content),s.className&&h.setAttributeNS(null,"class",s.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,n,r,o,s,a,h){if(0!=r){r<0&&(r*=-1,i-=r);var l=e.getSVGElement("rect",s,a);l.setAttributeNS(null,"x",t-.5*n),l.setAttributeNS(null,"y",i),l.setAttributeNS(null,"width",n),l.setAttributeNS(null,"height",r),l.setAttributeNS(null,"class",o),h&&l.setAttributeNS(null,"style",h)}}},function(t,e,i){function n(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),n=0,r=i.length;n<r;n++){var o=i[n],s=this._options.type[o];"Date"==s||"ISODate"==s||"ASPDate"==s?this._type[o]="Date":this._type[o]=s}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},t&&this.add(t),this.setOptions(e)}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=i(1),s=i(9);n.prototype.setOptions=function(t){t&&void 0!==t.queue&&(t.queue===!1?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=s.extend(this,{replace:["add","update","remove"]})),"object"===r(t.queue)&&this._queue.setOptions(t.queue)))},n.prototype.on=function(t,e){var i=this._subs
  28. var M=i.getCurrent(),C=new u(o,s,M),E=this._convert3Dto2D(C);e=new d(E.x-y,E.y),this._line(f,E,e,this.axisColor);var D=this.zValueLabel(M)+" ";this.drawAxisLabelZ(f,C,D,5),i.next()}f.lineWidth=1,t=new u(o,s,b.min),e=new u(o,s,b.max),this._line3d(f,t,e,this.axisColor);var O,P;f.lineWidth=1,O=new u(w.min,x.min,b.min),P=new u(w.max,x.min,b.min),this._line3d(f,O,P,this.axisColor),O=new u(w.min,x.max,b.min),P=new u(w.max,x.max,b.min),this._line3d(f,O,P,this.axisColor),f.lineWidth=1,t=new u(w.min,x.min,b.min),e=new u(w.min,x.max,b.min),this._line3d(f,t,e,this.axisColor),t=new u(w.max,x.min,b.min),e=new u(w.max,x.max,b.min),this._line3d(f,t,e,this.axisColor);var L=this.xLabel;L.length>0&&(c=.1/this.scale.y,o=w.center()/2,s=_.x>0?x.min-c:x.max+c,r=new u(o,s,b.min),this.drawAxisLabelX(f,r,L,g));var R=this.yLabel;R.length>0&&(l=.1/this.scale.x,o=_.y>0?w.min-l:w.max+l,s=x.center()/2,r=new u(o,s,b.min),this.drawAxisLabelY(f,r,R,g));var Y=this.zLabel;Y.length>0&&(h=30,o=_.x>0?w.min:w.max,s=_.y<0?x.min:x.max,a=b.center()/2,r=new u(o,s,a),this.drawAxisLabelZ(f,r,Y,h))},n.prototype._hsv2rgb=function(t,e,i){var n,r,o,s,a,h;switch(s=i*e,a=Math.floor(t/60),h=s*(1-Math.abs(t/60%2-1)),a){case 0:n=s,r=h,o=0;break;case 1:n=h,r=s,o=0;break;case 2:n=0,r=s,o=h;break;case 3:n=0,r=h,o=s;break;case 4:n=h,r=0,o=s;break;case 5:n=s,r=0,o=h;break;default:n=0,r=0,o=0}return"RGB("+parseInt(255*n)+","+parseInt(255*r)+","+parseInt(255*o)+")"},n.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-(this.eye.z/this.camera.getArmLength())*this.dataColor.strokeWidth:this.dataColor.strokeWidth},n.prototype._redrawBar=function(t,e,i,n,r,o){var s,a,h=this,l=e.point,d=this.zRange.min,c=[{point:new u(l.x-i,l.y-n,l.z)},{point:new u(l.x+i,l.y-n,l.z)},{point:new u(l.x+i,l.y+n,l.z)},{point:new u(l.x-i,l.y+n,l.z)}],f=[{point:new u(l.x-i,l.y-n,d)},{point:new u(l.x+i,l.y-n,d)},{point:new u(l.x+i,l.y+n,d)},{point:new u(l.x-i,l.y+n,d)}];c.forEach(function(t){t.screen=h._convert3Dto2D(t.point)}),f.forEach(function(t){t.screen=h._convert3Dto2D(t.point)});var p=[{corners:c,center:u.avg(f[0].point,f[2].point)},{corners:[c[0],c[1],f[1],f[0]],center:u.avg(f[1].point,f[0].point)},{corners:[c[1],c[2],f[2],f[1]],center:u.avg(f[2].point,f[1].point)},{corners:[c[2],c[3],f[3],f[2]],center:u.avg(f[3].point,f[2].point)},{corners:[c[3],c[0],f[0],f[3]],center:u.avg(f[0].point,f[3].point)}];for(e.surfaces=p,s=0;s<p.length;s++){a=p[s];var m=this._convertPointToTranslation(a.center);a.dist=this.showPerspective?m.length():-m.z}for(p.sort(function(t,e){var i=e.dist-t.dist;return i?i:t.corners===c?1:e.corners===c?-1:0}),t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=o,t.fillStyle=r,s=2;s<p.length;s++)a=p[s],this._polygon(t,a.corners)},n.prototype._polygon=function(t,e,i,n){if(!(e.length<2)){void 0!==i&&(t.fillStyle=i),void 0!==n&&(t.strokeStyle=n),t.beginPath(),t.moveTo(e[0].screen.x,e[0].screen.y);for(var r=1;r<e.length;++r){var o=e[r];t.lineTo(o.screen.x,o.screen.y)}t.closePath(),t.fill(),t.stroke()}},n.prototype._drawCircle=function(t,e,i,n,r){var o=this._calcRadius(e,r);t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=n,t.fillStyle=i,t.beginPath(),t.arc(e.screen.x,e.screen.y,o,0,2*Math.PI,!0),t.fill(),t.stroke()},n.prototype._getColorsRegular=function(t){var e=240*(1-(t.point.z-this.zRange.min)*this.scale.z/this.verticalRatio),i=this._hsv2rgb(e,1,1),n=this._hsv2rgb(e,1,.8);return{fill:i,border:n}},n.prototype._getColorsColor=function(t){var e=240*(1-(t.point.value-this.valueRange.min)*this.scale.value),i=this._hsv2rgb(e,1,1),n=this._hsv2rgb(e,1,.8);return{fill:i,border:n}},n.prototype._getColorsSize=function(){return{fill:this.dataColor.fill,border:this.dataColor.stroke}},n.prototype._calcRadius=function(t,e){void 0===e&&(e=this._dotSize());var i;return i=this.showPerspective?e/-t.trans.z:e*-(this.eye.z/this.camera.getArmLength()),i<0&&(i=0),i},n.prototype._redrawBarGraphPoint=function(t,e){var i=this.xBarWidth/2,n=this.yBarWidth/2,r=this._getColorsRegular(e);this._redrawBar(t,e,i,n,r.fill,r.border)},n.prototype._redrawBarC
  29. * http://hammerjs.github.io/
  30. *
  31. * Copyright (c) 2016 Jorik Tangelder;
  32. * Licensed under the MIT license */
  33. !function(r,o,s,a){function h(t,e,i){return setTimeout(f(t,i),e)}function l(t,e,i){return!!Array.isArray(t)&&(u(t,i[e],i),!0)}function u(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function d(t,e,i){var n="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=new Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,n,i),t.apply(this,arguments)}}function c(t,e,i){var n,r=e.prototype;n=t.prototype=Object.create(r),n.constructor=t,n._super=r,i&&mt(n,i)}function f(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==gt?t.apply(e?e[0]||a:a,e):t}function m(t,e){return t===a?e:t}function v(t,e,i){u(w(e),function(e){t.addEventListener(e,i,!1)})}function y(t,e,i){u(w(e),function(e){t.removeEventListener(e,i,!1)})}function g(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function _(t,e){return t.indexOf(e)>-1}function w(t){return t.trim().split(/\s+/g)}function x(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function b(t){return Array.prototype.slice.call(t,0)}function S(t,e,i){for(var n=[],r=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];x(r,s)<0&&n.push(t[o]),r[o]=s,o++}return i&&(n=e?n.sort(function(t,i){return t[e]>i[e]}):n.sort()),n}function T(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),o=0;o<vt.length;){if(i=vt[o],n=i?i+r:e,n in t)return n;o++}return a}function D(){return Tt++}function k(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||r}function M(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){p(t.options.enable,[t])&&i.handler(e)},this.init()}function C(t){var e,i=t.options.inputClass;return new(e=i?i:Mt?j:Ct?U:kt?X:G)(t,E)}function E(t,e,i){var n=i.pointers.length,r=i.changedPointers.length,o=e&Yt&&n-r===0,s=e&(It|Wt)&&n-r===0;i.isFirst=!!o,i.isFinal=!!s,o&&(t.session={}),i.eventType=e,O(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function O(t,e){var i=t.session,n=e.pointers,r=n.length;i.firstInput||(i.firstInput=R(e)),r>1&&!i.firstMultiple?i.firstMultiple=R(e):1===r&&(i.firstMultiple=!1);var o=i.firstInput,s=i.firstMultiple,a=s?s.center:o.center,h=e.center=Y(n);e.timeStamp=xt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=z(a,h),e.distance=W(a,h),P(i,e),e.offsetDirection=I(e.deltaX,e.deltaY);var l=A(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=wt(l.x)>wt(l.y)?l.x:l.y,e.scale=s?F(s.pointers,n):1,e.rotation=s?N(s.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,L(i,e);var u=t.element;g(e.srcEvent.target,u)&&(u=e.srcEvent.target),e.target=u}function P(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==Yt&&o.eventType!==It||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}function L(t,e){var i,n,r,o,s=t.lastInterval||e,h=e.timeStamp-s.timeStamp;if(e.eventType!=Wt&&(h>Rt||s.velocity===a)){var l=e.deltaX-s.deltaX,u=e.deltaY-s.deltaY,d=A(h,l,u);n=d.x,r=d.y,i=wt(d.x)>wt(d.y)?d.x:d.y,o=I(l,u),t.lastInterval=e}else i=s.velocity,n=s.velocityX,r=s.velocityY,o=s.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=o}function R(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:_t(t.pointers[i].clientX),clientY:_t(t.pointers[i].clientY)},i++;return{timeStamp:xt(),pointers:e,center:Y(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Y(t){var e=t.length;if(1===e)return{x:_t(t[0].clientX),y:_t(t[0].clientY)};for(var i=0,n=0,r=0;r<e;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:_t(i/e),y:_t(n/e)}}function A(t,e,i){return{