mdbootstrap-rails 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rubocop.yml +1 -0
  4. data/.rubocop_todo.yml +54 -0
  5. data/.travis.yml +10 -0
  6. data/CHANGE_LOG.md +10 -0
  7. data/Gemfile +10 -0
  8. data/Guardfile +9 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +85 -0
  11. data/Rakefile +12 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/lib/mdbootstrap/rails.rb +7 -0
  15. data/lib/mdbootstrap/rails/engine.rb +6 -0
  16. data/lib/mdbootstrap/rails/version.rb +5 -0
  17. data/mdbootstrap-rails.gemspec +31 -0
  18. data/vendor/assets/README.txt +25 -0
  19. data/vendor/assets/css/bootstrap.css +6686 -0
  20. data/vendor/assets/css/bootstrap.min.css +7 -0
  21. data/vendor/assets/css/mdb.css +8614 -0
  22. data/vendor/assets/css/mdb.min.css +26 -0
  23. data/vendor/assets/css/style.css +1 -0
  24. data/vendor/assets/fonts/roboto/Roboto-Bold.eot +0 -0
  25. data/vendor/assets/fonts/roboto/Roboto-Bold.ttf +0 -0
  26. data/vendor/assets/fonts/roboto/Roboto-Bold.woff +0 -0
  27. data/vendor/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
  28. data/vendor/assets/fonts/roboto/Roboto-Light.eot +0 -0
  29. data/vendor/assets/fonts/roboto/Roboto-Light.ttf +0 -0
  30. data/vendor/assets/fonts/roboto/Roboto-Light.woff +0 -0
  31. data/vendor/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
  32. data/vendor/assets/fonts/roboto/Roboto-Medium.eot +0 -0
  33. data/vendor/assets/fonts/roboto/Roboto-Medium.ttf +0 -0
  34. data/vendor/assets/fonts/roboto/Roboto-Medium.woff +0 -0
  35. data/vendor/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
  36. data/vendor/assets/fonts/roboto/Roboto-Regular.eot +0 -0
  37. data/vendor/assets/fonts/roboto/Roboto-Regular.ttf +0 -0
  38. data/vendor/assets/fonts/roboto/Roboto-Regular.woff +0 -0
  39. data/vendor/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
  40. data/vendor/assets/fonts/roboto/Roboto-Thin.eot +0 -0
  41. data/vendor/assets/fonts/roboto/Roboto-Thin.ttf +0 -0
  42. data/vendor/assets/fonts/roboto/Roboto-Thin.woff +0 -0
  43. data/vendor/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
  44. data/vendor/assets/images/lightbox/default-skin.png +0 -0
  45. data/vendor/assets/images/lightbox/default-skin.svg +1 -0
  46. data/vendor/assets/images/lightbox/preloader.gif +0 -0
  47. data/vendor/assets/images/overlays/01.png +0 -0
  48. data/vendor/assets/images/overlays/02.png +0 -0
  49. data/vendor/assets/images/overlays/03.png +0 -0
  50. data/vendor/assets/images/overlays/04.png +0 -0
  51. data/vendor/assets/images/overlays/05.png +0 -0
  52. data/vendor/assets/images/overlays/06.png +0 -0
  53. data/vendor/assets/images/overlays/07.png +0 -0
  54. data/vendor/assets/images/overlays/08.png +0 -0
  55. data/vendor/assets/images/overlays/09.png +0 -0
  56. data/vendor/assets/javascripts/bootstrap.js +3430 -0
  57. data/vendor/assets/javascripts/bootstrap.min.js +7 -0
  58. data/vendor/assets/javascripts/jquery-2.2.3.js +9842 -0
  59. data/vendor/assets/javascripts/jquery-2.2.3.min.js +4 -0
  60. data/vendor/assets/javascripts/jquery-3.1.1.js +10220 -0
  61. data/vendor/assets/javascripts/jquery-3.1.1.min.js +4 -0
  62. data/vendor/assets/javascripts/mdb.js +5316 -0
  63. data/vendor/assets/javascripts/mdb.min.js +4 -0
  64. data/vendor/assets/javascripts/tether.js +1726 -0
  65. data/vendor/assets/javascripts/tether.min.js +1 -0
  66. data/vendor/assets/stylesheets/bootstrap.css +6686 -0
  67. data/vendor/assets/stylesheets/bootstrap.min.css +7 -0
  68. data/vendor/assets/stylesheets/mdb.scss +49 -0
  69. data/vendor/assets/stylesheets/mdb/free/_animations.scss +3340 -0
  70. data/vendor/assets/stylesheets/mdb/free/_buttons.scss +528 -0
  71. data/vendor/assets/stylesheets/mdb/free/_cards-basic.scss +59 -0
  72. data/vendor/assets/stylesheets/mdb/free/_carousels-basic.scss +51 -0
  73. data/vendor/assets/stylesheets/mdb/free/_footer.scss +51 -0
  74. data/vendor/assets/stylesheets/mdb/free/_forms-basic.scss +306 -0
  75. data/vendor/assets/stylesheets/mdb/free/_global.scss +397 -0
  76. data/vendor/assets/stylesheets/mdb/free/_helpers.scss +257 -0
  77. data/vendor/assets/stylesheets/mdb/free/_hover-effects.scss +415 -0
  78. data/vendor/assets/stylesheets/mdb/free/_navbars.scss +196 -0
  79. data/vendor/assets/stylesheets/mdb/free/_roboto.scss +51 -0
  80. data/vendor/assets/stylesheets/mdb/free/_typography.scss +201 -0
  81. data/vendor/assets/stylesheets/mdb/free/_waves.scss +157 -0
  82. data/vendor/assets/stylesheets/mdb/free/data/_colors.scss +875 -0
  83. data/vendor/assets/stylesheets/mdb/free/data/_mixins.scss +83 -0
  84. data/vendor/assets/stylesheets/mdb/free/data/_prefixer.scss +376 -0
  85. data/vendor/assets/stylesheets/mdb/free/data/_variables-b4.scss +666 -0
  86. data/vendor/assets/stylesheets/mdb/free/data/_variables.scss +102 -0
  87. metadata +221 -0
