reveal-js-base-theme/js/reveal.min.js
2013-07-20 22:56:48 -04:00

8 lines
25 KiB
JavaScript

/*!
* reveal.js 2.5.0 (2013-07-20, 22:53)
* http://lab.hakim.se/reveal-js
* MIT licensed
*
* Copyright (C) 2013 Hakim El Hattab, http://hakim.se
*/
var Reveal=function(){"use strict";function e(e){return Ot||It?(window.addEventListener("load",L,!1),l(Pt,e),r(),o(),void 0):(document.body.setAttribute("class","no-transforms"),void 0)}function t(){if(Rt.theme=document.querySelector("#theme"),Rt.wrapper=document.querySelector(".reveal"),Rt.slides=document.querySelector(".reveal .slides"),document.querySelector(".reveal .backgrounds")||(Rt.background=document.createElement("div"),Rt.background.classList.add("backgrounds"),Rt.wrapper.appendChild(Rt.background)),!Rt.wrapper.querySelector(".progress")){var e=document.createElement("div");e.classList.add("progress"),e.innerHTML="<span></span>",Rt.wrapper.appendChild(e)}if(!Rt.wrapper.querySelector(".controls")){var t=document.createElement("aside");t.classList.add("controls"),t.innerHTML='<div class="navigate-left"></div><div class="navigate-right"></div><div class="navigate-up"></div><div class="navigate-down"></div>',Rt.wrapper.appendChild(t)}if(!Rt.wrapper.querySelector(".state-background")){var n=document.createElement("div");n.classList.add("state-background"),Rt.wrapper.appendChild(n)}if(!Rt.wrapper.querySelector(".pause-overlay")){var r=document.createElement("div");r.classList.add("pause-overlay"),Rt.wrapper.appendChild(r)}Rt.progress=document.querySelector(".reveal .progress"),Rt.progressbar=document.querySelector(".reveal .progress span"),Pt.controls&&(Rt.controls=document.querySelector(".reveal .controls"),Rt.controlsLeft=d(document.querySelectorAll(".navigate-left")),Rt.controlsRight=d(document.querySelectorAll(".navigate-right")),Rt.controlsUp=d(document.querySelectorAll(".navigate-up")),Rt.controlsDown=d(document.querySelectorAll(".navigate-down")),Rt.controlsPrev=d(document.querySelectorAll(".navigate-prev")),Rt.controlsNext=d(document.querySelectorAll(".navigate-next")))}function n(){function e(e,t){var n={background:e.getAttribute("data-background"),backgroundSize:e.getAttribute("data-background-size"),backgroundImage:e.getAttribute("data-background-image"),backgroundColor:e.getAttribute("data-background-color"),backgroundRepeat:e.getAttribute("data-background-repeat"),backgroundPosition:e.getAttribute("data-background-position"),backgroundTransition:e.getAttribute("data-background-transition")},r=document.createElement("div");return r.className="slide-background",n.background&&(/^(http|file|\/\/)/gi.test(n.background)||/\.(png|jpg|jpeg|gif|bmp)$/gi.test(n.background)?r.style.backgroundImage="url("+n.background+")":r.style.background=n.background),n.backgroundSize&&(r.style.backgroundSize=n.backgroundSize),n.backgroundImage&&(r.style.backgroundImage='url("'+n.backgroundImage+'")'),n.backgroundColor&&(r.style.backgroundColor=n.backgroundColor),n.backgroundRepeat&&(r.style.backgroundRepeat=n.backgroundRepeat),n.backgroundPosition&&(r.style.backgroundPosition=n.backgroundPosition),n.backgroundTransition&&r.setAttribute("data-background-transition",n.backgroundTransition),t.appendChild(r),r}v()&&document.body.classList.add("print-pdf"),Rt.background.innerHTML="",Rt.background.classList.add("no-transition"),d(document.querySelectorAll(xt)).forEach(function(t){var n;n=v()?e(t,t):e(t,Rt.background),d(t.querySelectorAll("section")).forEach(function(t){v()?e(t,t):e(t,n)})})}function r(){/iphone|ipod|android/gi.test(navigator.userAgent)&&!/crios/gi.test(navigator.userAgent)&&(window.addEventListener("load",p,!1),window.addEventListener("orientationchange",p,!1))}function o(){function e(){n.length&&head.js.apply(null,n),a()}for(var t=[],n=[],r=0,o=Pt.dependencies.length;o>r;r++){var i=Pt.dependencies[r];(!i.condition||i.condition())&&(i.async?n.push(i.src):t.push(i.src),"function"==typeof i.callback&&head.ready(i.src.match(/([\w\d_\-]*)\.?js$|[^\\\/]*$/i)[0],i.callback))}t.length?(head.ready(e),head.js.apply(null,t)):e()}function a(){t(),i(),F(),setTimeout(function(){m("ready",{indexh:Et,indexv:kt,currentSlide:At})},1)}function i(e){if(Rt.wrapper.classList.remove(Pt.transition),"object"==typeof e&&l(Pt,e),It===!1&&(Pt.transition="linear"),Rt.wrapper.classList.add(Pt.transition),Rt.wrapper.setAttribute("data-transition-speed",Pt.transitionSpeed),Rt.wrapper.setAttribute("data-background-transition",Pt.backgroundTransition),Rt.controls&&(Rt.controls.style.display=Pt.controls&&Rt.controls?"block":"none"),Rt.progress&&(Rt.progress.style.display=Pt.progress&&Rt.progress?"block":"none"),Pt.rtl?Rt.wrapper.classList.add("rtl"):Rt.wrapper.classList.remove("rtl"),Pt.center?Rt.wrapper.classList.add("center"):Rt.wrapper.classList.remove("center"),Pt.mouseWheel?(document.addEventListener("DOMMouseScroll",dt,!1),document.addEventListener("mousewheel",dt,!1)):(document.removeEventListener("DOMMouseScroll",dt,!1),document.removeEventListener("mousewheel",dt,!1)),Pt.previewLinks?g():(h(),g("[data-preview-link]")),Pt.theme&&Rt.theme){var t=Rt.theme.getAttribute("href"),n=/[^\/]*?(?=\.css)/,r=t.match(n)[0];Pt.theme!==r&&(t=t.replace(n,Pt.theme),Rt.theme.setAttribute("href",t))}I()}function s(){Ht=!0,window.addEventListener("hashchange",yt,!1),window.addEventListener("resize",bt,!1),Pt.touch&&(Rt.wrapper.addEventListener("touchstart",ot,!1),Rt.wrapper.addEventListener("touchmove",at,!1),Rt.wrapper.addEventListener("touchend",it,!1),window.navigator.msPointerEnabled&&(Rt.wrapper.addEventListener("MSPointerDown",st,!1),Rt.wrapper.addEventListener("MSPointerMove",ct,!1),Rt.wrapper.addEventListener("MSPointerUp",lt,!1))),Pt.keyboard&&document.addEventListener("keydown",rt,!1),Pt.progress&&Rt.progress&&Rt.progress.addEventListener("click",ut,!1),Pt.controls&&Rt.controls&&["touchstart","click"].forEach(function(e){Rt.controlsLeft.forEach(function(t){t.addEventListener(e,ft,!1)}),Rt.controlsRight.forEach(function(t){t.addEventListener(e,vt,!1)}),Rt.controlsUp.forEach(function(t){t.addEventListener(e,pt,!1)}),Rt.controlsDown.forEach(function(t){t.addEventListener(e,mt,!1)}),Rt.controlsPrev.forEach(function(t){t.addEventListener(e,gt,!1)}),Rt.controlsNext.forEach(function(t){t.addEventListener(e,ht,!1)})})}function c(){Ht=!1,document.removeEventListener("keydown",rt,!1),window.removeEventListener("hashchange",yt,!1),window.removeEventListener("resize",bt,!1),Rt.wrapper.removeEventListener("touchstart",ot,!1),Rt.wrapper.removeEventListener("touchmove",at,!1),Rt.wrapper.removeEventListener("touchend",it,!1),window.navigator.msPointerEnabled&&(Rt.wrapper.removeEventListener("MSPointerDown",st,!1),Rt.wrapper.removeEventListener("MSPointerMove",ct,!1),Rt.wrapper.removeEventListener("MSPointerUp",lt,!1)),Pt.progress&&Rt.progress&&Rt.progress.removeEventListener("click",ut,!1),Pt.controls&&Rt.controls&&["touchstart","click"].forEach(function(e){Rt.controlsLeft.forEach(function(t){t.removeEventListener(e,ft,!1)}),Rt.controlsRight.forEach(function(t){t.removeEventListener(e,vt,!1)}),Rt.controlsUp.forEach(function(t){t.removeEventListener(e,pt,!1)}),Rt.controlsDown.forEach(function(t){t.removeEventListener(e,mt,!1)}),Rt.controlsPrev.forEach(function(t){t.removeEventListener(e,gt,!1)}),Rt.controlsNext.forEach(function(t){t.removeEventListener(e,ht,!1)})})}function l(e,t){for(var n in t)e[n]=t[n]}function d(e){return Array.prototype.slice.call(e)}function u(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function f(e){var t=0;if(e){var n=0;d(e.childNodes).forEach(function(e){"number"==typeof e.offsetTop&&e.style&&("absolute"===e.style.position&&(n+=1),t=Math.max(t,e.offsetTop+e.offsetHeight))}),0===n&&(t=e.offsetHeight)}return t}function v(){return/print-pdf/gi.test(window.location.search)}function p(){0===window.orientation?(document.documentElement.style.overflow="scroll",document.body.style.height="120%"):(document.documentElement.style.overflow="",document.body.style.height="100%"),setTimeout(function(){window.scrollTo(0,1)},10)}function m(e,t){var n=document.createEvent("HTMLEvents",1,2);n.initEvent(e,!0,!0),l(n,t),Rt.wrapper.dispatchEvent(n)}function g(e){var t=d(document.querySelectorAll(e?e:"a"));t.forEach(function(e){/^(http|www)/gi.test(e.getAttribute("href"))&&e.addEventListener("click",Lt,!1)})}function h(){var e=d(document.querySelectorAll("a"));e.forEach(function(e){/^(http|www)/gi.test(e.getAttribute("href"))&&e.removeEventListener("click",Lt,!1)})}function y(e){b(),Rt.preview=document.createElement("div"),Rt.preview.classList.add("preview-link-overlay"),Rt.wrapper.appendChild(Rt.preview),Rt.preview.innerHTML=["<header>",'<a class="close" href="#"><span class="icon"></span></a>','<a class="external" href="'+e+'" target="_blank"><span class="icon"></span></a>',"</header>",'<div class="spinner"></div>','<div class="viewport">','<iframe src="'+e+'"></iframe>',"</div>"].join(""),Rt.preview.querySelector("iframe").addEventListener("load",function(){Rt.preview.classList.add("loaded")},!1),Rt.preview.querySelector(".close").addEventListener("click",function(e){b(),e.preventDefault()},!1),Rt.preview.querySelector(".external").addEventListener("click",function(){b()},!1),setTimeout(function(){Rt.preview.classList.add("visible")},1)}function b(){Rt.preview&&(Rt.preview.setAttribute("src",""),Rt.preview.parentNode.removeChild(Rt.preview),Rt.preview=null)}function w(e){var t=d(e);return t.forEach(function(e,t){e.hasAttribute("data-fragment-index")||e.setAttribute("data-fragment-index",t)}),t.sort(function(e,t){return e.getAttribute("data-fragment-index")-t.getAttribute("data-fragment-index")}),t}function L(){if(Rt.wrapper&&!v()){var e=Rt.wrapper.offsetWidth,t=Rt.wrapper.offsetHeight;e-=t*Pt.margin,t-=t*Pt.margin;var n=Pt.width,r=Pt.height;if("string"==typeof n&&/%$/.test(n)&&(n=parseInt(n,10)/100*e),"string"==typeof r&&/%$/.test(r)&&(r=parseInt(r,10)/100*t),Rt.slides.style.width=n+"px",Rt.slides.style.height=r+"px",Ct=Math.min(e/n,t/r),Ct=Math.max(Ct,Pt.minScale),Ct=Math.min(Ct,Pt.maxScale),void 0===Rt.slides.style.zoom||navigator.userAgent.match(/(iphone|ipod|ipad|android)/gi)){var o="translate(-50%, -50%) scale("+Ct+") translate(50%, 50%)";Rt.slides.style.WebkitTransform=o,Rt.slides.style.MozTransform=o,Rt.slides.style.msTransform=o,Rt.slides.style.OTransform=o,Rt.slides.style.transform=o}else Rt.slides.style.zoom=Ct;for(var a=d(document.querySelectorAll(qt)),i=0,s=a.length;s>i;i++){var c=a[i];"none"!==c.style.display&&(c.style.top=Pt.center?c.classList.contains("stack")?0:Math.max(-(f(c)/2)-20,-r/2)+"px":"")}Y()}}function E(e,t){"object"==typeof e&&"function"==typeof e.setAttribute&&e.setAttribute("data-previous-indexv",t||0)}function k(e){if("object"==typeof e&&"function"==typeof e.setAttribute&&e.classList.contains("stack")){var t=e.hasAttribute("data-start-indexv")?"data-start-indexv":"data-previous-indexv";return parseInt(e.getAttribute(t)||0,10)}return 0}function S(){if(Pt.overview){Q();var e=Rt.wrapper.classList.contains("overview");Rt.wrapper.classList.add("overview"),Rt.wrapper.classList.remove("exit-overview"),clearTimeout(Wt),clearTimeout(Ut),Wt=setTimeout(function(){for(var t=document.querySelectorAll(xt),n=0,r=t.length;r>n;n++){var o=t[n],a=Pt.rtl?-105:105,i="translateZ(-2500px) translate("+(n-Et)*a+"%, 0%)";if(o.setAttribute("data-index-h",n),o.style.display="block",o.style.WebkitTransform=i,o.style.MozTransform=i,o.style.msTransform=i,o.style.OTransform=i,o.style.transform=i,o.classList.contains("stack"))for(var s=o.querySelectorAll("section"),c=0,l=s.length;l>c;c++){var d=n===Et?kt:k(o),u=s[c],f="translate(0%, "+105*(c-d)+"%)";u.setAttribute("data-index-h",n),u.setAttribute("data-index-v",c),u.style.display="block",u.style.WebkitTransform=f,u.style.MozTransform=f,u.style.msTransform=f,u.style.OTransform=f,u.style.transform=f,u.addEventListener("click",wt,!0)}else o.addEventListener("click",wt,!0)}L(),e||m("overviewshown",{indexh:Et,indexv:kt,currentSlide:At})},10)}}function A(){if(Pt.overview){clearTimeout(Wt),clearTimeout(Ut),Rt.wrapper.classList.remove("overview"),Rt.wrapper.classList.add("exit-overview"),Ut=setTimeout(function(){Rt.wrapper.classList.remove("exit-overview")},10);for(var e=d(document.querySelectorAll(qt)),t=0,n=e.length;n>t;t++){var r=e[t];r.style.display="",r.style.WebkitTransform="",r.style.MozTransform="",r.style.msTransform="",r.style.OTransform="",r.style.transform="",r.removeEventListener("click",wt,!0)}R(Et,kt),Z(),m("overviewhidden",{indexh:Et,indexv:kt,currentSlide:At})}}function q(e){"boolean"==typeof e?e?S():A():x()?A():S()}function x(){return Rt.wrapper.classList.contains("overview")}function T(e){return e=e?e:At,e&&!!e.parentNode.nodeName.match(/section/i)}function M(){var e=document.body,t=e.requestFullScreen||e.webkitRequestFullscreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullScreen;t&&t.apply(e)}function P(){var e=Rt.wrapper.classList.contains("paused");Q(),Rt.wrapper.classList.add("paused"),e===!1&&m("paused")}function N(){var e=Rt.wrapper.classList.contains("paused");Rt.wrapper.classList.remove("paused"),Z(),e&&m("resumed")}function D(){C()?N():P()}function C(){return Rt.wrapper.classList.contains("paused")}function R(e,t,n,r){St=At;var o=document.querySelectorAll(xt);void 0===t&&(t=k(o[e])),St&&St.parentNode&&St.parentNode.classList.contains("stack")&&E(St.parentNode,kt);var a=Dt.concat();Dt.length=0;var i=Et,s=kt;Et=O(xt,void 0===e?Et:e),kt=O(Tt,void 0===t?kt:t),L();e:for(var c=0,l=Dt.length;l>c;c++){for(var u=0;a.length>u;u++)if(a[u]===Dt[c]){a.splice(u,1);continue e}document.documentElement.classList.add(Dt[c]),m(Dt[c])}for(;a.length;)document.documentElement.classList.remove(a.pop());x()&&S();var f=o[Et],v=f.querySelectorAll("section");if(At=v[kt]||f,n!==void 0){var p=w(At.querySelectorAll(".fragment"));d(p).forEach(function(e,t){n>t?e.classList.add("visible"):e.classList.remove("visible")})}var g=Et!==i||kt!==s;g?m("slidechanged",{indexh:Et,indexv:kt,previousSlide:St,currentSlide:At,origin:r}):St=null,St&&(St.classList.remove("present"),document.querySelector(Mt).classList.contains("present")&&setTimeout(function(){var e,t=d(document.querySelectorAll(xt+".stack"));for(e in t)t[e]&&E(t[e],0)},0)),g&&(j(St),H(At)),z(),Y(),X(),_()}function I(){c(),s(),L(),Nt=Pt.autoSlide,Z(),n(),z(),Y(),X()}function O(e,t){var n=d(document.querySelectorAll(e)),r=n.length;if(r){Pt.loop&&(t%=r,0>t&&(t=r+t)),t=Math.max(Math.min(t,r-1),0);for(var o=0;r>o;o++){var a=n[o];if(x()===!1){var i=Math.abs((t-o)%(r-3))||0;a.style.display=i>3?"none":"block"}var s=Pt.rtl&&!T(a);if(a.classList.remove("past"),a.classList.remove("present"),a.classList.remove("future"),a.setAttribute("hidden",""),t>o)a.classList.add(s?"future":"past");else if(o>t){a.classList.add(s?"past":"future");for(var c=d(a.querySelectorAll(".fragment.visible"));c.length;)c.pop().classList.remove("visible")}a.querySelector("section")&&a.classList.add("stack")}n[t].classList.add("present"),n[t].removeAttribute("hidden");var l=n[t].getAttribute("data-state");l&&(Dt=Dt.concat(l.split(" ")));var u=n[t].getAttribute("data-autoslide");Nt=u?parseInt(u,10):Pt.autoSlide,Z()}else t=0;return t}function Y(){if(Pt.progress&&Rt.progress){var e=d(document.querySelectorAll(xt)),t=document.querySelectorAll(qt+":not(.stack)").length,n=0;e:for(var r=0;e.length>r;r++){for(var o=e[r],a=d(o.querySelectorAll("section")),i=0;a.length>i;i++){if(a[i].classList.contains("present"))break e;n++}if(o.classList.contains("present"))break;o.classList.contains("stack")===!1&&n++}Rt.progressbar.style.width=n/(t-1)*window.innerWidth+"px"}}function z(){if(Pt.controls&&Rt.controls){var e=W(),t=U();Rt.controlsLeft.concat(Rt.controlsRight).concat(Rt.controlsUp).concat(Rt.controlsDown).concat(Rt.controlsPrev).concat(Rt.controlsNext).forEach(function(e){e.classList.remove("enabled"),e.classList.remove("fragmented")}),e.left&&Rt.controlsLeft.forEach(function(e){e.classList.add("enabled")}),e.right&&Rt.controlsRight.forEach(function(e){e.classList.add("enabled")}),e.up&&Rt.controlsUp.forEach(function(e){e.classList.add("enabled")}),e.down&&Rt.controlsDown.forEach(function(e){e.classList.add("enabled")}),(e.left||e.up)&&Rt.controlsPrev.forEach(function(e){e.classList.add("enabled")}),(e.right||e.down)&&Rt.controlsNext.forEach(function(e){e.classList.add("enabled")}),At&&(t.prev&&Rt.controlsPrev.forEach(function(e){e.classList.add("fragmented","enabled")}),t.next&&Rt.controlsNext.forEach(function(e){e.classList.add("fragmented","enabled")}),T(At)?(t.prev&&Rt.controlsUp.forEach(function(e){e.classList.add("fragmented","enabled")}),t.next&&Rt.controlsDown.forEach(function(e){e.classList.add("fragmented","enabled")})):(t.prev&&Rt.controlsLeft.forEach(function(e){e.classList.add("fragmented","enabled")}),t.next&&Rt.controlsRight.forEach(function(e){e.classList.add("fragmented","enabled")})))}}function X(){d(Rt.background.childNodes).forEach(function(e,t){var n=Pt.rtl?"future":"past",r=Pt.rtl?"past":"future";e.className="slide-background "+(Et>t?n:t>Et?r:"present"),d(e.childNodes).forEach(function(e,t){e.className="slide-background "+(kt>t?"past":t>kt?"future":"present")})}),setTimeout(function(){Rt.background.classList.remove("no-transition")},1)}function W(){var e=document.querySelectorAll(xt),t=document.querySelectorAll(Tt),n={left:Et>0||Pt.loop,right:e.length-1>Et||Pt.loop,up:kt>0,down:t.length-1>kt};if(Pt.rtl){var r=n.left;n.left=n.right,n.right=r}return n}function U(){if(At&&Pt.fragments){var e=At.querySelectorAll(".fragment"),t=At.querySelectorAll(".fragment:not(.visible)");return{prev:e.length-t.length>0,next:!!t.length}}return{prev:!1,next:!1}}function H(e){e&&(d(e.querySelectorAll("video, audio")).forEach(function(e){e.hasAttribute("data-autoplay")&&e.play()}),d(e.querySelectorAll('iframe[src*="youtube.com/embed/"]')).forEach(function(e){e.hasAttribute("data-autoplay")&&e.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*")}))}function j(e){e&&(d(e.querySelectorAll("video, audio")).forEach(function(e){e.hasAttribute("data-ignore")||e.pause()}),d(e.querySelectorAll('iframe[src*="youtube.com/embed/"]')).forEach(function(e){e.hasAttribute("data-ignore")||"function"!=typeof e.contentWindow.postMessage||e.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}))}function F(){var e=window.location.hash,t=e.slice(2).split("/"),n=e.replace(/#|\//gi,"");if(isNaN(parseInt(t[0],10))&&n.length){var r=document.querySelector("#"+n);if(r){var o=Reveal.getIndices(r);R(o.h,o.v)}else R(Et,kt)}else{var a=parseInt(t[0],10)||0,i=parseInt(t[1],10)||0;(a!==Et||i!==kt)&&R(a,i)}}function _(e){if(Pt.history)if(clearTimeout(Xt),"number"==typeof e)Xt=setTimeout(_,e);else{var t="/";At&&"string"==typeof At.getAttribute("id")?t="/"+At.getAttribute("id"):((Et>0||kt>0)&&(t+=Et),kt>0&&(t+="/"+kt)),window.location.hash=t}}function K(e){var t,n=Et,r=kt;if(e){var o=T(e),a=o?e.parentNode:e,i=d(document.querySelectorAll(xt));n=Math.max(i.indexOf(a),0),o&&(r=Math.max(d(e.parentNode.querySelectorAll("section")).indexOf(e),0))}if(!e&&At){var s=At.querySelectorAll(".fragment.visible");s.length&&(t=s.length)}return{h:n,v:r,f:t}}function $(){if(At&&Pt.fragments){var e=w(At.querySelectorAll(".fragment:not(.visible)"));if(e.length){var t=e[0].getAttribute("data-fragment-index");return e=At.querySelectorAll('.fragment[data-fragment-index="'+t+'"]'),d(e).forEach(function(e){e.classList.add("visible")}),m("fragmentshown",{fragment:e[0],fragments:e}),z(),!0}}return!1}function V(){if(At&&Pt.fragments){var e=w(At.querySelectorAll(".fragment.visible"));if(e.length){var t=e[e.length-1].getAttribute("data-fragment-index");return e=At.querySelectorAll('.fragment[data-fragment-index="'+t+'"]'),d(e).forEach(function(e){e.classList.remove("visible")}),m("fragmenthidden",{fragment:e[0],fragments:e}),z(),!0}}return!1}function Z(){clearTimeout(zt),!Nt||C()||x()||(zt=setTimeout(nt,Nt))}function Q(){clearTimeout(zt)}function B(){Pt.rtl?(x()||$()===!1)&&W().left&&R(Et+1):(x()||V()===!1)&&W().left&&R(Et-1)}function G(){Pt.rtl?(x()||V()===!1)&&W().right&&R(Et-1):(x()||$()===!1)&&W().right&&R(Et+1)}function J(){(x()||V()===!1)&&W().up&&R(Et,kt-1)}function et(){(x()||$()===!1)&&W().down&&R(Et,kt+1)}function tt(){if(V()===!1)if(W().up)J();else{var e=document.querySelector(xt+".past:nth-child("+Et+")");if(e){var t=e.querySelectorAll("section").length-1||void 0,n=Et-1;R(n,t)}}}function nt(){$()===!1&&(W().down?et():G()),Z()}function rt(e){document.activeElement;var t=!(!document.activeElement||!document.activeElement.type&&!document.activeElement.href&&"inherit"===document.activeElement.contentEditable);if(!(t||e.shiftKey&&32!==e.keyCode||e.altKey||e.ctrlKey||e.metaKey)){if(C()&&-1===[66,190,191].indexOf(e.keyCode))return!1;var n=!1;if("object"==typeof Pt.keyboard)for(var r in Pt.keyboard)if(parseInt(r,10)===e.keyCode){var o=Pt.keyboard[r];"function"==typeof o?o.apply(null,[e]):"string"==typeof o&&"function"==typeof Reveal[o]&&Reveal[o].call(),n=!0}if(n===!1)switch(n=!0,e.keyCode){case 80:case 33:tt();break;case 78:case 34:nt();break;case 72:case 37:B();break;case 76:case 39:G();break;case 75:case 38:J();break;case 74:case 40:et();break;case 36:R(0);break;case 35:R(Number.MAX_VALUE);break;case 32:x()?A():e.shiftKey?tt():nt();break;case 13:x()?A():n=!1;break;case 66:case 190:case 191:D();break;case 70:M();break;default:n=!1}n?e.preventDefault():27!==e.keyCode&&79!==e.keyCode||!It||(q(),e.preventDefault()),Z()}}function ot(e){jt.startX=e.touches[0].clientX,jt.startY=e.touches[0].clientY,jt.startCount=e.touches.length,2===e.touches.length&&Pt.overview&&(jt.startSpan=u({x:e.touches[1].clientX,y:e.touches[1].clientY},{x:jt.startX,y:jt.startY}))}function at(e){if(jt.handled)navigator.userAgent.match(/android/gi)&&e.preventDefault();else{var t=e.touches[0].clientX,n=e.touches[0].clientY;if(2===e.touches.length&&2===jt.startCount&&Pt.overview){var r=u({x:e.touches[1].clientX,y:e.touches[1].clientY},{x:jt.startX,y:jt.startY});Math.abs(jt.startSpan-r)>jt.threshold&&(jt.handled=!0,jt.startSpan>r?S():A()),e.preventDefault()}else if(1===e.touches.length&&2!==jt.startCount){var o=t-jt.startX,a=n-jt.startY;o>jt.threshold&&Math.abs(o)>Math.abs(a)?(jt.handled=!0,B()):-jt.threshold>o&&Math.abs(o)>Math.abs(a)?(jt.handled=!0,G()):a>jt.threshold?(jt.handled=!0,J()):-jt.threshold>a&&(jt.handled=!0,et()),e.preventDefault()}}}function it(){jt.handled=!1}function st(e){e.pointerType===e.MSPOINTER_TYPE_TOUCH&&(e.touches=[{clientX:e.clientX,clientY:e.clientY}],ot(e))}function ct(e){e.pointerType===e.MSPOINTER_TYPE_TOUCH&&(e.touches=[{clientX:e.clientX,clientY:e.clientY}],at(e))}function lt(e){e.pointerType===e.MSPOINTER_TYPE_TOUCH&&(e.touches=[{clientX:e.clientX,clientY:e.clientY}],it(e))}function dt(e){if(Date.now()-Yt>600){Yt=Date.now();var t=e.detail||-e.wheelDelta;t>0?nt():tt()}}function ut(e){e.preventDefault();var t=d(document.querySelectorAll(xt)).length,n=Math.floor(e.clientX/Rt.wrapper.offsetWidth*t);R(n)}function ft(e){e.preventDefault(),B()}function vt(e){e.preventDefault(),G()}function pt(e){e.preventDefault(),J()}function mt(e){e.preventDefault(),et()}function gt(e){e.preventDefault(),tt()}function ht(e){e.preventDefault(),nt()}function yt(){F()}function bt(){L()}function wt(e){if(Ht&&x()){e.preventDefault();for(var t=e.target;t&&!t.nodeName.match(/section/gi);)t=t.parentNode;if(t&&!t.classList.contains("disabled")&&(A(),t.nodeName.match(/section/gi))){var n=parseInt(t.getAttribute("data-index-h"),10),r=parseInt(t.getAttribute("data-index-v"),10);R(n,r)}}}function Lt(e){var t=e.target.getAttribute("href");t&&(y(t),e.preventDefault())}var Et,kt,St,At,qt=".reveal .slides section",xt=".reveal .slides>section",Tt=".reveal .slides>section.present>section",Mt=".reveal .slides>section:first-child",Pt={width:960,height:700,margin:.1,minScale:.2,maxScale:1,controls:!0,progress:!0,history:!1,keyboard:!0,overview:!0,center:!0,touch:!0,loop:!1,rtl:!1,fragments:!0,autoSlide:0,mouseWheel:!1,previewLinks:!1,theme:null,transition:"default",transitionSpeed:"default",backgroundTransition:"default",dependencies:[]},Nt=0,Dt=[],Ct=1,Rt={},It="WebkitPerspective"in document.body.style||"MozPerspective"in document.body.style||"msPerspective"in document.body.style||"OPerspective"in document.body.style||"perspective"in document.body.style,Ot="WebkitTransform"in document.body.style||"MozTransform"in document.body.style||"msTransform"in document.body.style||"OTransform"in document.body.style||"transform"in document.body.style,Yt=0,zt=0,Xt=0,Wt=0,Ut=0,Ht=!1,jt={startX:0,startY:0,startSpan:0,startCount:0,handled:!1,threshold:80};return{initialize:e,configure:i,sync:I,slide:R,left:B,right:G,up:J,down:et,prev:tt,next:nt,prevFragment:V,nextFragment:$,navigateTo:R,navigateLeft:B,navigateRight:G,navigateUp:J,navigateDown:et,navigatePrev:tt,navigateNext:nt,layout:L,availableRoutes:W,availableFragments:U,toggleOverview:q,togglePause:D,isOverview:x,isPaused:C,addEventListeners:s,removeEventListeners:c,getIndices:K,getSlide:function(e,t){var n=document.querySelectorAll(xt)[e],r=n&&n.querySelectorAll("section");return t!==void 0?r?r[t]:void 0:n},getPreviousSlide:function(){return St},getCurrentSlide:function(){return At},getScale:function(){return Ct},getConfig:function(){return Pt},getQueryHash:function(){var e={};return location.search.replace(/[A-Z0-9]+?=(\w*)/gi,function(t){e[t.split("=").shift()]=t.split("=").pop()}),e},isFirstSlide:function(){return null==document.querySelector(qt+".past")?!0:!1},isLastSlide:function(){return At&&At.classList.contains(".stack")?null==At.querySelector(qt+".future")?!0:!1:null==document.querySelector(qt+".future")?!0:!1},addEventListener:function(e,t,n){"addEventListener"in window&&(Rt.wrapper||document.querySelector(".reveal")).addEventListener(e,t,n)},removeEventListener:function(e,t,n){"addEventListener"in window&&(Rt.wrapper||document.querySelector(".reveal")).removeEventListener(e,t,n)}}}();