text: /*
   * presentr.js 1.0.0
   * 
   * https://github.com/oodzchen/presentr.js
   * Copyright 2015, Lin Chen
   *
   * MIT License
   *
   */
  !function(e){"use strict";var t=function(o,r){function l(){c(),d(),(Y.navigation.elements||Y.navigation.elements.length>0)&&n.init(ne),Y.enableHash?i.init(ne):P(Y.startIndex)}function c(){var e={width:Y.width+"px",height:Y.height+"px"},t=h(Y.effect);if(e=a.extend(e,t),W=document.createElement("div"),a.setStyle(X,{position:"relative",overflow:"hidden",visibility:"hidden"}),a.setStyle(W,{position:"absolute",left:0,top:0,width:"100%",height:"100%"}),U.forEach(function(t){a.setStyle(t,e),W.appendChild(t)}),X.appendChild(W),U=B.call(W.children),ne.slides=U,"slide"===Y.effect&&Y.cycle){var n=U[0].cloneNode(!0),i=U[G].cloneNode(!0);n.removeAttribute("data-hash"),i.removeAttribute("data-hash"),W.insertBefore(i,W.firstChild),W.appendChild(n),a.setStyle(W,{left:-Y.width+"px",width:3*Y.width+"px"})}setTimeout(function(){X.style.visibility=""},0)}function h(e){var t;switch(e){case"slide":t={display:"none","float":"left"};break;case"fade":t={position:"absolute",left:0,top:0,opacity:0};break;case"none":t={position:"absolute",left:0,top:0,display:"none"};break;default:t={display:"none","float":"left"}}return t}function d(){W.addEventListener(K.touchstart,f,!1)}function f(e){if(e.preventDefault(),e.stopPropagation(),le!==re.both){if(ae=J?e.touches[0].pageX:e.pageX,ce){if("slide"!==Y.effect)return;N(),se=Number(W.style[ee].match(/matrix\(1,\s?0,\s?0,\s?1,\s?(.*?),\s?0\)/)[1]),ae-=se}Y.actionArea.addEventListener(K.touchmove,u,!1),Y.actionArea.addEventListener(K.touchend,v,!1),Y.actionArea.addEventListener(K.touchleave,v,!1)}}function u(e){var t=J?e.touches[0].pageX:e.pageX,n=t-ae;return oe=n-se,se=n,e.preventDefault(),e.stopPropagation(),"slide"===Y.effect?se>0&&le===re.left||0>se&&le===re.right?(Y.actionArea.removeEventListener(K.touchmove,u,!1),Y.actionArea.removeEventListener(K.touchend,v,!1),void Y.actionArea.removeEventListener(K.touchleave,v,!1)):void(W.style[ee]="matrix(1, 0, 0, 1, "+se+", 0)"):void 0}function v(e){var t=parseInt(Y.width/3),n=O();if(e.preventDefault(),e.stopPropagation(),0!==se){var i=0===oe?Y.speed:100*(100-R)/oe;!Y.cycle&&(0===n&&se>0||n===G&&0>se)?y():Math.abs(oe)<=R?Math.abs(se)>t?p(i):y():p(i)}ae=0,se=0,oe=0,Y.actionArea.removeEventListener(K.touchmove,u,!1),Y.actionArea.removeEventListener(K.touchend,v,!1),Y.actionArea.removeEventListener(K.touchleave,v,!1)}function p(e){var t=Math.abs(e);t>Y.speed&&(t=Y.speed),se>0?m(t):g(t)}function y(){var e=O();te[Y.effect](e)}function g(e){var t=O();te[Y.effect](t+1,e)}function m(e){var t=O();te[Y.effect](t-1,e)}function x(e,t){var n=O(),i=t||Y.speed,a=Y.width,s=S(e);null!==s&&(n===e?a=0:e>n&&(a=-a),ce||(C(s,n),ce=!0,H(W,{transform:"matrix(1, 0, 0, 1, "+a+", 0)"},i,function(){ce=!1,Q&&(W.style.width=Y.width*q+1+"px",setTimeout(function(){W.style.width=Y.width*q+"px"},0)),W.style[ee]="matrix(1, 0, 0, 1, 0, 0)",P(s)})))}function b(e,t){var n=O(),i=t||Y.speed,a=S(e);null!==a&&n!==a&&(ce||(C(a,n),ce=!0,H(U[n],{opacity:0},i),H(U[a],{opacity:1},i,function(){ce=!1,P(a)})))}function w(e){var t=O(),n=S(e);C(n,t),P(n)}function C(e,t){n.initialized&&n.update(e),"function"==typeof Y.onChangeStart&&Y.onChangeStart.call(ne,e,t)}function E(e){n.initialized&&n.update(e),"function"==typeof Y.onChangeEnd&&Y.onChangeEnd.call(ne,e)}function S(e){var t=e;if(-1>t||t>G+1)return null;if(-1===t){if(!Y.cycle)return null;t=G}else if(t===G+1){if(!Y.cycle)return null;t=0}return t}function A(e,t){var n=O(),a="string"==typeof e&&Y.enableHash?i.hashToIndex(e):e;a===n||0>a||a>G||ce||("slide"===Y.effect&&(n>a?(U[n-1].style.display="none",U[a].style.display=""):(U[n+1].style.display="none",U[a].style.display="")),te[Y.effect](a,t))}function L(e){var t=re[e];if(0===arguments.length)t=re.both;else if(t===le||!re.hasOwnProperty(e))return!1;le=t}function T(e){var t=re[e];if(0===arguments.length)t=re.both;else if(!re.hasOwnProperty(e))return!1;return le===re.both-t?!1:void(le=t>=le?0:le-t)}function P(e){var t,n,a="string"==typeof e&&Y.enableHash?i.hashToIndex(e):e,s=U[a],o=[],r=W.children;if(!s)return!1;if("slide"===Y.effect){e>0?(n=U[a-1],o.push(n),r[0].style.display="none"):r[0].style.display="",o.push(s),G>e?(t=U[a+1],o.push(t),r[r.length-1].style.display="none"):r[r.length-1].style.display="";var l=I();l.forEach(function(e){e.classList.remove(Y.activeClassName),-1===o.indexOf(e)&&(e.style.display="none")}),Y.cycle||(W.style.left=-Y.width*o.indexOf(s)+"px",W.style.width=Y.width*o.length+"px"),s.classList.add(Y.activeClassName),o.forEach(function(e){e.style.display=""})}else{var c=O();U[c].classList.remove(Y.activeClassName),s.classList.add(Y.activeClassName),"fade"===Y.effect?s.style.opacity=1:(U[c].style.display="none",s.style.display="")}Y.enableHash&&i.setHash(a),E(e)}function H(e,t,n,i){e.style[Z]="all "+n+"ms "+Y.timingFunction,ie=function s(t){e.style[Z]="","function"==typeof i&&i.call(e),e.removeEventListener(_,s,!1)},e.addEventListener(_,ie,!1),a.setStyle(e,t)}function N(t,n){ce&&(W.removeEventListener(_,ie,!1),t||(W.style[ee]=e.getComputedStyle(W,null)[ee],arguments.length>1&&(n?ie():(W.style[ee]="matrix(1, 0, 0, 1, 0, 0)",se=0))),W.style[Z]="",ce=!1)}function I(){var e=O();return[U[e-1],U[e],U[e+1]].filter(function(e){return!!e})}function O(){for(var e=0;q>e;e++)if(U[e].classList.contains(Y.activeClassName))return e;return 0}function M(t){if(!he){W.style[ee]="matrix(1, 0, 0, 1, 0, 0)",W.style[Z]="",s.data("old-config",a.clone(Y,!0)),s.data("container-style",X.style.cssText),s.data("innerbox-style",W.style.cssText);var n=Y.height=e.innerHeight,i=Y.width=e.innerWidth;he=!0,a.setStyle(X,{position:"fixed",left:0,top:0,height:n+"px",width:i+"px",zIndex:t||999}),j()}}function k(){he&&(Y=s.data("old-config"),he=!1,X.style.cssText=s.data("container-style"),W.style.cssText=s.data("innerbox-style"),j())}function z(){return he}function j(){var e={width:Y.width+"px",height:Y.height+"px"},t=O(),n=h(Y.effect);e=a.extend(e,n),B.call(W.children).forEach(function(t){a.setStyle(t,e)}),"slide"===Y.effect&&Y.cycle&&a.setStyle(W,{left:-Y.width+"px",width:3*Y.width+"px"}),P(t)}function D(){F(),Y.actionArea.removeEventListener(K.touchstart,f,!1),n.initialized&&n.destroy(),Y.enableHash&&i.destroy()}function F(){for(;X.firstChild;)X.removeChild(X.firstChild);X.removeAttribute("style"),U.forEach(function(e){e.removeAttribute("style"),e.classList.remove(Y.activeClassName),X.appendChild(e)})}if(!(this instanceof t))return new t(o,r);var W,X=o,B=Array.prototype.slice,U=B.call(o.children),q=U.length,G=q-1,J="ontouchstart"in e,K=J?{touchstart:"touchstart",touchmove:"touchmove",touchend:"touchend",touchleave:"touchleave"}:{touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",touchleave:"mouseleave"},Q=function(){var e=navigator.userAgent.match(/Android/i)&&navigator.userAgent.match(/Chrome\/(\d+)/i);return(!!e&&e[1])>40}(),R=1,V={width:X.offsetWidth,height:X.offsetHeight,startIndex:0,cycle:!1,speed:300,lock:!1,timingFunction:"ease",effect:"slide",activeClassName:"presentr-active",navigation:{elements:[],eventType:"click",activeClassName:"presentr-nav-active"},enableHash:!0,actionArea:document,onChangeStart:function(e,t){},onChangeEnd:function(e){}},Y=a.extend(V,r,!0),Z=a.getPrefixedCSS("transition"),$={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",MSTransition:"MSTransitionEnd",transition:"transitionend"},_=$[Z],ee=a.getPrefixedCSS("transform");if(null!==Z&&null!==ee){var te={slide:x,fade:b,none:w},ne=a.extend(this,{show:P,prev:m,next:g,lock:L,unLock:T,gotoSlide:A,getIndex:O,fullScreen:M,cancelFullScreen:k,isFullScreen:z,destroy:D});ne.options=Y;var ie,ae=0,se=0,oe=0,re={"false":0,left:1,right:2,"true":3,both:3},le=re[Y.lock],ce=!1,he=!1;return l(),ne}},n={initialized:!1,init:function(e){var t=this;t.config=e.options.navigation,t.elements=t.config.elements,t.presentr=e,t.elements&&0!==t.elements.length&&(Array.prototype.slice.call(t.elements).forEach(function(e,n){e.setAttribute("data-index",n),e.addEventListener(t.config.eventType,t.eventHandler,!1)}),t.update(),t.initialized=!0)},eventHandler:function(e){var t=Number(this.getAttribute("data-index"));e.preventDefault(),presentr.gotoSlide(t)},getIndex:function(){var e,t=this.elements.length;for(e=0;t>e;e++)if(this.elements[e].classList.contains(this.config.activeClassName))return e;return 0},update:function(e){if(0!==this.elements.length){var t=arguments.length>0?e:this.presentr.getIndex();this.elements[this.getIndex()].classList.remove(this.config.activeClassName),this.elements[t].classList.add(this.config.activeClassName)}},destroy:function(){var e=this;e.initialized&&(Array.prototype.slice.call(e.elements).forEach(function(t,n){t.removeAttribute("data-index"),t.classList.remove(e.config.activeClassName),t.removeEventListener(e.config.eventType,e.eventHandler,!1)}),e.initialized=!1)}},i={init:function(t){var n=this,i=e.location.hash.replace("#",""),a={};n.presentr=t,n.hashes=t.slides.map(function(e,t){return e.getAttribute("data-hash")||String(t)}),n.hashes.forEach(function(e,t){a[e]=t,a[t]=t,n.presentr.slides[t].setAttribute("data-hash",e)}),n.hashMap=a,n.hashMap.hasOwnProperty(i)?n.presentr.show(n.hashToIndex(i)):(n.presentr.show(n.presentr.options.startIndex),e.location.hash=n.hashes[n.presentr.options.startIndex]),n.addEvent()},setHash:function(t){var n=e.location.hash.replace("#","");this.hashToIndex(n)!==t&&(this.removeEvent(),e.location.hash=this.hashes[t],this.addEvent())},onHashChange:function(t){var n=e.location.hash.replace("#","");this.hashMap.hasOwnProperty(n)&&(this.presentr.gotoSlide(this.hashToIndex(n)),t.stopImmediatePropagation())},hashToIndex:function(e){return this.hashMap[e]},addEvent:function(){this.onHashChange=this.onHashChange.bind(this),e.addEventListener("hashchange",this.onHashChange,!1)},removeEvent:function(){e.removeEventListener("hashchange",this.onHashChange,!1)},destroy:function(){var e=this;e.hashes.forEach(function(t,n){e.presentr.slides[n].removeAttribute("data-hash")}),e.removeEvent()}},a={extend:function(e,t,n){var i=e;for(var a in t)if(t.hasOwnProperty(a)){var s=t[a];!n||"object"!=typeof s||s instanceof Node?i[a]=t[a]:i[a]=this.extend(i[a],s,n)}return i},clone:function(e,t){var n={};if("object"!=typeof e||e instanceof Node)return e;e instanceof Array&&(n=[]);for(var i in e){var a=e[i];e.hasOwnProperty(i)&&(t&&"object"==typeof a?n[i]=this.clone(a,t):n[i]=a)}return n},setStyle:function(e,t){var n=this.getPrefixedCSSObj(t);a.extend(e.style,n)},getPrefixedCSSObj:function(e){var t,n;for(n in e)if(e.hasOwnProperty(n)){if(t=this.getPrefixedCSS(n),t===n||null===t)continue;e[t]=e[n],delete e.prop}return e},getPrefixedCSS:function(e){var t,n,i=document.body.style,a=e,s=["Moz","Webkit","O","MS","ms"],o=a.charAt(0).toUpperCase()+a.slice(1);if(a in i)return a;for(n=0;n<s.length;n++)if(t=s[n]+o,t in i)return t;return null}},s={data:function(e,t){return"string"!=typeof e?null:(this.storage=this.storage||{},1===arguments.length?this.storage.hasOwnProperty(e)?this.storage[e]:null:void(this.storage[e]=a.clone(t,!0)))}};e.Presentr=t}(window);