/*! https://www.litejs.com/MIT-LICENSE.txt */
/*
    MIT License
    MIT License
    MIT License
*/
!function(t){function f(b,c){for(var a="_",e=b,l=b.split("->");1<l.length;)e=l.pop(),a=l.pop().match(/\w+/g)||"",l.length&&l.push("(function("+a+"){return("+e+")})");return new Function(a,(c&&(b=b.replace(u,"").match(/\b[a-z]\w*|\b_\w+/g))?"var "+b.uniq().join("='',")+"='';with("+c+"||{})":"")+"return("+e+")")}var m=Array.prototype,d=Function.prototype,r=String.prototype,h=Object,n=h.prototype.hasOwnProperty,p=d.call.bind(m.slice),q=[],u=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|this|arguments|\.\w+|\w+:/g;
d.construct=function(b){var c=b.length;return c?(q[c]||(q[c]=f("t a->new t(a["+h.keys(p(b)).join("],a[")+"])")))(this,b):new this};d.partial=function(){var b=this,c=p(arguments);return function(){return b.apply(this,c.concat.apply(c,arguments))}};d.byWords=function(b,c){var a=this;return function(){var e=this,l=e,d=arguments;(d[b|=0]||"").replace(c||/\S+/g,function(c){d[b]=c;l=a.apply(e,d)});return l}};d.byKeyVal=function(){var b=this;return function(c){var a,e=p(arguments);if("object"==typeof c)for(a in c)e[0]=
a,e[1]=c[a],a=b.apply(this,e);else a=b.apply(this,e);return a}};d.cache=function(b,c,a){var e=this,l=a||{},d=function(){var a=arguments,f=!!b||this instanceof d,h=c?c.apply(e,a):f+":"+a.length+":"+p(a);return h in l?l[h]:l[h]=f?e.construct(a):e.apply(this,a)};d.origin=e;d.cached=l;d.extend=function(){return e.extend.apply(e,arguments).cache(b,c,a)};d.prototype=e.prototype;return d};d.extend=function(){function b(){return a.apply(this,arguments)}var c,a=this,e=0;for(b.prototype=h.create(a.prototype);c=
arguments[e++];)h.merge(b.prototype,c);return b.prototype.constructor=b};h.each=function(b,c,a,e){if(b)for(e in b)n.call(b,e)&&c.call(a,b[e],e,b)};h.merge=function(b,c){for(var a,e=1;c=arguments[e++];)for(a in c)n.call(c,a)&&(b[a]=c[a]);return b};h.clone=function(b,c,a){if(b&&b.constructor===h){c={};for(a in b)n.call(b,a)&&(c[a]=h.clone(b[a]));b=c}return b};h.zip=function(b,c){return b.fold(function(a,e,b){a[e]=c[b];return a},{})};m.remove=function(){for(var b=this.length,c=p(arguments),a=-1;b--;)~c.indexOf(this[b])&&
this.splice(a=b,1);return a};m.each=m.forEach;m.fold=m.reduce;m.foldr=m.reduceRight;m.uniq=m.filter.partial(function(b,c,a){return c==a.indexOf(b)});m.pushUniq=function(b){return-1==this.indexOf(b)?this.push(b):!1};!function(b){d[b]=r[b]=function(){var c=arguments,a=c[0];c[0]=this.fn();return m[b].apply(a,c)}}.byWords()("every filter each map fold foldr some");d.fn=function(){return this};r.fn=function(b){return f(this,b)};t.Fn=f.cache()}(this);
!function(t,f){function m(a,c,b,d){var f=this._e||(this._e={});(f[a]||(f[a]=[])).unshift(b,d,c);return this}function d(a,c,b){var d=this._e&&this._e[a];if(d)if(c)for(a=d.length;a--;a--){if((d[a--]===c||d[a]===c)&&d[a-1]==b){h=d.splice(a-1,3);break}}else d.length=0;return this}function r(a,c,b){function d(){f.non(a,c,b).non(a,d,b)}var f=this;return f.on(a,d,b).on(a,c,b)}var h,n=t.Event||(t.Event={}),p=120,q="addEventListener",u="removeEventListener",b=t[q]?"":(q="attachEvent",u="detachEvent","on"),
c={wheel:"onwheel"in f?"wheel":"onmousewheel"in f?"mousewheel":"DOMMouseScroll"};n.Emitter={on:m,non:d,off:d,once:r,one:r,emit:function(a){var c,b;if(a=this._e&&this._e[a])for(a=a.slice(),b=a.length,c=a.slice.call(arguments,1);b--;b--)a[b--].apply(a[b-1]||this,c);return this}};n.add=function(a,e,d){var f="wheel"==e?function(c){c||(c=t.event);var b=(c.wheelDelta||-c.detail||-c.deltaY)/p;if(0!=b){if(1>b&&-1<b){var e=(0>b?-1:1)/b,b=b*e;p/=e}d.call(a,c,b)}}:b?function(){d.call(a,t.event)}:d;m.call(a,
e,f,a,d);a[q](b+(c[e]||e),f,!1);return n};n.remove=function(a,e,f){h=null;d.call(a,e,f,a);if(h)a[u](b+(c[e]||e),h[2]);return n};n.stop=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();a.cancelBubble=a.cancel=!0;return a.returnValue=!1};n.removeAll=function(a,c,b,d,f){if(a._e)for(b in a._e)c&&b!==c||n.remove(a,b)}}(this,document);
!function(t,f,m){function d(g,a,c){var b,d={};g=g.replace(G,function(g,a,b,c,F,e){d["."==a?(d[a="class"]&&(b=d[a]+" "+b),a):"#"==a?"id":b]=e?F.slice(1,-1):F||b;return""})||"div";b=(A[g]||(A[g]=f.createElement(g))).cloneNode(!0).set(d);return c?(w[g]&&b.setAttribute("data-call",g),b):w[g]&&w[g].call(b,a)||b.set(a)}function r(g,a){var b,c=0,e=typeof g;if(g){if("string"==e||"number"==e)g=d.text(g);else if(!("nodeType"in g)&&"length"in g){e=g.length;for(b=f.createDocumentFragment();c<e;)r.call(b,g[c++]);
g=b}g.nodeType&&this.insertBefore(g,(!0===a?this.firstChild:"number"==typeof a?this.childNodes[0>a?this.childNodes.length-a-2:a]:a)||null);g.appendHook&&g.appendHook()}return this}function h(g){return-1<(" "+this.className+" ").indexOf(" "+g+" ")}function n(g){this.className+=this.className?h.call(this,g)?"":" "+g:g;return this}function p(g){this.className=(" "+this.className+" ").replace(" "+g+" "," ").trim();return this}function q(g,a){1==arguments.length&&(a=!h.call(this,g));return(a?n:p).call(this,
g),a}function u(){this.parentNode&&this.parentNode.removeChild(this);Event.removeAll&&Event.removeAll(this);this.killHook&&this.killHook();this.empty&&this.empty();return this}function b(g,a){var c=this;if(1==arguments.length){if(g&&g.constructor===Object){Object.each(g,function(g,a){b.call(c,a,g)});return}return c.getAttribute(g)}"id"!=g&&"name"!=g&&"type"!=g||"\v"!="v"?c.setAttribute(g,a):c.mergeAttributes(H("<INPUT "+g+'="'+a+'">'),!1)}function c(g,a){var b,d=this;if(b=!a&&d.getAttribute("data-call"))d.removeAttribute("data-call"),
w[b].call(d);if(b=!a&&d.getAttribute("data-bind"))if(d.getAttribute("lang"),"{"==b.charAt(0)&&(b='txt:"'+b.replace(/"/g,'\\"')+'"'),b="n d p r->d&&("+b.replace(N,"(p['$1']?(r=p['$1'](n,d,$2)||r):(n['$1']=$2.format(d))),")+"r)",Fn(b)(d,g,O))return d;for(d=d.firstChild;d;d=d.nextSibling)1==d.nodeType&&c.call(d,g);return this}function a(g,a,b){var c=0,d=[];g=g.getElementsByTagName("*");for(var e=l(a.split(/\s*,\s*/).map(function(a){return"_.matches('"+a+"')"}).join("||"));a=g[c++];)if(e(a)){if(b)return a;
d.push(a)}return b?null:d}function e(a){var b=["_"];(a=a.replace(G,function(a,g,c,d,e,f,h){f&&(e=e.slice(1,-1));e&&(h=e.length,e=e.replace(/'/g,"\\'"));b.push("."==g?"(' '+_.className+' ').indexOf(' "+c+" ')>-1":"#"==g?"_.id=='"+c+"'":":"==g&&P[c]||"(a=_.getAttribute('"+c+"'))"+(!d&&e?"=='"+e+"'":""));d&&b.push("^"==d?"a.slice(0,"+h+")=='"+e+"'":"|"==d?"a.split('-')[0]=='"+e+"'":"$"==d?"a.slice(-"+h+")=='"+e+"'":"~"==d?"(' '+a+' ').indexOf(' "+e+" ')>-1":"a.indexOf('"+e+"')>-1");return""}))&&"*"!=
a&&b.unshift("_.nodeName=='"+a.toUpperCase()+"'");return b.join("&&")}function l(a){return I[a]||(I[a]=Function("_,a","return "+a))}function y(a){this._nodes=a}function B(a,b){if(a)for(b in k)a[b]=k[b];return a}function C(a,b,c){A[a]="string"==typeof b?d(b):b;c&&(w[a]=c)}function z(a){function b(a,g,c,f,l,k){for(l=g.length;l<=h[0];)h.shift(),e=e.plugin?e.plugin.done():e.parentNode;c?z.plugins[f]?(e=(new z.plugins[f](e,k)).el,h.unshift(l)):e.append(d.text("text"==f?k:a)):(f&&(e=d(f,0,1).to(e),h.unshift(l)),
k&&(l=k.charAt(0),">"==l?(g+" "+k.slice(1)).replace(J,b):"="==l?e.set({"data-bind":k.slice(1)}):e.append(k.replace(/\\([=>:])/g,"$1"))))}var c=f.createDocumentFragment(),e=c,h=[-1];a.replace(J,b);c=c.childNodes;if(1==c.length)return c[0];h=[];for(e=c.length;e--;)h[e]=c[e];return h}function D(a,b){this.name=b;this.parent=a;this.el=d("div");this.el.plugin=this;return this}function v(a,b){return v[b?E(b):x][a]||a}function E(a){if(!a)return x;a=(a||"").toLowerCase();return v[a]?a:(a=a.split("-")[0],v[a])?
a:x}function K(a,b){Object.merge(v[a]||(v[a]={}),b)}var x,L=f.body,H=f.createElement,M="textContent"in L?"textContent":"innerText",A={},w={},k=(t.HTMLElement||t.Element||d)[m],I={},G=/([.#:[])([-\w]+)(?:([~^$*|]?)=((["'\/])(?:\\?.)*?\5|[-\w]+)])?]?/g,Q=/(\s*[>+]?\s*)((["'\/])(?:\\?.)*?\2|[^\s+>])+$/,P={empty:"!_.hasChildNodes()","first-child":"_.parentNode&&_.parentNode.firstChild==_","last-child":"_.parentNode&&_.parentNode.lastChild==_",link:"_.nodeName=='A'&&_.getAttribute('href')"},J=/^([ \t]*)(@?)((?:(["'\/])(?:\\?.)*?\4|[-\w\:.#\[\]=])+)[ \t]*(.*)$/gm,
N=/[;\s]*(\w+)(?:\s*\:((?:(["'\/])(?:\\?.)*?\3|[-,\s\w])*))?/g,O=d.bindings={"class":function(a,b,c,e){q.call(a,c,e.fn("_")(b))},html:function(a,b,c){a.innerHTML=c.format(b)},txt:function(a,b,c){a.txt(c.format(b))},val:function(a,b,c){a.val(c.format(b))}};t.El=d;k.append=r;k.after=function(a,b){r.call(a.parentNode,this,b?a:a.nextSibling);return this};k.to=function(a,b){r.call(a,this,b);return this};k.hasClass=h;k.addClass=n;k.rmClass=p;k.toggleClass=q;k.empty=function(){for(var a;a=this.firstChild;)u.call(a);
return this};k.kill=u;k.on=function(a,b){Event.add(this,a,b);return this};k.non=function(a,b){Event.remove(this,a,b);return this};k.attr=b;k.set=function(a,c,e){if(a)if("object"==typeof a)for(c in a)e=a[c],"class"==c?n.call(this,e):"string"==typeof e?b.call(this,c,e):e||this.removeAttribute(c);else r.call(this,a);return this};k.render=c;k.txt=function(a){return arguments.length?this[M]=a:this[M]};k.val=function(a){var b=this,c=b.type,e=b.options;if(arguments.length)return b.value=a;if("select-multiple"==
c){a=[];for(c=0;b=e[c++];)!b.selected||b.disabled||b.parentNode.disabled||a.push(b.value);return a}return"checkbox"!=c&&"radio"!=c||b.checked?b.value||options&&options[b.selectedIndex].value||"on":""};k.matches=k.matches||function(a){var b,c,d=a.replace(Q,function(a,e,d,g,f){c=f+e.length;b=e.trim();return""}),f="+"==b?this.previousSibling:this.parentNode;return l(e(a.slice(c)))(this)?d?b?f&&f.matches&&f.matches(d)||!1:!!(f&&f.closest&&f.closest(d)):!0:!1};k.closest=k.closest||function(a){for(var b=
this;b;b=b.parentNode)if(b.matches&&b.matches(a))return b;return null};k.find="\v"!=="v"&&k.querySelector||function(b){return a(this,b,!0)};k.findAll=k.querySelectorAll?function(a){return new y(this.querySelectorAll(a))}:function(b){return new y(a(this,b))};d.wrap=y;y.prototype=Object.keys(k).reduce(function(a,b){a[b]=function(){for(var a=this._nodes,c=0,e=a.length;c<e;)k[b].apply(a[c++],arguments);return this};return a},{});k===d[m]&&(f.createElement=function(a){return B(H(a))},B(L));d[m]=k;d.get=
function(a){"string"==typeof a&&(a=f.getElementById(a));return a&&a.to?a:B(a)};C._el=A;C._fn=w;d.cache=C;d.text=function(a){return f.createTextNode(a)};D.prototype.done=function(){d.cache(this.name,this.el.removeChild(this.el.firstChild),c);this.el.plugin=null;return this.parent};z.plugins={template:D};d.create=d.tpl=function(a){return z(a).render()};d.include=function(a,b,c){b=d.get(a);(new D(null,a)).el.append(d.tpl(b.innerHTML)).plugin.done();b.kill()};d.i18n=v;v.get=E;v.use=function(a){a=E(a);
x!=(x=a)&&(v[a]=v[a]||{});return f.documentElement.lang=a};v.add=K;v.def=function(a){Object.each(a,function(b,c){K(c,a)})}}(window,document,"prototype");
!function(t,f,m){function d(a){a=(a||b).href.split("#")[1]||"";a=decodeURIComponent(a.replace(/\+/g," "));return a.replace(c,"")}function r(a,c){a=encodeURIComponent(a).replace(/%20/g,"+").replace(/%2F/gi,"/");b[c?"replace":"assign"]("#"+a);if(q&&d()!==d(q.location))q.location[c?"replace":q.document.open().close(),"assign"]("#"+a);h()}function h(){p!=(p=d())&&n&&n(p)}var n,p,q,u,b=location,c=/^[#\/\!]+|[\s\/]+$/g,a=!+"\v1"&&8>(f.documentMode||1);m.getUrl=d;m.setUrl=r;m.start=function(b,c){n||("onhashchange"in
t&&!a?t.onhashchange=h:(a&&(q=f.body.appendChild(f.createElement('<iframe class="hide" tabindex="-1">')).contentWindow),u=d(),setInterval(function(){var a=d();q&&u===a&&(a=d(q.location));u!==a&&(u=a,q?r(a):h())},50)));n=b;h()}}(this,document,history);
!function(t){function f(c,a,e,l){if(n[c])return a&&n[c].init(a,e,l),n[c];if(!(this instanceof f))return new f(c,a,e,l);n[this.route=c]=this;this.init(a,e,l);if("#"!=c.charAt(0)){a=q++;var p=["o._r='"+c+"'"];e=c.replace(/:(\w+)/g,"{$1}").replace(b,function(a,b){return b?p.push("o['"+b+"']=a["+q++ +"]")&&"([^/]+?)":a.replace(u,"\\$&")});r+=(r?"||":"")+"a["+a+"]&&("+p+")";h+=(h?"|":"")+"("+e+")";m=new Function("a","var o={};return "+r+",o");d=new RegExp("^\\/?(?:"+h+")[\\/\\s]*$")}f.active==c&&this.show()}
var m,d,r="",h="",n={},p={},q=1,u=/[.*+?^=!:${}()|\[\]\/\\]/g,b=/\{([\w%.]+?)\}|.[^{\\]*?/g;f.prototype={init:function(b,a,e){this.el=b;this.parent="string"==typeof a?f(a):a;this.selector=e},getEl:function(){var b=typeof this.el;"function"==b?this.el=this.el():"string"==b&&(this.el=El(this.el));return this.el},getContentEl:function(){return this.selector&&this.getEl().find(this.selector)||this.getEl()},load:function(b){function a(){e.el?e.show(b):e.route!==f["404"]&&f(f["404"]).show({})}var e=this,
d=(f.base||"")+(e.file||e.route+".js");p[d]?a():xhr.load(d,p[d]=a)},show:function(b){f.active=this.route;this.el?(this.active&&this.close(),this.ping(b),f.active==this.route&&this.emit("show",b)):this.load(b)},close:function(b){var a=this.parent;this.active=!1;a&&(a.getContentEl().removeChild(this.getEl()),a.child=null);this.emit("close",b);this.child&&this.child.close()},ping:function(b){var a=this.parent;this.active=!0;a&&(a.child!=this&&(a.child&&a.child.close(),a.child=this,a.getContentEl().appendChild(this.getEl())),
a.ping(b));this.emit("ping",b)}};Object.merge(f.prototype,Event.Emitter);f["404"]="404";f.main="main";f.show=function(b){var a=d.exec(b);f(a&&(a=m(a))._r||b&&f["404"]||f.main).show(a||{})};f.define=function(b){for(var a,d=/(\S+)\?(\S+)/g;a=d.exec(b);)a[2].split(",").map(function(b){f(b).file=a[1]})};t.View=f}(this);