@@ -0,0 +1,4 @@
1
+ jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(t,e,i,n,s){return jQuery.easing[jQuery.easing.def](t,e,i,n,s)},easeInQuad:function(t,e,i,n,s){return n*(e/=s)*e+i},easeOutQuad:function(t,e,i,n,s){return-n*(e/=s)*(e-2)+i},easeInOutQuad:function(t,e,i,n,s){return(e/=s/2)<1?n/2*e*e+i:-n/2*(--e*(e-2)-1)+i},easeInCubic:function(t,e,i,n,s){return n*(e/=s)*e*e+i},easeOutCubic:function(t,e,i,n,s){return n*((e=e/s-1)*e*e+1)+i},easeInOutCubic:function(t,e,i,n,s){return(e/=s/2)<1?n/2*e*e*e+i:n/2*((e-=2)*e*e+2)+i},easeInQuart:function(t,e,i,n,s){return n*(e/=s)*e*e*e+i},easeOutQuart:function(t,e,i,n,s){return-n*((e=e/s-1)*e*e*e-1)+i},easeInOutQuart:function(t,e,i,n,s){return(e/=s/2)<1?n/2*e*e*e*e+i:-n/2*((e-=2)*e*e*e-2)+i},easeInQuint:function(t,e,i,n,s){return n*(e/=s)*e*e*e*e+i},easeOutQuint:function(t,e,i,n,s){return n*((e=e/s-1)*e*e*e*e+1)+i},easeInOutQuint:function(t,e,i,n,s){return(e/=s/2)<1?n/2*e*e*e*e*e+i:n/2*((e-=2)*e*e*e*e+2)+i},easeInSine:function(t,e,i,n,s){return-n*Math.cos(e/s*(Math.PI/2))+n+i},easeOutSine:function(t,e,i,n,s){return n*Math.sin(e/s*(Math.PI/2))+i},easeInOutSine:function(t,e,i,n,s){return-n/2*(Math.cos(Math.PI*e/s)-1)+i},easeInExpo:function(t,e,i,n,s){return 0==e?i:n*Math.pow(2,10*(e/s-1))+i},easeOutExpo:function(t,e,i,n,s){return e==s?i+n:n*(-Math.pow(2,-10*e/s)+1)+i},easeInOutExpo:function(t,e,i,n,s){return 0==e?i:e==s?i+n:(e/=s/2)<1?n/2*Math.pow(2,10*(e-1))+i:n/2*(-Math.pow(2,-10*--e)+2)+i},easeInCirc:function(t,e,i,n,s){return-n*(Math.sqrt(1-(e/=s)*e)-1)+i},easeOutCirc:function(t,e,i,n,s){return n*Math.sqrt(1-(e=e/s-1)*e)+i},easeInOutCirc:function(t,e,i,n,s){return(e/=s/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+i:n/2*(Math.sqrt(1-(e-=2)*e)+1)+i},easeInElastic:function(t,e,i,n,s){var a=1.70158,o=0,r=n;if(0==e)return i;if(1==(e/=s))return i+n;if(o||(o=.3*s),r<Math.abs(n)){r=n;var a=o/4}else var a=o/(2*Math.PI)*Math.asin(n/r);return-(r*Math.pow(2,10*(e-=1))*Math.sin((e*s-a)*(2*Math.PI)/o))+i},easeOutElastic:function(t,e,i,n,s){var a=1.70158,o=0,r=n;if(0==e)return i;if(1==(e/=s))return i+n;if(o||(o=.3*s),r<Math.abs(n)){r=n;var a=o/4}else var a=o/(2*Math.PI)*Math.asin(n/r);return r*Math.pow(2,-10*e)*Math.sin((e*s-a)*(2*Math.PI)/o)+n+i},easeInOutElastic:function(t,e,i,n,s){var a=1.70158,o=0,r=n;if(0==e)return i;if(2==(e/=s/2))return i+n;if(o||(o=s*(.3*1.5)),r<Math.abs(n)){r=n;var a=o/4}else var a=o/(2*Math.PI)*Math.asin(n/r);return 1>e?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e*s-a)*(2*Math.PI)/o))+i:r*Math.pow(2,-10*(e-=1))*Math.sin((e*s-a)*(2*Math.PI)/o)*.5+n+i},easeInBack:function(t,e,i,n,s,a){return void 0==a&&(a=1.70158),n*(e/=s)*e*((a+1)*e-a)+i},easeOutBack:function(t,e,i,n,s,a){return void 0==a&&(a=1.70158),n*((e=e/s-1)*e*((a+1)*e+a)+1)+i},easeInOutBack:function(t,e,i,n,s,a){return void 0==a&&(a=1.70158),(e/=s/2)<1?n/2*(e*e*(((a*=1.525)+1)*e-a))+i:n/2*((e-=2)*e*(((a*=1.525)+1)*e+a)+2)+i},easeInBounce:function(t,e,i,n,s){return n-jQuery.easing.easeOutBounce(t,s-e,0,n,s)+i},easeOutBounce:function(t,e,i,n,s){return(e/=s)<1/2.75?n*(7.5625*e*e)+i:2/2.75>e?n*(7.5625*(e-=1.5/2.75)*e+.75)+i:2.5/2.75>e?n*(7.5625*(e-=2.25/2.75)*e+.9375)+i:n*(7.5625*(e-=2.625/2.75)*e+.984375)+i},easeInOutBounce:function(t,e,i,n,s){return s/2>e?.5*jQuery.easing.easeInBounce(t,2*e,0,n,s)+i:.5*jQuery.easing.easeOutBounce(t,2*e-s,0,n,s)+.5*n+i}}),function(t){t.Package?Materialize={}:t.Materialize={}}(window),Materialize.guid=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return function(){return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}}(),Materialize.elementOrParentIsFixed=function(t){var e=$(t),i=e.add(e.parents()),n=!1;return i.each(function(){return"fixed"===$(this).css("position")?(n=!0,!1):void 0}),n};var Vel;Vel=$?$.Velocity:jQuery?jQuery.Velocity:Velocity,jQuery.Velocity?console.log("Velocity is already loaded. You may be needlessly importing Velocity again; note that Materialize includes Velocity."):(!function(t){function e(t){var e=t.length,n=i.type(t);return"function"===n||i.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}if(!t.jQuery){var i=function(t,e){return new i.fn.init(t,e)};i.isWindow=function(t){return null!=t&&t==t.window},i.type=function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?s[o.call(t)]||"object":typeof t},i.isArray=Array.isArray||function(t){return"array"===i.type(t)},i.isPlainObject=function(t){var e;if(!t||"object"!==i.type(t)||t.nodeType||i.isWindow(t))return!1;try{if(t.constructor&&!a.call(t,"constructor")&&!a.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}for(e in t);return void 0===e||a.call(t,e)},i.each=function(t,i,n){var s,a=0,o=t.length,r=e(t);if(n){if(r)for(;o>a&&(s=i.apply(t[a],n),s!==!1);a++);else for(a in t)if(s=i.apply(t[a],n),s===!1)break}else if(r)for(;o>a&&(s=i.call(t[a],a,t[a]),s!==!1);a++);else for(a in t)if(s=i.call(t[a],a,t[a]),s===!1)break;return t},i.data=function(t,e,s){if(void 0===s){var a=t[i.expando],o=a&&n[a];if(void 0===e)return o;if(o&&e in o)return o[e]}else if(void 0!==e){var a=t[i.expando]||(t[i.expando]=++i.uuid);return n[a]=n[a]||{},n[a][e]=s,s}},i.removeData=function(t,e){var s=t[i.expando],a=s&&n[s];a&&i.each(e,function(t,e){delete a[e]})},i.extend=function(){var t,e,n,s,a,o,r=arguments[0]||{},l=1,h=arguments.length,u=!1;for("boolean"==typeof r&&(u=r,r=arguments[l]||{},l++),"object"!=typeof r&&"function"!==i.type(r)&&(r={}),l===h&&(r=this,l--);h>l;l++)if(null!=(a=arguments[l]))for(s in a)t=r[s],n=a[s],r!==n&&(u&&n&&(i.isPlainObject(n)||(e=i.isArray(n)))?(e?(e=!1,o=t&&i.isArray(t)?t:[]):o=t&&i.isPlainObject(t)?t:{},r[s]=i.extend(u,o,n)):void 0!==n&&(r[s]=n));return r},i.queue=function(t,n,s){function a(t,i){var n=i||[];return null!=t&&(e(Object(t))?!function(t,e){for(var i=+e.length,n=0,s=t.length;i>n;)t[s++]=e[n++];if(i!==i)for(;void 0!==e[n];)t[s++]=e[n++];return t.length=s,t}(n,"string"==typeof t?[t]:t):[].push.call(n,t)),n}if(t){n=(n||"fx")+"queue";var o=i.data(t,n);return s?(!o||i.isArray(s)?o=i.data(t,n,a(s)):o.push(s),o):o||[]}},i.dequeue=function(t,e){i.each(t.nodeType?[t]:t,function(t,n){e=e||"fx";var s=i.queue(n,e),a=s.shift();"inprogress"===a&&(a=s.shift()),a&&("fx"===e&&s.unshift("inprogress"),a.call(n,function(){i.dequeue(n,e)}))})},i.fn=i.prototype={init:function(t){if(t.nodeType)return this[0]=t,this;throw new Error("Not a DOM node.")},offset:function(){var e=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:e.top+(t.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:e.left+(t.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function t(){for(var t=this.offsetParent||document;t&&"html"===!t.nodeType.toLowerCase&&"static"===t.style.position;)t=t.offsetParent;return t||document}var e=this[0],t=t.apply(e),n=this.offset(),s=/^(?:body|html)$/i.test(t.nodeName)?{top:0,left:0}:i(t).offset();return n.top-=parseFloat(e.style.marginTop)||0,n.left-=parseFloat(e.style.marginLeft)||0,t.style&&(s.top+=parseFloat(t.style.borderTopWidth)||0,s.left+=parseFloat(t.style.borderLeftWidth)||0),{top:n.top-s.top,left:n.left-s.left}}};var n={};i.expando="velocity"+(new Date).getTime(),i.uuid=0;for(var s={},a=s.hasOwnProperty,o=s.toString,r="Boolean Number String Function Array Date RegExp Object Error".split(" "),l=0;l<r.length;l++)s["[object "+r[l]+"]"]=r[l].toLowerCase();i.fn.init.prototype=i.fn,t.Velocity={Utilities:i}}}(window),function(t){"object"==typeof module&&"object"==typeof module.exports?module.exports=t():"function"==typeof define&&define.amd?define(t):t()}(function(){return function(t,e,i,n){function s(t){for(var e=-1,i=t?t.length:0,n=[];++e<i;){var s=t[e];s&&n.push(s)}return n}function a(t){return g.isWrapped(t)?t=[].slice.call(t):g.isNode(t)&&(t=[t]),t}function o(t){var e=f.data(t,"velocity");return null===e?n:e}function r(t){return function(e){return Math.round(e*t)*(1/t)}}function l(t,i,n,s){function a(t,e){return 1-3*e+3*t}function o(t,e){return 3*e-6*t}function r(t){return 3*t}function l(t,e,i){return((a(e,i)*t+o(e,i))*t+r(e))*t}function h(t,e,i){return 3*a(e,i)*t*t+2*o(e,i)*t+r(e)}function u(e,i){for(var s=0;g>s;++s){var a=h(i,t,n);if(0===a)return i;var o=l(i,t,n)-e;i-=o/a}return i}function c(){for(var e=0;b>e;++e)C[e]=l(e*x,t,n)}function f(e,i,s){var a,o,r=0;do o=i+(s-i)/2,a=l(o,t,n)-e,a>0?s=o:i=o;while(Math.abs(a)>m&&++r<y);return o}function d(e){for(var i=0,s=1,a=b-1;s!=a&&C[s]<=e;++s)i+=x;--s;var o=(e-C[s])/(C[s+1]-C[s]),r=i+o*x,l=h(r,t,n);return l>=v?u(e,r):0==l?r:f(e,i,i+x)}function p(){P=!0,(t!=i||n!=s)&&c()}var g=4,v=.001,m=1e-7,y=10,b=11,x=1/(b-1),w="Float32Array"in e;if(4!==arguments.length)return!1;for(var S=0;4>S;++S)if("number"!=typeof arguments[S]||isNaN(arguments[S])||!isFinite(arguments[S]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var C=w?new Float32Array(b):new Array(b),P=!1,k=function(e){return P||p(),t===i&&n===s?e:0===e?0:1===e?1:l(d(e),i,s)};k.getControlPoints=function(){return[{x:t,y:i},{x:n,y:s}]};var L="generateBezier("+[t,i,n,s]+")";return k.toString=function(){return L},k}function h(t,e){var i=t;return g.isString(t)?b.Easings[t]||(i=!1):i=g.isArray(t)&&1===t.length?r.apply(null,t):g.isArray(t)&&2===t.length?x.apply(null,t.concat([e])):g.isArray(t)&&4===t.length?l.apply(null,t):!1,i===!1&&(i=b.Easings[b.defaults.easing]?b.defaults.easing:y),i}function u(t){if(t){var e=(new Date).getTime(),i=b.State.calls.length;i>1e4&&(b.State.calls=s(b.State.calls));for(var a=0;i>a;a++)if(b.State.calls[a]){var r=b.State.calls[a],l=r[0],h=r[2],d=r[3],p=!!d,v=null;d||(d=b.State.calls[a][3]=e-16);for(var m=Math.min((e-d)/h.duration,1),y=0,x=l.length;x>y;y++){var S=l[y],P=S.element;if(o(P)){var k=!1;if(h.display!==n&&null!==h.display&&"none"!==h.display){if("flex"===h.display){var L=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];f.each(L,function(t,e){w.setPropertyValue(P,"display",e)})}w.setPropertyValue(P,"display",h.display)}h.visibility!==n&&"hidden"!==h.visibility&&w.setPropertyValue(P,"visibility",h.visibility);for(var A in S)if("element"!==A){var T,F=S[A],M=g.isString(F.easing)?b.Easings[F.easing]:F.easing;if(1===m)T=F.endValue;else{var E=F.endValue-F.startValue;if(T=F.startValue+E*M(m,h,E),!p&&T===F.currentValue)continue}if(F.currentValue=T,"tween"===A)v=T;else{if(w.Hooks.registered[A]){var V=w.Hooks.getRoot(A),R=o(P).rootPropertyValueCache[V];R&&(F.rootPropertyValue=R)}var O=w.setPropertyValue(P,A,F.currentValue+(0===parseFloat(T)?"":F.unitType),F.rootPropertyValue,F.scrollData);w.Hooks.registered[A]&&(o(P).rootPropertyValueCache[V]=w.Normalizations.registered[V]?w.Normalizations.registered[V]("extract",null,O[1]):O[1]),"transform"===O[0]&&(k=!0)}}h.mobileHA&&o(P).transformCache.translate3d===n&&(o(P).transformCache.translate3d="(0px, 0px, 0px)",k=!0),k&&w.flushTransformCache(P)}}h.display!==n&&"none"!==h.display&&(b.State.calls[a][2].display=!1),h.visibility!==n&&"hidden"!==h.visibility&&(b.State.calls[a][2].visibility=!1),h.progress&&h.progress.call(r[1],r[1],m,Math.max(0,d+h.duration-e),d,v),1===m&&c(a)}}b.State.isTicking&&C(u)}function c(t,e){if(!b.State.calls[t])return!1;for(var i=b.State.calls[t][0],s=b.State.calls[t][1],a=b.State.calls[t][2],r=b.State.calls[t][4],l=!1,h=0,u=i.length;u>h;h++){var c=i[h].element;if(e||a.loop||("none"===a.display&&w.setPropertyValue(c,"display",a.display),"hidden"===a.visibility&&w.setPropertyValue(c,"visibility",a.visibility)),a.loop!==!0&&(f.queue(c)[1]===n||!/\.velocityQueueEntryFlag/i.test(f.queue(c)[1]))&&o(c)){o(c).isAnimating=!1,o(c).rootPropertyValueCache={};var d=!1;f.each(w.Lists.transforms3D,function(t,e){var i=/^scale/.test(e)?1:0,s=o(c).transformCache[e];o(c).transformCache[e]!==n&&new RegExp("^\\("+i+"[^.]").test(s)&&(d=!0,delete o(c).transformCache[e])}),a.mobileHA&&(d=!0,delete o(c).transformCache.translate3d),d&&w.flushTransformCache(c),w.Values.removeClass(c,"velocity-animating")}if(!e&&a.complete&&!a.loop&&h===u-1)try{a.complete.call(s,s)}catch(p){setTimeout(function(){throw p},1)}r&&a.loop!==!0&&r(s),o(c)&&a.loop===!0&&!e&&(f.each(o(c).tweensContainer,function(t,e){/^rotate/.test(t)&&360===parseFloat(e.endValue)&&(e.endValue=0,e.startValue=360),/^backgroundPosition/.test(t)&&100===parseFloat(e.endValue)&&"%"===e.unitType&&(e.endValue=0,e.startValue=100)}),b(c,"reverse",{loop:!0,delay:a.delay})),a.queue!==!1&&f.dequeue(c,a.queue)}b.State.calls[t]=!1;for(var g=0,v=b.State.calls.length;v>g;g++)if(b.State.calls[g]!==!1){l=!0;break}l===!1&&(b.State.isTicking=!1,delete b.State.calls,b.State.calls=[])}var f,d=function(){if(i.documentMode)return i.documentMode;for(var t=7;t>4;t--){var e=i.createElement("div");if(e.innerHTML="<!--[if IE "+t+"]><span></span><![endif]-->",e.getElementsByTagName("span").length)return e=null,t}return n}(),p=function(){var t=0;return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||function(e){var i,n=(new Date).getTime();return i=Math.max(0,16-(n-t)),t=n+i,setTimeout(function(){e(n+i)},i)}}(),g={isString:function(t){return"string"==typeof t},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},isFunction:function(t){return"[object Function]"===Object.prototype.toString.call(t)},isNode:function(t){return t&&t.nodeType},isNodeList:function(t){return"object"==typeof t&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(t))&&t.length!==n&&(0===t.length||"object"==typeof t[0]&&t[0].nodeType>0)},isWrapped:function(t){return t&&(t.jquery||e.Zepto&&e.Zepto.zepto.isZ(t))},isSVG:function(t){return e.SVGElement&&t instanceof e.SVGElement},isEmptyObject:function(t){for(var e in t)return!1;return!0}},v=!1;if(t.fn&&t.fn.jquery?(f=t,v=!0):f=e.Velocity.Utilities,8>=d&&!v)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=d)return void(jQuery.fn.velocity=jQuery.fn.animate);var m=400,y="swing",b={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:e.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:i.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:f,Redirects:{},Easings:{},Promise:e.Promise,defaults:{queue:"",duration:m,easing:y,begin:n,complete:n,progress:n,display:n,visibility:n,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(t){f.data(t,"velocity",{isSVG:g.isSVG(t),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:2,patch:2},debug:!1};e.pageYOffset!==n?(b.State.scrollAnchor=e,b.State.scrollPropertyLeft="pageXOffset",b.State.scrollPropertyTop="pageYOffset"):(b.State.scrollAnchor=i.documentElement||i.body.parentNode||i.body,b.State.scrollPropertyLeft="scrollLeft",b.State.scrollPropertyTop="scrollTop");var x=function(){function t(t){return-t.tension*t.x-t.friction*t.v}function e(e,i,n){var s={x:e.x+n.dx*i,v:e.v+n.dv*i,tension:e.tension,friction:e.friction};return{dx:s.v,dv:t(s)}}function i(i,n){var s={dx:i.v,dv:t(i)},a=e(i,.5*n,s),o=e(i,.5*n,a),r=e(i,n,o),l=1/6*(s.dx+2*(a.dx+o.dx)+r.dx),h=1/6*(s.dv+2*(a.dv+o.dv)+r.dv);return i.x=i.x+l*n,i.v=i.v+h*n,i}return function n(t,e,s){var a,o,r,l={x:-1,v:0,tension:null,friction:null},h=[0],u=0,c=1e-4,f=.016;for(t=parseFloat(t)||500,e=parseFloat(e)||20,s=s||null,l.tension=t,l.friction=e,a=null!==s,a?(u=n(t,e),o=u/s*f):o=f;r=i(r||l,o),h.push(1+r.x),u+=16,Math.abs(r.x)>c&&Math.abs(r.v)>c;);return a?function(t){return h[t*(h.length-1)|0]}:u}}();b.Easings={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},spring:function(t){return 1-Math.cos(4.5*t*Math.PI)*Math.exp(6*-t)}},f.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(t,e){b.Easings[e[0]]=l.apply(null,e[1])});var w=b.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var t=0;t<w.Lists.colors.length;t++){var e="color"===w.Lists.colors[t]?"0 0 0 1":"255 255 255 1";w.Hooks.templates[w.Lists.colors[t]]=["Red Green Blue Alpha",e]}var i,n,s;if(d)for(i in w.Hooks.templates){n=w.Hooks.templates[i],s=n[0].split(" ");var a=n[1].match(w.RegEx.valueSplit);"Color"===s[0]&&(s.push(s.shift()),a.push(a.shift()),w.Hooks.templates[i]=[s.join(" "),a.join(" ")])}for(i in w.Hooks.templates){n=w.Hooks.templates[i],s=n[0].split(" ");for(var t in s){var o=i+s[t],r=t;w.Hooks.registered[o]=[i,r]}}},getRoot:function(t){var e=w.Hooks.registered[t];return e?e[0]:t},cleanRootPropertyValue:function(t,e){return w.RegEx.valueUnwrap.test(e)&&(e=e.match(w.RegEx.valueUnwrap)[1]),w.Values.isCSSNullValue(e)&&(e=w.Hooks.templates[t][1]),e},extractValue:function(t,e){var i=w.Hooks.registered[t];if(i){var n=i[0],s=i[1];return e=w.Hooks.cleanRootPropertyValue(n,e),e.toString().match(w.RegEx.valueSplit)[s]}return e},injectValue:function(t,e,i){var n=w.Hooks.registered[t];if(n){var s,a,o=n[0],r=n[1];return i=w.Hooks.cleanRootPropertyValue(o,i),s=i.toString().match(w.RegEx.valueSplit),s[r]=e,a=s.join(" ")}return i}},Normalizations:{registered:{clip:function(t,e,i){switch(t){case"name":return"clip";case"extract":var n;return w.RegEx.wrappedValueAlreadyExtracted.test(i)?n=i:(n=i.toString().match(w.RegEx.valueUnwrap),n=n?n[1].replace(/,(\s+)?/g," "):i),n;case"inject":return"rect("+i+")"}},blur:function(t,e,i){switch(t){case"name":return b.State.isFirefox?"filter":"-webkit-filter";case"extract":var n=parseFloat(i);if(!n&&0!==n){var s=i.toString().match(/blur\(([0-9]+[A-z]+)\)/i);n=s?s[1]:0}return n;case"inject":return parseFloat(i)?"blur("+i+")":"none"}},opacity:function(t,e,i){if(8>=d)switch(t){case"name":return"filter";case"extract":var n=i.toString().match(/alpha\(opacity=(.*)\)/i);return i=n?n[1]/100:1;case"inject":return e.style.zoom=1,parseFloat(i)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(i),10)+")"}else switch(t){case"name":return"opacity";case"extract":return i;case"inject":return i}}},register:function(){9>=d||b.State.isGingerbread||(w.Lists.transformsBase=w.Lists.transformsBase.concat(w.Lists.transforms3D));for(var t=0;t<w.Lists.transformsBase.length;t++)!function(){var e=w.Lists.transformsBase[t];w.Normalizations.registered[e]=function(t,i,s){switch(t){case"name":return"transform";case"extract":return o(i)===n||o(i).transformCache[e]===n?/^scale/i.test(e)?1:0:o(i).transformCache[e].replace(/[()]/g,"");case"inject":var a=!1;switch(e.substr(0,e.length-1)){case"translate":a=!/(%|px|em|rem|vw|vh|\d)$/i.test(s);break;case"scal":case"scale":b.State.isAndroid&&o(i).transformCache[e]===n&&1>s&&(s=1),a=!/(\d)$/i.test(s);break;case"skew":a=!/(deg|\d)$/i.test(s);break;case"rotate":a=!/(deg|\d)$/i.test(s)}return a||(o(i).transformCache[e]="("+s+")"),o(i).transformCache[e]}}}();for(var t=0;t<w.Lists.colors.length;t++)!function(){var e=w.Lists.colors[t];w.Normalizations.registered[e]=function(t,i,s){switch(t){case"name":return e;case"extract":var a;if(w.RegEx.wrappedValueAlreadyExtracted.test(s))a=s;else{var o,r={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(s)?o=r[s]!==n?r[s]:r.black:w.RegEx.isHex.test(s)?o="rgb("+w.Values.hexToRgb(s).join(" ")+")":/^rgba?\(/i.test(s)||(o=r.black),a=(o||s).toString().match(w.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return 8>=d||3!==a.split(" ").length||(a+=" 1"),a;case"inject":return 8>=d?4===s.split(" ").length&&(s=s.split(/\s+/).slice(0,3).join(" ")):3===s.split(" ").length&&(s+=" 1"),(8>=d?"rgb":"rgba")+"("+s.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})},SVGAttribute:function(t){var e="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(d||b.State.isAndroid&&!b.State.isChrome)&&(e+="|transform"),new RegExp("^("+e+")$","i").test(t)},prefixCheck:function(t){if(b.State.prefixMatches[t])return[b.State.prefixMatches[t],!0];for(var e=["","Webkit","Moz","ms","O"],i=0,n=e.length;n>i;i++){var s;if(s=0===i?t:e[i]+t.replace(/^\w/,function(t){return t.toUpperCase()}),g.isString(b.State.prefixElement.style[s]))return b.State.prefixMatches[t]=s,[s,!0]}return[t,!1]}},Values:{hexToRgb:function(t){var e,i=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return t=t.replace(i,function(t,e,i,n){return e+e+i+i+n+n}),e=n.exec(t),e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:[0,0,0]},isCSSNullValue:function(t){return 0==t||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(t)},getUnitType:function(t){return/^(rotate|skew)/i.test(t)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(t)?"":"px"},getDisplayType:function(t){var e=t&&t.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(e)?"inline":/^(li)$/i.test(e)?"list-item":/^(tr)$/i.test(e)?"table-row":/^(table)$/i.test(e)?"table":/^(tbody)$/i.test(e)?"table-row-group":"block"},addClass:function(t,e){t.classList?t.classList.add(e):t.className+=(t.className.length?" ":"")+e},removeClass:function(t,e){t.classList?t.classList.remove(e):t.className=t.className.toString().replace(new RegExp("(^|\\s)"+e.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(t,i,s,a){function r(t,i){function s(){h&&w.setPropertyValue(t,"display","none")}var l=0;if(8>=d)l=f.css(t,i);else{var h=!1;if(/^(width|height)$/.test(i)&&0===w.getPropertyValue(t,"display")&&(h=!0,w.setPropertyValue(t,"display",w.Values.getDisplayType(t))),!a){if("height"===i&&"border-box"!==w.getPropertyValue(t,"boxSizing").toString().toLowerCase()){var u=t.offsetHeight-(parseFloat(w.getPropertyValue(t,"borderTopWidth"))||0)-(parseFloat(w.getPropertyValue(t,"borderBottomWidth"))||0)-(parseFloat(w.getPropertyValue(t,"paddingTop"))||0)-(parseFloat(w.getPropertyValue(t,"paddingBottom"))||0);return s(),u}if("width"===i&&"border-box"!==w.getPropertyValue(t,"boxSizing").toString().toLowerCase()){var c=t.offsetWidth-(parseFloat(w.getPropertyValue(t,"borderLeftWidth"))||0)-(parseFloat(w.getPropertyValue(t,"borderRightWidth"))||0)-(parseFloat(w.getPropertyValue(t,"paddingLeft"))||0)-(parseFloat(w.getPropertyValue(t,"paddingRight"))||0);return s(),c}}var p;p=o(t)===n?e.getComputedStyle(t,null):o(t).computedStyle?o(t).computedStyle:o(t).computedStyle=e.getComputedStyle(t,null),"borderColor"===i&&(i="borderTopColor"),l=9===d&&"filter"===i?p.getPropertyValue(i):p[i],(""===l||null===l)&&(l=t.style[i]),s()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(i)){var g=r(t,"position");("fixed"===g||"absolute"===g&&/top|left/i.test(i))&&(l=f(t).position()[i]+"px")}return l}var l;if(w.Hooks.registered[i]){var h=i,u=w.Hooks.getRoot(h);s===n&&(s=w.getPropertyValue(t,w.Names.prefixCheck(u)[0])),w.Normalizations.registered[u]&&(s=w.Normalizations.registered[u]("extract",t,s)),l=w.Hooks.extractValue(h,s)}else if(w.Normalizations.registered[i]){var c,p;c=w.Normalizations.registered[i]("name",t),"transform"!==c&&(p=r(t,w.Names.prefixCheck(c)[0]),w.Values.isCSSNullValue(p)&&w.Hooks.templates[i]&&(p=w.Hooks.templates[i][1])),l=w.Normalizations.registered[i]("extract",t,p)}if(!/^[\d-]/.test(l))if(o(t)&&o(t).isSVG&&w.Names.SVGAttribute(i))if(/^(height|width)$/i.test(i))try{l=t.getBBox()[i]}catch(g){l=0}else l=t.getAttribute(i);else l=r(t,w.Names.prefixCheck(i)[0]);return w.Values.isCSSNullValue(l)&&(l=0),b.debug>=2&&console.log("Get "+i+": "+l),l},setPropertyValue:function(t,i,n,s,a){var r=i;if("scroll"===i)a.container?a.container["scroll"+a.direction]=n:"Left"===a.direction?e.scrollTo(n,a.alternateValue):e.scrollTo(a.alternateValue,n);else if(w.Normalizations.registered[i]&&"transform"===w.Normalizations.registered[i]("name",t))w.Normalizations.registered[i]("inject",t,n),r="transform",n=o(t).transformCache[i];else{if(w.Hooks.registered[i]){var l=i,h=w.Hooks.getRoot(i);s=s||w.getPropertyValue(t,h),n=w.Hooks.injectValue(l,n,s),i=h}if(w.Normalizations.registered[i]&&(n=w.Normalizations.registered[i]("inject",t,n),i=w.Normalizations.registered[i]("name",t)),r=w.Names.prefixCheck(i)[0],8>=d)try{t.style[r]=n}catch(u){b.debug&&console.log("Browser does not support ["+n+"] for ["+r+"]")}else o(t)&&o(t).isSVG&&w.Names.SVGAttribute(i)?t.setAttribute(i,n):t.style[r]=n;b.debug>=2&&console.log("Set "+i+" ("+r+"): "+n)}return[r,n]},flushTransformCache:function(t){function e(e){return parseFloat(w.getPropertyValue(t,e))}var i="";if((d||b.State.isAndroid&&!b.State.isChrome)&&o(t).isSVG){var n={translate:[e("translateX"),e("translateY")],skewX:[e("skewX")],skewY:[e("skewY")],scale:1!==e("scale")?[e("scale"),e("scale")]:[e("scaleX"),e("scaleY")],rotate:[e("rotateZ"),0,0]};f.each(o(t).transformCache,function(t){/^translate/i.test(t)?t="translate":/^scale/i.test(t)?t="scale":/^rotate/i.test(t)&&(t="rotate"),n[t]&&(i+=t+"("+n[t].join(" ")+") ",delete n[t])})}else{var s,a;f.each(o(t).transformCache,function(e){return s=o(t).transformCache[e],"transformPerspective"===e?(a=s,!0):(9===d&&"rotateZ"===e&&(e="rotate"),void(i+=e+s+" "))}),a&&(i="perspective"+a+" "+i)}w.setPropertyValue(t,"transform",i)}};w.Hooks.register(),w.Normalizations.register(),b.hook=function(t,e,i){var s=n;return t=a(t),f.each(t,function(t,a){if(o(a)===n&&b.init(a),i===n)s===n&&(s=b.CSS.getPropertyValue(a,e));else{var r=b.CSS.setPropertyValue(a,e,i);"transform"===r[0]&&b.CSS.flushTransformCache(a),s=r}}),s};var S=function(){function t(){return r?A.promise||null:l}function s(){function t(t){function c(t,e){var i=n,s=n,o=n;return g.isArray(t)?(i=t[0],!g.isArray(t[1])&&/^[\d-]/.test(t[1])||g.isFunction(t[1])||w.RegEx.isHex.test(t[1])?o=t[1]:(g.isString(t[1])&&!w.RegEx.isHex.test(t[1])||g.isArray(t[1]))&&(s=e?t[1]:h(t[1],r.duration),t[2]!==n&&(o=t[2]))):i=t,e||(s=s||r.easing),g.isFunction(i)&&(i=i.call(a,P,C)),g.isFunction(o)&&(o=o.call(a,P,C)),[i||0,s,o]}function d(t,e){var i,n;return n=(e||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(t){return i=t,""}),i||(i=w.Values.getUnitType(t)),[n,i]}function m(){var t={myParent:a.parentNode||i.body,position:w.getPropertyValue(a,"position"),fontSize:w.getPropertyValue(a,"fontSize")},n=t.position===O.lastPosition&&t.myParent===O.lastParent,s=t.fontSize===O.lastFontSize;O.lastParent=t.myParent,O.lastPosition=t.position,O.lastFontSize=t.fontSize;var r=100,l={};if(s&&n)l.emToPx=O.lastEmToPx,l.percentToPxWidth=O.lastPercentToPxWidth,l.percentToPxHeight=O.lastPercentToPxHeight;else{var h=o(a).isSVG?i.createElementNS("http://www.w3.org/2000/svg","rect"):i.createElement("div");b.init(h),t.myParent.appendChild(h),f.each(["overflow","overflowX","overflowY"],function(t,e){b.CSS.setPropertyValue(h,e,"hidden")}),b.CSS.setPropertyValue(h,"position",t.position),b.CSS.setPropertyValue(h,"fontSize",t.fontSize),b.CSS.setPropertyValue(h,"boxSizing","content-box"),f.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(t,e){b.CSS.setPropertyValue(h,e,r+"%")}),b.CSS.setPropertyValue(h,"paddingLeft",r+"em"),l.percentToPxWidth=O.lastPercentToPxWidth=(parseFloat(w.getPropertyValue(h,"width",null,!0))||1)/r,l.percentToPxHeight=O.lastPercentToPxHeight=(parseFloat(w.getPropertyValue(h,"height",null,!0))||1)/r,l.emToPx=O.lastEmToPx=(parseFloat(w.getPropertyValue(h,"paddingLeft"))||1)/r,t.myParent.removeChild(h)}return null===O.remToPx&&(O.remToPx=parseFloat(w.getPropertyValue(i.body,"fontSize"))||16),null===O.vwToPx&&(O.vwToPx=parseFloat(e.innerWidth)/100,O.vhToPx=parseFloat(e.innerHeight)/100),l.remToPx=O.remToPx,l.vwToPx=O.vwToPx,l.vhToPx=O.vhToPx,b.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),a),l}if(r.begin&&0===P)try{r.begin.call(p,p)}catch(x){setTimeout(function(){throw x},1)}if("scroll"===T){var S,k,L,F=/^x$/i.test(r.axis)?"Left":"Top",M=parseFloat(r.offset)||0;r.container?g.isWrapped(r.container)||g.isNode(r.container)?(r.container=r.container[0]||r.container,S=r.container["scroll"+F],L=S+f(a).position()[F.toLowerCase()]+M):r.container=null:(S=b.State.scrollAnchor[b.State["scrollProperty"+F]],k=b.State.scrollAnchor[b.State["scrollProperty"+("Left"===F?"Top":"Left")]],L=f(a).offset()[F.toLowerCase()]+M),l={scroll:{rootPropertyValue:!1,startValue:S,currentValue:S,endValue:L,unitType:"",easing:r.easing,scrollData:{container:r.container,direction:F,alternateValue:k}},element:a},b.debug&&console.log("tweensContainer (scroll): ",l.scroll,a)}else if("reverse"===T){if(!o(a).tweensContainer)return void f.dequeue(a,r.queue);"none"===o(a).opts.display&&(o(a).opts.display="auto"),"hidden"===o(a).opts.visibility&&(o(a).opts.visibility="visible"),o(a).opts.loop=!1,o(a).opts.begin=null,o(a).opts.complete=null,y.easing||delete r.easing,y.duration||delete r.duration,r=f.extend({},o(a).opts,r);var E=f.extend(!0,{},o(a).tweensContainer);for(var V in E)if("element"!==V){var R=E[V].startValue;E[V].startValue=E[V].currentValue=E[V].endValue,E[V].endValue=R,g.isEmptyObject(y)||(E[V].easing=r.easing),b.debug&&console.log("reverse tweensContainer ("+V+"): "+JSON.stringify(E[V]),a)}l=E}else if("start"===T){var E;o(a).tweensContainer&&o(a).isAnimating===!0&&(E=o(a).tweensContainer),f.each(v,function(t,e){if(RegExp("^"+w.Lists.colors.join("$|^")+"$").test(t)){var i=c(e,!0),s=i[0],a=i[1],o=i[2];if(w.RegEx.isHex.test(s)){for(var r=["Red","Green","Blue"],l=w.Values.hexToRgb(s),h=o?w.Values.hexToRgb(o):n,u=0;u<r.length;u++){var f=[l[u]];a&&f.push(a),h!==n&&f.push(h[u]),v[t+r[u]]=f}delete v[t]}}});for(var W in v){var I=c(v[W]),B=I[0],H=I[1],j=I[2];W=w.Names.camelCase(W);var N=w.Hooks.getRoot(W),D=!1;if(o(a).isSVG||"tween"===N||w.Names.prefixCheck(N)[1]!==!1||w.Normalizations.registered[N]!==n){(r.display!==n&&null!==r.display&&"none"!==r.display||r.visibility!==n&&"hidden"!==r.visibility)&&/opacity|filter/.test(W)&&!j&&0!==B&&(j=0),r._cacheValues&&E&&E[W]?(j===n&&(j=E[W].endValue+E[W].unitType),D=o(a).rootPropertyValueCache[N]):w.Hooks.registered[W]?j===n?(D=w.getPropertyValue(a,N),j=w.getPropertyValue(a,W,D)):D=w.Hooks.templates[N][1]:j===n&&(j=w.getPropertyValue(a,W));var q,X,Y,$=!1;if(q=d(W,j),j=q[0],Y=q[1],q=d(W,B),B=q[0].replace(/^([+-\/*])=/,function(t,e){return $=e,""}),X=q[1],j=parseFloat(j)||0,B=parseFloat(B)||0,
2
+ "%"===X&&(/^(fontSize|lineHeight)$/.test(W)?(B/=100,X="em"):/^scale/.test(W)?(B/=100,X=""):/(Red|Green|Blue)$/i.test(W)&&(B=B/100*255,X="")),/[\/*]/.test($))X=Y;else if(Y!==X&&0!==j)if(0===B)X=Y;else{s=s||m();var Q=/margin|padding|left|right|width|text|word|letter/i.test(W)||/X$/.test(W)||"x"===W?"x":"y";switch(Y){case"%":j*="x"===Q?s.percentToPxWidth:s.percentToPxHeight;break;case"px":break;default:j*=s[Y+"ToPx"]}switch(X){case"%":j*=1/("x"===Q?s.percentToPxWidth:s.percentToPxHeight);break;case"px":break;default:j*=1/s[X+"ToPx"]}}switch($){case"+":B=j+B;break;case"-":B=j-B;break;case"*":B=j*B;break;case"/":B=j/B}l[W]={rootPropertyValue:D,startValue:j,currentValue:j,endValue:B,unitType:X,easing:H},b.debug&&console.log("tweensContainer ("+W+"): "+JSON.stringify(l[W]),a)}else b.debug&&console.log("Skipping ["+N+"] due to a lack of browser support.")}l.element=a}l.element&&(w.Values.addClass(a,"velocity-animating"),z.push(l),""===r.queue&&(o(a).tweensContainer=l,o(a).opts=r),o(a).isAnimating=!0,P===C-1?(b.State.calls.push([z,p,r,null,A.resolver]),b.State.isTicking===!1&&(b.State.isTicking=!0,u())):P++)}var s,a=this,r=f.extend({},b.defaults,y),l={};switch(o(a)===n&&b.init(a),parseFloat(r.delay)&&r.queue!==!1&&f.queue(a,r.queue,function(t){b.velocityQueueEntryFlag=!0,o(a).delayTimer={setTimeout:setTimeout(t,parseFloat(r.delay)),next:t}}),r.duration.toString().toLowerCase()){case"fast":r.duration=200;break;case"normal":r.duration=m;break;case"slow":r.duration=600;break;default:r.duration=parseFloat(r.duration)||1}b.mock!==!1&&(b.mock===!0?r.duration=r.delay=1:(r.duration*=parseFloat(b.mock)||1,r.delay*=parseFloat(b.mock)||1)),r.easing=h(r.easing,r.duration),r.begin&&!g.isFunction(r.begin)&&(r.begin=null),r.progress&&!g.isFunction(r.progress)&&(r.progress=null),r.complete&&!g.isFunction(r.complete)&&(r.complete=null),r.display!==n&&null!==r.display&&(r.display=r.display.toString().toLowerCase(),"auto"===r.display&&(r.display=b.CSS.Values.getDisplayType(a))),r.visibility!==n&&null!==r.visibility&&(r.visibility=r.visibility.toString().toLowerCase()),r.mobileHA=r.mobileHA&&b.State.isMobile&&!b.State.isGingerbread,r.queue===!1?r.delay?setTimeout(t,r.delay):t():f.queue(a,r.queue,function(e,i){return i===!0?(A.promise&&A.resolver(p),!0):(b.velocityQueueEntryFlag=!0,void t(e))}),""!==r.queue&&"fx"!==r.queue||"inprogress"===f.queue(a)[0]||f.dequeue(a)}var r,l,d,p,v,y,x=arguments[0]&&(arguments[0].p||f.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||g.isString(arguments[0].properties));if(g.isWrapped(this)?(r=!1,d=0,p=this,l=this):(r=!0,d=1,p=x?arguments[0].elements||arguments[0].e:arguments[0]),p=a(p)){x?(v=arguments[0].properties||arguments[0].p,y=arguments[0].options||arguments[0].o):(v=arguments[d],y=arguments[d+1]);var C=p.length,P=0;if(!/^(stop|finish)$/i.test(v)&&!f.isPlainObject(y)){var k=d+1;y={};for(var L=k;L<arguments.length;L++)g.isArray(arguments[L])||!/^(fast|normal|slow)$/i.test(arguments[L])&&!/^\d/.test(arguments[L])?g.isString(arguments[L])||g.isArray(arguments[L])?y.easing=arguments[L]:g.isFunction(arguments[L])&&(y.complete=arguments[L]):y.duration=arguments[L]}var A={promise:null,resolver:null,rejecter:null};r&&b.Promise&&(A.promise=new b.Promise(function(t,e){A.resolver=t,A.rejecter=e}));var T;switch(v){case"scroll":T="scroll";break;case"reverse":T="reverse";break;case"finish":case"stop":f.each(p,function(t,e){o(e)&&o(e).delayTimer&&(clearTimeout(o(e).delayTimer.setTimeout),o(e).delayTimer.next&&o(e).delayTimer.next(),delete o(e).delayTimer)});var F=[];return f.each(b.State.calls,function(t,e){e&&f.each(e[1],function(i,s){var a=y===n?"":y;return a===!0||e[2].queue===a||y===n&&e[2].queue===!1?void f.each(p,function(i,n){n===s&&((y===!0||g.isString(y))&&(f.each(f.queue(n,g.isString(y)?y:""),function(t,e){g.isFunction(e)&&e(null,!0)}),f.queue(n,g.isString(y)?y:"",[])),"stop"===v?(o(n)&&o(n).tweensContainer&&a!==!1&&f.each(o(n).tweensContainer,function(t,e){e.endValue=e.currentValue}),F.push(t)):"finish"===v&&(e[2].duration=1))}):!0})}),"stop"===v&&(f.each(F,function(t,e){c(e,!0)}),A.promise&&A.resolver(p)),t();default:if(!f.isPlainObject(v)||g.isEmptyObject(v)){if(g.isString(v)&&b.Redirects[v]){var M=f.extend({},y),E=M.duration,V=M.delay||0;return M.backwards===!0&&(p=f.extend(!0,[],p).reverse()),f.each(p,function(t,e){parseFloat(M.stagger)?M.delay=V+parseFloat(M.stagger)*t:g.isFunction(M.stagger)&&(M.delay=V+M.stagger.call(e,t,C)),M.drag&&(M.duration=parseFloat(E)||(/^(callout|transition)/.test(v)?1e3:m),M.duration=Math.max(M.duration*(M.backwards?1-t/C:(t+1)/C),.75*M.duration,200)),b.Redirects[v].call(e,e,M||{},t,C,p,A.promise?A:n)}),t()}var R="Velocity: First argument ("+v+") was not a property map, a known action, or a registered redirect. Aborting.";return A.promise?A.rejecter(new Error(R)):console.log(R),t()}T="start"}var O={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},z=[];f.each(p,function(t,e){g.isNode(e)&&s.call(e)});var W,M=f.extend({},b.defaults,y);if(M.loop=parseInt(M.loop),W=2*M.loop-1,M.loop)for(var I=0;W>I;I++){var B={delay:M.delay,progress:M.progress};I===W-1&&(B.display=M.display,B.visibility=M.visibility,B.complete=M.complete),S(p,"reverse",B)}return t()}};b=f.extend(S,b),b.animate=S;var C=e.requestAnimationFrame||p;return b.State.isMobile||i.hidden===n||i.addEventListener("visibilitychange",function(){i.hidden?(C=function(t){return setTimeout(function(){t(!0)},16)},u()):C=e.requestAnimationFrame||p}),t.Velocity=b,t!==e&&(t.fn.velocity=S,t.fn.velocity.defaults=b.defaults),f.each(["Down","Up"],function(t,e){b.Redirects["slide"+e]=function(t,i,s,a,o,r){var l=f.extend({},i),h=l.begin,u=l.complete,c={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},d={};l.display===n&&(l.display="Down"===e?"inline"===b.CSS.Values.getDisplayType(t)?"inline-block":"block":"none"),l.begin=function(){h&&h.call(o,o);for(var i in c){d[i]=t.style[i];var n=b.CSS.getPropertyValue(t,i);c[i]="Down"===e?[n,0]:[0,n]}d.overflow=t.style.overflow,t.style.overflow="hidden"},l.complete=function(){for(var e in d)t.style[e]=d[e];u&&u.call(o,o),r&&r.resolver(o)},b(t,c,l)}}),f.each(["In","Out"],function(t,e){b.Redirects["fade"+e]=function(t,i,s,a,o,r){var l=f.extend({},i),h={opacity:"In"===e?1:0},u=l.complete;l.complete=s!==a-1?l.begin=null:function(){u&&u.call(o,o),r&&r.resolver(o)},l.display===n&&(l.display="In"===e?"auto":"none"),b(this,h,l)}}),b}(window.jQuery||window.Zepto||window,window,document)})),function(){"use strict";var t=this,e=t.Chart,i=function(t){this.canvas=t.canvas,this.ctx=t;var i=function(t,e){return t["offset"+e]?t["offset"+e]:document.defaultView.getComputedStyle(t).getPropertyValue(e)},s=this.width=i(t.canvas,"Width")||t.canvas.width,a=this.height=i(t.canvas,"Height")||t.canvas.height;return s=this.width=t.canvas.width,a=this.height=t.canvas.height,this.aspectRatio=this.width/this.height,n.retinaScale(this),this};i.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipTitleTemplate:"<%= label%>",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",segmentColorDefault:["#A6CEE3","#1F78B4","#B2DF8A","#33A02C","#FB9A99","#E31A1C","#FDBF6F","#FF7F00","#CAB2D6","#6A3D9A","#B4B482","#B15928"],segmentHighlightColorDefaults:["#CEF6FF","#47A0DC","#DAFFB2","#5BC854","#FFC2C1","#FF4244","#FFE797","#FFA728","#F2DAFE","#9265C2","#DCDCAA","#D98150"],onAnimationProgress:function(){},onAnimationComplete:function(){}}},i.types={};var n=i.helpers={},s=n.each=function(t,e,i){var n=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var s;for(s=0;s<t.length;s++)e.apply(i,[t[s],s].concat(n))}else for(var a in t)e.apply(i,[t[a],a].concat(n))},a=n.clone=function(t){var e={};return s(t,function(i,n){t.hasOwnProperty(n)&&(e[n]=i)}),e},o=n.extend=function(t){return s(Array.prototype.slice.call(arguments,1),function(e){s(e,function(i,n){e.hasOwnProperty(n)&&(t[n]=i)})}),t},r=n.merge=function(t,e){var i=Array.prototype.slice.call(arguments,0);return i.unshift({}),o.apply(null,i)},l=n.indexOf=function(t,e){if(Array.prototype.indexOf)return t.indexOf(e);for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},f=(n.where=function(t,e){var i=[];return n.each(t,function(t){e(t)&&i.push(t)}),i},n.findNextWhere=function(t,e,i){i||(i=-1);for(var n=i+1;n<t.length;n++){var s=t[n];if(e(s))return s}},n.findPreviousWhere=function(t,e,i){i||(i=t.length);for(var n=i-1;n>=0;n--){var s=t[n];if(e(s))return s}},n.inherits=function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},n=function(){this.constructor=i};return n.prototype=e.prototype,i.prototype=new n,i.extend=f,t&&o(i.prototype,t),i.__super__=e.prototype,i}),d=n.noop=function(){},p=n.uid=function(){var t=0;return function(){return"chart-"+t++}}(),g=n.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},v=n.amd="function"==typeof define&&define.amd,m=n.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},y=n.max=function(t){return Math.max.apply(Math,t)},b=n.min=function(t){return Math.min.apply(Math,t)},w=(n.cap=function(t,e,i){if(m(e)){if(t>e)return e}else if(m(i)&&i>t)return i;return t},n.getDecimalPlaces=function(t){if(t%1!==0&&m(t)){var e=t.toString();if(e.indexOf("e-")<0)return e.split(".")[1].length;if(e.indexOf(".")<0)return parseInt(e.split("e-")[1]);var i=e.split(".")[1].split("e-");return i[0].length+parseInt(i[1])}return 0}),S=n.radians=function(t){return t*(Math.PI/180)},P=(n.getAngleFromPoint=function(t,e){var i=e.x-t.x,n=e.y-t.y,s=Math.sqrt(i*i+n*n),a=2*Math.PI+Math.atan2(n,i);return 0>i&&0>n&&(a+=2*Math.PI),{angle:a,distance:s}},n.aliasPixel=function(t){return t%2===0?0:.5}),L=(n.splineCurve=function(t,e,i,n){var s=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),a=Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2)),o=n*s/(s+a),r=n*a/(s+a);return{inner:{x:e.x-o*(i.x-t.x),y:e.y-o*(i.y-t.y)},outer:{x:e.x+r*(i.x-t.x),y:e.y+r*(i.y-t.y)}}},n.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),T=(n.calculateScaleRange=function(t,e,i,n,a){var o=2,r=Math.floor(e/(1.5*i)),l=o>=r,h=[];s(t,function(t){null==t||h.push(t)});var u=b(h),c=y(h);c===u&&(c+=.5,u>=.5&&!n?u-=.5:c+=.5);for(var f=Math.abs(c-u),d=L(f),p=Math.ceil(c/(1*Math.pow(10,d)))*Math.pow(10,d),g=n?0:Math.floor(u/(1*Math.pow(10,d)))*Math.pow(10,d),v=p-g,m=Math.pow(10,d),x=Math.round(v/m);(x>r||r>2*x)&&!l;)if(x>r)m*=2,x=Math.round(v/m),x%1!==0&&(l=!0);else if(a&&d>=0){if(m/2%1!==0)break;m/=2,x=Math.round(v/m)}else m/=2,x=Math.round(v/m);return l&&(x=o,m=v/x),{steps:x,stepValue:m,min:g,max:g+x*m}},n.template=function(t,e){function n(t,e){var n=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):i[t]=i[t];return e?n(e):n}if(t instanceof Function)return t(e);var i={};return n(t,e)}),M=(n.generateLabels=function(t,e,i,n){var a=new Array(e);return t&&s(a,function(e,s){a[s]=T(t,{value:i+n*(s+1)})}),a},n.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1==(t/=1)?1:(i||(i=.3),n<Math.abs(1)?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),-(n*Math.pow(2,10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/i)))},easeOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1==(t/=1)?1:(i||(i=.3),n<Math.abs(1)?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),n*Math.pow(2,-10*t)*Math.sin((1*t-e)*(2*Math.PI)/i)+1)},easeInOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:2==(t/=.5)?1:(i||(i=1*(.3*1.5)),n<Math.abs(1)?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),1>t?-.5*(n*Math.pow(2,10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/i)):n*Math.pow(2,-10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/i)*.5+1)},easeInBack:function(t){var e=1.70158;return 1*(t/=1)*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return 1*((t=t/1-1)*t*((e+1)*t+e)+1)},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:function(t){return 1-M.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?1*(7.5625*t*t):2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*M.easeInBounce(2*t):.5*M.easeOutBounce(2*t-1)+.5}}),E=n.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),z=(n.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),n.animationLoop=function(t,e,i,n,s,a){var o=0,r=M[i]||M.linear,l=function(){o++;var i=o/e,h=r(i);t.call(a,h,i,o),n.call(a,h,i),e>o?a.animationFrame=E(l):s.apply(a)};E(l)},n.getRelativePosition=function(t){var e,i,n=t.originalEvent||t,s=t.currentTarget||t.srcElement,a=s.getBoundingClientRect();return n.touches?(e=n.touches[0].clientX-a.left,i=n.touches[0].clientY-a.top):(e=n.clientX-a.left,i=n.clientY-a.top),{x:e,y:i}},n.addEvent=function(t,e,i){t.addEventListener?t.addEventListener(e,i):t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}),W=n.removeEvent=function(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=d},B=(n.bindEvents=function(t,e,i){t.events||(t.events={}),s(e,function(e){t.events[e]=function(){i.apply(t,arguments)},z(t.chart.canvas,e,t.events[e])})},n.unbindEvents=function(t,e){s(e,function(e,i){W(t.chart.canvas,i,e)})}),H=n.getMaximumWidth=function(t){var e=t.parentNode,i=parseInt(N(e,"padding-left"))+parseInt(N(e,"padding-right"));return e.clientWidth-i},j=n.getMaximumHeight=function(t){var e=t.parentNode,i=parseInt(N(e,"padding-bottom"))+parseInt(N(e,"padding-top"));return e.clientHeight-i},N=n.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},q=(n.getMaximumSize=n.getMaximumWidth,n.retinaScale=function(t){var e=t.ctx,i=t.canvas.width,n=t.canvas.height;window.devicePixelRatio&&(e.canvas.style.width=i+"px",e.canvas.style.height=n+"px",e.canvas.height=n*window.devicePixelRatio,e.canvas.width=i*window.devicePixelRatio,e.scale(window.devicePixelRatio,window.devicePixelRatio))}),X=n.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},Y=n.fontString=function(t,e,i){return e+" "+t+"px "+i},$=n.longestText=function(t,e,i){t.font=e;var n=0;return s(i,function(e){var i=t.measureText(e).width;n=i>n?i:n}),n},Q=n.drawRoundedRectangle=function(t,e,i,n,s,a){t.beginPath(),t.moveTo(e+a,i),t.lineTo(e+n-a,i),t.quadraticCurveTo(e+n,i,e+n,i+a),t.lineTo(e+n,i+s-a),t.quadraticCurveTo(e+n,i+s,e+n-a,i+s),t.lineTo(e+a,i+s),t.quadraticCurveTo(e,i+s,e,i+s-a),t.lineTo(e,i+a),t.quadraticCurveTo(e,i,e+a,i),t.closePath()};i.instances={},i.Type=function(t,e,n){this.options=e,this.chart=n,this.id=p(),i.instances[this.id]=this,e.responsive&&this.resize(),this.initialize.call(this,t)},o(i.Type.prototype,{initialize:function(){return this},clear:function(){return X(this.chart),this},stop:function(){return i.animationService.cancelAnimation(this),this},resize:function(t){this.stop();var e=this.chart.canvas,i=H(this.chart.canvas),n=this.options.maintainAspectRatio?i/this.chart.aspectRatio:j(this.chart.canvas);return e.width=this.chart.width=i,e.height=this.chart.height=n,q(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:d,render:function(t){if(t&&this.reflow(),this.options.animation&&!t){var e=new i.Animation;e.numSteps=this.options.animationSteps,e.easing=this.options.animationEasing,e.render=function(t,e){var i=n.easingEffects[e.easing],s=e.currentStep/e.numSteps,a=i(s);t.draw(a,s,e.currentStep)},e.onAnimationProgress=this.options.onAnimationProgress,e.onAnimationComplete=this.options.onAnimationComplete,i.animationService.addAnimation(this,e)}else this.draw(),this.options.onAnimationComplete.call(this);return this},generateLegend:function(){return T(this.options.legendTemplate,this)},destroy:function(){this.clear(),B(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete i.instances[this.id]},showTooltip:function(t,e){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var a=function(t){var e=!1;return t.length!==this.activeElements.length?e=!0:(s(t,function(t,i){t!==this.activeElements[i]&&(e=!0)},this),e)}.call(this,t);if(a||e){if(this.activeElements=t,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),t.length>0)if(this.datasets&&this.datasets.length>1){for(var o,r,h=this.datasets.length-1;h>=0&&(o=this.datasets[h].points||this.datasets[h].bars||this.datasets[h].segments,r=l(o,t[0]),-1===r);h--);var u=[],c=[],f=function(t){var i,o,l,h,f,e=[],s=[],a=[];return n.each(this.datasets,function(t){i=t.points||t.bars||t.segments,i[r]&&i[r].hasValue()&&e.push(i[r])}),n.each(e,function(t){s.push(t.x),a.push(t.y),u.push(n.template(this.options.multiTooltipTemplate,t)),c.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),f=b(a),l=y(a),h=b(s),o=y(s),{x:h>this.chart.width/2?h:o,y:(f+l)/2}}.call(this,r);new i.MultiTooltip({x:f.x,y:f.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:u,legendColors:c,legendColorBackground:this.options.multiTooltipKeyBackground,title:T(this.options.tooltipTitleTemplate,t[0]),chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips}).draw()}else s(t,function(t){var e=t.tooltipPosition();new i.Tooltip({x:Math.round(e.x),y:Math.round(e.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:T(this.options.tooltipTemplate,t),chart:this.chart,custom:this.options.customTooltips}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),i.Type.extend=function(t){var e=this,n=function(){return e.apply(this,arguments)};if(n.prototype=a(e.prototype),o(n.prototype,t),n.extend=i.Type.extend,t.name||e.prototype.name){var s=t.name||e.prototype.name,l=i.defaults[e.prototype.name]?a(i.defaults[e.prototype.name]):{};i.defaults[s]=o(l,t.defaults),i.types[s]=n,i.prototype[s]=function(t,e){var a=r(i.defaults.global,i.defaults[s],e||{});return new n(t,a,this)}}else g("Name not provided for this chart, so it hasn't been registered");return e},i.Element=function(t){o(this,t),this.initialize.apply(this,arguments),this.save()},o(i.Element.prototype,{initialize:function(){},restore:function(t){return t?s(t,function(t){this[t]=this._saved[t]},this):o(this,this._saved),this},save:function(){return this._saved=a(this),delete this._saved._saved,this},update:function(t){return s(t,function(t,e){this._saved[e]=this[e],this[e]=t},this),this},transition:function(t,e){return s(t,function(t,i){this[i]=(t-this._saved[i])*e+this._saved[i]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return m(this.value)}}),i.Element.extend=f,i.Point=i.Element.extend({display:!0,inRange:function(t,e){var i=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(e-this.y,2)<Math.pow(i,2)},draw:function(){if(this.display){var t=this.ctx;t.beginPath(),t.arc(this.x,this.y,this.radius,0,2*Math.PI),t.closePath(),t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.fillStyle=this.fillColor,t.fill(),t.stroke()}}}),i.Arc=i.Element.extend({inRange:function(t,e){var i=n.getAngleFromPoint(this,{x:t,y:e}),s=i.angle%(2*Math.PI),a=(2*Math.PI+this.startAngle)%(2*Math.PI),o=(2*Math.PI+this.endAngle)%(2*Math.PI)||360,r=a>o?o>=s||s>=a:s>=a&&o>=s,l=i.distance>=this.innerRadius&&i.distance<=this.outerRadius;return r&&l},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,e=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*e,y:this.y+Math.sin(t)*e}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius<0?0:this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius<0?0:this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin="bevel",this.showStroke&&i.stroke()}}),i.Rectangle=i.Element.extend({draw:function(){var t=this.ctx,e=this.width/2,i=this.x-e,n=this.x+e,s=this.base-(this.base-this.y),a=this.strokeWidth/2;this.showStroke&&(i+=a,n-=a,s+=a),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(i,this.base),t.lineTo(i,s),t.lineTo(n,s),t.lineTo(n,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,e){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&e>=this.y&&e<=this.base}}),i.Animation=i.Element.extend({currentStep:null,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),i.Tooltip=i.Element.extend({draw:function(){var t=this.chart.ctx;t.font=Y(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var e=this.caretPadding=2,i=t.measureText(this.text).width+2*this.xPadding,n=this.fontSize+2*this.yPadding,s=n+this.caretHeight+e;this.x+i/2>this.chart.width?this.xAlign="left":this.x-i/2<0&&(this.xAlign="right"),this.y-s<0&&(this.yAlign="below");var a=this.x-i/2,o=this.y-s;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-e),t.lineTo(this.x+this.caretHeight,this.y-(e+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(e+this.caretHeight)),t.closePath(),t.fill();break;case"below":o=this.y+e+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+e),t.lineTo(this.x+this.caretHeight,this.y+e+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+e+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":a=this.x-i+(this.cornerRadius+this.caretHeight);break;case"right":a=this.x-(this.cornerRadius+this.caretHeight)}Q(t,a,o,i,n,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,a+i/2,o+n/2)}}}),i.MultiTooltip=i.Element.extend({initialize:function(){this.font=Y(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=Y(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.titleHeight=this.title?1.5*this.titleFontSize:0,this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+this.titleHeight,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,e=$(this.ctx,this.font,this.labels)+this.fontSize+3,i=y([e,t]);this.width=i+2*this.xPadding;var n=this.height/2;this.y-n<0?this.y=n:this.y+n>this.chart.height&&(this.y=this.chart.height-n),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var e=this.y-this.height/2+this.yPadding,i=t-1;return 0===t?e+this.titleHeight/3:e+(1.5*this.fontSize*i+this.fontSize/2)+this.titleHeight},draw:function(){if(this.custom)this.custom(this);else{Q(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,n.each(this.labels,function(e,i){t.fillStyle=this.textColor,t.fillText(e,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(i+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(i+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[i].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(i+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}}),i.Scale=i.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=w(this.stepValue),e=0;e<=this.steps;e++)this.yLabels.push(T(this.templateString,{value:(this.min+e*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?$(this.ctx,this.font,this.yLabels)+10:0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var i,t=this.endPoint,e=this.endPoint-this.startPoint;for(this.calculateYRange(e),this.buildYLabels(),this.calculateXLabelRotation();e>this.endPoint-this.startPoint;)e=this.endPoint-this.startPoint,i=this.yLabelWidth,this.calculateYRange(e),this.buildYLabels(),i<this.yLabelWidth&&(this.endPoint=t,this.calculateXLabelRotation())},calculateXLabelRotation:function(){this.ctx.font=this.font;var i,n,t=this.ctx.measureText(this.xLabels[0]).width,e=this.ctx.measureText(this.xLabels[this.xLabels.length-1]).width;if(this.xScalePaddingRight=e/2+3,this.xScalePaddingLeft=t/2>this.yLabelWidth?t/2:this.yLabelWidth,this.xLabelRotation=0,this.display){var a,s=$(this.ctx,this.font,this.xLabels);this.xLabelWidth=s;for(var r=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>r&&0===this.xLabelRotation||this.xLabelWidth>r&&this.xLabelRotation<=90&&this.xLabelRotation>0;)a=Math.cos(S(this.xLabelRotation)),i=a*t,n=a*e,i+this.fontSize/2>this.yLabelWidth&&(this.xScalePaddingLeft=i+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=a*s;this.xLabelRotation>0&&(this.endPoint-=Math.sin(S(this.xLabelRotation))*s+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:d,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var e=this.drawingArea()/(this.min-this.max);return this.endPoint-e*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),n=i/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1),s=n*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=n/2),Math.round(s)},update:function(t){n.extend(this,t),this.fit()},draw:function(){var t=this.ctx,e=(this.endPoint-this.startPoint)/this.steps,i=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,s(this.yLabels,function(s,a){var o=this.endPoint-e*a,r=Math.round(o),l=this.showHorizontalLines;t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(s,i-10,o),0!==a||l||(l=!0),l&&t.beginPath(),a>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),r+=n.aliasPixel(t.lineWidth),l&&(t.moveTo(i,r),t.lineTo(this.width,r),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(i-5,r),t.lineTo(i,r),t.stroke(),t.closePath()},this),s(this.xLabels,function(e,i){var n=this.calculateX(i)+P(this.lineWidth),s=this.calculateX(i-(this.offsetGridLines?.5:0))+P(this.lineWidth),a=this.xLabelRotation>0,o=this.showVerticalLines;0!==i||o||(o=!0),o&&t.beginPath(),i>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),o&&(t.moveTo(s,this.endPoint),t.lineTo(s,this.startPoint-3),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(s,this.endPoint),t.lineTo(s,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(n,a?this.endPoint+12:this.endPoint+8),t.rotate(-1*S(this.xLabelRotation)),t.font=this.font,t.textAlign=a?"right":"center",t.textBaseline=a?"middle":"top",t.fillText(e,0,0),t.restore()},this))}}),i.RadialScale=i.Element.extend({initialize:function(){this.size=b([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var e=this.drawingArea/(this.max-this.min);return(t-this.min)*e},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),
3
+ this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=w(this.stepValue),e=0;e<=this.steps;e++)this.yLabels.push(T(this.templateString,{value:(this.min+e*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var e,i,n,s,o,r,h,u,c,f,d,p,t=b([this.height/2-this.pointLabelFontSize-5,this.width/2]),a=this.width,l=0;for(this.ctx.font=Y(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;i<this.valuesCount;i++)e=this.getPointPosition(i,t),n=this.ctx.measureText(T(this.templateString,{value:this.labels[i]})).width+5,0===i||i===this.valuesCount/2?(s=n/2,e.x+s>a&&(a=e.x+s,o=i),e.x-s<l&&(l=e.x-s,h=i)):i<this.valuesCount/2?e.x+n>a&&(a=e.x+n,o=i):i>this.valuesCount/2&&e.x-n<l&&(l=e.x-n,h=i);c=l,f=Math.ceil(a-this.width),r=this.getIndexAngle(o),u=this.getIndexAngle(h),d=f/Math.sin(r+Math.PI/2),p=c/Math.sin(u+Math.PI/2),d=m(d)?d:0,p=m(p)?p:0,this.drawingArea=t-(p+d)/2,this.setCenterPoint(p,d)},setCenterPoint:function(t,e){var i=this.width-e-this.drawingArea,n=t+this.drawingArea;this.xCenter=(n+i)/2,this.yCenter=this.height/2},getIndexAngle:function(t){var e=2*Math.PI/this.valuesCount;return t*e-Math.PI/2},getPointPosition:function(t,e){var i=this.getIndexAngle(t);return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter}},draw:function(){if(this.display){var t=this.ctx;if(s(this.yLabels,function(e,i){if(i>0){var a,n=i*(this.drawingArea/this.steps),s=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var o=0;o<this.valuesCount;o++)a=this.getPointPosition(o,this.calculateCenterOffset(this.min+i*this.stepValue)),0===o?t.moveTo(a.x,a.y):t.lineTo(a.x,a.y);t.closePath(),t.stroke()}if(this.showLabels){if(t.font=Y(this.fontSize,this.fontStyle,this.fontFamily),this.showLabelBackdrop){var r=t.measureText(e).width;t.fillStyle=this.backdropColor,t.fillRect(this.xCenter-r/2-this.backdropPaddingX,s-this.fontSize/2-this.backdropPaddingY,r+2*this.backdropPaddingX,this.fontSize+2*this.backdropPaddingY)}t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.fontColor,t.fillText(e,this.xCenter,s)}}},this),!this.lineArc){t.lineWidth=this.angleLineWidth,t.strokeStyle=this.angleLineColor;for(var e=this.valuesCount-1;e>=0;e--){var i=null,n=null;if(this.angleLineWidth>0&&(i=this.calculateCenterOffset(this.max),n=this.getPointPosition(e,i),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(n.x,n.y),t.stroke(),t.closePath()),this.backgroundColors&&this.backgroundColors.length==this.valuesCount){null==i&&(i=this.calculateCenterOffset(this.max)),null==n&&(n=this.getPointPosition(e,i));var a=this.getPointPosition(0===e?this.valuesCount-1:e-1,i),o=this.getPointPosition(e===this.valuesCount-1?0:e+1,i),r={x:(a.x+n.x)/2,y:(a.y+n.y)/2},l={x:(n.x+o.x)/2,y:(n.y+o.y)/2};t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(r.x,r.y),t.lineTo(n.x,n.y),t.lineTo(l.x,l.y),t.fillStyle=this.backgroundColors[e],t.fill(),t.closePath()}var h=this.getPointPosition(e,this.calculateCenterOffset(this.max)+5);t.font=Y(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var u=this.labels.length,c=this.labels.length/2,f=c/2,d=f>e||e>u-f,p=e===f||e===u-f;0===e?t.textAlign="center":e===c?t.textAlign="center":c>e?t.textAlign="left":t.textAlign="right",p?t.textBaseline="middle":d?t.textBaseline="bottom":t.textBaseline="top",t.fillText(this.labels[e],h.x,h.y)}}}}}),i.animationService={frameDuration:17,animations:[],dropFrames:0,addAnimation:function(t,e){for(var i=0;i<this.animations.length;++i)if(this.animations[i].chartInstance===t)return void(this.animations[i].animationObject=e);this.animations.push({chartInstance:t,animationObject:e}),1==this.animations.length&&n.requestAnimFrame.call(window,this.digestWrapper)},cancelAnimation:function(t){var e=n.findNextWhere(this.animations,function(e){return e.chartInstance===t});e&&this.animations.splice(e,1)},digestWrapper:function(){i.animationService.startDigest.call(i.animationService)},startDigest:function(){var t=Date.now(),e=0;this.dropFrames>1&&(e=Math.floor(this.dropFrames),this.dropFrames-=e);for(var i=0;i<this.animations.length;i++)null===this.animations[i].animationObject.currentStep&&(this.animations[i].animationObject.currentStep=0),this.animations[i].animationObject.currentStep+=1+e,this.animations[i].animationObject.currentStep>this.animations[i].animationObject.numSteps&&(this.animations[i].animationObject.currentStep=this.animations[i].animationObject.numSteps),this.animations[i].animationObject.render(this.animations[i].chartInstance,this.animations[i].animationObject),this.animations[i].animationObject.currentStep==this.animations[i].animationObject.numSteps&&(this.animations[i].animationObject.onAnimationComplete.call(this.animations[i].chartInstance),this.animations.splice(i,1),i--);var s=Date.now(),a=s-t-this.frameDuration,o=a/this.frameDuration;o>1&&(this.dropFrames+=o),this.animations.length>0&&n.requestAnimFrame.call(window,this.digestWrapper)}},n.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){s(i.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),v?define(function(){return i}):"object"==typeof module&&module.exports&&(module.exports=i),t.Chart=i,i.noConflict=function(){return t.Chart=e,i}}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,n={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"><%if(datasets[i].label){%><%=datasets[i].label%><%}%></span></li><%}%></ul>'};e.Type.extend({name:"Bar",defaults:n,initialize:function(t){var n=this.options;this.ScaleClass=e.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,e,i){var s=this.calculateBaseWidth(),a=this.calculateX(i)-s/2,o=this.calculateBarWidth(t);return a+o*e+e*n.barDatasetSpacing+o/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*n.barValueSpacing},calculateBarWidth:function(t){var e=this.calculateBaseWidth()-(t-1)*n.barDatasetSpacing;return e/t}}),this.datasets=[],this.options.showTooltips&&i.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),i.each(e,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(e)}),this.BarClass=e.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),i.each(t.datasets,function(e,n){var s={label:e.label||null,fillColor:e.fillColor,strokeColor:e.strokeColor,bars:[]};this.datasets.push(s),i.each(e.data,function(i,n){s.bars.push(new this.BarClass({value:i,label:t.labels[n],datasetLabel:e.label,strokeColor:e.strokeColor,fillColor:e.fillColor,highlightFill:e.highlightFill||e.fillColor,highlightStroke:e.highlightStroke||e.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,e,n){i.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,n,e),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),i.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){i.each(this.datasets,function(e,n){i.each(e.bars,t,this,n)},this)},getBarsAtEvent:function(t){for(var a,e=[],n=i.getRelativePosition(t),s=function(t){e.push(t.bars[a])},o=0;o<this.datasets.length;o++)for(a=0;a<this.datasets[o].bars.length;a++)if(this.datasets[o].bars[a].inRange(n.x,n.y))return i.each(this.datasets,s),e;return e},buildScale:function(t){var e=this,n=function(){var t=[];return e.eachBars(function(e){t.push(e.value)}),t},s={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var e=i.calculateScaleRange(n(),t,this.fontSize,this.beginAtZero,this.integersOnly);i.extend(this,e)},xLabels:t,font:i.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.barShowStroke?this.options.barStrokeWidth:0,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&i.extend(s,{calculateYRange:i.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new this.ScaleClass(s)},addData:function(t,e){i.each(t,function(t,i){this.datasets[i].bars.push(new this.BarClass({value:t,label:e,datasetLabel:this.datasets[i].label,x:this.scale.calculateBarX(this.datasets.length,i,this.scale.valuesCount+1),y:this.scale.endPoint,width:this.scale.calculateBarWidth(this.datasets.length),base:this.scale.endPoint,strokeColor:this.datasets[i].strokeColor,fillColor:this.datasets[i].fillColor}))},this),this.scale.addXLabel(e),this.update()},removeData:function(){this.scale.removeXLabel(),i.each(this.datasets,function(t){t.bars.shift()},this),this.update()},reflow:function(){i.extend(this.BarClass.prototype,{y:this.scale.endPoint,base:this.scale.endPoint});var t=i.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var e=t||1;this.clear();this.chart.ctx;this.scale.draw(e),i.each(this.datasets,function(t,n){i.each(t.bars,function(t,i){t.hasValue()&&(t.base=this.scale.endPoint,t.transition({x:this.scale.calculateBarX(this.datasets.length,n,i),y:this.scale.calculateY(t.value),width:this.scale.calculateBarWidth(this.datasets.length)},e).draw())},this)},this)}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,n={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"><%if(segments[i].label){%><%=segments[i].label%><%}%></span></li><%}%></ul>'};e.Type.extend({name:"Doughnut",defaults:n,initialize:function(t){this.segments=[],this.outerRadius=(i.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=e.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&i.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];i.each(this.segments,function(t){t.restore(["fillColor"])}),i.each(e,function(t){t.fillColor=t.highlightColor}),this.showTooltip(e)}),this.calculateTotal(t),i.each(t,function(e,i){e.color||(e.color="hsl("+360*i/t.length+", 100%, 50%)"),this.addData(e,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var e=[],n=i.getRelativePosition(t);return i.each(this.segments,function(t){t.inRange(n.x,n.y)&&e.push(t)},this),e},addData:function(t,i,n){var s=void 0!==i?i:this.segments.length;"undefined"==typeof t.color&&(t.color=e.defaults.global.segmentColorDefault[s%e.defaults.global.segmentColorDefault.length],t.highlight=e.defaults.global.segmentHighlightColorDefaults[s%e.defaults.global.segmentHighlightColorDefaults.length]),this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),n||(this.reflow(),this.update())},calculateCircumference:function(t){return this.total>0?2*Math.PI*(t/this.total):0},calculateTotal:function(t){this.total=0,i.each(t,function(t){this.total+=Math.abs(t.value)},this)},update:function(){this.calculateTotal(this.segments),i.each(this.activeElements,function(t){t.restore(["fillColor"])}),i.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var e=i.isNumber(t)?t:this.segments.length-1;this.segments.splice(e,1),this.reflow(),this.update()},reflow:function(){i.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(i.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,i.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var e=t?t:1;this.clear(),i.each(this.segments,function(t,i){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},e),t.endAngle=t.startAngle+t.circumference,t.draw(),0===i&&(t.startAngle=1.5*Math.PI),i<this.segments.length-1&&(this.segments[i+1].startAngle=t.endAngle)},this)}}),e.types.Doughnut.extend({name:"Pie",defaults:i.merge(n,{percentageInnerCutout:0})})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,n={scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,bezierCurve:!0,bezierCurveTension:.4,pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"><%if(datasets[i].label){%><%=datasets[i].label%><%}%></span></li><%}%></ul>',offsetGridLines:!1};e.Type.extend({name:"Line",defaults:n,initialize:function(t){this.PointClass=e.Point.extend({offsetGridLines:this.options.offsetGridLines,strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)<Math.pow(this.radius+this.hitDetectionRadius,2)}}),this.datasets=[],this.options.showTooltips&&i.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),i.each(e,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(e)}),i.each(t.datasets,function(e){var n={label:e.label||null,fillColor:e.fillColor,strokeColor:e.strokeColor,pointColor:e.pointColor,pointStrokeColor:e.pointStrokeColor,points:[]};this.datasets.push(n),i.each(e.data,function(i,s){n.points.push(new this.PointClass({value:i,label:t.labels[s],datasetLabel:e.label,strokeColor:e.pointStrokeColor,fillColor:e.pointColor,highlightFill:e.pointHighlightFill||e.pointColor,highlightStroke:e.pointHighlightStroke||e.pointStrokeColor}))},this),this.buildScale(t.labels),this.eachPoints(function(t,e){i.extend(t,{x:this.scale.calculateX(e),y:this.scale.endPoint}),t.save()},this)},this),this.render()},update:function(){this.scale.update(),i.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachPoints(function(t){t.save()}),this.render()},eachPoints:function(t){i.each(this.datasets,function(e){i.each(e.points,t,this)},this)},getPointsAtEvent:function(t){var e=[],n=i.getRelativePosition(t);return i.each(this.datasets,function(t){i.each(t.points,function(t){t.inRange(n.x,n.y)&&e.push(t)})},this),e},buildScale:function(t){var n=this,s=function(){var t=[];return n.eachPoints(function(e){t.push(e.value)}),t},a={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,offsetGridLines:this.options.offsetGridLines,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var e=i.calculateScaleRange(s(),t,this.fontSize,this.beginAtZero,this.integersOnly);i.extend(this,e)},xLabels:t,font:i.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.pointDotRadius+this.options.pointDotStrokeWidth,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&i.extend(a,{calculateYRange:i.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new e.Scale(a)},addData:function(t,e){i.each(t,function(t,i){this.datasets[i].points.push(new this.PointClass({value:t,label:e,datasetLabel:this.datasets[i].label,x:this.scale.calculateX(this.scale.valuesCount+1),y:this.scale.endPoint,strokeColor:this.datasets[i].pointStrokeColor,fillColor:this.datasets[i].pointColor}))},this),this.scale.addXLabel(e),this.update()},removeData:function(){this.scale.removeXLabel(),i.each(this.datasets,function(t){t.points.shift()},this),this.update()},reflow:function(){var t=i.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var e=t||1;this.clear();var n=this.chart.ctx,s=function(t){return null!==t.value},a=function(t,e,n){return i.findNextWhere(e,s,n)||t},o=function(t,e,n){return i.findPreviousWhere(e,s,n)||t};this.scale&&(this.scale.draw(e),i.each(this.datasets,function(t){var r=i.where(t.points,s);i.each(t.points,function(t,i){t.hasValue()&&t.transition({y:this.scale.calculateY(t.value),x:this.scale.calculateX(i)},e)},this),this.options.bezierCurve&&i.each(r,function(t,e){var n=e>0&&e<r.length-1?this.options.bezierCurveTension:0;t.controlPoints=i.splineCurve(o(t,r,e),t,a(t,r,e),n),t.controlPoints.outer.y>this.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.y<this.scale.startPoint&&(t.controlPoints.outer.y=this.scale.startPoint),t.controlPoints.inner.y>this.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y<this.scale.startPoint&&(t.controlPoints.inner.y=this.scale.startPoint)},this),n.lineWidth=this.options.datasetStrokeWidth,n.strokeStyle=t.strokeColor,n.beginPath(),i.each(r,function(t,e){if(0===e)n.moveTo(t.x,t.y);else if(this.options.bezierCurve){var i=o(t,r,e);n.bezierCurveTo(i.controlPoints.outer.x,i.controlPoints.outer.y,t.controlPoints.inner.x,t.controlPoints.inner.y,t.x,t.y)}else n.lineTo(t.x,t.y)},this),this.options.datasetStroke&&n.stroke(),this.options.datasetFill&&r.length>0&&(n.lineTo(r[r.length-1].x,this.scale.endPoint),n.lineTo(r[0].x,this.scale.endPoint),n.fillStyle=t.fillColor,n.closePath(),n.fill()),i.each(r,function(t){t.draw()})},this))}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,n={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"><%if(segments[i].label){%><%=segments[i].label%><%}%></span></li><%}%></ul>'};e.Type.extend({name:"PolarArea",defaults:n,initialize:function(t){this.segments=[],this.SegmentArc=e.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new e.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),i.each(t,function(t,e){this.addData(t,e,!0)},this),this.options.showTooltips&&i.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];i.each(this.segments,function(t){t.restore(["fillColor"])}),i.each(e,function(t){t.fillColor=t.highlightColor}),this.showTooltip(e)}),this.render()},getSegmentsAtEvent:function(t){var e=[],n=i.getRelativePosition(t);return i.each(this.segments,function(t){t.inRange(n.x,n.y)&&e.push(t)},this),e},addData:function(t,e,i){var n=e||this.segments.length;this.segments.splice(n,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),i||(this.reflow(),this.update())},removeData:function(t){var e=i.isNumber(t)?t:this.segments.length-1;this.segments.splice(e,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,i.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var e=[];i.each(t,function(t){e.push(t.value)});var n=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:i.calculateScaleRange(e,i.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);i.extend(this.scale,n,{size:i.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),i.each(this.segments,function(t){t.save()}),this.reflow(),this.render()},reflow:function(){i.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),i.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),i.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var e=t||1;this.clear(),i.each(this.segments,function(t,i){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},e),t.endAngle=t.startAngle+t.circumference,0===i&&(t.startAngle=1.5*Math.PI),i<this.segments.length-1&&(this.segments[i+1].startAngle=t.endAngle),t.draw()},this),this.scale.draw()}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.Type.extend({name:"Radar",defaults:{scaleShowLine:!0,angleShowLineOut:!0,scaleShowLabels:!1,scaleBeginAtZero:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:10,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"><%if(datasets[i].label){%><%=datasets[i].label%><%}%></span></li><%}%></ul>'},initialize:function(t){this.PointClass=e.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&i.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),i.each(e,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(e)}),i.each(t.datasets,function(e){var n={label:e.label||null,fillColor:e.fillColor,strokeColor:e.strokeColor,pointColor:e.pointColor,pointStrokeColor:e.pointStrokeColor,points:[]};this.datasets.push(n),i.each(e.data,function(i,s){var a;this.scale.animation||(a=this.scale.getPointPosition(s,this.scale.calculateCenterOffset(i))),n.points.push(new this.PointClass({value:i,label:t.labels[s],datasetLabel:e.label,x:this.options.animation?this.scale.xCenter:a.x,y:this.options.animation?this.scale.yCenter:a.y,strokeColor:e.pointStrokeColor,fillColor:e.pointColor,highlightFill:e.pointHighlightFill||e.pointColor,highlightStroke:e.pointHighlightStroke||e.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){i.each(this.datasets,function(e){i.each(e.points,t,this)},this)},getPointsAtEvent:function(t){var e=i.getRelativePosition(t),n=i.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},e),s=2*Math.PI/this.scale.valuesCount,a=Math.round((n.angle-1.5*Math.PI)/s),o=[];return(a>=this.scale.valuesCount||0>a)&&(a=0),n.distance<=this.scale.drawingArea&&i.each(this.datasets,function(t){o.push(t.points[a])}),o},buildScale:function(t){this.scale=new e.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backgroundColors:this.options.scaleBackgroundColors,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var e=function(){var e=[];return i.each(t,function(t){t.data?e=e.concat(t.data):i.each(t.points,function(t){e.push(t.value)})}),e}(),n=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:i.calculateScaleRange(e,i.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);i.extend(this.scale,n)},addData:function(t,e){this.scale.valuesCount++,i.each(t,function(t,i){var n=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[i].points.push(new this.PointClass({value:t,label:e,datasetLabel:this.datasets[i].label,x:n.x,y:n.y,strokeColor:this.datasets[i].pointStrokeColor,fillColor:this.datasets[i].pointColor}))},this),this.scale.labels.push(e),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),i.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){i.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:i.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var e=t||1,n=this.chart.ctx;this.clear(),this.scale.draw(),i.each(this.datasets,function(t){i.each(t.points,function(t,i){t.hasValue()&&t.transition(this.scale.getPointPosition(i,this.scale.calculateCenterOffset(t.value)),e)},this),n.lineWidth=this.options.datasetStrokeWidth,n.strokeStyle=t.strokeColor,n.beginPath(),i.each(t.points,function(t,e){0===e?n.moveTo(t.x,t.y):n.lineTo(t.x,t.y)},this),n.closePath(),n.stroke(),n.fillStyle=t.fillColor,this.options.datasetFill&&n.fill(),i.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this),function(){var t,e,i,n,s,a=function(t,e){return function(){return t.apply(e,arguments)}},o=[].indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(e in this&&this[e]===t)return e;return-1};e=function(){function t(){}return t.prototype.extend=function(t,e){var i,n;for(i in e)n=e[i],null==t[i]&&(t[i]=n);return t},t.prototype.isMobile=function(t){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)},t.prototype.createEvent=function(t,e,i,n){var s;return null==e&&(e=!1),null==i&&(i=!1),null==n&&(n=null),null!=document.createEvent?(s=document.createEvent("CustomEvent"),s.initCustomEvent(t,e,i,n)):null!=document.createEventObject?(s=document.createEventObject(),s.eventType=t):s.eventName=t,s},t.prototype.emitEvent=function(t,e){return null!=t.dispatchEvent?t.dispatchEvent(e):e in(null!=t)?t[e]():"on"+e in(null!=t)?t["on"+e]():void 0},t.prototype.addEvent=function(t,e,i){return null!=t.addEventListener?t.addEventListener(e,i,!1):null!=t.attachEvent?t.attachEvent("on"+e,i):t[e]=i},t.prototype.removeEvent=function(t,e,i){return null!=t.removeEventListener?t.removeEventListener(e,i,!1):null!=t.detachEvent?t.detachEvent("on"+e,i):delete t[e]},t.prototype.innerHeight=function(){return"innerHeight"in window?window.innerHeight:document.documentElement.clientHeight},t}(),i=this.WeakMap||this.MozWeakMap||(i=function(){function t(){
4
+ this.keys=[],this.values=[]}return t.prototype.get=function(t){var e,i,n,s,a;for(a=this.keys,e=n=0,s=a.length;s>n;e=++n)if(i=a[e],i===t)return this.values[e]},t.prototype.set=function(t,e){var i,n,s,a,o;for(o=this.keys,i=s=0,a=o.length;a>s;i=++s)if(n=o[i],n===t)return void(this.values[i]=e);return this.keys.push(t),this.values.push(e)},t}()),t=this.MutationObserver||this.WebkitMutationObserver||this.MozMutationObserver||(t=function(){function t(){"undefined"!=typeof console&&null!==console&&console.warn("MutationObserver is not supported by your browser."),"undefined"!=typeof console&&null!==console&&console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.")}return t.notSupported=!0,t.prototype.observe=function(){},t}()),n=this.getComputedStyle||function(t,e){return this.getPropertyValue=function(e){var i;return"float"===e&&(e="styleFloat"),s.test(e)&&e.replace(s,function(t,e){return e.toUpperCase()}),(null!=(i=t.currentStyle)?i[e]:void 0)||null},this},s=/(\-([a-z]){1})/g,this.WOW=function(){function s(t){null==t&&(t={}),this.scrollCallback=a(this.scrollCallback,this),this.scrollHandler=a(this.scrollHandler,this),this.resetAnimation=a(this.resetAnimation,this),this.start=a(this.start,this),this.scrolled=!0,this.config=this.util().extend(t,this.defaults),null!=t.scrollContainer&&(this.config.scrollContainer=document.querySelector(t.scrollContainer)),this.animationNameCache=new i,this.wowEvent=this.util().createEvent(this.config.boxClass)}return s.prototype.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:!0,live:!0,callback:null,scrollContainer:null},s.prototype.init=function(){var t;return this.element=window.document.documentElement,"interactive"===(t=document.readyState)||"complete"===t?this.start():this.util().addEvent(document,"DOMContentLoaded",this.start),this.finished=[]},s.prototype.start=function(){var e,i,n,s;if(this.stopped=!1,this.boxes=function(){var t,i,n,s;for(n=this.element.querySelectorAll("."+this.config.boxClass),s=[],t=0,i=n.length;i>t;t++)e=n[t],s.push(e);return s}.call(this),this.all=function(){var t,i,n,s;for(n=this.boxes,s=[],t=0,i=n.length;i>t;t++)e=n[t],s.push(e);return s}.call(this),this.boxes.length)if(this.disabled())this.resetStyle();else for(s=this.boxes,i=0,n=s.length;n>i;i++)e=s[i],this.applyStyle(e,!0);return this.disabled()||(this.util().addEvent(this.config.scrollContainer||window,"scroll",this.scrollHandler),this.util().addEvent(window,"resize",this.scrollHandler),this.interval=setInterval(this.scrollCallback,50)),this.config.live?new t(function(t){return function(e){var i,n,s,a,o;for(o=[],i=0,n=e.length;n>i;i++)a=e[i],o.push(function(){var t,e,i,n;for(i=a.addedNodes||[],n=[],t=0,e=i.length;e>t;t++)s=i[t],n.push(this.doSync(s));return n}.call(t));return o}}(this)).observe(document.body,{childList:!0,subtree:!0}):void 0},s.prototype.stop=function(){return this.stopped=!0,this.util().removeEvent(this.config.scrollContainer||window,"scroll",this.scrollHandler),this.util().removeEvent(window,"resize",this.scrollHandler),null!=this.interval?clearInterval(this.interval):void 0},s.prototype.sync=function(e){return t.notSupported?this.doSync(this.element):void 0},s.prototype.doSync=function(t){var e,i,n,s,a;if(null==t&&(t=this.element),1===t.nodeType){for(t=t.parentNode||t,s=t.querySelectorAll("."+this.config.boxClass),a=[],i=0,n=s.length;n>i;i++)e=s[i],o.call(this.all,e)<0?(this.boxes.push(e),this.all.push(e),this.stopped||this.disabled()?this.resetStyle():this.applyStyle(e,!0),a.push(this.scrolled=!0)):a.push(void 0);return a}},s.prototype.show=function(t){return this.applyStyle(t),t.className=t.className+" "+this.config.animateClass,null!=this.config.callback&&this.config.callback(t),this.util().emitEvent(t,this.wowEvent),this.util().addEvent(t,"animationend",this.resetAnimation),this.util().addEvent(t,"oanimationend",this.resetAnimation),this.util().addEvent(t,"webkitAnimationEnd",this.resetAnimation),this.util().addEvent(t,"MSAnimationEnd",this.resetAnimation),t},s.prototype.applyStyle=function(t,e){var i,n,s;return n=t.getAttribute("data-wow-duration"),i=t.getAttribute("data-wow-delay"),s=t.getAttribute("data-wow-iteration"),this.animate(function(a){return function(){return a.customStyle(t,e,n,i,s)}}(this))},s.prototype.animate=function(){return"requestAnimationFrame"in window?function(t){return window.requestAnimationFrame(t)}:function(t){return t()}}(),s.prototype.resetStyle=function(){var t,e,i,n,s;for(n=this.boxes,s=[],e=0,i=n.length;i>e;e++)t=n[e],s.push(t.style.visibility="visible");return s},s.prototype.resetAnimation=function(t){var e;return t.type.toLowerCase().indexOf("animationend")>=0?(e=t.target||t.srcElement,e.className=e.className.replace(this.config.animateClass,"").trim()):void 0},s.prototype.customStyle=function(t,e,i,n,s){return e&&this.cacheAnimationName(t),t.style.visibility=e?"hidden":"visible",i&&this.vendorSet(t.style,{animationDuration:i}),n&&this.vendorSet(t.style,{animationDelay:n}),s&&this.vendorSet(t.style,{animationIterationCount:s}),this.vendorSet(t.style,{animationName:e?"none":this.cachedAnimationName(t)}),t},s.prototype.vendors=["moz","webkit"],s.prototype.vendorSet=function(t,e){var i,n,s,a;n=[];for(i in e)s=e[i],t[""+i]=s,n.push(function(){var e,n,o,r;for(o=this.vendors,r=[],e=0,n=o.length;n>e;e++)a=o[e],r.push(t[""+a+i.charAt(0).toUpperCase()+i.substr(1)]=s);return r}.call(this));return n},s.prototype.vendorCSS=function(t,e){var i,s,a,o,r,l;for(r=n(t),o=r.getPropertyCSSValue(e),a=this.vendors,i=0,s=a.length;s>i;i++)l=a[i],o=o||r.getPropertyCSSValue("-"+l+"-"+e);return o},s.prototype.animationName=function(t){var e;try{e=this.vendorCSS(t,"animation-name").cssText}catch(i){e=n(t).getPropertyValue("animation-name")}return"none"===e?"":e},s.prototype.cacheAnimationName=function(t){return this.animationNameCache.set(t,this.animationName(t))},s.prototype.cachedAnimationName=function(t){return this.animationNameCache.get(t)},s.prototype.scrollHandler=function(){return this.scrolled=!0},s.prototype.scrollCallback=function(){var t;return!this.scrolled||(this.scrolled=!1,this.boxes=function(){var e,i,n,s;for(n=this.boxes,s=[],e=0,i=n.length;i>e;e++)t=n[e],t&&(this.isVisible(t)?this.show(t):s.push(t));return s}.call(this),this.boxes.length||this.config.live)?void 0:this.stop()},s.prototype.offsetTop=function(t){for(var e;void 0===t.offsetTop;)t=t.parentNode;for(e=t.offsetTop;t=t.offsetParent;)e+=t.offsetTop;return e},s.prototype.isVisible=function(t){var e,i,n,s,a;return i=t.getAttribute("data-wow-offset")||this.config.offset,a=this.config.scrollContainer&&this.config.scrollContainer.scrollTop||window.pageYOffset,s=a+Math.min(this.element.clientHeight,this.util().innerHeight())-i,n=this.offsetTop(t),e=n+t.clientHeight,s>=n&&e>=a},s.prototype.util=function(){return null!=this._util?this._util:this._util=new e},s.prototype.disabled=function(){return!this.config.mobile&&this.util().isMobile(navigator.userAgent)},s}()}.call(this),$(window).scroll(function(){$(".navbar").offset()&&($(".navbar").offset().top>50?$(".scrolling-navbar").addClass("top-nav-collapse"):$(".scrolling-navbar").removeClass("top-nav-collapse"))}),$(function(){$("a.page-scroll").bind("click",function(t){var e=$(this);$("html, body").stop().animate({scrollTop:$(e.attr("href")).offset().top},1500,"easeInOutExpo"),t.preventDefault()})}),function(t,e){"use strict";"function"==typeof define&&define.amd?define([],function(){return e.apply(t)}):"object"==typeof exports?module.exports=e.call(t):t.Waves=e.call(t)}("object"==typeof global?global:this,function(){"use strict";function s(t){return null!==t&&t===t.window}function a(t){return s(t)?t:9===t.nodeType&&t.defaultView}function o(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function r(t){return o(t)&&t.nodeType>0}function l(t){var n=i.call(t);return"[object String]"===n?e(t):o(t)&&/^\[object (Array|HTMLCollection|NodeList|Object)\]$/.test(n)&&t.hasOwnProperty("length")?t:r(t)?[t]:[]}function h(t){var e,i,n={top:0,left:0},s=t&&t.ownerDocument;return e=s.documentElement,"undefined"!=typeof t.getBoundingClientRect&&(n=t.getBoundingClientRect()),i=a(s),{top:n.top+i.pageYOffset-e.clientTop,left:n.left+i.pageXOffset-e.clientLeft}}function u(t){var e="";for(var i in t)t.hasOwnProperty(i)&&(e+=i+":"+t[i]+";");return e}function d(t,e,i){if(i){i.classList.remove("waves-rippling");var n=i.getAttribute("data-x"),s=i.getAttribute("data-y"),a=i.getAttribute("data-scale"),o=i.getAttribute("data-translate"),r=Date.now()-Number(i.getAttribute("data-hold")),l=350-r;0>l&&(l=0),"mousemove"===t.type&&(l=150);var h="mousemove"===t.type?2500:c.duration;setTimeout(function(){var t={top:s+"px",left:n+"px",opacity:"0","-webkit-transition-duration":h+"ms","-moz-transition-duration":h+"ms","-o-transition-duration":h+"ms","transition-duration":h+"ms","-webkit-transform":a+" "+o,"-moz-transform":a+" "+o,"-ms-transform":a+" "+o,"-o-transform":a+" "+o,transform:a+" "+o};i.setAttribute("style",u(t)),setTimeout(function(){try{e.removeChild(i)}catch(t){return!1}},h)},l)}}function g(t){if(p.allowEvent(t)===!1)return null;for(var e=null,i=t.target||t.srcElement;null!==i.parentElement;){if(i.classList.contains("waves-effect")&&!(i instanceof SVGElement)){e=i;break}i=i.parentElement}return e}function v(t){var e=g(t);if(null!==e){if(e.disabled||e.getAttribute("disabled")||e.classList.contains("disabled"))return;if(p.registerEvent(t),"touchstart"===t.type&&c.delay){var i=!1,s=setTimeout(function(){s=null,c.show(t,e)},c.delay),a=function(n){s&&(clearTimeout(s),s=null,c.show(t,e)),i||(i=!0,c.hide(n,e))},o=function(t){s&&(clearTimeout(s),s=null),a(t)};e.addEventListener("touchmove",o,!1),e.addEventListener("touchend",a,!1),e.addEventListener("touchcancel",a,!1)}else c.show(t,e),n&&(e.addEventListener("touchend",c.hide,!1),e.addEventListener("touchcancel",c.hide,!1)),e.addEventListener("mouseup",c.hide,!1),e.addEventListener("mouseleave",c.hide,!1)}}var t=t||{},e=document.querySelectorAll.bind(document),i=Object.prototype.toString,n="ontouchstart"in window,c={duration:750,delay:200,show:function(t,e,i){if(2===t.button)return!1;e=e||this;var n=document.createElement("div");n.className="waves-ripple waves-rippling",e.appendChild(n);var s=h(e),a=0,o=0;"touches"in t&&t.touches.length?(a=t.touches[0].pageY-s.top,o=t.touches[0].pageX-s.left):(a=t.pageY-s.top,o=t.pageX-s.left),o=o>=0?o:0,a=a>=0?a:0;var r="scale("+e.clientWidth/100*3+")",l="translate(0,0)";i&&(l="translate("+i.x+"px, "+i.y+"px)"),n.setAttribute("data-hold",Date.now()),n.setAttribute("data-x",o),n.setAttribute("data-y",a),n.setAttribute("data-scale",r),n.setAttribute("data-translate",l);var f={top:a+"px",left:o+"px"};n.classList.add("waves-notransition"),n.setAttribute("style",u(f)),n.classList.remove("waves-notransition"),f["-webkit-transform"]=r+" "+l,f["-moz-transform"]=r+" "+l,f["-ms-transform"]=r+" "+l,f["-o-transform"]=r+" "+l,f.transform=r+" "+l,f.opacity="1";var d="mousemove"===t.type?2500:c.duration;f["-webkit-transition-duration"]=d+"ms",f["-moz-transition-duration"]=d+"ms",f["-o-transition-duration"]=d+"ms",f["transition-duration"]=d+"ms",n.setAttribute("style",u(f))},hide:function(t,e){e=e||this;for(var i=e.getElementsByClassName("waves-rippling"),n=0,s=i.length;s>n;n++)d(t,e,i[n])}},f={input:function(t){var e=t.parentNode;if("i"!==e.tagName.toLowerCase()||!e.classList.contains("waves-effect")){var i=document.createElement("i");i.className=t.className+" waves-input-wrapper",t.className="waves-button-input",e.replaceChild(i,t),i.appendChild(t);var n=window.getComputedStyle(t,null),s=n.color,a=n.backgroundColor;i.setAttribute("style","color:"+s+";background:"+a),t.setAttribute("style","background-color:rgba(0,0,0,0);")}},img:function(t){var e=t.parentNode;if("i"!==e.tagName.toLowerCase()||!e.classList.contains("waves-effect")){var i=document.createElement("i");e.replaceChild(i,t),i.appendChild(t)}}},p={touches:0,allowEvent:function(t){var e=!0;return/^(mousedown|mousemove)$/.test(t.type)&&p.touches&&(e=!1),e},registerEvent:function(t){var e=t.type;"touchstart"===e?p.touches+=1:/^(touchend|touchcancel)$/.test(e)&&setTimeout(function(){p.touches&&(p.touches-=1)},500)}};return t.init=function(t){var e=document.body;t=t||{},"duration"in t&&(c.duration=t.duration),"delay"in t&&(c.delay=t.delay),n&&(e.addEventListener("touchstart",v,!1),e.addEventListener("touchcancel",p.registerEvent,!1),e.addEventListener("touchend",p.registerEvent,!1)),e.addEventListener("mousedown",v,!1)},t.attach=function(t,e){t=l(t),"[object Array]"===i.call(e)&&(e=e.join(" ")),e=e?" "+e:"";for(var n,s,a=0,o=t.length;o>a;a++)n=t[a],s=n.tagName.toLowerCase(),-1!==["input","img"].indexOf(s)&&(f[s](n),n=n.parentElement),-1===n.className.indexOf("waves-effect")&&(n.className+=" waves-effect"+e)},t.ripple=function(t,e){t=l(t);var i=t.length;if(e=e||{},e.wait=e.wait||0,e.position=e.position||null,i)for(var n,s,a,o={},r=0,u={type:"mousedown",button:1},f=function(t,e){return function(){c.hide(t,e)}};i>r;r++)if(n=t[r],s=e.position||{x:n.clientWidth/2,y:n.clientHeight/2},a=h(n),o.x=a.left+s.x,o.y=a.top+s.y,u.pageX=o.x,u.pageY=o.y,c.show(u,n),e.wait>=0&&null!==e.wait){var d={type:"mouseup",button:1};setTimeout(f(d,n),e.wait)}},t.calm=function(t){t=l(t);for(var e={type:"mouseup",button:1},i=0,n=t.length;n>i;i++)c.hide(e,t[i])},t.displayEffect=function(e){console.error("Waves.displayEffect() has been deprecated and will be removed in future version. Please use Waves.init() to initialize Waves effect"),t.init(e)},t}),Waves.attach(".btn, .btn-floating",["waves-light"]),Waves.attach(".view .mask",["waves-light"]),Waves.attach(".waves-light",["waves-light"]),Waves.attach(".navbar-nav a, .nav-icons li a, .navbar form, .nav-tabs .nav-item",["waves-light"]),Waves.attach(".navbar-brand",["waves-light"]),Waves.attach(".pager li a",["waves-light"]),Waves.attach(".pagination .page-item .page-link",["waves-effect"]),Waves.init(),function(t){t(document).ready(function(){function s(e){var n=e.css("font-family"),s=e.css("font-size");s&&i.css("font-size",s),n&&i.css("font-family",n),"off"===e.attr("wrap")&&i.css("overflow-wrap","normal").css("white-space","pre"),i.text(e.val()+"\n");var a=i.html().replace(/\n/g,"<br>");i.html(a),e.is(":visible")?i.css("width",e.width()):i.css("width",t(window).width()/2),e.css("height",i.height())}Materialize.updateTextFields=function(){var e="input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea";t(e).each(function(e,i){t(i).val().length>0||void 0!==t(this).attr("placeholder")||t(i)[0].validity.badInput===!0?t(this).siblings("label, i").addClass("active"):t(this).siblings("label, i").removeClass("active")})};var e="input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea";t("input[autofocus]").siblings("label, i").addClass("active"),t(document).on("change",e,function(){(0!==t(this).val().length||void 0!==t(this).attr("placeholder"))&&t(this).siblings("label, i").addClass("active"),validate_field(t(this))}),t(document).ready(function(){Materialize.updateTextFields()}),t(document).on("reset",function(i){var n=t(i.target);n.is("form")&&(n.find(e).removeClass("valid").removeClass("invalid"),n.find(e).each(function(){""===t(this).attr("value")&&t(this).siblings("label, i").removeClass("active")}),n.find("select.initialized").each(function(){var t=n.find("option[selected]").text();n.siblings("input.select-dropdown").val(t)}))}),t(document).on("focus",e,function(){t(this).siblings("label, i").addClass("active")}),t(document).on("blur",e,function(){var e=t(this);0===e.val().length&&e[0].validity.badInput!==!0&&void 0===e.attr("placeholder")&&e.siblings("label, i").removeClass("active"),validate_field(e)}),validate_field=function(t){var e=void 0!==t.attr("length"),i=parseInt(t.attr("length")),n=t.val().length;0===t.val().length&&t[0].validity.badInput===!1?t.hasClass("validate")&&(t.removeClass("valid"),t.removeClass("invalid")):t.hasClass("validate")&&(t.is(":valid")&&e&&i>n||t.is(":valid")&&!e?(t.removeClass("invalid"),t.addClass("valid")):(t.removeClass("valid"),t.addClass("invalid")))};var i=t(".hiddendiv").first();i.length||(i=t('<div class="hiddendiv common"></div>'),t("body").append(i));var n=".materialize-textarea";t(n).each(function(){var e=t(this);e.val().length&&s(e)}),t("body").on("keyup keydown",n,function(){s(t(this))})})}(jQuery);
@@ -0,0 +1,1726 @@
1
+ /*! tether 1.2.0 */
2
+
3
+ (function(root, factory) {
4
+ if (typeof define === 'function' && define.amd) {
5
+ define(factory);
6
+ } else if (typeof exports === 'object') {
7
+ module.exports = factory(require, exports, module);
8
+ } else {
9
+ root.Tether = factory();
10
+ }
11
+ }(this, function(require, exports, module) {
12
+
13
+ 'use strict';
14
+
15
+ var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
16
+
17
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
18
+
19
+ var TetherBase = undefined;
20
+ if (typeof TetherBase === 'undefined') {
21
+ TetherBase = { modules: [] };
22
+ }
23
+
24
+ function getScrollParent(el) {
25
+ // In firefox if the el is inside an iframe with display: none; window.getComputedStyle() will return null;
26
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=548397
27
+ var computedStyle = getComputedStyle(el) || {};
28
+ var position = computedStyle.position;
29
+
30
+ if (position === 'fixed') {
31
+ return el;
32
+ }
33
+
34
+ var parent = el;
35
+ while (parent = parent.parentNode) {
36
+ var style = undefined;
37
+ try {
38
+ style = getComputedStyle(parent);
39
+ } catch (err) {}
40
+
41
+ if (typeof style === 'undefined' || style === null) {
42
+ return parent;
43
+ }
44
+
45
+ var _style = style;
46
+ var overflow = _style.overflow;
47
+ var overflowX = _style.overflowX;
48
+ var overflowY = _style.overflowY;
49
+
50
+ if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) {
51
+ if (position !== 'absolute' || ['relative', 'absolute', 'fixed'].indexOf(style.position) >= 0) {
52
+ return parent;
53
+ }
54
+ }
55
+ }
56
+
57
+ return document.body;
58
+ }
59
+
60
+ var uniqueId = (function () {
61
+ var id = 0;
62
+ return function () {
63
+ return ++id;
64
+ };
65
+ })();
66
+
67
+ var zeroPosCache = {};
68
+ var getOrigin = function getOrigin(doc) {
69
+ // getBoundingClientRect is unfortunately too accurate. It introduces a pixel or two of
70
+ // jitter as the user scrolls that messes with our ability to detect if two positions
71
+ // are equivilant or not. We place an element at the top left of the page that will
72
+ // get the same jitter, so we can cancel the two out.
73
+ var node = doc._tetherZeroElement;
74
+ if (typeof node === 'undefined') {
75
+ node = doc.createElement('div');
76
+ node.setAttribute('data-tether-id', uniqueId());
77
+ extend(node.style, {
78
+ top: 0,
79
+ left: 0,
80
+ position: 'absolute'
81
+ });
82
+
83
+ doc.body.appendChild(node);
84
+
85
+ doc._tetherZeroElement = node;
86
+ }
87
+
88
+ var id = node.getAttribute('data-tether-id');
89
+ if (typeof zeroPosCache[id] === 'undefined') {
90
+ zeroPosCache[id] = {};
91
+
92
+ var rect = node.getBoundingClientRect();
93
+ for (var k in rect) {
94
+ // Can't use extend, as on IE9, elements don't resolve to be hasOwnProperty
95
+ zeroPosCache[id][k] = rect[k];
96
+ }
97
+
98
+ // Clear the cache when this position call is done
99
+ defer(function () {
100
+ delete zeroPosCache[id];
101
+ });
102
+ }
103
+
104
+ return zeroPosCache[id];
105
+ };
106
+
107
+ function getBounds(el) {
108
+ var doc = undefined;
109
+ if (el === document) {
110
+ doc = document;
111
+ el = document.documentElement;
112
+ } else {
113
+ doc = el.ownerDocument;
114
+ }
115
+
116
+ var docEl = doc.documentElement;
117
+
118
+ var box = {};
119
+ // The original object returned by getBoundingClientRect is immutable, so we clone it
120
+ // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9
121
+ var rect = el.getBoundingClientRect();
122
+ for (var k in rect) {
123
+ box[k] = rect[k];
124
+ }
125
+
126
+ var origin = getOrigin(doc);
127
+
128
+ box.top -= origin.top;
129
+ box.left -= origin.left;
130
+
131
+ if (typeof box.width === 'undefined') {
132
+ box.width = document.body.scrollWidth - box.left - box.right;
133
+ }
134
+ if (typeof box.height === 'undefined') {
135
+ box.height = document.body.scrollHeight - box.top - box.bottom;
136
+ }
137
+
138
+ box.top = box.top - docEl.clientTop;
139
+ box.left = box.left - docEl.clientLeft;
140
+ box.right = doc.body.clientWidth - box.width - box.left;
141
+ box.bottom = doc.body.clientHeight - box.height - box.top;
142
+
143
+ return box;
144
+ }
145
+
146
+ function getOffsetParent(el) {
147
+ return el.offsetParent || document.documentElement;
148
+ }
149
+
150
+ function getScrollBarSize() {
151
+ var inner = document.createElement('div');
152
+ inner.style.width = '100%';
153
+ inner.style.height = '200px';
154
+
155
+ var outer = document.createElement('div');
156
+ extend(outer.style, {
157
+ position: 'absolute',
158
+ top: 0,
159
+ left: 0,
160
+ pointerEvents: 'none',
161
+ visibility: 'hidden',
162
+ width: '200px',
163
+ height: '150px',
164
+ overflow: 'hidden'
165
+ });
166
+
167
+ outer.appendChild(inner);
168
+
169
+ document.body.appendChild(outer);
170
+
171
+ var widthContained = inner.offsetWidth;
172
+ outer.style.overflow = 'scroll';
173
+ var widthScroll = inner.offsetWidth;
174
+
175
+ if (widthContained === widthScroll) {
176
+ widthScroll = outer.clientWidth;
177
+ }
178
+
179
+ document.body.removeChild(outer);
180
+
181
+ var width = widthContained - widthScroll;
182
+
183
+ return { width: width, height: width };
184
+ }
185
+
186
+ function extend() {
187
+ var out = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
188
+
189
+ var args = [];
190
+
191
+ Array.prototype.push.apply(args, arguments);
192
+
193
+ args.slice(1).forEach(function (obj) {
194
+ if (obj) {
195
+ for (var key in obj) {
196
+ if (({}).hasOwnProperty.call(obj, key)) {
197
+ out[key] = obj[key];
198
+ }
199
+ }
200
+ }
201
+ });
202
+
203
+ return out;
204
+ }
205
+
206
+ function removeClass(el, name) {
207
+ if (typeof el.classList !== 'undefined') {
208
+ name.split(' ').forEach(function (cls) {
209
+ if (cls.trim()) {
210
+ el.classList.remove(cls);
211
+ }
212
+ });
213
+ } else {
214
+ var regex = new RegExp('(^| )' + name.split(' ').join('|') + '( |$)', 'gi');
215
+ var className = getClassName(el).replace(regex, ' ');
216
+ setClassName(el, className);
217
+ }
218
+ }
219
+
220
+ function addClass(el, name) {
221
+ if (typeof el.classList !== 'undefined') {
222
+ name.split(' ').forEach(function (cls) {
223
+ if (cls.trim()) {
224
+ el.classList.add(cls);
225
+ }
226
+ });
227
+ } else {
228
+ removeClass(el, name);
229
+ var cls = getClassName(el) + (' ' + name);
230
+ setClassName(el, cls);
231
+ }
232
+ }
233
+
234
+ function hasClass(el, name) {
235
+ if (typeof el.classList !== 'undefined') {
236
+ return el.classList.contains(name);
237
+ }
238
+ var className = getClassName(el);
239
+ return new RegExp('(^| )' + name + '( |$)', 'gi').test(className);
240
+ }
241
+
242
+ function getClassName(el) {
243
+ if (el.className instanceof SVGAnimatedString) {
244
+ return el.className.baseVal;
245
+ }
246
+ return el.className;
247
+ }
248
+
249
+ function setClassName(el, className) {
250
+ el.setAttribute('class', className);
251
+ }
252
+
253
+ function updateClasses(el, add, all) {
254
+ // Of the set of 'all' classes, we need the 'add' classes, and only the
255
+ // 'add' classes to be set.
256
+ all.forEach(function (cls) {
257
+ if (add.indexOf(cls) === -1 && hasClass(el, cls)) {
258
+ removeClass(el, cls);
259
+ }
260
+ });
261
+
262
+ add.forEach(function (cls) {
263
+ if (!hasClass(el, cls)) {
264
+ addClass(el, cls);
265
+ }
266
+ });
267
+ }
268
+
269
+ var deferred = [];
270
+
271
+ var defer = function defer(fn) {
272
+ deferred.push(fn);
273
+ };
274
+
275
+ var flush = function flush() {
276
+ var fn = undefined;
277
+ while (fn = deferred.pop()) {
278
+ fn();
279
+ }
280
+ };
281
+
282
+ var Evented = (function () {
283
+ function Evented() {
284
+ _classCallCheck(this, Evented);
285
+ }
286
+
287
+ _createClass(Evented, [{
288
+ key: 'on',
289
+ value: function on(event, handler, ctx) {
290
+ var once = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
291
+
292
+ if (typeof this.bindings === 'undefined') {
293
+ this.bindings = {};
294
+ }
295
+ if (typeof this.bindings[event] === 'undefined') {
296
+ this.bindings[event] = [];
297
+ }
298
+ this.bindings[event].push({ handler: handler, ctx: ctx, once: once });
299
+ }
300
+ }, {
301
+ key: 'once',
302
+ value: function once(event, handler, ctx) {
303
+ this.on(event, handler, ctx, true);
304
+ }
305
+ }, {
306
+ key: 'off',
307
+ value: function off(event, handler) {
308
+ if (typeof this.bindings !== 'undefined' && typeof this.bindings[event] !== 'undefined') {
309
+ return;
310
+ }
311
+
312
+ if (typeof handler === 'undefined') {
313
+ delete this.bindings[event];
314
+ } else {
315
+ var i = 0;
316
+ while (i < this.bindings[event].length) {
317
+ if (this.bindings[event][i].handler === handler) {
318
+ this.bindings[event].splice(i, 1);
319
+ } else {
320
+ ++i;
321
+ }
322
+ }
323
+ }
324
+ }
325
+ }, {
326
+ key: 'trigger',
327
+ value: function trigger(event) {
328
+ if (typeof this.bindings !== 'undefined' && this.bindings[event]) {
329
+ var i = 0;
330
+
331
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
332
+ args[_key - 1] = arguments[_key];
333
+ }
334
+
335
+ while (i < this.bindings[event].length) {
336
+ var _bindings$event$i = this.bindings[event][i];
337
+ var handler = _bindings$event$i.handler;
338
+ var ctx = _bindings$event$i.ctx;
339
+ var once = _bindings$event$i.once;
340
+
341
+ var context = ctx;
342
+ if (typeof context === 'undefined') {
343
+ context = this;
344
+ }
345
+
346
+ handler.apply(context, args);
347
+
348
+ if (once) {
349
+ this.bindings[event].splice(i, 1);
350
+ } else {
351
+ ++i;
352
+ }
353
+ }
354
+ }
355
+ }
356
+ }]);
357
+
358
+ return Evented;
359
+ })();
360
+
361
+ TetherBase.Utils = {
362
+ getScrollParent: getScrollParent,
363
+ getBounds: getBounds,
364
+ getOffsetParent: getOffsetParent,
365
+ extend: extend,
366
+ addClass: addClass,
367
+ removeClass: removeClass,
368
+ hasClass: hasClass,
369
+ updateClasses: updateClasses,
370
+ defer: defer,
371
+ flush: flush,
372
+ uniqueId: uniqueId,
373
+ Evented: Evented,
374
+ getScrollBarSize: getScrollBarSize
375
+ };
376
+ /* globals TetherBase, performance */
377
+
378
+ 'use strict';
379
+
380
+ var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
381
+
382
+ var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
383
+
384
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
385
+
386
+ if (typeof TetherBase === 'undefined') {
387
+ throw new Error('You must include the utils.js file before tether.js');
388
+ }
389
+
390
+ var _TetherBase$Utils = TetherBase.Utils;
391
+ var getScrollParent = _TetherBase$Utils.getScrollParent;
392
+ var getBounds = _TetherBase$Utils.getBounds;
393
+ var getOffsetParent = _TetherBase$Utils.getOffsetParent;
394
+ var extend = _TetherBase$Utils.extend;
395
+ var addClass = _TetherBase$Utils.addClass;
396
+ var removeClass = _TetherBase$Utils.removeClass;
397
+ var updateClasses = _TetherBase$Utils.updateClasses;
398
+ var defer = _TetherBase$Utils.defer;
399
+ var flush = _TetherBase$Utils.flush;
400
+ var getScrollBarSize = _TetherBase$Utils.getScrollBarSize;
401
+
402
+ function within(a, b) {
403
+ var diff = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];
404
+
405
+ return a + diff >= b && b >= a - diff;
406
+ }
407
+
408
+ var transformKey = (function () {
409
+ if (typeof document === 'undefined') {
410
+ return '';
411
+ }
412
+ var el = document.createElement('div');
413
+
414
+ var transforms = ['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform'];
415
+ for (var i = 0; i < transforms.length; ++i) {
416
+ var key = transforms[i];
417
+ if (el.style[key] !== undefined) {
418
+ return key;
419
+ }
420
+ }
421
+ })();
422
+
423
+ var tethers = [];
424
+
425
+ var position = function position() {
426
+ tethers.forEach(function (tether) {
427
+ tether.position(false);
428
+ });
429
+ flush();
430
+ };
431
+
432
+ function now() {
433
+ if (typeof performance !== 'undefined' && typeof performance.now !== 'undefined') {
434
+ return performance.now();
435
+ }
436
+ return +new Date();
437
+ }
438
+
439
+ (function () {
440
+ var lastCall = null;
441
+ var lastDuration = null;
442
+ var pendingTimeout = null;
443
+
444
+ var tick = function tick() {
445
+ if (typeof lastDuration !== 'undefined' && lastDuration > 16) {
446
+ // We voluntarily throttle ourselves if we can't manage 60fps
447
+ lastDuration = Math.min(lastDuration - 16, 250);
448
+
449
+ // Just in case this is the last event, remember to position just once more
450
+ pendingTimeout = setTimeout(tick, 250);
451
+ return;
452
+ }
453
+
454
+ if (typeof lastCall !== 'undefined' && now() - lastCall < 10) {
455
+ // Some browsers call events a little too frequently, refuse to run more than is reasonable
456
+ return;
457
+ }
458
+
459
+ if (typeof pendingTimeout !== 'undefined') {
460
+ clearTimeout(pendingTimeout);
461
+ pendingTimeout = null;
462
+ }
463
+
464
+ lastCall = now();
465
+ position();
466
+ lastDuration = now() - lastCall;
467
+ };
468
+
469
+ if (typeof window !== 'undefined') {
470
+ ['resize', 'scroll', 'touchmove'].forEach(function (event) {
471
+ window.addEventListener(event, tick);
472
+ });
473
+ }
474
+ })();
475
+
476
+ var MIRROR_LR = {
477
+ center: 'center',
478
+ left: 'right',
479
+ right: 'left'
480
+ };
481
+
482
+ var MIRROR_TB = {
483
+ middle: 'middle',
484
+ top: 'bottom',
485
+ bottom: 'top'
486
+ };
487
+
488
+ var OFFSET_MAP = {
489
+ top: 0,
490
+ left: 0,
491
+ middle: '50%',
492
+ center: '50%',
493
+ bottom: '100%',
494
+ right: '100%'
495
+ };
496
+
497
+ var autoToFixedAttachment = function autoToFixedAttachment(attachment, relativeToAttachment) {
498
+ var left = attachment.left;
499
+ var top = attachment.top;
500
+
501
+ if (left === 'auto') {
502
+ left = MIRROR_LR[relativeToAttachment.left];
503
+ }
504
+
505
+ if (top === 'auto') {
506
+ top = MIRROR_TB[relativeToAttachment.top];
507
+ }
508
+
509
+ return { left: left, top: top };
510
+ };
511
+
512
+ var attachmentToOffset = function attachmentToOffset(attachment) {
513
+ var left = attachment.left;
514
+ var top = attachment.top;
515
+
516
+ if (typeof OFFSET_MAP[attachment.left] !== 'undefined') {
517
+ left = OFFSET_MAP[attachment.left];
518
+ }
519
+
520
+ if (typeof OFFSET_MAP[attachment.top] !== 'undefined') {
521
+ top = OFFSET_MAP[attachment.top];
522
+ }
523
+
524
+ return { left: left, top: top };
525
+ };
526
+
527
+ function addOffset() {
528
+ var out = { top: 0, left: 0 };
529
+
530
+ for (var _len = arguments.length, offsets = Array(_len), _key = 0; _key < _len; _key++) {
531
+ offsets[_key] = arguments[_key];
532
+ }
533
+
534
+ offsets.forEach(function (_ref) {
535
+ var top = _ref.top;
536
+ var left = _ref.left;
537
+
538
+ if (typeof top === 'string') {
539
+ top = parseFloat(top, 10);
540
+ }
541
+ if (typeof left === 'string') {
542
+ left = parseFloat(left, 10);
543
+ }
544
+
545
+ out.top += top;
546
+ out.left += left;
547
+ });
548
+
549
+ return out;
550
+ }
551
+
552
+ function offsetToPx(offset, size) {
553
+ if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) {
554
+ offset.left = parseFloat(offset.left, 10) / 100 * size.width;
555
+ }
556
+ if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) {
557
+ offset.top = parseFloat(offset.top, 10) / 100 * size.height;
558
+ }
559
+
560
+ return offset;
561
+ }
562
+
563
+ var parseOffset = function parseOffset(value) {
564
+ var _value$split = value.split(' ');
565
+
566
+ var _value$split2 = _slicedToArray(_value$split, 2);
567
+
568
+ var top = _value$split2[0];
569
+ var left = _value$split2[1];
570
+
571
+ return { top: top, left: left };
572
+ };
573
+ var parseAttachment = parseOffset;
574
+
575
+ var TetherClass = (function () {
576
+ function TetherClass(options) {
577
+ var _this = this;
578
+
579
+ _classCallCheck(this, TetherClass);
580
+
581
+ this.position = this.position.bind(this);
582
+
583
+ tethers.push(this);
584
+
585
+ this.history = [];
586
+
587
+ this.setOptions(options, false);
588
+
589
+ TetherBase.modules.forEach(function (module) {
590
+ if (typeof module.initialize !== 'undefined') {
591
+ module.initialize.call(_this);
592
+ }
593
+ });
594
+
595
+ this.position();
596
+ }
597
+
598
+ _createClass(TetherClass, [{
599
+ key: 'getClass',
600
+ value: function getClass() {
601
+ var key = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
602
+ var classes = this.options.classes;
603
+
604
+ if (typeof classes !== 'undefined' && classes[key]) {
605
+ return this.options.classes[key];
606
+ } else if (this.options.classPrefix) {
607
+ return this.options.classPrefix + '-' + key;
608
+ } else {
609
+ return key;
610
+ }
611
+ }
612
+ }, {
613
+ key: 'setOptions',
614
+ value: function setOptions(options) {
615
+ var _this2 = this;
616
+
617
+ var pos = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
618
+
619
+ var defaults = {
620
+ offset: '0 0',
621
+ targetOffset: '0 0',
622
+ targetAttachment: 'auto auto',
623
+ classPrefix: 'tether'
624
+ };
625
+
626
+ this.options = extend(defaults, options);
627
+
628
+ var _options = this.options;
629
+ var element = _options.element;
630
+ var target = _options.target;
631
+ var targetModifier = _options.targetModifier;
632
+
633
+ this.element = element;
634
+ this.target = target;
635
+ this.targetModifier = targetModifier;
636
+
637
+ if (this.target === 'viewport') {
638
+ this.target = document.body;
639
+ this.targetModifier = 'visible';
640
+ } else if (this.target === 'scroll-handle') {
641
+ this.target = document.body;
642
+ this.targetModifier = 'scroll-handle';
643
+ }
644
+
645
+ ['element', 'target'].forEach(function (key) {
646
+ if (typeof _this2[key] === 'undefined') {
647
+ throw new Error('Tether Error: Both element and target must be defined');
648
+ }
649
+
650
+ if (typeof _this2[key].jquery !== 'undefined') {
651
+ _this2[key] = _this2[key][0];
652
+ } else if (typeof _this2[key] === 'string') {
653
+ _this2[key] = document.querySelector(_this2[key]);
654
+ }
655
+ });
656
+
657
+ addClass(this.element, this.getClass('element'));
658
+ if (!(this.options.addTargetClasses === false)) {
659
+ addClass(this.target, this.getClass('target'));
660
+ }
661
+
662
+ if (!this.options.attachment) {
663
+ throw new Error('Tether Error: You must provide an attachment');
664
+ }
665
+
666
+ this.targetAttachment = parseAttachment(this.options.targetAttachment);
667
+ this.attachment = parseAttachment(this.options.attachment);
668
+ this.offset = parseOffset(this.options.offset);
669
+ this.targetOffset = parseOffset(this.options.targetOffset);
670
+
671
+ if (typeof this.scrollParent !== 'undefined') {
672
+ this.disable();
673
+ }
674
+
675
+ if (this.targetModifier === 'scroll-handle') {
676
+ this.scrollParent = this.target;
677
+ } else {
678
+ this.scrollParent = getScrollParent(this.target);
679
+ }
680
+
681
+ if (!(this.options.enabled === false)) {
682
+ this.enable(pos);
683
+ }
684
+ }
685
+ }, {
686
+ key: 'getTargetBounds',
687
+ value: function getTargetBounds() {
688
+ if (typeof this.targetModifier !== 'undefined') {
689
+ if (this.targetModifier === 'visible') {
690
+ if (this.target === document.body) {
691
+ return { top: pageYOffset, left: pageXOffset, height: innerHeight, width: innerWidth };
692
+ } else {
693
+ var bounds = getBounds(this.target);
694
+
695
+ var out = {
696
+ height: bounds.height,
697
+ width: bounds.width,
698
+ top: bounds.top,
699
+ left: bounds.left
700
+ };
701
+
702
+ out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top));
703
+ out.height = Math.min(out.height, bounds.height - (bounds.top + bounds.height - (pageYOffset + innerHeight)));
704
+ out.height = Math.min(innerHeight, out.height);
705
+ out.height -= 2;
706
+
707
+ out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left));
708
+ out.width = Math.min(out.width, bounds.width - (bounds.left + bounds.width - (pageXOffset + innerWidth)));
709
+ out.width = Math.min(innerWidth, out.width);
710
+ out.width -= 2;
711
+
712
+ if (out.top < pageYOffset) {
713
+ out.top = pageYOffset;
714
+ }
715
+ if (out.left < pageXOffset) {
716
+ out.left = pageXOffset;
717
+ }
718
+
719
+ return out;
720
+ }
721
+ } else if (this.targetModifier === 'scroll-handle') {
722
+ var bounds = undefined;
723
+ var target = this.target;
724
+ if (target === document.body) {
725
+ target = document.documentElement;
726
+
727
+ bounds = {
728
+ left: pageXOffset,
729
+ top: pageYOffset,
730
+ height: innerHeight,
731
+ width: innerWidth
732
+ };
733
+ } else {
734
+ bounds = getBounds(target);
735
+ }
736
+
737
+ var style = getComputedStyle(target);
738
+
739
+ var hasBottomScroll = target.scrollWidth > target.clientWidth || [style.overflow, style.overflowX].indexOf('scroll') >= 0 || this.target !== document.body;
740
+
741
+ var scrollBottom = 0;
742
+ if (hasBottomScroll) {
743
+ scrollBottom = 15;
744
+ }
745
+
746
+ var height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom;
747
+
748
+ var out = {
749
+ width: 15,
750
+ height: height * 0.975 * (height / target.scrollHeight),
751
+ left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15
752
+ };
753
+
754
+ var fitAdj = 0;
755
+ if (height < 408 && this.target === document.body) {
756
+ fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58;
757
+ }
758
+
759
+ if (this.target !== document.body) {
760
+ out.height = Math.max(out.height, 24);
761
+ }
762
+
763
+ var scrollPercentage = this.target.scrollTop / (target.scrollHeight - height);
764
+ out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth);
765
+
766
+ if (this.target === document.body) {
767
+ out.height = Math.max(out.height, 24);
768
+ }
769
+
770
+ return out;
771
+ }
772
+ } else {
773
+ return getBounds(this.target);
774
+ }
775
+ }
776
+ }, {
777
+ key: 'clearCache',
778
+ value: function clearCache() {
779
+ this._cache = {};
780
+ }
781
+ }, {
782
+ key: 'cache',
783
+ value: function cache(k, getter) {
784
+ // More than one module will often need the same DOM info, so
785
+ // we keep a cache which is cleared on each position call
786
+ if (typeof this._cache === 'undefined') {
787
+ this._cache = {};
788
+ }
789
+
790
+ if (typeof this._cache[k] === 'undefined') {
791
+ this._cache[k] = getter.call(this);
792
+ }
793
+
794
+ return this._cache[k];
795
+ }
796
+ }, {
797
+ key: 'enable',
798
+ value: function enable() {
799
+ var pos = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
800
+
801
+ if (!(this.options.addTargetClasses === false)) {
802
+ addClass(this.target, this.getClass('enabled'));
803
+ }
804
+ addClass(this.element, this.getClass('enabled'));
805
+ this.enabled = true;
806
+
807
+ if (this.scrollParent !== document) {
808
+ this.scrollParent.addEventListener('scroll', this.position);
809
+ }
810
+
811
+ if (pos) {
812
+ this.position();
813
+ }
814
+ }
815
+ }, {
816
+ key: 'disable',
817
+ value: function disable() {
818
+ removeClass(this.target, this.getClass('enabled'));
819
+ removeClass(this.element, this.getClass('enabled'));
820
+ this.enabled = false;
821
+
822
+ if (typeof this.scrollParent !== 'undefined') {
823
+ this.scrollParent.removeEventListener('scroll', this.position);
824
+ }
825
+ }
826
+ }, {
827
+ key: 'destroy',
828
+ value: function destroy() {
829
+ var _this3 = this;
830
+
831
+ this.disable();
832
+
833
+ tethers.forEach(function (tether, i) {
834
+ if (tether === _this3) {
835
+ tethers.splice(i, 1);
836
+ return;
837
+ }
838
+ });
839
+ }
840
+ }, {
841
+ key: 'updateAttachClasses',
842
+ value: function updateAttachClasses(elementAttach, targetAttach) {
843
+ var _this4 = this;
844
+
845
+ elementAttach = elementAttach || this.attachment;
846
+ targetAttach = targetAttach || this.targetAttachment;
847
+ var sides = ['left', 'top', 'bottom', 'right', 'middle', 'center'];
848
+
849
+ if (typeof this._addAttachClasses !== 'undefined' && this._addAttachClasses.length) {
850
+ // updateAttachClasses can be called more than once in a position call, so
851
+ // we need to clean up after ourselves such that when the last defer gets
852
+ // ran it doesn't add any extra classes from previous calls.
853
+ this._addAttachClasses.splice(0, this._addAttachClasses.length);
854
+ }
855
+
856
+ if (typeof this._addAttachClasses === 'undefined') {
857
+ this._addAttachClasses = [];
858
+ }
859
+ var add = this._addAttachClasses;
860
+
861
+ if (elementAttach.top) {
862
+ add.push(this.getClass('element-attached') + '-' + elementAttach.top);
863
+ }
864
+ if (elementAttach.left) {
865
+ add.push(this.getClass('element-attached') + '-' + elementAttach.left);
866
+ }
867
+ if (targetAttach.top) {
868
+ add.push(this.getClass('target-attached') + '-' + targetAttach.top);
869
+ }
870
+ if (targetAttach.left) {
871
+ add.push(this.getClass('target-attached') + '-' + targetAttach.left);
872
+ }
873
+
874
+ var all = [];
875
+ sides.forEach(function (side) {
876
+ all.push(_this4.getClass('element-attached') + '-' + side);
877
+ all.push(_this4.getClass('target-attached') + '-' + side);
878
+ });
879
+
880
+ defer(function () {
881
+ if (!(typeof _this4._addAttachClasses !== 'undefined')) {
882
+ return;
883
+ }
884
+
885
+ updateClasses(_this4.element, _this4._addAttachClasses, all);
886
+ if (!(_this4.options.addTargetClasses === false)) {
887
+ updateClasses(_this4.target, _this4._addAttachClasses, all);
888
+ }
889
+
890
+ delete _this4._addAttachClasses;
891
+ });
892
+ }
893
+ }, {
894
+ key: 'position',
895
+ value: function position() {
896
+ var _this5 = this;
897
+
898
+ var flushChanges = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
899
+
900
+ // flushChanges commits the changes immediately, leave true unless you are positioning multiple
901
+ // tethers (in which case call Tether.Utils.flush yourself when you're done)
902
+
903
+ if (!this.enabled) {
904
+ return;
905
+ }
906
+
907
+ this.clearCache();
908
+
909
+ // Turn 'auto' attachments into the appropriate corner or edge
910
+ var targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment);
911
+
912
+ this.updateAttachClasses(this.attachment, targetAttachment);
913
+
914
+ var elementPos = this.cache('element-bounds', function () {
915
+ return getBounds(_this5.element);
916
+ });
917
+
918
+ var width = elementPos.width;
919
+ var height = elementPos.height;
920
+
921
+ if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') {
922
+ var _lastSize = this.lastSize;
923
+
924
+ // We cache the height and width to make it possible to position elements that are
925
+ // getting hidden.
926
+ width = _lastSize.width;
927
+ height = _lastSize.height;
928
+ } else {
929
+ this.lastSize = { width: width, height: height };
930
+ }
931
+
932
+ var targetPos = this.cache('target-bounds', function () {
933
+ return _this5.getTargetBounds();
934
+ });
935
+ var targetSize = targetPos;
936
+
937
+ // Get an actual px offset from the attachment
938
+ var offset = offsetToPx(attachmentToOffset(this.attachment), { width: width, height: height });
939
+ var targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize);
940
+
941
+ var manualOffset = offsetToPx(this.offset, { width: width, height: height });
942
+ var manualTargetOffset = offsetToPx(this.targetOffset, targetSize);
943
+
944
+ // Add the manually provided offset
945
+ offset = addOffset(offset, manualOffset);
946
+ targetOffset = addOffset(targetOffset, manualTargetOffset);
947
+
948
+ // It's now our goal to make (element position + offset) == (target position + target offset)
949
+ var left = targetPos.left + targetOffset.left - offset.left;
950
+ var top = targetPos.top + targetOffset.top - offset.top;
951
+
952
+ for (var i = 0; i < TetherBase.modules.length; ++i) {
953
+ var _module2 = TetherBase.modules[i];
954
+ var ret = _module2.position.call(this, {
955
+ left: left,
956
+ top: top,
957
+ targetAttachment: targetAttachment,
958
+ targetPos: targetPos,
959
+ elementPos: elementPos,
960
+ offset: offset,
961
+ targetOffset: targetOffset,
962
+ manualOffset: manualOffset,
963
+ manualTargetOffset: manualTargetOffset,
964
+ scrollbarSize: scrollbarSize,
965
+ attachment: this.attachment
966
+ });
967
+
968
+ if (ret === false) {
969
+ return false;
970
+ } else if (typeof ret === 'undefined' || typeof ret !== 'object') {
971
+ continue;
972
+ } else {
973
+ top = ret.top;
974
+ left = ret.left;
975
+ }
976
+ }
977
+
978
+ // We describe the position three different ways to give the optimizer
979
+ // a chance to decide the best possible way to position the element
980
+ // with the fewest repaints.
981
+ var next = {
982
+ // It's position relative to the page (absolute positioning when
983
+ // the element is a child of the body)
984
+ page: {
985
+ top: top,
986
+ left: left
987
+ },
988
+
989
+ // It's position relative to the viewport (fixed positioning)
990
+ viewport: {
991
+ top: top - pageYOffset,
992
+ bottom: pageYOffset - top - height + innerHeight,
993
+ left: left - pageXOffset,
994
+ right: pageXOffset - left - width + innerWidth
995
+ }
996
+ };
997
+
998
+ var scrollbarSize = undefined;
999
+ if (document.body.scrollWidth > window.innerWidth) {
1000
+ scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
1001
+ next.viewport.bottom -= scrollbarSize.height;
1002
+ }
1003
+
1004
+ if (document.body.scrollHeight > window.innerHeight) {
1005
+ scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
1006
+ next.viewport.right -= scrollbarSize.width;
1007
+ }
1008
+
1009
+ if (['', 'static'].indexOf(document.body.style.position) === -1 || ['', 'static'].indexOf(document.body.parentElement.style.position) === -1) {
1010
+ // Absolute positioning in the body will be relative to the page, not the 'initial containing block'
1011
+ next.page.bottom = document.body.scrollHeight - top - height;
1012
+ next.page.right = document.body.scrollWidth - left - width;
1013
+ }
1014
+
1015
+ if (typeof this.options.optimizations !== 'undefined' && this.options.optimizations.moveElement !== false && !(typeof this.targetModifier !== 'undefined')) {
1016
+ (function () {
1017
+ var offsetParent = _this5.cache('target-offsetparent', function () {
1018
+ return getOffsetParent(_this5.target);
1019
+ });
1020
+ var offsetPosition = _this5.cache('target-offsetparent-bounds', function () {
1021
+ return getBounds(offsetParent);
1022
+ });
1023
+ var offsetParentStyle = getComputedStyle(offsetParent);
1024
+ var offsetParentSize = offsetPosition;
1025
+
1026
+ var offsetBorder = {};
1027
+ ['Top', 'Left', 'Bottom', 'Right'].forEach(function (side) {
1028
+ offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle['border' + side + 'Width']);
1029
+ });
1030
+
1031
+ offsetPosition.right = document.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right;
1032
+ offsetPosition.bottom = document.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom;
1033
+
1034
+ if (next.page.top >= offsetPosition.top + offsetBorder.top && next.page.bottom >= offsetPosition.bottom) {
1035
+ if (next.page.left >= offsetPosition.left + offsetBorder.left && next.page.right >= offsetPosition.right) {
1036
+ // We're within the visible part of the target's scroll parent
1037
+ var scrollTop = offsetParent.scrollTop;
1038
+ var scrollLeft = offsetParent.scrollLeft;
1039
+
1040
+ // It's position relative to the target's offset parent (absolute positioning when
1041
+ // the element is moved to be a child of the target's offset parent).
1042
+ next.offset = {
1043
+ top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top,
1044
+ left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left
1045
+ };
1046
+ }
1047
+ }
1048
+ })();
1049
+ }
1050
+
1051
+ // We could also travel up the DOM and try each containing context, rather than only
1052
+ // looking at the body, but we're gonna get diminishing returns.
1053
+
1054
+ this.move(next);
1055
+
1056
+ this.history.unshift(next);
1057
+
1058
+ if (this.history.length > 3) {
1059
+ this.history.pop();
1060
+ }
1061
+
1062
+ if (flushChanges) {
1063
+ flush();
1064
+ }
1065
+
1066
+ return true;
1067
+ }
1068
+
1069
+ // THE ISSUE
1070
+ }, {
1071
+ key: 'move',
1072
+ value: function move(pos) {
1073
+ var _this6 = this;
1074
+
1075
+ if (!(typeof this.element.parentNode !== 'undefined')) {
1076
+ return;
1077
+ }
1078
+
1079
+ var same = {};
1080
+
1081
+ for (var type in pos) {
1082
+ same[type] = {};
1083
+
1084
+ for (var key in pos[type]) {
1085
+ var found = false;
1086
+
1087
+ for (var i = 0; i < this.history.length; ++i) {
1088
+ var point = this.history[i];
1089
+ if (typeof point[type] !== 'undefined' && !within(point[type][key], pos[type][key])) {
1090
+ found = true;
1091
+ break;
1092
+ }
1093
+ }
1094
+
1095
+ if (!found) {
1096
+ same[type][key] = true;
1097
+ }
1098
+ }
1099
+ }
1100
+
1101
+ var css = { top: '', left: '', right: '', bottom: '' };
1102
+
1103
+ var transcribe = function transcribe(_same, _pos) {
1104
+ var hasOptimizations = typeof _this6.options.optimizations !== 'undefined';
1105
+ var gpu = hasOptimizations ? _this6.options.optimizations.gpu : null;
1106
+ if (gpu !== false) {
1107
+ var yPos = undefined,
1108
+ xPos = undefined;
1109
+ if (_same.top) {
1110
+ css.top = 0;
1111
+ yPos = _pos.top;
1112
+ } else {
1113
+ css.bottom = 0;
1114
+ yPos = -_pos.bottom;
1115
+ }
1116
+
1117
+ if (_same.left) {
1118
+ css.left = 0;
1119
+ xPos = _pos.left;
1120
+ } else {
1121
+ css.right = 0;
1122
+ xPos = -_pos.right;
1123
+ }
1124
+
1125
+ css[transformKey] = 'translateX(' + Math.round(xPos) + 'px) translateY(' + Math.round(yPos) + 'px)';
1126
+
1127
+ if (transformKey !== 'msTransform') {
1128
+ // The Z transform will keep this in the GPU (faster, and prevents artifacts),
1129
+ // but IE9 doesn't support 3d transforms and will choke.
1130
+ css[transformKey] += " translateZ(0)";
1131
+ }
1132
+ } else {
1133
+ if (_same.top) {
1134
+ css.top = _pos.top + 'px';
1135
+ } else {
1136
+ css.bottom = _pos.bottom + 'px';
1137
+ }
1138
+
1139
+ if (_same.left) {
1140
+ css.left = _pos.left + 'px';
1141
+ } else {
1142
+ css.right = _pos.right + 'px';
1143
+ }
1144
+ }
1145
+ };
1146
+
1147
+ var moved = false;
1148
+ if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) {
1149
+ css.position = 'absolute';
1150
+ transcribe(same.page, pos.page);
1151
+ } else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) {
1152
+ css.position = 'fixed';
1153
+ transcribe(same.viewport, pos.viewport);
1154
+ } else if (typeof same.offset !== 'undefined' && same.offset.top && same.offset.left) {
1155
+ (function () {
1156
+ css.position = 'absolute';
1157
+ var offsetParent = _this6.cache('target-offsetparent', function () {
1158
+ return getOffsetParent(_this6.target);
1159
+ });
1160
+
1161
+ if (getOffsetParent(_this6.element) !== offsetParent) {
1162
+ defer(function () {
1163
+ _this6.element.parentNode.removeChild(_this6.element);
1164
+ offsetParent.appendChild(_this6.element);
1165
+ });
1166
+ }
1167
+
1168
+ transcribe(same.offset, pos.offset);
1169
+ moved = true;
1170
+ })();
1171
+ } else {
1172
+ css.position = 'absolute';
1173
+ transcribe({ top: true, left: true }, pos.page);
1174
+ }
1175
+
1176
+ if (!moved) {
1177
+ var offsetParentIsBody = true;
1178
+ var currentNode = this.element.parentNode;
1179
+ while (currentNode && currentNode.tagName !== 'BODY') {
1180
+ if (getComputedStyle(currentNode).position !== 'static') {
1181
+ offsetParentIsBody = false;
1182
+ break;
1183
+ }
1184
+
1185
+ currentNode = currentNode.parentNode;
1186
+ }
1187
+
1188
+ if (!offsetParentIsBody) {
1189
+ this.element.parentNode.removeChild(this.element);
1190
+ document.body.appendChild(this.element);
1191
+ }
1192
+ }
1193
+
1194
+ // Any css change will trigger a repaint, so let's avoid one if nothing changed
1195
+ var writeCSS = {};
1196
+ var write = false;
1197
+ for (var key in css) {
1198
+ var val = css[key];
1199
+ var elVal = this.element.style[key];
1200
+
1201
+ if (elVal !== '' && val !== '' && ['top', 'left', 'bottom', 'right'].indexOf(key) >= 0) {
1202
+ elVal = parseFloat(elVal);
1203
+ val = parseFloat(val);
1204
+ }
1205
+
1206
+ if (elVal !== val) {
1207
+ write = true;
1208
+ writeCSS[key] = val;
1209
+ }
1210
+ }
1211
+
1212
+ if (write) {
1213
+ defer(function () {
1214
+ extend(_this6.element.style, writeCSS);
1215
+ });
1216
+ }
1217
+ }
1218
+ }]);
1219
+
1220
+ return TetherClass;
1221
+ })();
1222
+
1223
+ TetherClass.modules = [];
1224
+
1225
+ TetherBase.position = position;
1226
+
1227
+ var Tether = extend(TetherClass, TetherBase);
1228
+ /* globals TetherBase */
1229
+
1230
+ 'use strict';
1231
+
1232
+ var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
1233
+
1234
+ var _TetherBase$Utils = TetherBase.Utils;
1235
+ var getBounds = _TetherBase$Utils.getBounds;
1236
+ var extend = _TetherBase$Utils.extend;
1237
+ var updateClasses = _TetherBase$Utils.updateClasses;
1238
+ var defer = _TetherBase$Utils.defer;
1239
+
1240
+ var BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom'];
1241
+
1242
+ function getBoundingRect(tether, to) {
1243
+ if (to === 'scrollParent') {
1244
+ to = tether.scrollParent;
1245
+ } else if (to === 'window') {
1246
+ to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset];
1247
+ }
1248
+
1249
+ if (to === document) {
1250
+ to = to.documentElement;
1251
+ }
1252
+
1253
+ if (typeof to.nodeType !== 'undefined') {
1254
+ (function () {
1255
+ var size = getBounds(to);
1256
+ var pos = size;
1257
+ var style = getComputedStyle(to);
1258
+
1259
+ to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top];
1260
+
1261
+ BOUNDS_FORMAT.forEach(function (side, i) {
1262
+ side = side[0].toUpperCase() + side.substr(1);
1263
+ if (side === 'Top' || side === 'Left') {
1264
+ to[i] += parseFloat(style['border' + side + 'Width']);
1265
+ } else {
1266
+ to[i] -= parseFloat(style['border' + side + 'Width']);
1267
+ }
1268
+ });
1269
+ })();
1270
+ }
1271
+
1272
+ return to;
1273
+ }
1274
+
1275
+ TetherBase.modules.push({
1276
+ position: function position(_ref) {
1277
+ var _this = this;
1278
+
1279
+ var top = _ref.top;
1280
+ var left = _ref.left;
1281
+ var targetAttachment = _ref.targetAttachment;
1282
+
1283
+ if (!this.options.constraints) {
1284
+ return true;
1285
+ }
1286
+
1287
+ var _cache = this.cache('element-bounds', function () {
1288
+ return getBounds(_this.element);
1289
+ });
1290
+
1291
+ var height = _cache.height;
1292
+ var width = _cache.width;
1293
+
1294
+ if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') {
1295
+ var _lastSize = this.lastSize;
1296
+
1297
+ // Handle the item getting hidden as a result of our positioning without glitching
1298
+ // the classes in and out
1299
+ width = _lastSize.width;
1300
+ height = _lastSize.height;
1301
+ }
1302
+
1303
+ var targetSize = this.cache('target-bounds', function () {
1304
+ return _this.getTargetBounds();
1305
+ });
1306
+
1307
+ var targetHeight = targetSize.height;
1308
+ var targetWidth = targetSize.width;
1309
+
1310
+ var allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')];
1311
+
1312
+ this.options.constraints.forEach(function (constraint) {
1313
+ var outOfBoundsClass = constraint.outOfBoundsClass;
1314
+ var pinnedClass = constraint.pinnedClass;
1315
+
1316
+ if (outOfBoundsClass) {
1317
+ allClasses.push(outOfBoundsClass);
1318
+ }
1319
+ if (pinnedClass) {
1320
+ allClasses.push(pinnedClass);
1321
+ }
1322
+ });
1323
+
1324
+ allClasses.forEach(function (cls) {
1325
+ ['left', 'top', 'right', 'bottom'].forEach(function (side) {
1326
+ allClasses.push(cls + '-' + side);
1327
+ });
1328
+ });
1329
+
1330
+ var addClasses = [];
1331
+
1332
+ var tAttachment = extend({}, targetAttachment);
1333
+ var eAttachment = extend({}, this.attachment);
1334
+
1335
+ this.options.constraints.forEach(function (constraint) {
1336
+ var to = constraint.to;
1337
+ var attachment = constraint.attachment;
1338
+ var pin = constraint.pin;
1339
+
1340
+ if (typeof attachment === 'undefined') {
1341
+ attachment = '';
1342
+ }
1343
+
1344
+ var changeAttachX = undefined,
1345
+ changeAttachY = undefined;
1346
+ if (attachment.indexOf(' ') >= 0) {
1347
+ var _attachment$split = attachment.split(' ');
1348
+
1349
+ var _attachment$split2 = _slicedToArray(_attachment$split, 2);
1350
+
1351
+ changeAttachY = _attachment$split2[0];
1352
+ changeAttachX = _attachment$split2[1];
1353
+ } else {
1354
+ changeAttachX = changeAttachY = attachment;
1355
+ }
1356
+
1357
+ var bounds = getBoundingRect(_this, to);
1358
+
1359
+ if (changeAttachY === 'target' || changeAttachY === 'both') {
1360
+ if (top < bounds[1] && tAttachment.top === 'top') {
1361
+ top += targetHeight;
1362
+ tAttachment.top = 'bottom';
1363
+ }
1364
+
1365
+ if (top + height > bounds[3] && tAttachment.top === 'bottom') {
1366
+ top -= targetHeight;
1367
+ tAttachment.top = 'top';
1368
+ }
1369
+ }
1370
+
1371
+ if (changeAttachY === 'together') {
1372
+ if (top < bounds[1] && tAttachment.top === 'top') {
1373
+ if (eAttachment.top === 'bottom') {
1374
+ top += targetHeight;
1375
+ tAttachment.top = 'bottom';
1376
+
1377
+ top += height;
1378
+ eAttachment.top = 'top';
1379
+ } else if (eAttachment.top === 'top') {
1380
+ top += targetHeight;
1381
+ tAttachment.top = 'bottom';
1382
+
1383
+ top -= height;
1384
+ eAttachment.top = 'bottom';
1385
+ }
1386
+ }
1387
+
1388
+ if (top + height > bounds[3] && tAttachment.top === 'bottom') {
1389
+ if (eAttachment.top === 'top') {
1390
+ top -= targetHeight;
1391
+ tAttachment.top = 'top';
1392
+
1393
+ top -= height;
1394
+ eAttachment.top = 'bottom';
1395
+ } else if (eAttachment.top === 'bottom') {
1396
+ top -= targetHeight;
1397
+ tAttachment.top = 'top';
1398
+
1399
+ top += height;
1400
+ eAttachment.top = 'top';
1401
+ }
1402
+ }
1403
+
1404
+ if (tAttachment.top === 'middle') {
1405
+ if (top + height > bounds[3] && eAttachment.top === 'top') {
1406
+ top -= height;
1407
+ eAttachment.top = 'bottom';
1408
+ } else if (top < bounds[1] && eAttachment.top === 'bottom') {
1409
+ top += height;
1410
+ eAttachment.top = 'top';
1411
+ }
1412
+ }
1413
+ }
1414
+
1415
+ if (changeAttachX === 'target' || changeAttachX === 'both') {
1416
+ if (left < bounds[0] && tAttachment.left === 'left') {
1417
+ left += targetWidth;
1418
+ tAttachment.left = 'right';
1419
+ }
1420
+
1421
+ if (left + width > bounds[2] && tAttachment.left === 'right') {
1422
+ left -= targetWidth;
1423
+ tAttachment.left = 'left';
1424
+ }
1425
+ }
1426
+
1427
+ if (changeAttachX === 'together') {
1428
+ if (left < bounds[0] && tAttachment.left === 'left') {
1429
+ if (eAttachment.left === 'right') {
1430
+ left += targetWidth;
1431
+ tAttachment.left = 'right';
1432
+
1433
+ left += width;
1434
+ eAttachment.left = 'left';
1435
+ } else if (eAttachment.left === 'left') {
1436
+ left += targetWidth;
1437
+ tAttachment.left = 'right';
1438
+
1439
+ left -= width;
1440
+ eAttachment.left = 'right';
1441
+ }
1442
+ } else if (left + width > bounds[2] && tAttachment.left === 'right') {
1443
+ if (eAttachment.left === 'left') {
1444
+ left -= targetWidth;
1445
+ tAttachment.left = 'left';
1446
+
1447
+ left -= width;
1448
+ eAttachment.left = 'right';
1449
+ } else if (eAttachment.left === 'right') {
1450
+ left -= targetWidth;
1451
+ tAttachment.left = 'left';
1452
+
1453
+ left += width;
1454
+ eAttachment.left = 'left';
1455
+ }
1456
+ } else if (tAttachment.left === 'center') {
1457
+ if (left + width > bounds[2] && eAttachment.left === 'left') {
1458
+ left -= width;
1459
+ eAttachment.left = 'right';
1460
+ } else if (left < bounds[0] && eAttachment.left === 'right') {
1461
+ left += width;
1462
+ eAttachment.left = 'left';
1463
+ }
1464
+ }
1465
+ }
1466
+
1467
+ if (changeAttachY === 'element' || changeAttachY === 'both') {
1468
+ if (top < bounds[1] && eAttachment.top === 'bottom') {
1469
+ top += height;
1470
+ eAttachment.top = 'top';
1471
+ }
1472
+
1473
+ if (top + height > bounds[3] && eAttachment.top === 'top') {
1474
+ top -= height;
1475
+ eAttachment.top = 'bottom';
1476
+ }
1477
+ }
1478
+
1479
+ if (changeAttachX === 'element' || changeAttachX === 'both') {
1480
+ if (left < bounds[0]) {
1481
+ if (eAttachment.left === 'right') {
1482
+ left += width;
1483
+ eAttachment.left = 'left';
1484
+ } else if (eAttachment.left === 'center') {
1485
+ left += width / 2;
1486
+ eAttachment.left = 'left';
1487
+ }
1488
+ }
1489
+
1490
+ if (left + width > bounds[2]) {
1491
+ if (eAttachment.left === 'left') {
1492
+ left -= width;
1493
+ eAttachment.left = 'right';
1494
+ } else if (eAttachment.left === 'center') {
1495
+ left -= width / 2;
1496
+ eAttachment.left = 'right';
1497
+ }
1498
+ }
1499
+ }
1500
+
1501
+ if (typeof pin === 'string') {
1502
+ pin = pin.split(',').map(function (p) {
1503
+ return p.trim();
1504
+ });
1505
+ } else if (pin === true) {
1506
+ pin = ['top', 'left', 'right', 'bottom'];
1507
+ }
1508
+
1509
+ pin = pin || [];
1510
+
1511
+ var pinned = [];
1512
+ var oob = [];
1513
+
1514
+ if (top < bounds[1]) {
1515
+ if (pin.indexOf('top') >= 0) {
1516
+ top = bounds[1];
1517
+ pinned.push('top');
1518
+ } else {
1519
+ oob.push('top');
1520
+ }
1521
+ }
1522
+
1523
+ if (top + height > bounds[3]) {
1524
+ if (pin.indexOf('bottom') >= 0) {
1525
+ top = bounds[3] - height;
1526
+ pinned.push('bottom');
1527
+ } else {
1528
+ oob.push('bottom');
1529
+ }
1530
+ }
1531
+
1532
+ if (left < bounds[0]) {
1533
+ if (pin.indexOf('left') >= 0) {
1534
+ left = bounds[0];
1535
+ pinned.push('left');
1536
+ } else {
1537
+ oob.push('left');
1538
+ }
1539
+ }
1540
+
1541
+ if (left + width > bounds[2]) {
1542
+ if (pin.indexOf('right') >= 0) {
1543
+ left = bounds[2] - width;
1544
+ pinned.push('right');
1545
+ } else {
1546
+ oob.push('right');
1547
+ }
1548
+ }
1549
+
1550
+ if (pinned.length) {
1551
+ (function () {
1552
+ var pinnedClass = undefined;
1553
+ if (typeof _this.options.pinnedClass !== 'undefined') {
1554
+ pinnedClass = _this.options.pinnedClass;
1555
+ } else {
1556
+ pinnedClass = _this.getClass('pinned');
1557
+ }
1558
+
1559
+ addClasses.push(pinnedClass);
1560
+ pinned.forEach(function (side) {
1561
+ addClasses.push(pinnedClass + '-' + side);
1562
+ });
1563
+ })();
1564
+ }
1565
+
1566
+ if (oob.length) {
1567
+ (function () {
1568
+ var oobClass = undefined;
1569
+ if (typeof _this.options.outOfBoundsClass !== 'undefined') {
1570
+ oobClass = _this.options.outOfBoundsClass;
1571
+ } else {
1572
+ oobClass = _this.getClass('out-of-bounds');
1573
+ }
1574
+
1575
+ addClasses.push(oobClass);
1576
+ oob.forEach(function (side) {
1577
+ addClasses.push(oobClass + '-' + side);
1578
+ });
1579
+ })();
1580
+ }
1581
+
1582
+ if (pinned.indexOf('left') >= 0 || pinned.indexOf('right') >= 0) {
1583
+ eAttachment.left = tAttachment.left = false;
1584
+ }
1585
+ if (pinned.indexOf('top') >= 0 || pinned.indexOf('bottom') >= 0) {
1586
+ eAttachment.top = tAttachment.top = false;
1587
+ }
1588
+
1589
+ if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== _this.attachment.top || eAttachment.left !== _this.attachment.left) {
1590
+ _this.updateAttachClasses(eAttachment, tAttachment);
1591
+ }
1592
+ });
1593
+
1594
+ defer(function () {
1595
+ if (!(_this.options.addTargetClasses === false)) {
1596
+ updateClasses(_this.target, addClasses, allClasses);
1597
+ }
1598
+ updateClasses(_this.element, addClasses, allClasses);
1599
+ });
1600
+
1601
+ return { top: top, left: left };
1602
+ }
1603
+ });
1604
+ /* globals TetherBase */
1605
+
1606
+ 'use strict';
1607
+
1608
+ var _TetherBase$Utils = TetherBase.Utils;
1609
+ var getBounds = _TetherBase$Utils.getBounds;
1610
+ var updateClasses = _TetherBase$Utils.updateClasses;
1611
+ var defer = _TetherBase$Utils.defer;
1612
+
1613
+ TetherBase.modules.push({
1614
+ position: function position(_ref) {
1615
+ var _this = this;
1616
+
1617
+ var top = _ref.top;
1618
+ var left = _ref.left;
1619
+
1620
+ var _cache = this.cache('element-bounds', function () {
1621
+ return getBounds(_this.element);
1622
+ });
1623
+
1624
+ var height = _cache.height;
1625
+ var width = _cache.width;
1626
+
1627
+ var targetPos = this.getTargetBounds();
1628
+
1629
+ var bottom = top + height;
1630
+ var right = left + width;
1631
+
1632
+ var abutted = [];
1633
+ if (top <= targetPos.bottom && bottom >= targetPos.top) {
1634
+ ['left', 'right'].forEach(function (side) {
1635
+ var targetPosSide = targetPos[side];
1636
+ if (targetPosSide === left || targetPosSide === right) {
1637
+ abutted.push(side);
1638
+ }
1639
+ });
1640
+ }
1641
+
1642
+ if (left <= targetPos.right && right >= targetPos.left) {
1643
+ ['top', 'bottom'].forEach(function (side) {
1644
+ var targetPosSide = targetPos[side];
1645
+ if (targetPosSide === top || targetPosSide === bottom) {
1646
+ abutted.push(side);
1647
+ }
1648
+ });
1649
+ }
1650
+
1651
+ var allClasses = [];
1652
+ var addClasses = [];
1653
+
1654
+ var sides = ['left', 'top', 'right', 'bottom'];
1655
+ allClasses.push(this.getClass('abutted'));
1656
+ sides.forEach(function (side) {
1657
+ allClasses.push(_this.getClass('abutted') + '-' + side);
1658
+ });
1659
+
1660
+ if (abutted.length) {
1661
+ addClasses.push(this.getClass('abutted'));
1662
+ }
1663
+
1664
+ abutted.forEach(function (side) {
1665
+ addClasses.push(_this.getClass('abutted') + '-' + side);
1666
+ });
1667
+
1668
+ defer(function () {
1669
+ if (!(_this.options.addTargetClasses === false)) {
1670
+ updateClasses(_this.target, addClasses, allClasses);
1671
+ }
1672
+ updateClasses(_this.element, addClasses, allClasses);
1673
+ });
1674
+
1675
+ return true;
1676
+ }
1677
+ });
1678
+ /* globals TetherBase */
1679
+
1680
+ 'use strict';
1681
+
1682
+ var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
1683
+
1684
+ TetherBase.modules.push({
1685
+ position: function position(_ref) {
1686
+ var top = _ref.top;
1687
+ var left = _ref.left;
1688
+
1689
+ if (!this.options.shift) {
1690
+ return;
1691
+ }
1692
+
1693
+ var shift = this.options.shift;
1694
+ if (typeof this.options.shift === 'function') {
1695
+ shift = this.options.shift.call(this, { top: top, left: left });
1696
+ }
1697
+
1698
+ var shiftTop = undefined,
1699
+ shiftLeft = undefined;
1700
+ if (typeof shift === 'string') {
1701
+ shift = shift.split(' ');
1702
+ shift[1] = shift[1] || shift[0];
1703
+
1704
+ var _shift = shift;
1705
+
1706
+ var _shift2 = _slicedToArray(_shift, 2);
1707
+
1708
+ shiftTop = _shift2[0];
1709
+ shiftLeft = _shift2[1];
1710
+
1711
+ shiftTop = parseFloat(shiftTop, 10);
1712
+ shiftLeft = parseFloat(shiftLeft, 10);
1713
+ } else {
1714
+ shiftTop = shift.top;
1715
+ shiftLeft = shift.left;
1716
+ }
1717
+
1718
+ top += shiftTop;
1719
+ left += shiftLeft;
1720
+
1721
+ return { top: top, left: left };
1722
+ }
1723
+ });
1724
+ return Tether;
1725
+
1726
+ }));