|
|
- /**
- * vis.js
- * https://github.com/almende/vis
- *
- * A dynamic, browser-based visualization library.
- *
- * @version 4.16.1
- * @date 2016-04-18
- *
- * @license
- * Copyright (C) 2011-2016 Almende B.V, http://almende.com
- *
- * Vis.js is dual licensed under both
- *
- * * The Apache 2.0 License
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * and
- *
- * * The MIT License
- * http://opensource.org/licenses/MIT
- *
- * Vis.js may be distributed under either license.
- */
- "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(19),e.keycharm=i(22)},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?"symbol":typeof t},r=i(2),s=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=o.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return s.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]?!1:arguments[2];for(var s in t)void 0!==i[s]&&("object"!==n(i[s])?void 0!==i[s]&&null!==i[s]||void 0===t[s]||r!==!0?t[s]=i[s]:delete t[s]:"object"===n(t[s])&&e.fillIfDefined(t[s],i[s],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],s=0;s<t.length;s++){var o=t[s];r.hasOwnProperty(o)&&(e[o]=r[o])}return e},e.selectiveDeepExtend=function(t,i,n){var r=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s<arguments.length;s++)for(var o=arguments[s],a=0;a<t.length;a++){var h=t[a];if(o.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]?!1:arguments[3];if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var s in n)if(n.hasOwnProperty(s)&&-1==t.indexOf(s))if(n[s]&&n[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?e.deepExtend(i[s],n[s]):null===n[s]&&void 0!==i[s]&&r===!0?delete i[s]:i[s]=n[s];else if(Array.isArray(n[s])){i[s]=[];for(var o=0;o<n[s].length;o++)i[s].push(n[s][o])}else null===n[s]&&void 0!==i[s]&&r===!0?delete i[s]:i[s]=n[s];return i},e.deepExtend=function(t,i,n,r){for(var s in i)if(i.hasOwnProperty(s)||n===!0)if(i[s]&&i[s].constructor===Object)void 0===t[s]&&(t[s]={}),t[s].constructor===Object?e.deepExtend(t[s],i[s],n):null===i[s]&&void 0!==t[s]&&r===!0?delete t[s]:t[s]=i[s];else if(Array.isArray(i[s])){t[s]=[];for(var o=0;o<i[s].length;o++)t[s].push(i[s][o])}else null===i[s]&&void 0!==t[s]&&r===!0?delete t[s]:t[s]=i[s];return t},e.equalArray=function(t,e){if(t.length!=e.length)return!1;for(var i=0,n=t.length;n>i;i++)if(t[i]!=e[i])return!1;return!0},e.convert=function(t,i){var n;if(void 0!==t){if(null===t)return nul
- return(isNaN(i)?0:i)*e}function oe(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function ae(t,e){var i;return t.isValid()&&e.isValid()?(e=jt(e,t),t.isBefore(e)?i=oe(t,e):(i=oe(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function he(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function le(t,e){return function(i,n){var r,s;return null===n||isNaN(+n)||(b(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),s=i,i=n,n=s),i="string"==typeof i?+i:i,r=re(i,n),ue(this,r,t),this}}function ue(t,i,n,r){var s=i._milliseconds,o=he(i._days),a=he(i._months);t.isValid()&&(r=null==r?!0:r,s&&t._d.setTime(t._d.valueOf()+s*n),o&&V(t,"Date",F(t,"Date")+o*n),a&&at(t,F(t,"Month")+a*n),r&&e.updateOffset(t,o||a))}function de(t,e){var i=t||zt(),n=jt(i,this).startOf("day"),r=this.diff(n,"days",!0),s=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse",o=e&&(M(e[s])?e[s]():e[s]);return this.format(o||this.localeData().calendar(s,this,zt(i)))}function ce(){return new m(this)}function fe(t,e){var i=v(t)?t:zt(t);return this.isValid()&&i.isValid()?(e=z(f(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf()):!1}function pe(t,e){var i=v(t)?t:zt(t);return this.isValid()&&i.isValid()?(e=z(f(e)?"millisecond":e),"millisecond"===e?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf()):!1}function me(t,e,i,n){return n=n||"()",("("===n[0]?this.isAfter(t,i):!this.isBefore(t,i))&&(")"===n[1]?this.isBefore(e,i):!this.isAfter(e,i))}function ve(t,e){var i,n=v(t)?t:zt(t);return this.isValid()&&n.isValid()?(e=z(e||"millisecond"),"millisecond"===e?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf())):!1}function ye(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ge(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function _e(t,e,i){var n,r,s,o;return this.isValid()?(n=jt(t,this),n.isValid()?(r=6e4*(n.utcOffset()-this.utcOffset()),e=z(e),"year"===e||"month"===e||"quarter"===e?(o=xe(this,n),"quarter"===e?o/=3:"year"===e&&(o/=12)):(s=this-n,o="second"===e?s/1e3:"minute"===e?s/6e4:"hour"===e?s/36e5:"day"===e?(s-r)/864e5:"week"===e?(s-r)/6048e5:s),i?o:y(o)):NaN):NaN}function xe(t,e){var i,n,r=12*(e.year()-t.year())+(e.month()-t.month()),s=t.clone().add(r,"months");return 0>e-s?(i=t.clone().add(r-1,"months"),n=(e-s)/(s-i)):(i=t.clone().add(r+1,"months"),n=(e-s)/(i-s)),-(r+n)||0}function we(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function be(){var t=this.clone().utc();return 0<t.year()&&t.year()<=9999?M(Date.prototype.toISOString)?this.toDate().toISOString():X(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):X(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function Me(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var i=X(this,t);return this.localeData().postformat(i)}function Se(t,e){return this.isValid()&&(v(t)&&t.isValid()||zt(t).isValid())?re({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Te(t){return this.from(zt(),t)}function De(t,e){return this.isValid()&&(v(t)&&t.isValid()||zt(t).isValid())?re({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ke(t){return this.to(zt(),t)}function Ce(t){var e;return void 0===t?this._locale._abbr:(e=A(t),null!=e&&(this._locale=e),this)}function Oe(){return this._locale}function Pe(t){switch(t=z(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this}function Ee(t){return t=z(t),void 0===t||"millisecond"===t?this:("d
- o.content&&(h.textContent=o.content),o.className&&h.setAttributeNS(null,"class",o.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,n,r,s,o,a,h){if(0!=r){0>r&&(r*=-1,i-=r);var l=e.getSVGElement("rect",o,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",s),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;r>n;n++){var s=i[n],o=this._options.type[s];"Date"==o||"ISODate"==o||"ASPDate"==o?this._type[s]="Date":this._type[s]=o}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?"symbol":typeof t},s=i(1),o=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=o.extend(this,{replace:["add","update","remove"]})),"object"===r(t.queue)&&this._queue.setOptions(t.queue)))},n.prototype.on=function(t,e){var i=this._subscribers[t];i||(i=[],this._subscribers[t]=i),i.push({callback:e})},n.prototype.subscribe=function(){throw new Error("DataSet.subscribe is deprecated. Use DataSet.on instead.")},n.prototype.off=function(t,e){var i=this._subscribers[t];i&&(this._subscribers[t]=i.filter(function(t){return t.callback!=e}))},n.prototype.unsubscribe=function(){throw new Error("DataSet.unsubscribe is deprecated. Use DataSet.off instead.")},n.prototype._trigger=function(t,e,i){if("*"==t)throw new Error("Cannot trigger event *");var n=[];t in this._subscribers&&(n=n.concat(this._subscribers[t])),"*"in this._subscribers&&(n=n.concat(this._subscribers["*"]));for(var r=0,s=n.length;s>r;r++){var o=n[r];o.callback&&o.callback(t,e,i||null)}},n.prototype.add=function(t,e){var i,n=[],r=this;if(Array.isArray(t))for(var s=0,o=t.length;o>s;s++)i=r._addItem(t[s]),n.push(i);else{if(!(t instanceof Object))throw new Error("Unknown dataType");i=r._addItem(t),n.push(i)}return n.length&&this._trigger("add",{items:n},e),n},n.prototype.update=function(t,e){var i=[],n=[],r=[],o=[],a=this,h=a._fieldId,l=function(t){var e=t[h];if(a._data[e]){var l=s.extend({},a._data[e]);e=a._updateItem(t),n.push(e),o.push(t),r.push(l)}else e=a._addItem(t),i.push(e)};if(Array.isArray(t))for(var u=0,d=t.length;d>u;u++)t[u]instanceof Object?l(t[u]):console.warn("Ignoring input item, which is not an object at index "+u);else{if(!(t instanceof Object))throw new Error("Unknown dataType");l(t)}if(i.length&&this._trigger("add",{items:i},e),n.length){var c={items:n,oldData:r,data:o};this._trigger("update",c,e)}return i.concat(n)},n.prototype.get=function(t){var e,i,n,r=this,o=s.getType(arguments[0]);"String"==o||"Number"==o?(e=arguments[0],n=arguments[1]):"Array"==o?(i=arguments[0],n=arguments[1]):n=arguments[0];var a;if(n&&n.returnType){var h=["Array","Object"];a=-1==h.indexOf(n.returnType)?"Array":n.returnType}else a="Array";var l,u,d,c,f,p=n&&n.type||this._options.type,m=n&&n.filter,v=[];if(void 0!=e)l=r._getItem(e,p),l&&m&&!m(l)&&(l=null);else if(void 0!=i)for(c=0,f=i.length;f>c;c++)l=r._getItem(i[c],p),m&&!m(l)||v.push(l);else for(u=Object.keys(this._data),c=0,f=u.length;f>c;c++)d=u[c],l=r._getItem(d,p),m&&!m(l)||v.push(l);if(n&&n.order&&void 0==e&&this._sort(v,n.order),n&&n.fields){var y=n.fields;if(void 0!=e)l=this._filterFields(l,y);else for(c=0,f=v.length;f>c;c++)v[c]=this._filterFields(v[c],y)}if("Object"==a){var g,_={};for(c=0,f=v.length;f>c;c++)g=v[c],_[g.id]=g;return _}return void 0!=e?l:v},n.prototype.getIds=function(t){var e,i,n,r,s,o=this._data,a=t&&t.filter,h=t&&t.order,l=t&&t.type||this._options.type,u=O
- m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),t=this._convert3Dto2D(new d(this.xMax,i.getCurrent(),this.zMin)),e=this._convert3Dto2D(new d(this.xMax-g,i.getCurrent(),this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke()),s=Math.sin(x)>0?this.xMin:this.xMax,r=this._convert3Dto2D(new d(s,i.getCurrent(),this.zMin)),Math.cos(2*x)<0?(m.textAlign="center",m.textBaseline="top",r.y+=_):Math.sin(2*x)>0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(" "+this.yValueLabel(i.getCurrent())+" ",r.x,r.y),i.next();for(m.lineWidth=1,n=void 0===this.defaultZStep,i=new v(this.zMin,this.zMax,this.zStep,n),i.start(),i.getCurrent()<this.zMin&&i.next(),s=Math.cos(x)>0?this.xMin:this.xMax,o=Math.sin(x)<0?this.yMin:this.yMax;!i.end();)t=this._convert3Dto2D(new d(s,o,i.getCurrent())),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(t.x-_,t.y),m.stroke(),m.textAlign="right",m.textBaseline="middle",m.fillStyle=this.axisColor,m.fillText(this.zValueLabel(i.getCurrent())+" ",t.x-5,t.y),i.next();m.lineWidth=1,t=this._convert3Dto2D(new d(s,o,this.zMin)),e=this._convert3Dto2D(new d(s,o,this.zMax)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),m.lineWidth=1,c=this._convert3Dto2D(new d(this.xMin,this.yMin,this.zMin)),f=this._convert3Dto2D(new d(this.xMax,this.yMin,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(c.x,c.y),m.lineTo(f.x,f.y),m.stroke(),c=this._convert3Dto2D(new d(this.xMin,this.yMax,this.zMin)),f=this._convert3Dto2D(new d(this.xMax,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(c.x,c.y),m.lineTo(f.x,f.y),m.stroke(),m.lineWidth=1,t=this._convert3Dto2D(new d(this.xMin,this.yMin,this.zMin)),e=this._convert3Dto2D(new d(this.xMin,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),t=this._convert3Dto2D(new d(this.xMax,this.yMin,this.zMin)),e=this._convert3Dto2D(new d(this.xMax,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke();var b=this.xLabel;b.length>0&&(u=.1/this.scale.y,s=(this.xMin+this.xMax)/2,o=Math.cos(x)>0?this.yMin-u:this.yMax+u,r=this._convert3Dto2D(new d(s,o,this.zMin)),Math.cos(2*x)>0?(m.textAlign="center",m.textBaseline="top"):Math.sin(2*x)<0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(b,r.x,r.y));var M=this.yLabel;M.length>0&&(l=.1/this.scale.x,s=Math.sin(x)>0?this.xMin-l:this.xMax+l,o=(this.yMin+this.yMax)/2,r=this._convert3Dto2D(new d(s,o,this.zMin)),Math.cos(2*x)<0?(m.textAlign="center",m.textBaseline="top"):Math.sin(2*x)>0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(M,r.x,r.y));var S=this.zLabel;S.length>0&&(h=30,s=Math.cos(x)>0?this.xMin:this.xMax,o=Math.sin(x)<0?this.yMin:this.yMax,a=(this.zMin+this.zMax)/2,r=this._convert3Dto2D(new d(s,o,a)),m.textAlign="right",m.textBaseline="middle",m.fillStyle=this.axisColor,m.fillText(S,r.x-h,r.y))},n.prototype._hsv2rgb=function(t,e,i){var n,r,s,o,a,h;switch(o=i*e,a=Math.floor(t/60),h=o*(1-Math.abs(t/60%2-1)),a){case 0:n=o,r=h,s=0;break;case 1:n=h,r=o,s=0;break;case 2:n=0,r=o,s=h;break;case 3:n=0,r=h,s=o;break;case 4:n=h,r=0,s=o;break;case 5:n=o,r=0,s=h;break;default:n=0,r=0,s=0}return"RGB("+parseInt(255*n)+","+parseInt(255*r)+","+parseInt(255*s)+")"},n.prototype._redrawDataGrid=function(){var t,e,i,r,s,o,a,h,l,u,c,f,p=this.frame.canvas,m=p.getContext("2d");if(m.lineJoin="round",m.lineCap="round",!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(s=0;s<this.dataPoints.length;s++){var v=this._convertPointToTranslation(this.dataPoints[s].point),y=this._convertTranslationToScreen(v);this.dataPoints[s].trans=v,this.dataPoints[s].screen=y;var g=this._convertPointToTranslation(this.dataPoints[s].bottom);this.dataPoints[s].dist=this.showPerspective?g.
- * http://hammerjs.github.io/
- *
- * Copyright (c) 2015 Jorik Tangelder;
- * Licensed under the license */
- !function(r,s,o,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):!1}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",s=r.console&&(r.console.warn||r.console.log);return s&&s.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&&dt(n,i)}function f(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==pt?t.apply(e?e[0]||a:a,e):t}function m(t,e){return t===a?e:t}function v(t,e,i){u(x(e),function(e){t.addEventListener(e,i,!1)})}function y(t,e,i){u(x(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 x(t){return t.trim().split(/\s+/g)}function w(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 M(t,e,i){for(var n=[],r=[],s=0;s<t.length;){var o=e?t[s][e]:t[s];w(r,o)<0&&n.push(t[s]),r[s]=o,s++}return i&&(n=e?n.sort(function(t,i){return t[e]>i[e]}):n.sort()),n}function S(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),s=0;s<ct.length;){if(i=ct[s],n=i?i+r:e,n in t)return n;s++}return a}function T(){return xt++}function D(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||r}function k(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?B:St?j:bt?X:V)(t,O)}function O(t,e,i){var n=i.pointers.length,r=i.changedPointers.length,s=e&Pt&&n-r===0,o=e&(Lt|Yt)&&n-r===0;i.isFirst=!!s,i.isFinal=!!o,s&&(t.session={}),i.eventType=e,P(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function P(t,e){var i=t.session,n=e.pointers,r=n.length;i.firstInput||(i.firstInput=Y(e)),r>1&&!i.firstMultiple?i.firstMultiple=Y(e):1===r&&(i.firstMultiple=!1);var s=i.firstInput,o=i.firstMultiple,a=o?o.center:s.center,h=e.center=A(n);e.timeStamp=yt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=W(a,h),e.distance=z(a,h),E(i,e),e.offsetDirection=I(e.deltaX,e.deltaY);var l=R(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=vt(l.x)>vt(l.y)?l.x:l.y,e.scale=o?F(o.pointers,n):1,e.rotation=o?N(o.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 E(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},s=t.prevInput||{};e.eventType!==Pt&&s.eventType!==Lt||(r=t.prevDelta={x:s.deltaX||0,y:s.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,s,o=t.lastInterval||e,h=e.timeStamp-o.timeStamp;if(e.eventType!=Yt&&(h>Ot||o.velocity===a)){var l=e.deltaX-o.deltaX,u=e.deltaY-o.deltaY,d=R(h,l,u);n=d.x,r=d.y,i=vt(d.x)>vt(d.y)?d.x:d.y,s=I(l,u),t.lastInterval=e}else i=o.velocity,n=o.velocityX,r=o.velocityY,s=o.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=s}function Y(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:mt(t.pointers[i].clientX),clientY:mt(t.pointers[i].clientY)},i++;return{timeStamp:yt(),pointers:e,center:A(e),deltaX:t.deltaX,deltaY:t.deltaY}}function A(t){var e=t.length;if(1===e)return{x:mt(t[0].clientX),y:mt(t[0].clientY)};for(var i=0,n=0,r=0;e>r;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:mt(i/e),y:mt(n/e)}}function R(t,e,i){return
|