text: !function(e,t){"function"==typeof define&&define.amd?(e.marked=require("./marked"),e.RevealMarkdown=t(e.marked),e.RevealMarkdown.initialize()):"object"==typeof exports?module.exports=t(require("./marked")):e.RevealMarkdown=t(e.marked)}(this,function(e){function t(e){var t=(e.querySelector("script")||e).textContent,a=(t=t.replace(new RegExp(m,"g"),"<\/script>")).match(/^\n?(\s*)/)[1].length,r=t.match(/^\n?(\t*)/)[1].length;return r>0?t=t.replace(new RegExp("\\n?\\t{"+r+"}","g"),"\n"):a>1&&(t=t.replace(new RegExp("\\n? {"+a+"}","g"),"\n")),t}function a(e){for(var t=e.attributes,a=[],r=0,n=t.length;r<n;r++){var i=t[r].name,s=t[r].value;/data\-(markdown|separator|vertical|notes)/gi.test(i)||(s?a.push(i+'="'+s+'"'):a.push(i))}return a.join(" ")}function r(e){return e=e||{},e.separator=e.separator||c,e.notesSeparator=e.notesSeparator||p,e.attributes=e.attributes||"",e}function n(t,a){a=r(a);var n=t.split(new RegExp(a.notesSeparator,"mgi"));return 2===n.length&&(t=n[0]+'<aside class="notes">'+e(n[1].trim())+"</aside>"),'<script type="text/template">'+(t=t.replace(/<\/script>/g,m))+"<\/script>"}function i(e,t){t=r(t);for(var a,i,s,o=new RegExp(t.separator+(t.verticalSeparator?"|"+t.verticalSeparator:""),"mg"),l=new RegExp(t.separator),d=0,u=!0,c=[];a=o.exec(e);)notes=null,!(i=l.test(a[0]))&&u&&c.push([]),s=e.substring(d,a.index),i&&u?c.push(s):c[c.length-1].push(s),d=o.lastIndex,u=i;(u?c:c[c.length-1]).push(e.substring(d));for(var p="",h=0,g=c.length;h<g;h++)c[h]instanceof Array?c[h].forEach(function(e){p+='<slide class="slide"><section class="slide-wrapper" data-markdown>'+n(e,t)+"</section></slide>"}):p+='<slide class="slide"><section class="slide-wrapper" '+t.attributes+" data-markdown>"+n(c[h],t)+"</section></slide>";return p}function s(){for(var e,r=document.querySelectorAll("[data-markdown]"),s=0,o=r.length;s<o;s++)if((e=r[s]).getAttribute("data-markdown").length){var l=new XMLHttpRequest,d=e.getAttribute("data-markdown");datacharset=e.getAttribute("data-charset"),null!=datacharset&&""!=datacharset&&l.overrideMimeType("text/html; charset="+datacharset),l.onreadystatechange=function(){4===l.readyState&&(l.status>=200&&l.status<300||0===l.status?e.outerHTML=i(l.responseText,{separator:e.getAttribute("data-separator"),verticalSeparator:e.getAttribute("data-separator-vertical"),notesSeparator:e.getAttribute("data-separator-notes"),attributes:a(e)}):e.outerHTML='<section data-state="alert">ERROR: The attempt to fetch '+d+" failed with HTTP status "+l.status+".Check your browser's JavaScript console for more details.<p>Remember that you need to serve the presentation HTML from a HTTP server.</p></section>")},l.open("GET",d,!1);try{l.send()}catch(e){alert("Failed to get the Markdown file "+d+". Make sure that the presentation and the file are served by a HTTP server and the file can be found there. "+e)}}else e.getAttribute("data-separator")||e.getAttribute("data-separator-vertical")||e.getAttribute("data-separator-notes")?e.outerHTML=i(t(e),{separator:e.getAttribute("data-separator"),verticalSeparator:e.getAttribute("data-separator-vertical"),notesSeparator:e.getAttribute("data-separator-notes"),attributes:a(e)}):e.innerHTML=n(t(e))}function o(e,t,a){var r=new RegExp(a,"mg"),n=new RegExp('([^"= ]+?)="([^"=]+?)"',"mg"),i=e.nodeValue;if(matches=r.exec(i)){var s=matches[1];for(i=i.substring(0,matches.index)+i.substring(r.lastIndex),e.nodeValue=i;matchesClass=n.exec(s);)t.setAttribute(matchesClass[1],matchesClass[2]);return!0}return!1}function l(e,t,a,r,n){if(null!=t&&void 0!=t.childNodes&&t.childNodes.length>0){previousParentElement=t;for(var i=0;i<t.childNodes.length;i++){if(childElement=t.childNodes[i],i>0)for(j=i-1;j>=0;){if(aPreviousChildElement=t.childNodes[j],"function"==typeof aPreviousChildElement.setAttribute&&"BR"!=aPreviousChildElement.tagName){previousParentElement=aPreviousChildElement;break}j-=1}parentSection=e,"section"==childElement.nodeName&&(parentSection=childElement,previousParentElement=childElement),"function"!=typeof childElement.setAttribute&&childElement.nodeType!=Node.COMMENT_NODE||l(parentSection,childElement,previousParentElement,r,n)}}t.nodeType==Node.COMMENT_NODE&&0==o(t,a,r)&&o(t,e,n)}function d(e,t){-1!==t.indexOf("background-image")&&(e.parentNode.className+=" fill")}function u(){for(var a=document.querySelectorAll("[data-markdown]"),r=a[0].getAttribute("data-img-content",!0)||"markdown",n=0,i=a.length;n<i;n++){var s=a[n];if(!s.getAttribute("data-markdown-parsed")){s.setAttribute("data-markdown-parsed",!0);var o=s.querySelector("aside.notes"),u=t(s),c=e(u);s.innerHTML=c.replace(RegExp(/<img src=".\//gi),'<img src="./'+r+"/"),l(s.parentNode,s,null,s.getAttribute("data-element-attributes")||s.parentNode.getAttribute("data-element-attributes")||h,s.getAttribute("data-attributes")||s.parentNode.getAttribute("data-attributes")||g),d(s,c),o&&s.appendChild(o)}}$(".slide.fill").append('<div style="background-color:rgba(55,68,84,.82);position:absolute;left:0;right:0;top:0;bottom:0;width:100%;height:100%;z-index:-1;">')}if(void 0===e)throw"The reveal.js Markdown plugin requires marked to be loaded";"undefined"!=typeof hljs&&e.setOptions({highlight:function(e,t){return hljs.highlightAuto(e,t).value}});var c="^\r?\n---\r?\n$",p="note:",h="\\.element\\s*?(.+?)$",g="\\.slide:\\s*?(\\S.+?)$",m="__SCRIPT_END__";return{initialize:function(){s(),u()},processSlides:s,convertSlides:u,slidify:i}});