(function(){varr={Etag:1,"Last-Modified":1,"Content-Length":1,"Content-Type":1},n={},i={},s={},o={},c=1e3,a=!1,t={html:1,css:1,js:1},e={heartbeat:function(){document.body&&(a||e.loadresources(),e.checkForChanges()),setTimeout(e.heartbeat,c)},loadresources:function(){functionh(e){vart=document.location,n=newRegExp("^\\.|^/(?!/)|^[\\w]((?!://).)*$|"+t.protocol+"//"+t.host);returne.match(n)}for(vari,f,g,b,p=document.getElementsByTagName("script"),m=document.getElementsByTagName("link"),r=[],o=0;o<p.length;o++)if(f=p[o],i=f.getAttribute("src"),i&&h(i)&&r.push(i),i&&i.match(/\blive.js#/)){for(gint)t[g]=i.match("[#,|]"+g)!=null;i.match("notify")&&alert("Live.js is loaded.")}t.js||(r=[]),t.html&&r.push(document.location.href);for(o=0;o<m.length&&t.css;o++){varu=m[o],v=u.getAttribute("rel"),l=u.getAttribute("href",2);l&&v&&v.match(newRegExp("stylesheet","i"))&&h(l)&&(r.push(l),s[l]=u)}for(o=0;o<r.length;o++)b=r[o],e.getHead(b,function(e,t){n[e]=t});varj=document.getElementsByTagName("head")[0],c=document.createElement("style"),d="transition: all .3s ease-out;";css=[".livejs-loading * { ",d," -webkit-",d,"-moz-",d,"-o-",d,"}"].join(""),c.setAttribute("type","text/css"),j.appendChild(c),c.styleSheet?c.styleSheet.cssText=css:c.appendChild(document.createTextNode(css)),a=!0},checkForChanges:function(){for(vartinn){if(i[t])continue;e.getHead(t,function(t,s){varo,i=n[t],a=!1;n[t]=s;for(oini){varc=i[o],r=s[o],l=s["Content-Type"];switch(o.toLowerCase()){case"etag":if(!r)break;default:a=c!=r;break}if(a){e.refreshResource(t,l);break}}})}},refreshResource:function(t,n){switch(n.toLowerCase()){case"text/css":vara=s[t],r=document.body.parentNode,c=a.parentNode,l=a.nextSibling,i=document.createElement("link");r.className=r.className.replace(/\s*livejs-loading/gi,"")+" livejs-loading",i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",t+"?now="+newDate*1),l?c.insertBefore(i,l):c.appendChild(i),s[t]=i,o[t]=a,e.removeoldLinkElements();break;case"text/html":if(t!=document.location.href)return;case"text/javascript":case"application/javascript":case"application/x-javascript":document.location.reload()}},removeoldLinkElements:function(){t=0;for(nino){try{vart,n,i=s[n],a=o[n],r=document.body.parentNode,c=i.sheet||i.styleSheet,l=c.rules||c.cssRules;l.length>=0&&(a.parentNode.removeChild(a),deleteo[n],setTimeout(function(){r.className=r.className.replace(/\s*livejs-loading/gi,"")},100))}catch{t++}t&&setTimeout(e.removeoldLinkElements,50)}},getHead:function(e,t){i[e]=!0;varn=window.XMLHttpRequest?newXMLHttpRequest:newActiveXObject("Microsoft.XmlHttp");n.open("HEAD",e,!0),n.onreadystatechange=function(){if(deletei[e],n.readyState==4&&n.status!=304){n.getAllResponseHeaders();vars,o,a={};for(oinr)s=n.getResponseHeader(o),o.toLowerCase()=="etag"&&s&&(s=s.replace(/^W\//,"")),o.toLowerCase()=="content-type"&&s&&(s=s.replace(/^(.*?);.*?$/i,"$1")),a[o]=s;t(e,a)}},n.send()}};document.location.protocol!="file:"?(window.liveJsLoaded||e.heartbeat(),window.liveJsLoaded=!0):window.console&&console.log("Live.js doesn't support the file protocol. It needs http.")})()