git ssb

0+

Zach! / music-visions



Tree: 4e3a4be0788f6e80d9510e5f86c967dea4d413cd

Files: 4e3a4be0788f6e80d9510e5f86c967dea4d413cd / bundle.js

41677 bytesRaw
1!function(){var e,t,n,r=e={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var a,h=[],u=!1,c=-1;function l(){u&&a&&(u=!1,a.length?h=a.concat(h):c=-1,h.length&&f())}function f(){if(!u){var e=s(l);u=!0;for(var t=h.length;t;){for(a=h,h=[];++c<t;)a&&a[c].run();c=-1,t=h.length}a=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new p(e,t)),1!==h.length||u||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=d,r.addListener=d,r.once=d,r.off=d,r.removeListener=d,r.removeAllListeners=d,r.emit=d,r.prependListener=d,r.prependOnceListener=d,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0};var m={};(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}m.resolve=function(){for(var r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s=o>=0?arguments[o]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},m.normalize=function(e){var i=m.isAbsolute(e),o="/"===r(e,-1);return(e=t(n(e.split("/"),function(e){return!!e}),!i).join("/"))||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},m.isAbsolute=function(e){return"/"===e.charAt(0)},m.join=function(){var e=Array.prototype.slice.call(arguments,0);return m.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))};var r="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,e);var v={exports:{}};function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(function(e){!function(t){var n="object"==typeof v.exports&&v.exports&&!v.exports.nodeType&&v.exports,r=v&&!v.nodeType&&v,i="object"==typeof e&&e;i.global!==i&&i.window!==i&&i.self!==i||(t=i);var o,s,a=2147483647,h=36,u=1,c=26,l=38,f=700,p=72,d=128,m="-",g=/^xn--/,y=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=h-u,_=Math.floor,E=String.fromCharCode;function O(e){throw new RangeError(b[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function S(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+T((e=e.replace(w,".")).split("."),t).join(".")}function x(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function N(e){return T(e,function(e){var t="";return e>65535&&(t+=E((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+E(e)}).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function L(e,t,n){var r=0;for(e=n?_(e/f):e>>1,e+=_(e/t);e>A*c>>1;r+=h)e=_(e/A);return _(r+(A+1)*e/(e+l))}function k(e){var t,n,r,i,o,s,l,f,v,g,y,w=[],b=e.length,A=0,E=d,T=p;for((n=e.lastIndexOf(m))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&O("not-basic"),w.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<b;){for(o=A,s=1,l=h;i>=b&&O("invalid-input"),((f=(y=e.charCodeAt(i++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:h)>=h||f>_((a-A)/s))&&O("overflow"),A+=f*s,!(f<(v=l<=T?u:l>=T+c?c:l-T));l+=h)s>_(a/(g=h-v))&&O("overflow"),s*=g;T=L(A-o,t=w.length+1,0==o),_(A/t)>a-E&&O("overflow"),E+=_(A/t),A%=t,w.splice(A++,0,E)}return N(w)}function R(e){var t,n,r,i,o,s,l,f,v,g,y,w,b,A,T,S=[];for(w=(e=x(e)).length,t=d,n=0,o=p,s=0;s<w;++s)(y=e[s])<128&&S.push(E(y));for(r=i=S.length,i&&S.push(m);r<w;){for(l=a,s=0;s<w;++s)(y=e[s])>=t&&y<l&&(l=y);for(l-t>_((a-n)/(b=r+1))&&O("overflow"),n+=(l-t)*b,t=l,s=0;s<w;++s)if((y=e[s])<t&&++n>a&&O("overflow"),y==t){for(f=n,v=h;!(f<(g=v<=o?u:v>=o+c?c:v-o));v+=h)T=f-g,A=h-g,S.push(E(C(g+T%A,0))),f=_(T/A);S.push(E(C(f,0))),o=L(n,b,r==i),n=0,++r}++n,++t}return S.join("")}if(o={version:"1.4.1",ucs2:{decode:x,encode:N},decode:k,encode:R,toASCII:function(e){return S(e,function(e){return y.test(e)?"xn--"+R(e):e})},toUnicode:function(e){return S(e,function(e){return g.test(e)?k(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return o});else if(n&&r)if(v.exports==n)r.exports=o;else for(s in o)o.hasOwnProperty(s)&&(n[s]=o[s]);else t.punycode=o}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),v=v.exports;var y=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},w=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},b=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function A(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var _=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},E={parse:function(e,t,n,r){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=e.length;s>0&&a>s&&(a=s);for(var h=0;h<a;++h){var u,c,l,f,p=e[h].replace(o,"%20"),d=p.indexOf(n);d>=0?(u=p.substr(0,d),c=p.substr(d+1)):(u=p,c=""),l=decodeURIComponent(u),f=decodeURIComponent(c),g(i,l)?y(i[l])?i[l].push(f):i[l]=[i[l],f]:i[l]=f}return i},stringify:function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?A(_(e),function(r){var i=encodeURIComponent(w(r))+n;return b(e[r])?A(e[r],function(e){return i+encodeURIComponent(w(e))}).join(t):i+encodeURIComponent(w(e[r]))}).join(t):r?encodeURIComponent(w(r))+n+encodeURIComponent(w(e)):""}},O={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}},T={};function S(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}T.format=function(e){return O.isString(e)&&(e=U(e)),e instanceof S?e.format():S.prototype.format.call(e)};var x=/^([a-z0-9.+-]+:)/i,N=/:[0-9]*$/,C=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,L=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),k=["'"].concat(L),R=["%","/","?",";","#"].concat(k),j=["/","?","#"],I=/^[+a-z0-9A-Z_-]{0,63}$/,P=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,M={javascript:!0,"javascript:":!0},D={javascript:!0,"javascript:":!0},q={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function U(e,t,n){if(e&&O.isObject(e)&&e instanceof S)return e;var r=new S;return r.parse(e,t,n),r}S.prototype.parse=function(e,t,n){if(!O.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),i=-1!==r&&r<e.indexOf("#")?"?":"#",o=e.split(i);o[0]=o[0].replace(/\\/g,"/");var s=e=o.join(i);if(s=s.trim(),!n&&1===e.split("#").length){var a=C.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=t?E.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=x.exec(s);if(h){var u=(h=h[0]).toLowerCase();this.protocol=u,s=s.substr(h.length)}if(n||h||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===s.substr(0,2);!c||h&&D[h]||(s=s.substr(2),this.slashes=!0)}if(!D[h]&&(c||h&&!q[h])){for(var l,f,p=-1,d=0;d<j.length;d++)-1!==(m=s.indexOf(j[d]))&&(-1===p||m<p)&&(p=m);for(-1!==(f=-1===p?s.lastIndexOf("@"):s.lastIndexOf("@",p))&&(l=s.slice(0,f),s=s.slice(f+1),this.auth=decodeURIComponent(l)),p=-1,d=0;d<R.length;d++){var m;-1!==(m=s.indexOf(R[d]))&&(-1===p||m<p)&&(p=m)}-1===p&&(p=s.length),this.host=s.slice(0,p),s=s.slice(p),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var y=this.hostname.split(/\./),w=(d=0,y.length);d<w;d++){var b=y[d];if(b&&!b.match(I)){for(var A="",_=0,T=b.length;_<T;_++)b.charCodeAt(_)>127?A+="x":A+=b[_];if(!A.match(I)){var S=y.slice(0,d),N=y.slice(d+1),L=b.match(P);L&&(S.push(L[1]),N.unshift(L[2])),N.length&&(s="/"+N.join(".")+s),this.hostname=S.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=v.toASCII(this.hostname));var U=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+U,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!M[u])for(d=0,w=k.length;d<w;d++){var G=k[d];if(-1!==s.indexOf(G)){var V=encodeURIComponent(G);V===G&&(V=escape(G)),s=s.split(G).join(V)}}var F=s.indexOf("#");-1!==F&&(this.hash=s.substr(F),s=s.slice(0,F));var W=s.indexOf("?");if(-1!==W?(this.search=s.substr(W),this.query=s.substr(W+1),t&&(this.query=E.parse(this.query)),s=s.slice(0,W)):t&&(this.search="",this.query={}),s&&(this.pathname=s),q[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var H=this.search||"";this.path=U+H}return this.href=this.format(),this},S.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&O.isObject(this.query)&&Object.keys(this.query).length&&(o=E.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||q[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+r},S.prototype.resolve=function(e){return this.resolveObject(U(e,!1,!0)).format()},S.prototype.resolveObject=function(e){if(O.isString(e)){var t=new S;t.parse(e,!1,!0),e=t}for(var n=new S,r=Object.keys(this),i=0;i<r.length;i++){var o=r[i];n[o]=this[o]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),a=0;a<s.length;a++){var h=s[a];"protocol"!==h&&(n[h]=e[h])}return q[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!q[e.protocol]){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];n[l]=e[l]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||D[e.protocol])n.pathname=e.pathname;else{for(var f=(e.pathname||"").split("/");f.length&&!(e.host=f.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),n.pathname=f.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var p=n.pathname||"",d=n.search||"";n.path=p+d}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var m=n.pathname&&"/"===n.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),g=v||m||n.host&&e.pathname,y=g,w=n.pathname&&n.pathname.split("/")||[],b=(f=e.pathname&&e.pathname.split("/")||[],n.protocol&&!q[n.protocol]);if(b&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===f[0]?f[0]=e.host:f.unshift(e.host)),e.host=null),g=g&&(""===f[0]||""===w[0])),v)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,w=f;else if(f.length)w||(w=[]),w.pop(),w=w.concat(f),n.search=e.search,n.query=e.query;else if(!O.isNullOrUndefined(e.search))return b&&(n.hostname=n.host=w.shift(),(x=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=x.shift(),n.host=n.hostname=x.shift())),n.search=e.search,n.query=e.query,O.isNull(n.pathname)&&O.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var A=w.slice(-1)[0],_=(n.host||e.host||w.length>1)&&("."===A||".."===A)||""===A,E=0,T=w.length;T>=0;T--)"."===(A=w[T])?w.splice(T,1):".."===A?(w.splice(T,1),E++):E&&(w.splice(T,1),E--);if(!g&&!y)for(;E--;E)w.unshift("..");!g||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),_&&"/"!==w.join("/").substr(-1)&&w.push("");var x,N=""===w[0]||w[0]&&"/"===w[0].charAt(0);return b&&(n.hostname=n.host=N?"":w.length?w.shift():"",(x=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=x.shift(),n.host=n.hostname=x.shift())),(g=g||n.host&&w.length)&&!N&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),O.isNull(n.pathname)&&O.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},S.prototype.parseHost=function(){var e=this.host,t=N.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var $=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)G.call(n,r)&&(e[r]=n[r])}return e},G=Object.prototype.hasOwnProperty,V={};(function(e){V=n;var t=n.events={INSTALLED:"sw:installed",UPDATED:"sw:updated",REDUNDANT:"sw:redundant",POST_MESSAGE:"sw:postMessage",MESSAGE:"sw:message",SYNC:"sw:sync",NOTIFICATION_REQUEST:"sw:notificationRequest",ERROR:"log:error"};function n(n,r){return n=n||"/sw.js",r=r||{},function(i,o){o.on(i.events.DOMCONTENTLOADED,function(){if((r=$({scope:"/"},r)).electron){r.scope=m.join(e,r.scope),n=T.format({pathname:m.join(e,n.replace(/^\//,"")),protocol:"file:",slashes:!0}),delete r.electron}if(window.onmessage=function(e){o.emit(t.MESSAGE,{data:e.data,channel:"window",port:null})},window.MessageChannel){var s=new MessageChannel;s.port1.onmessage=function(e){o.emit(t.MESSAGE,{data:e.data,channel:"messageChannel",port:"port1"})},s.port2.onmessage=function(e){o.emit(t.MESSAGE,{data:e.data,channel:"messageChannel",port:"port2"})}}o.on(t.NOTIFICATION_REQUEST,function(e){Notification.requestPermission(function(t){"function"==typeof t&&e(t)})}),navigator.serviceWorker&&navigator.onLine&&(navigator.serviceWorker.onmessage=function(e){o.emit(t.MESSAGE,{data:e.data,channel:"navigator.serviceWorker",port:null})},navigator.serviceWorker.register(n,r).then(function(e){e.onupdatefound=function(){var n=e.installing;n.onstatechange=function(){"installed"===n.state?navigator.serviceWorker.controller?o.emit(t.UPDATED,e):o.emit(t.INSTALLED,e):"redundant"===n.state&&o.emit(t.REDUNDANT,e)}},e.sync&&function(e){e.sync.getTags().then(function(e){i.syncTags=e}).catch(function(e){o.emit(t.ERROR,e)})}(e)}).catch(function(e){o.emit(t.ERROR,e)}),navigator.serviceWorker.ready.then(function(e){new Promise(function(n){var r=e.active;"activated"!==r.state?(r.addEventListener("statechange",n,{once:!0}),o.on(t.POST_MESSAGE,function(e){r.postMessage(e)})):n()}).then(function(){e.navigationPreload&&e.navigationPreload.enable()}),o.on(t.SYNC,function(n){e.sync.register(n).then(function(){return e.sync.getTags()}).then(function(e){i.syncTags=e}).catch(function(e){o.emit(t.ERROR,e)})})}).catch(function(e){o.emit(t.ERROR,e)}))})}}}).call(this,"/node_modules/choo-service-worker");var F=/\n[\s]+$/,W=/^\n[\s]+/,H=/[\s]+$/,B=/^[\s]+/,z=/[\n\s]+/g,K=["a","abbr","b","bdi","bdo","br","cite","data","dfn","em","i","kbd","mark","q","rp","rt","rtc","ruby","s","amp","small","span","strong","sub","sup","time","u","var","wbr"],Y=["code","pre","textarea"],Z=function e(t,n){if(Array.isArray(n))for(var r,i,o=t.nodeName.toLowerCase(),s=!1,a=0,h=n.length;a<h;a++){var u=n[a];if(Array.isArray(u))e(t,u);else{("number"==typeof u||"boolean"==typeof u||"function"==typeof u||u instanceof Date||u instanceof RegExp)&&(u=u.toString());var c=t.childNodes[t.childNodes.length-1];if("string"==typeof u)s=!0,c&&"#text"===c.nodeName?c.nodeValue+=u:(u=document.createTextNode(u),t.appendChild(u),c=u),a===h-1&&(s=!1,-1===K.indexOf(o)&&-1===Y.indexOf(o)?""===(r=c.nodeValue.replace(W,"").replace(H,"").replace(F,"").replace(z," "))?t.removeChild(c):c.nodeValue=r:-1===Y.indexOf(o)&&(i=0===a?"":" ",r=c.nodeValue.replace(W,i).replace(B," ").replace(H,"").replace(F,"").replace(z," "),c.nodeValue=r));else if(u&&u.nodeType){s&&(s=!1,-1===K.indexOf(o)&&-1===Y.indexOf(o)?""===(r=c.nodeValue.replace(W,"").replace(F,"").replace(z," "))?t.removeChild(c):c.nodeValue=r:-1===Y.indexOf(o)&&(r=c.nodeValue.replace(B," ").replace(W,"").replace(F,"").replace(z," "),c.nodeValue=r));var l=u.nodeName;l&&(o=l.toLowerCase()),t.appendChild(u)}}}},Q={class:"className",for:"htmlFor","http-equiv":"httpEquiv"},X=1,J=2,ee=3,te=4,ne=5,re=6,ie=7,oe=8,se=9,ae=10,he=11,ue=12,ce=13;function le(e){return e===se||e===ae}Object.prototype.hasOwnProperty;var fe=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","!--","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9\x7f-\uffff_:-]+)*$"),pe={},de="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xlink",ve=["autofocus","checked","defaultchecked","disabled","formnovalidate","indeterminate","readonly","required","selected","willvalidate"],ge="!--",ye=["svg","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"];function we(e,t,n){var r;-1!==ye.indexOf(e)&&(t.namespace=de);var i=!1;if(t.namespace&&(i=t.namespace,delete t.namespace),i)r=document.createElementNS(i,e);else{if(e===ge)return document.createComment(t.comment);r=document.createElement(e)}for(var o in t)if(t.hasOwnProperty(o)){var s=o.toLowerCase(),a=t[o];if("classname"===s&&(s="class",o="class"),"htmlFor"===o&&(o="for"),-1!==ve.indexOf(s))if("true"===a)a=s;else if("false"===a)continue;"on"===s.slice(0,2)?r[o]=a:i?"xlink:href"===o?r.setAttributeNS(me,o,a):/^xmlns($|:)/i.test(o)||r.setAttributeNS(null,o,a):r.setAttribute(o,a)}return Z(r,n),r}(pe=function(e,t){t||(t={});var n=t.concat||function(e,t){return String(e)+String(t)};return!1!==t.attrToProp&&(e=function(e){return function(t,n,r){for(var i in n)i in Q&&(n[Q[i]]=n[i],delete n[i]);return e(t,n,r)}}(e)),function(i){for(var o=X,s="",a=arguments.length,h=[],u=0;u<i.length;u++)if(u<a-1){var c=arguments[u+1],l=E(i[u]),f=o;f===ae&&(f=oe),f===se&&(f=oe),f===ie&&(f=oe),f===te&&(f=ne),f===J?"/"===s?(l.push([J,"/",c]),s=""):l.push([J,c]):l.push([0,f,c]),h.push.apply(h,l)}else h.push.apply(h,E(i[u]));var p,d=[null,{},[]],m=[[d,-1]];for(u=0;u<h.length;u++){var v=m[m.length-1][0],g=(l=h[u])[0];if(g===J&&/^\//.test(l[1])){var y=m[m.length-1][1];m.length>1&&(m.pop(),m[m.length-1][0][2][y]=e(v[0],v[1],v[2].length?v[2]:void 0))}else if(g===J){var w=[l[1],{},[]];v[2].push(w),m.push([w,v[2].length-1])}else if(g===ne||0===g&&l[1]===ne){for(var b,A="";u<h.length;u++)if(h[u][0]===ne)A=n(A,h[u][1]);else{if(0!==h[u][0]||h[u][1]!==ne)break;if("object"!=typeof h[u][2]||A)A=n(A,h[u][2]);else for(b in h[u][2])h[u][2].hasOwnProperty(b)&&!v[1][b]&&(v[1][b]=h[u][2][b])}h[u][0]===he&&u++;for(var _=u;u<h.length;u++)if(h[u][0]===oe||h[u][0]===ne)v[1][A]?""===h[u][1]||(v[1][A]=n(v[1][A],h[u][1])):v[1][A]=r(h[u][1]);else{if(0!==h[u][0]||h[u][1]!==oe&&h[u][1]!==ne){!A.length||v[1][A]||u!==_||h[u][0]!==ee&&h[u][0]!==ue||(v[1][A]=A.toLowerCase()),h[u][0]===ee&&u--;break}v[1][A]?""===h[u][2]||(v[1][A]=n(v[1][A],h[u][2])):v[1][A]=r(h[u][2])}}else if(g===ne)v[1][l[1]]=!0;else if(0===g&&l[1]===ne)v[1][l[2]]=!0;else if(g===ee)p=v[0],fe.test(p)&&m.length&&(y=m[m.length-1][1],m.pop(),m[m.length-1][0][2][y]=e(v[0],v[1],v[2].length?v[2]:void 0));else if(0===g&&l[1]===X)void 0===l[2]||null===l[2]?l[2]="":l[2]||(l[2]=n("",l[2])),Array.isArray(l[2][0])?v[2].push.apply(v[2],l[2]):v[2].push(l[2]);else if(g===X)v[2].push(l[1]);else if(g!==he&&g!==ue)throw new Error("unhandled: "+g)}if(d[2].length>1&&/^\s*$/.test(d[2][0])&&d[2].shift(),d[2].length>2||2===d[2].length&&/\S/.test(d[2][1]))throw new Error("multiple root elements must be wrapped in an enclosing tag");return Array.isArray(d[2][0])&&"string"==typeof d[2][0][0]&&Array.isArray(d[2][0][2])&&(d[2][0]=e(d[2][0][0],d[2][0][1],d[2][0][2])),d[2][0];function E(e){var n=[];o===ie&&(o=te);for(var r=0;r<e.length;r++){var i=e.charAt(r);o===X&&"<"===i?(s.length&&n.push([X,s]),s="",o=J):">"!==i||le(o)||o===ce?o===ce&&/-$/.test(s)&&"-"===i?(t.comments&&n.push([oe,s.substr(0,s.length-1)],[ee]),s="",o=X):o===J&&/^!--$/.test(s)?(t.comments&&n.push([J,s],[ne,"comment"],[he]),s=i,o=ce):o===X||o===ce?s+=i:o===J&&"/"===i&&s.length||(o===J&&/\s/.test(i)?(s.length&&n.push([J,s]),s="",o=te):o===J?s+=i:o===te&&/[^\s"'=/]/.test(i)?(o=ne,s=i):o===te&&/\s/.test(i)?(s.length&&n.push([ne,s]),n.push([ue])):o===ne&&/\s/.test(i)?(n.push([ne,s]),s="",o=re):o===ne&&"="===i?(n.push([ne,s],[he]),s="",o=ie):o===ne?s+=i:o!==re&&o!==te||"="!==i?o!==re&&o!==te||/\s/.test(i)?o===ie&&'"'===i?o=ae:o===ie&&"'"===i?o=se:o===ae&&'"'===i?(n.push([oe,s],[ue]),s="",o=te):o===se&&"'"===i?(n.push([oe,s],[ue]),s="",o=te):o!==ie||/\s/.test(i)?o===oe&&/\s/.test(i)?(n.push([oe,s],[ue]),s="",o=te):o!==oe&&o!==se&&o!==ae||(s+=i):(o=oe,r--):(n.push([ue]),/[\w-]/.test(i)?(s+=i,o=ne):o=te):(n.push([he]),o=ie)):(o===J&&s.length?n.push([J,s]):o===ne?n.push([ne,s]):o===oe&&s.length&&n.push([oe,s]),n.push([ee]),s="",o=X)}return o===X&&s.length?(n.push([X,s]),s=""):o===oe&&s.length?(n.push([oe,s]),s=""):o===ae&&s.length?(n.push([oe,s]),s=""):o===se&&s.length?(n.push([oe,s]),s=""):o===ne&&(n.push([ne,s]),s=""),n}};function r(e){return"function"==typeof e?e:"string"==typeof e?e:e&&"object"==typeof e?e:n("",e)}}(we,{comments:!0})).default=pe,pe.createElement=we;var be=pe,Ae={};function _e(e){if(!(this instanceof _e))return new _e(e);"number"==typeof e&&(e={max:e}),e||(e={}),this.cache={},this.head=this.tail=null,this.length=0,this.max=e.max||1e3,this.maxAge=e.maxAge||0}Ae=_e,Object.defineProperty(_e.prototype,"keys",{get:function(){return Object.keys(this.cache)}}),_e.prototype.clear=function(){this.cache={},this.head=this.tail=null,this.length=0},_e.prototype.remove=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];return delete this.cache[e],this._unlink(e,t.prev,t.next),t.value}},_e.prototype._unlink=function(e,t,n){this.length--,0===this.length?this.head=this.tail=null:this.head===e?(this.head=t,this.cache[this.head].next=null):this.tail===e?(this.tail=n,this.cache[this.tail].prev=null):(this.cache[t].next=n,this.cache[n].prev=t)},_e.prototype.peek=function(e){if(this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return t.value}},_e.prototype.set=function(e,t){var n;if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){if((n=this.cache[e]).value=t,this.maxAge&&(n.modified=Date.now()),e===this.head)return t;this._unlink(e,n.prev,n.next)}else n={value:t,modified:0,next:null,prev:null},this.maxAge&&(n.modified=Date.now()),this.cache[e]=n,this.length===this.max&&this.evict();return this.length++,n.next=null,n.prev=this.head,this.head&&(this.cache[this.head].next=e),this.head=e,this.tail||(this.tail=e),t},_e.prototype._checkAge=function(e,t){return!(this.maxAge&&Date.now()-t.modified>this.maxAge&&(this.remove(e),1))},_e.prototype.get=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return this.head!==e&&(e===this.tail?(this.tail=t.next,this.cache[this.tail].prev=null):this.cache[t.prev].next=t.next,this.cache[t.next].prev=t.prev,this.cache[this.head].next=e,t.prev=this.head,t.next=null,this.head=e),t.value}},_e.prototype.evict=function(){this.tail&&this.remove(this.tail)};var Ee={};function Oe(e,t,n){this.cache="number"==typeof n?new Ae(n):n||new Ae(100),this.state=e,this.emit=t}function Te(e){return new(e.bind.apply(e,arguments))}Ee=Oe,Oe.prototype.render=function(e,t){var n=this.cache.get(t);if(!n){for(var r=[],i=2,o=arguments.length;i<o;i++)r.push(arguments[i]);r.unshift(e,t,this.state,this.emit),n=Te.apply(Te,r),this.cache.set(t,n)}return n};var Se=function(e){var t=document.readyState;if("complete"===t||"interactive"===t)return setTimeout(e,0);document.addEventListener("DOMContentLoaded",function(){e()})},xe="undefined"!=typeof window;function Ne(e){this.hasWindow=e,this.hasIdle=this.hasWindow&&window.requestIdleCallback,this.method=this.hasIdle?window.requestIdleCallback.bind(window):this.setTimeout,this.scheduled=!1,this.queue=[]}Ne.prototype.push=function(e){this.queue.push(e),this.schedule()},Ne.prototype.schedule=function(){if(!this.scheduled){this.scheduled=!0;var e=this;this.method(function(t){for(;e.queue.length&&t.timeRemaining()>0;)e.queue.shift()(t);e.scheduled=!1,e.queue.length&&e.schedule()})}},Ne.prototype.setTimeout=function(e){setTimeout(e,0,{timeRemaining:function(){return 1}})};var Ce,Le=function(){var e;return xe?(window._nanoScheduler||(window._nanoScheduler=new Ne(!0)),e=window._nanoScheduler):e=new Ne,e}();ke.disabled=!0;try{Ce=window.performance,ke.disabled="true"===window.localStorage.DISABLE_NANOTIMING||!Ce.mark}catch(e){}function ke(e){if(ke.disabled)return Re;var t=(1e4*Ce.now()).toFixed()%Number.MAX_SAFE_INTEGER,n="start-"+t+"-"+e;function r(r){var i="end-"+t+"-"+e;Ce.mark(i),Le.push(function(){var o=null;try{var s=e+" ["+t+"]";Ce.measure(s,n,i),Ce.clearMarks(n),Ce.clearMarks(i)}catch(e){o=e}r&&r(o,e)})}return Ce.mark(n),r.uuid=t,r}function Re(e){e&&Le.push(function(){e(new Error("nanotiming: performance API unavailable"))})}var je=ke,Ie=function(e,t,n){var r,i=e.length;if(!(t>=i||0===n)){var o=i-(n=t+n>i?i-t:n);for(r=t;r<o;++r)e[r]=e[r+n];e.length=o}},Pe={};function Me(e){if(!(this instanceof Me))return new Me(e);this._name=e||"nanobus",this._starListeners=[],this._listeners={}}Pe=Me,Me.prototype.emit=function(e){for(var t=[],n=1,r=arguments.length;n<r;n++)t.push(arguments[n]);var i=je(this._name+"('"+e+"')"),o=this._listeners[e];return o&&o.length>0&&this._emit(this._listeners[e],t),this._starListeners.length>0&&this._emit(this._starListeners,e,t,i.uuid),i(),this},Me.prototype.on=Me.prototype.addListener=function(e,t){return"*"===e?this._starListeners.push(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)),this},Me.prototype.prependListener=function(e,t){return"*"===e?this._starListeners.unshift(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].unshift(t)),this},Me.prototype.once=function(e,t){var n=this;return this.on(e,function r(){t.apply(n,arguments),n.removeListener(e,r)}),this},Me.prototype.prependOnceListener=function(e,t){var n=this;return this.prependListener(e,function r(){t.apply(n,arguments),n.removeListener(e,r)}),this},Me.prototype.removeListener=function(e,t){return"*"===e?(this._starListeners=this._starListeners.slice(),n(this._starListeners,t)):(void 0!==this._listeners[e]&&(this._listeners[e]=this._listeners[e].slice()),n(this._listeners[e],t));function n(e,t){if(e){var n=e.indexOf(t);return-1!==n?(Ie(e,n,1),!0):void 0}}},Me.prototype.removeAllListeners=function(e){return e?"*"===e?this._starListeners=[]:this._listeners[e]=[]:(this._starListeners=[],this._listeners={}),this},Me.prototype.listeners=function(e){var t="*"!==e?this._listeners[e]:this._starListeners,n=[];if(t)for(var r=t.length,i=0;i<r;i++)n.push(t[i]);return n},Me.prototype._emit=function(e,t,n,r){if(void 0!==e&&0!==e.length){void 0===n&&(n=t,t=null),t&&(n=void 0!==r?[t].concat(n,r):[t].concat(n));for(var i=e.length,o=0;o<i;o++){var s=e[o];s.apply(s,n)}}};var De=/(noopener|noreferrer) (noopener|noreferrer)/,qe=/^[\w-_]+:/,Ue=function(){return window.location.pathname.replace(/\/$/,"")+window.location.hash.replace(/^#/,"/")},$e=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmousemove","onmouseout","onmouseenter","onmouseleave","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ondragstart","ondrag","ondragenter","ondragleave","ondragover","ondrop","ondragend","onkeydown","onkeypress","onkeyup","onunload","onabort","onerror","onresize","onscroll","onselect","onchange","onsubmit","onreset","onfocus","onblur","oninput","oncontextmenu","onfocusin","onfocusout"],Ge=$e.length;function Ve(e,t,n){e[n]!==t[n]&&(t[n]=e[n],e[n]?t.setAttribute(n,""):t.removeAttribute(n))}var Fe=function(e,t){var n=e.nodeType,r=e.nodeName;1===n&&function(e,t){for(var n=t.attributes,r=e.attributes,i=null,o=null,s=null,a=null,h=r.length-1;h>=0;--h)s=(a=r[h]).name,i=a.namespaceURI,o=a.value,i?(s=a.localName||s,t.getAttributeNS(i,s)!==o&&t.setAttributeNS(i,s,o)):t.hasAttribute(s)?t.getAttribute(s)!==o&&("null"===o||"undefined"===o?t.removeAttribute(s):t.setAttribute(s,o)):t.setAttribute(s,o);for(var u=n.length-1;u>=0;--u)!1!==(a=n[u]).specified&&(s=a.name,(i=a.namespaceURI)?(s=a.localName||s,e.hasAttributeNS(i,s)||t.removeAttributeNS(i,s)):e.hasAttributeNS(null,s)||t.removeAttribute(s))}(e,t),3!==n&&8!==n||t.nodeValue!==e.nodeValue&&(t.nodeValue=e.nodeValue),"INPUT"===r?function(e,t){var n=e.value,r=t.value;Ve(e,t,"checked"),Ve(e,t,"disabled"),n!==r&&(t.setAttribute("value",n),t.value=n),"null"===n&&(t.value="",t.removeAttribute("value")),e.hasAttributeNS(null,"value")?"range"===t.type&&(t.value=n):t.removeAttribute("value")}(e,t):"OPTION"===r?function(e,t){Ve(e,t,"selected")}(e,t):"TEXTAREA"===r&&function(e,t){var n=e.value;if(n!==t.value&&(t.value=n),t.firstChild&&t.firstChild.nodeValue!==n){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}}(e,t),function(e,t){for(var n=0;n<Ge;n++){var r=$e[n];e[r]?t[r]=e[r]:t[r]&&(t[r]=void 0)}}(e,t)},We=3;function He(e,t){return e.id?e.id===t.id:e.isSameNode?e.isSameNode(t):e.tagName===t.tagName&&e.type===We&&e.nodeValue===t.nodeValue}var Be=function(e,t){return function e(t,n){return n?t?t.isSameNode&&t.isSameNode(n)?n:t.tagName!==n.tagName?t:(Fe(t,n),function(t,n){for(var r,i,o,s,a=0,h=0;r=n.childNodes[h],i=t.childNodes[h-a],r||i;h++)if(i)if(r)if(He(i,r))(o=e(i,r))!==r&&(n.replaceChild(o,r),a++);else{s=null;for(var u=h;u<n.childNodes.length;u++)if(He(n.childNodes[u],i)){s=n.childNodes[u];break}s?((o=e(i,s))!==s&&a++,n.insertBefore(o,r)):i.id||r.id?(n.insertBefore(i,r),a++):(o=e(i,r))!==r&&(n.replaceChild(o,r),a++)}else n.appendChild(i),a++;else n.removeChild(r),h--}(t,n),n):null:t}(t,e)},ze=/([^?=&]+)(=([^&]*))?/g,Ke=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)Ye.call(n,r)&&(e[r]=n[r])}return e},Ye=Object.prototype.hasOwnProperty,Ze={};function Qe(){if(!(this instanceof Qe))return new Qe;this.trie={nodes:{}}}Ze=Qe,Qe.prototype.create=function(e){var t=e.replace(/^\//,"").split("/");return function e(n,r){var i=t.hasOwnProperty(n)&&t[n];if(!1===i)return r;var o=null;return/^:|^\*/.test(i)?(r.nodes.hasOwnProperty("$$")?o=r.nodes.$$:(o={nodes:{}},r.nodes.$$=o),"*"===i[0]&&(r.wildcard=!0),r.name=i.replace(/^:|^\*/,"")):r.nodes.hasOwnProperty(i)?o=r.nodes[i]:(o={nodes:{}},r.nodes[i]=o),e(n+1,o)}(0,this.trie)},Qe.prototype.match=function(e){var t=e.replace(/^\//,"").split("/"),n={},r=function e(r,i){if(void 0!==i){var o=t[r];if(void 0===o)return i;if(i.nodes.hasOwnProperty(o))return e(r+1,i.nodes[o]);if(i.name){try{n[i.name]=decodeURIComponent(o)}catch(t){return e(r,void 0)}return e(r+1,i.nodes.$$)}if(i.wildcard){try{n.wildcard=decodeURIComponent(t.slice(r).join("/"))}catch(t){return e(r,void 0)}return i.nodes.$$}return e(r+1)}}(0,this.trie);if(r)return(r=Ke(r)).params=n,r},Qe.prototype.mount=function(e,t){var n=e.replace(/^\//,"").split("/"),r=null,i=null;if(1===n.length)i=n[0],r=this.create(i);else{var o=n.join("/");i=n[0],r=this.create(o)}$(r.nodes,t.nodes),t.name&&(r.name=t.name),r.nodes[""]&&(Object.keys(r.nodes[""]).forEach(function(e){"nodes"!==e&&(r[e]=r.nodes[""][e])}),$(r.nodes,r.nodes[""].nodes),delete r.nodes[""].nodes)};var Xe=function e(t){if(!(this instanceof e))return new e(t);var n=(t||"").replace(/^\//,""),r=Ze();return i._trie=r,i.on=function(e,t){(e=e||"/",t.route=e,t&&t._wayfarer&&t._trie)?r.mount(e,t._trie.trie):r.create(e).cb=t;return i},i.emit=i,i.match=o,i._wayfarer=!0,i;function i(e){var t=o(e),n=new Array(arguments.length);n[0]=t.params;for(var r=1;r<n.length;r++)n[r]=arguments[r];return t.cb.apply(t.cb,n)}function o(e){var t=r.match(e);if(t&&t.cb)return new s(t);var i=r.match(n);if(i&&i.cb)return new s(i);throw new Error("route '"+e+"' did not match")}function s(e){this.cb=e.cb,this.route=e.cb.route,this.params=e.params}},Je={},et=/file:\/\//.test("object"==typeof window&&window.location&&window.location.origin),tt=new RegExp("^(file://|/)(.*.html?/?)?"),nt=new RegExp("^(http(s)?(://))?(www.)?[a-zA-Z0-9-_.]+(:[0-9]{1,5})?(/{1})?"),rt=new RegExp("#"),it=new RegExp("[?].*$");function ot(e){if(!(this instanceof ot))return new ot(e);e=e||{},this.router=Xe(e.default||"/404")}function st(e,t){return e=t?e.replace(tt,""):e.replace(nt,""),decodeURI(e.replace(it,"").replace(rt,"/"))}Je=ot,ot.prototype.on=function(e,t){e=e.replace(/^[#/]/,""),this.router.on(e,t)},ot.prototype.emit=function(e){return e=st(e,et),this.router.emit(e)},ot.prototype.match=function(e){return e=st(e,et),this.router.match(e)};var at=ut,ht={};function ut(e){if(!(this instanceof ut))return new ut(e);e=e||{};var t=this;this._events={DOMCONTENTLOADED:"DOMContentLoaded",DOMTITLECHANGE:"DOMTitleChange",REPLACESTATE:"replaceState",PUSHSTATE:"pushState",NAVIGATE:"navigate",POPSTATE:"popState",RENDER:"render"},this._historyEnabled=void 0===e.history||e.history,this._hrefEnabled=void 0===e.href||e.href,this._hasWindow="undefined"!=typeof window,this._createLocation=Ue,this._cache=e.cache,this._loaded=!1,this._stores=[],this._tree=null;var n={events:this._events,components:{}};this._hasWindow?(this.state=window.initialState?Ke(window.initialState,n):n,delete window.initialState):this.state=n,this.router=Je({curry:!0}),this.emitter=Pe("choo.emit"),this.emit=this.emitter.emit.bind(this.emitter),this._hasWindow&&(this.state.title=document.title),this.emitter.prependListener(this._events.DOMTITLECHANGE,function(e){t.state.title=e,t._hasWindow&&(document.title=e)})}ut.prototype.route=function(e,t){this.router.on(e,t)},ut.prototype.use=function(e){var t=this;this._stores.push(function(n){var r="choo.use";r=e.storeName?r+"("+e.storeName+")":r;var i=je(r);e(n,t.emitter,t),i()})},ut.prototype.start=function(){var e,t,n=this;return this._historyEnabled&&(this.emitter.prependListener(this._events.NAVIGATE,function(){n._matchRoute(),n._loaded&&(n.emitter.emit(n._events.RENDER),setTimeout(function(e,t){if(e)try{var n=document.querySelector(e);n&&n.scrollIntoView(t)}catch(e){}}.bind(null,window.location.hash),0))}),this.emitter.prependListener(this._events.POPSTATE,function(){n.emitter.emit(n._events.NAVIGATE)}),this.emitter.prependListener(this._events.PUSHSTATE,function(e){window.history.pushState(ht,null,e),n.emitter.emit(n._events.NAVIGATE)}),this.emitter.prependListener(this._events.REPLACESTATE,function(e){window.history.replaceState(ht,null,e),n.emitter.emit(n._events.NAVIGATE)}),window.onpopstate=function(){n.emitter.emit(n._events.POPSTATE)},n._hrefEnabled&&(e=function(e){var t=e.href;t!==window.location.href&&n.emitter.emit(n._events.PUSHSTATE,t)},t=t||window.document,window.addEventListener("click",function(n){if(!(n.button&&0!==n.button||n.ctrlKey||n.metaKey||n.altKey||n.shiftKey||n.defaultPrevented)){var r=function e(n){if(n&&n!==t)return"a"!==n.localName||void 0===n.href?e(n.parentNode):n}(n.target);r&&(window.location.origin!==r.origin||r.hasAttribute("download")||"_blank"===r.getAttribute("target")&&De.test(r.getAttribute("rel"))||qe.test(r.getAttribute("href"))||(n.preventDefault(),e(r)))}}))),this._setCache(this.state),this._stores.forEach(function(e){e(n.state)}),this._matchRoute(),this._tree=this._prerender(this.state),this.emitter.prependListener(n._events.RENDER,function(e,t){t||(t=window.requestAnimationFrame);var n=!1,r=null;return function(){null!==r||n||(n=!0,t(function(){n=!1;for(var t=r.length,i=new Array(t),o=0;o<t;o++)i[o]=r[o];e.apply(e,i),r=null})),r=arguments}}(function(){var e=je("choo.render"),t=n._prerender(n.state),r=je("choo.morph");Be(n._tree,t),r(),e()})),Se(function(){n.emitter.emit(n._events.DOMCONTENTLOADED),n._loaded=!0}),this._tree},ut.prototype.mount=function(e){if("object"!=typeof window)return this.selector=e,this;var t=this;Se(function(){var n=je("choo.render"),r=t.start();t._tree="string"==typeof e?document.querySelector(e):e;var i=je("choo.morph");Be(t._tree,r),i(),n()})},ut.prototype.toString=function(e,t){this.state=Ke(this.state,t||{});var n=this;this._setCache(this.state),this._stores.forEach(function(e){e(n.state)}),this._matchRoute(e);var r=this._prerender(this.state);return"string"==typeof r.outerHTML?r.outerHTML:r.toString()},ut.prototype._matchRoute=function(e){var t,n;e?(t=e.replace(/\?.+$/,""),n=e):(t=this._createLocation(),n=window.location.search);var r,i=this.router.match(t);return this._handler=i.cb,this.state.href=t,this.state.query=(r={},n.replace(/^.*\?/,"").replace(ze,function(e,t,n,i){r[decodeURIComponent(t)]=decodeURIComponent(i)}),r),this.state.route=i.route,this.state.params=i.params,this.state},ut.prototype._prerender=function(e){var t=je("choo.prerender('"+e.route+"')"),n=this._handler(e,this.emit);return t(),n},ut.prototype._setCache=function(e){var t=new Ee(e,this.emitter.emit.bind(this.emitter),this._cache);function n(e,n){for(var r=[],i=0,o=arguments.length;i<o;i++)r.push(arguments[i]);return t.render.apply(t,r)}e.cache=n,n.toJSON=function(){return null}};var ct=[{title:"background",link:"background",post:"here is what i want to say"},{title:"the future",link:"the-future",post:"here is another thing."},{title:"a third thing",link:"a-third-thing",post:"a third thing tooo."}];const lt=()=>be`
2 <div class='paper'>
3 <h1>music</h1>
4 <h1>visions</h1>
5 <a href='#songbook'>~enter~</a>
6 </div>
7 `,ft=at();ft.use(V()),ft.use(function(e,t){e.songs=ct,e.currentSong="",t.on("changeSong",function(e){setTimeout(()=>t.emit("pushState","/#songbook/"+e),5e3)})}),ft.route("/",lt),ft.route("#songbook",function(e,t){return""==e.currentSong?function(e,t){return be`
8 <div class='wrapper'>
9 <h1 class='title'>Music Visions</h1>
10 <div class=paper>
11 <ul>
12 ${e.songs.map(n)}
13 </ul>
14 <div class='fadingAnimation'></div>
15 </div>
16 </div>
17 `}(e):r(e);function n(e){return be`<li onclick=${i}>${e.title}</li>`}function r(e,t){var n=e.songs.find(t=>t.title==e.currentSong);return console.log(n),be`
18 <div class='wrapper'>
19 <div class='paper'>
20 <h1>${n.title}</h1>
21 <p>${n.post}></p>
22 <p onclick=${function(e){console.log(e)}}>x close x</a>
23 </div>
24 </div>
25 `}function i(e){console.log(e.target.innerHTML),r=e.target.innerHTML,t("changeSong",r)}}),ft.route("#songbook/:song",function(e,t){return console.log(e.currentSong),be`
26 <div>
27 <h1>YOU! YOU ARE ${e.currentSong}.</h1>
28 <a href='/'>go back home</a>
29 </div>
30 `}),ft.mount("div")}();

Built with git-ssb-web