diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..231a94b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016 Evan You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 0ba5d12..c7343c9 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ +> **NOTE**: this demo is using Vue.js 1.x - the 2.0 version is [here](https://github.com/vuejs/vue-hackernews-2.0). + # Vue.js HackerNews clone -[Live demo](http://yyx990803.github.io/vue-hackernews/) +[Live demo](http://vuejs.github.io/vue-hackernews/) -Built with [Vue.js](http://vuejs.org) and the official [HackerNews API](https://github.com/HackerNews/API), with routing, comments, comment folding, user profile & realtime updates. +Built with [Vue.js](http://vuejs.org), [vue-router](https://github.com/vuejs/vue-router) and the official [HackerNews API](https://github.com/HackerNews/API), with routing, comments, comment folding, user profile & realtime updates. -The build setup uses Webpack and the [Vue Loader](https://github.com/vuejs/vue-loader) plugin, which enables Vue components to be written in a format that encapsulates a component's style, template and logic in a single file. +The build setup uses [Webpack](http://webpack.github.io/) and the [vue-loader](https://github.com/vuejs/vue-loader) plugin, which enables Vue components to be written in a format that encapsulates a component's style, template and logic in a single file. If you are using SublimeText you can get proper syntax highlighting for `*.vue` files with [vue-syntax-highlight](https://github.com/vuejs/vue-syntax-highlight). -There's also a version of this app built with Browserify + [Vueify](https://github.com/vuejs/vueify) in the [browserify branch](https://github.com/yyx990803/vue-hackernews/tree/browserify). - ### Building ``` bash @@ -19,3 +19,7 @@ npm run dev # build: npm run build ``` + +### License + +[MIT](http://opensource.org/licenses/MIT) diff --git a/build/build.js b/build/build.js deleted file mode 100644 index 45ad1ea..0000000 --- a/build/build.js +++ /dev/null @@ -1,7 +0,0 @@ -!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var i=n(2),r=n(3).Router,o=new i(n(1)),s=new r;s.on("/news/:page",function(t){window.scrollTo(0,0),o.view="news-view",o.params.page=+t}),s.on("/user/:id",function(t){window.scrollTo(0,0),o.view="user-view",o.params.userId=t}),s.on("/item/:id",function(t){window.scrollTo(0,0),o.view="item-view",o.params.itemId=t}),s.configure({notfound:function(){s.setRoute("/news/1")}}),s.init("/news/1")},function(t,e,n){n(22)("body,html{font-family:Verdana;font-size:13px;margin:0;height:100%;background-color:#f6f6ef}ul{list-style-type:none;padding:0;margin:0}a{color:#000;cursor:pointer;text-decoration:none}#header{background-color:#f60;height:24px;position:relative}#header h1{font-weight:700;font-size:13px;display:inline-block;vertical-align:middle;margin:0}#header .source{color:#fff;font-size:11px;position:absolute;top:4px;right:4px}#header .source a{color:#fff}#header .source a:hover{text-decoration:underline}#yc{border:1px solid #fff;margin:2px;display:inline-block;vertical-align:middle}#yc img{vertical-align:middle}.view{position:absolute;width:100%;transition:opacity .1s ease;box-sizing:border-box;padding:8px 20px}.view.v-enter,.view.v-leave{opacity:0}");var i='\n \n \n
';t.exports={el:"#app",data:{view:"",params:{page:1,userId:null,itemId:null}},filters:{fromNow:n(4),domain:n(5)},components:{"news-view":n(6),"item-view":n(7),"user-view":n(8)}},t.exports.template=i},function(t,e,n){function i(t){this._init(t)}var r=n(9),o=r.extend;o(i,n(10)),i.options={directives:n(16),filters:n(17),partials:{},transitions:{},components:{}};var s=i.prototype;Object.defineProperty(s,"$data",{get:function(){return this._data},set:function(t){this._setData(t)}}),o(s,n(18)),o(s,n(19)),o(s,n(20)),o(s,n(21)),o(s,n(11)),o(s,n(12)),o(s,n(13)),o(s,n(14)),o(s,n(15)),t.exports=r.Vue=i},function(t,e){!function(t){function e(){return""===u.hash||"#"===u.hash}function n(t,e){for(var n=0;nn;n++)e=e.concat(t[n]);return e}function r(t,e,n){if(!t.length)return n();var i=0;!function r(){e(t[i],function(e){e||e===!1?(n(e),n=function(){}):(i+=1,i===t.length?n():r())})}()}function o(t,e,n){n=t;for(var i in e)if(e.hasOwnProperty(i)&&(n=e[i](t),n!==t))break;return n===t?"([._a-zA-Z0-9-]+)":n}function a(t,e){for(var n,i=0,r="";n=t.substr(i).match(/[^\w\d\- %@&]*\*[^\w\d\- %@&]*/);)i=n.index+n[0].length,n[0]=n[0].replace(/^\*/,"([_.()!\\ %@&a-zA-Z0-9-]+)"),r+=t.substr(0,n.index)+n[0];t=r+=t.substr(i);var s,a,h=t.match(/:([^\/]+)/gi);if(h){a=h.length;for(var u=0;a>u;u++)s=h[u],t="::"===s.slice(0,2)?s.slice(1):t.replace(s,o(s,e))}return t}function h(t,e,n,i){var r,o=0,s=0,a=0,n=(n||"(").toString(),i=(i||")").toString();for(r=0;rh.indexOf(i,o)||~h.indexOf(n,o)&&!~h.indexOf(i,o)||!~h.indexOf(n,o)&&~h.indexOf(i,o)){if(s=h.indexOf(n,o),a=h.indexOf(i,o),~s&&!~a||!~s&&~a){var u=t.slice(0,(r||1)+1).join(e);t=[u].concat(t.slice((r||1)+1))}o=(a>s?a:s)+1,r=0}else o=0}return t}var u=document.location,c={mode:"modern",hash:u.hash,history:!1,check:function(){var t=u.hash;t!=this.hash&&(this.hash=t,this.onHashChanged())},fire:function(){"modern"===this.mode?this.history===!0?window.onpopstate():window.onhashchange():this.onHashChanged()},init:function(t,e){function n(t){for(var e=0,n=l.listeners.length;n>e;e++)l.listeners[e](t)}var i=this;if(this.history=e,l.listeners||(l.listeners=[]),"onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7))this.history===!0?setTimeout(function(){window.onpopstate=n},500):window.onhashchange=n,this.mode="modern";else{var r=document.createElement("iframe");r.id="state-frame",r.style.display="none",document.body.appendChild(r),this.writeFrame(""),"onpropertychange"in document&&"attachEvent"in document&&document.attachEvent("onpropertychange",function(){"location"===event.propertyName&&i.check()}),window.setInterval(function(){i.check()},50),this.onHashChanged=n,this.mode="legacy"}return l.listeners.push(t),this.mode},destroy:function(t){if(l&&l.listeners)for(var e=l.listeners,n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)},setHash:function(t){return"legacy"===this.mode&&this.writeFrame(t),this.history===!0?(window.history.pushState({},document.title,t),this.fire()):u.hash="/"===t[0]?t:"/"+t,this},writeFrame:function(t){var e=document.getElementById("state-frame"),n=e.contentDocument||e.contentWindow.document;n.open(),n.write("'),t=""+t+"";try{this.ua.Ya.open(),this.ua.Ya.write(t),this.ua.Ya.close()}catch(o){kb("frame writing exception"),o.stack&&kb(o.stack),kb(o)}}function Yd(t){if(t.Wd&&t.Fd&&t.De.count()<(0=t.Lc[0].Xe.length+30+n.length;){var r=t.Lc.shift(),n=n+"&seg"+i+"="+r.ng+"&ts"+i+"="+r.vg+"&d"+i+"="+r.Xe;i++}return Zd(t,e+n,t.ie),!0}return!1}function Zd(t,e,n){function i(){t.De.remove(n),Yd(t)}t.De.add(n);var r=setTimeout(i,Math.floor(25e3));Xd(t,e,function(){clearTimeout(r),i()})}function Xd(t,e,n){setTimeout(function(){try{if(t.Fd){var i=t.ua.Ya.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){var t=i.readyState;t&&"loaded"!==t&&"complete"!==t||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),n())},i.onerror=function(){kb("Long-poll script failed to load: "+e),t.Fd=!1,t.close()},t.ua.Ya.body.appendChild(i)}}catch(r){}},Math.floor(1))}function $d(t){ae(this,t)}function ae(t,e){var n=Jd&&Jd.isAvailable(),i=n&&!(va.gf||!0===va.get("previous_websocket_failure"));if(e.xg&&(n||z("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)t.Vc=[Jd];else{var r=t.Vc=[];Cb(be,function(t,e){e&&e.isAvailable()&&r.push(e)})}}function ce(t){if(00&&(t.md=setTimeout(function(){t.md=null,t.vb||(t.K&&102400=t.uf?(t.f("Secondary connection is healthy."),t.vb=!0,t.H.rd(),t.H.start(),t.f("sending client ack on secondary"),t.H.send({t:"c",d:{t:"a",d:{}}}),t.f("Ending transmission on primary"),t.K.send({t:"c",d:{t:"n",d:{}}}),t.Wc=t.H,je(t)):(t.f("sending ping on secondary."),t.H.send({t:"c",d:{t:"p",d:{}}}))}function le(t){t.vb||(t.Fe--,0>=t.Fe&&(t.f("Primary connection is healthy."),t.vb=!0,t.K.rd()))}function ie(t,e){t.H=new e("c:"+t.id+":"+t.Se++,t.S,t.Gd),t.uf=e.responsesRequiredToBeHealthy||0,t.H.open(fe(t,t.H),ge(t,t.H)),setTimeout(function(){t.H&&(t.f("Timed out trying to upgrade."),t.H.close())},Math.floor(6e4))}function he(t,e,n){t.f("Realtime connection established."),t.K=e,t.Ra=1,t.Fc&&(t.Fc(n),t.Fc=null),0===t.Fe?(t.f("Primary connection is healthy."),t.vb=!0):setTimeout(function(){me(t)},Math.floor(5e3))}function me(t){t.vb||1!==t.Ra||(t.f("sending ping on primary."),oe(t,{t:"c",d:{t:"p",d:{}}}))}function oe(t,e){if(1!==t.Ra)throw"Connection is not connected";t.Wc.send(e)}function ke(t){t.f("Shutting down all connections"),t.K&&(t.K.close(),t.K=null),t.H&&(t.H.close(),t.H=null),t.md&&(clearTimeout(t.md),t.md=null)}function pe(t){var e={},n={},i={},r="";try{var o=t.split("."),e=sa(jb(o[0])||""),n=sa(jb(o[1])||""),r=o[2],i=n.d||{};delete n.d}catch(s){}return{Bg:e,de:n,data:i,sg:r}}function qe(t){return t=pe(t).de,"object"==typeof t&&t.hasOwnProperty("iat")?u(t,"iat"):null}function re(t){t=pe(t);var e=t.de;return!!t.sg&&!!e&&"object"==typeof e&&e.hasOwnProperty("iat")}function te(t,e,n,i){this.id=ue++,this.f=rb("p:"+this.id+":"),this.Eb=!0,this.ta={},this.ka=[],this.Ic=0,this.Ec=[],this.fa=!1,this.Ua=1e3,this.sd=3e5,this.xd=e,this.vd=n,this.Ce=i,this.S=t,this.Ie=null,this.Pc={},this.mg=0,this.yc=this.se=null,ve(this,0),qd.Mb().Ab("visible",this.eg,this),-1===t.host.indexOf("fblocal")&&rd.Mb().Ab("online",this.cg,this)}function xe(t,e,n,i,r){var o=e.Da(),s=e.path.toString();t.f("Listen called for "+s+" "+o),t.ta[s]=t.ta[s]||{},x(!t.ta[s][o],"listen() called twice for same path/queryId."),t.ta[s][o]={M:r,ld:n,ig:yc(e),tag:i},t.fa&&ye(t,s,o)}function ye(t,e,n){t.f("Listen on "+e+" for "+n);var i={p:e},r=t.ta[e][n];r.tag&&(i.q=r.ig,i.t=r.tag),r=t.ta[e][n],i.h=r.ld();var o=r.M;t.va("q",i,function(i){t.f("listen response",i);var r=i.s;"ok"!==r&&ze(t,e,n),o&&o(r,i.d)})}function Ae(t){var e=t.Hb;t.fa&&e&&t.va("auth",{cred:e.Mf},function(n){var i=n.s;n=n.d||"error","ok"!==i&&t.Hb===e&&delete t.Hb,e.$e?"ok"!==i&&e.Zc&&e.Zc(i,n):(e.$e=!0,e.mc&&e.mc(i,n)) -})}function Be(t,e,n,i){t.fa?Ce(t,"o",e,n,i):t.Ec.push({Kc:e,action:"o",data:n,M:i})}function De(t,e,n,i){t.fa?Ce(t,"om",e,n,i):t.Ec.push({Kc:e,action:"om",data:n,M:i})}function Ce(t,e,n,i,r){n={p:n,d:i},t.f("onDisconnect "+e,n),t.va(e,n,function(t){r&&setTimeout(function(){r(t.s,t.d)},Math.floor(0))})}function Fe(t,e,n,i){Ee(t,"m",e,n,i,void 0)}function Ee(t,e,n,i,r,o){i={p:n,d:i},m(o)&&(i.h=o),t.ka.push({action:e,pf:i,M:r}),t.Ic++,e=t.ka.length-1,t.fa?Ge(t,e):t.f("Buffering put: "+n)}function Ge(t,e){var n=t.ka[e].action,i=t.ka[e].pf,r=t.ka[e].M;t.ka[e].jg=t.fa,t.va(n,i,function(i){t.f(n+" response",i),delete t.ka[e],t.Ic--,0===t.Ic&&(t.ka=[]),r&&r(i.s,i.d)})}function ve(t,e){x(!t.Ta,"Scheduling a connect when we're already connected/ing?"),t.Jb&&clearTimeout(t.Jb),t.Jb=setTimeout(function(){t.Jb=null,Je(t)},Math.floor(e))}function Je(t){if(t.Eb){t.f("Making a connection attempt"),t.se=(new Date).getTime(),t.yc=null;var e=q(t.wd,t),n=q(t.Fc,t),i=q(t.kf,t),r=t.id+":"+we++;t.Ta=new de(r,t.S,e,n,i,function(e){z(e+" ("+t.S.toString()+")"),t.Eb=!1})}}function He(t,e,n){n=n?Ma(n,function(t){return Ab(t)}).join("$"):"default",(t=ze(t,e,n))&&t.M&&t.M("permission_denied")}function ze(t,e,n){e=new N(e).toString();var i=t.ta[e][n];return delete t.ta[e][n],0===sc(t.ta[e])&&delete t.ta[e],i}function Ie(t){Ae(t),A(t.ta,function(e,n){A(e,function(e,i){ye(t,n,i)})});for(var e=0;e=0;t--)try{if(e[t].location.protocol===window.location.protocol&&e[t].location.host===window.location.host&&"__winchan_relay_frame"===e[t].name)return e[t]}catch(n){}return null}function Ze(t,e,n){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener&&t.addEventListener(e,n,!1)}function $e(t,e,n){t.detachEvent?t.detachEvent("on"+e,n):t.removeEventListener&&t.removeEventListener(e,n,!1)}function af(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(t);return e?e[1]:t}function bf(e){var n="";try{e=e.replace("#","");var i={},r=e.replace(/^\?/,"").split("&");for(e=0;ep?(p=u(l,r.name),m(p)?(c.push(a[p]),a[p]=null):(f[r.name]=h.length,h.push(r)),r=T(n)):(p>0?(p=u(f,o.name),m(p)?(c.push(o),h[p]=null):(l[o.name]=a.length,a.push(o))):((r=r.L.hash()!==o.L.hash())&&c.push(o),r=T(n)),o=T(i))}for(l=0;l=a(s,t.gd)?Tf(t,e,n,i,r,o||e.k||e.g):null:0>=a(t.Jd,s)?Tf(t,e,n,i,r,o||e.k||e.g):null}function Tf(t,e,n,i,r,o){var s,a=Kb(t.index);s=t.Oa?function(t,e){return-1*a(t,e)}:a,e=W(e);var h=new C(n,i),u=t.Oa?gd(e,t.index):hd(e,t.index);return e.$(n)?(t=r.be(o,u,1,t.Oa,".priority"),0===t.length?e.w(n,i):(t=t[0],!i.e()&&0<=s(t,h)?e.w(n,i):e.w(n,E).w(t.name,t.L))):0<=s(u,h)?e.w(n,i).w(u.name,E):null}function Uf(t){this.G=t}function Vf(t){this.Y=t,this.G=t.C.G}function Wf(t,e,n,i){var r=[],o=t.G,s=Ma(La(e,function(t){return"child_changed"===t.type&&o.ef(t.Zf,t.Va)}),function(t){return new V("child_moved",t.Va,t.ob)}),a=Qa(e,function(t){return"child_removed"!==t.type&&"child_added"!==t.type});for(la(Sa,e,a,0).apply(null,s);0=0,"removeWrite called with nonexistent writeId.");var i=t.pa[n];t.pa.splice(n,1);for(var r=!1,o=!1,s=!1,a=t.pa.length-1;!r&&a>=0;){var h=t.pa[a];a>=n&&wg(h,i.path)?r=!0:!o&&i.path.contains(h.path)&&(a>=n?o=!0:s=!0),a--}return r||(o||s?xg(t):i.Qa?t.V=t.V.remove(i.path):A(i.children,function(e,n){t.V=t.V.remove(i.path.B(n))})),n=i.path,fg(t.V,n)?s?n:(x(r,"Must have found a shadow"),null):n}function wg(t,e){return t.Qa?t.path.contains(e):!!ud(t.children,function(n,i){return t.path.B(i).contains(e)})}function xg(t){t.V=yg(t.pa,zg,R),t.zc=0.firebaseio.com instead"),n||tb("Cannot parse Firebase url. Please use https://.firebaseio.com"),i.Cb||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&z("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),n=new xa(i.host,i.Cb,n,"ws"===i.scheme||"wss"===i.scheme),i=new N(i.Kc),r=i.toString();var o;if(!(o=!p(n.host)||0===n.host.length||!ac(n.zb))&&(o=0!==r.length)&&(r&&(r=r.replace(/^\/*\.info(\/|$)/,"/")),o=!(p(r)&&0!==r.length&&!$b.test(r))),o)throw Error(H("new Firebase",1,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".');if(e)if(e instanceof rh)r=e;else{if(!p(e))throw Error("Expected a valid Firebase.Context for second argument to new Firebase()");r=rh.Mb(),n.Cd=e}else r=rh.Mb();o=n.toString();var s=u(r.dc,o);s||(s=new Xg(n),r.dc[o]=s),n=s}L.call(this,n,i,Rb)}function qb(t,e){x(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?("undefined"!=typeof console&&("function"==typeof console.log?ob=q(console.log,console):"object"==typeof console.log&&(ob=function(t){console.log(t)})),e&&wa.set("logging_enabled",!0)):t?ob=t:(ob=null,wa.remove("logging_enabled"))}var h,aa=this,ma=Date.now||function(){return+new Date};h=ra.prototype,h.set=function(t,e){null==e?this.sc.removeItem(this.Dd+t):this.sc.setItem(this.Dd+t,v(e))},h.get=function(t){return t=this.sc.getItem(this.Dd+t),null==t?null:sa(t)},h.remove=function(t){this.sc.removeItem(this.Dd+t)},h.gf=!1,h.toString=function(){return this.sc.toString()},ta.prototype.set=function(t,e){null==e?delete this.la[t]:this.la[t]=e},ta.prototype.get=function(e){return t(this.la,e)?this.la[e]:null},ta.prototype.remove=function(t){delete this.la[t]},ta.prototype.gf=!0;var va=ua("localStorage"),wa=ua("sessionStorage");xa.prototype.toString=function(){var t=(this.Cb?"https://":"http://")+this.host;return this.Cd&&(t+="<"+this.Cd+">"),t},oa(Aa,za),Aa.prototype.reset=function(){this.T[0]=1732584193,this.T[1]=4023233417,this.T[2]=2562383102,this.T[3]=271733878,this.T[4]=3285377520,this.Pd=this.Pb=0},Aa.prototype.update=function(t,e){m(e)||(e=t.length);for(var n=e-this.Sa,i=0,r=this.Zd,o=this.Pb;e>i;){if(0==o)for(;n>=i;)Ba(this,t,i),i+=this.Sa;if(p(t)){for(;e>i;)if(r[o]=t.charCodeAt(i),++o,++i,o==this.Sa){Ba(this,r),o=0;break}}else for(;e>i;)if(r[o]=t[i],++o,++i,o==this.Sa){Ba(this,r),o=0;break}}this.Pb=o,this.Pd+=e};var Ga={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"," ":"\\u000b"},Ha=/\uffff/.test("ï¿¿")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,w=Array.prototype,Ja=w.indexOf?function(t,e,n){return w.indexOf.call(t,e,n)}:function(t,e,n){if(n=null==n?0:0>n?Math.max(0,t.length+n):n,p(t))return p(e)&&1==e.length?t.indexOf(e,n):-1;for(;no;o++)o in r&&e.call(n,r[o],o,t)},La=w.filter?function(t,e,n){return w.filter.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=[],o=0,s=p(t)?t.split(""):t,a=0;i>a;a++)if(a in s){var h=s[a];e.call(n,h,a,t)&&(r[o++]=h)}return r},Ma=w.map?function(t,e,n){return w.map.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=Array(i),o=p(t)?t.split(""):t,s=0;i>s;s++)s in o&&(r[s]=e.call(n,o[s],s,t));return r},Na=w.reduce?function(t,e,n,i){return i&&(e=q(e,i)),w.reduce.call(t,e,n)}:function(t,e,n,i){var r=n;return Ka(t,function(n,o){r=e.call(i,r,n,o,t)}),r},Oa=w.every?function(t,e,n){return w.every.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=p(t)?t.split(""):t,o=0;i>o;o++)if(o in r&&!e.call(n,r[o],o,t))return!1;return!0},Wa;t:{var Xa=aa.navigator;if(Xa){var Ya=Xa.userAgent;if(Ya){Wa=Ya;break t}}Wa=""}var $a=Za("Opera")||Za("OPR"),ab=Za("Trident")||Za("MSIE"),bb=Za("Gecko")&&-1==Wa.toLowerCase().indexOf("webkit")&&!(Za("Trident")||Za("MSIE")),cb=-1!=Wa.toLowerCase().indexOf("webkit");!function(){var t,e="";return $a&&aa.opera?(e=aa.opera.version,ha(e)?e():e):(bb?t=/rv\:([^\);]+)(\)|;)/:ab?t=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:cb&&(t=/WebKit\/(\S+)/),t&&(e=(e=t.exec(Wa))?e[1]:""),ab&&(t=(t=aa.document)?t.documentMode:void 0,t>parseFloat(e))?String(t):e)}();var db=null,eb=null,hb=function(){var t=1;return function(){return t++}}(),ob=null,pb=!0,Eb=/^-?\d{1,10}$/,Jb=Object.create(null);Ib.prototype.ef=function(t,e){return 0!==this.compare(new C("[MIN_NAME]",t),new C("[MIN_NAME]",e))},Ib.prototype.ye=function(){return Lb},oa(Mb,Ib),h=Mb.prototype,h.qe=function(t){return!t.I(this.Rb).e()},h.compare=function(t,e){var n=t.L.I(this.Rb),i=e.L.I(this.Rb),n=n.fe(i);return 0===n?xb(t.name,e.name):n},h.we=function(t,e){var n=D(t),n=E.w(this.Rb,n);return new C(e,n)},h.xe=function(){var t=E.w(this.Rb,Nb);return new C("[MAX_NAME]",t)},h.toString=function(){return this.Rb};var F=new Mb(".priority");oa(Ob,Ib),h=Ob.prototype,h.compare=function(t,e){return xb(t.name,e.name)},h.qe=function(){throw ib("KeyIndex.isDefinedOn not expected to be called.")},h.ef=function(){return!1},h.ye=function(){return Lb},h.xe=function(){return new C("[MAX_NAME]",E)},h.we=function(t){return x(p(t),"KeyIndex indexValue must always be a string."),new C(t,E)},h.toString=function(){return".key"};var Pb=new Ob,Rb=new Qb;h=Qb.prototype,h.te=function(t){var e=Wb(this);return e.sa=!0,e.yb=t,e.Yc="",e},h.ue=function(t){var e=Wb(this);return e.sa=!0,e.yb=t,e.Yc="l",e},h.ve=function(t){var e=Wb(this);return e.sa=!0,e.yb=t,e.Yc="r",e},h.Id=function(t,e){var n=Wb(this);return n.wa=!0,n.wc=t,null!=e?(n.hc=!0,n.Tb=e):(n.hc=!1,n.Tb=""),n},h.fd=function(t,e){var n=Wb(this);return n.Ja=!0,n.vc=t,m(e)?(n.tc=!0,n.Qb=e):(n.Dg=!1,n.Qb=""),n},h.Hc=function(t){var e=Wb(this);return e.G=t,e};var Zb=/[\[\].#$\/\u0000-\u001F\u007F]/,$b=/[\[\].#$\u0000-\u001F\u007F]/;oc.prototype.Nb=function(){var t=this.Hd.bc();return"value"===this.hd?t.path:t.parent().path},oc.prototype.me=function(){return this.hd},oc.prototype.Lb=function(){return this.je.Lb(this)},oc.prototype.toString=function(){return this.Nb().toString()+":"+this.hd+":"+v(this.Hd.Ze())},pc.prototype.Nb=function(){return this.path},pc.prototype.me=function(){return"cancel"},pc.prototype.Lb=function(){return this.je.Lb(this)},pc.prototype.toString=function(){return this.path.toString()+":cancel" -},h=qc.prototype,h.qf=function(t){return"value"===t},h.createEvent=function(t,e){var n=e.C.G;return new oc("value",this,new K(t.Va,e.bc(),n))},h.Lb=function(t){var e=this.pc;if("cancel"===t.me()){x(this.nb,"Raising a cancel event on a listener with no cancel callback");var n=this.nb;return function(){n.call(e,t.error)}}var i=this.Gb;return function(){i.call(e,t.Hd)}},h.Ue=function(t,e){return this.nb?new pc(this,t,e):null},h.matches=function(t){return t instanceof qc&&(!t.Gb||!this.Gb||t.Gb===this.Gb)&&t.pc===this.pc},h.df=function(){return null!==this.Gb},h=rc.prototype,h.qf=function(t){return t="children_added"===t?"child_added":t,("children_removed"===t?"child_removed":t)in this.ea},h.Ue=function(t,e){return this.nb?new pc(this,t,e):null},h.createEvent=function(t,e){var n=e.bc().B(t.ob);return new oc(t.type,this,new K(t.Va,n,e.C.G),t.Mc)},h.Lb=function(t){var e=this.pc;if("cancel"===t.me()){x(this.nb,"Raising a cancel event on a listener with no cancel callback");var n=this.nb;return function(){n.call(e,t.error)}}var i=this.ea[t.hd];return function(){i.call(e,t.Hd,t.Mc)}},h.matches=function(t){if(t instanceof rc){if(this.ea&&t.ea){var e=sc(t.ea);if(e===sc(this.ea)){if(1===e){var e=tc(t.ea),n=tc(this.ea);return!(n!==e||t.ea[e]&&this.ea[n]&&t.ea[e]!==this.ea[n])}return uc(this.ea,function(e,n){return t.ea[n]===e})}return!1}return!0}return!1},h.df=function(){return null!==this.ea},L.prototype.bc=function(){return G("Query.ref",0,0,arguments.length),new M(this.j,this.path)},L.prototype.ref=L.prototype.bc,L.prototype.Ab=function(t,e,n,i){G("Query.on",2,4,arguments.length),gc("Query.on",t,!1),I("Query.on",2,e,!1);var r=vc("Query.on",n,i);if("value"===t)wc(this.j,this,new qc(e,r.cancel||null,r.Ia||null));else{var o={};o[t]=e,wc(this.j,this,new rc(o,r.cancel,r.Ia))}return e},L.prototype.on=L.prototype.Ab,L.prototype.Yb=function(t,e,n){G("Query.off",0,3,arguments.length),gc("Query.off",t,!0),I("Query.off",2,e,!0),Yb("Query.off",3,n);var i=null,r=null;"value"===t?i=new qc(e||null,null,n||null):t&&(e&&(r={},r[t]=e),i=new rc(r,null,n||null)),r=this.j,i=".info"===J(this.path)?r.pd.eb(this,i):r.N.eb(this,i),xc(r.ba,this.path,i)},L.prototype.off=L.prototype.Yb,L.prototype.fg=function(t,e){function n(s){o&&(o=!1,r.Yb(t,n),e.call(i.Ia,s))}G("Query.once",2,4,arguments.length),gc("Query.once",t,!1),I("Query.once",2,e,!1);var i=vc("Query.once",arguments[2],arguments[3]),r=this,o=!0;this.Ab(t,n,function(e){r.Yb(t,n),i.cancel&&i.cancel.call(i.Ia,e)})},L.prototype.once=L.prototype.fg,L.prototype.te=function(t){if(G("Query.limit",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limit: First argument must be a positive integer.");if(this.C.Ja&&this.C.wa)throw Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.");return new L(this.j,this.path,this.C.te(t))},L.prototype.limit=L.prototype.te,L.prototype.ue=function(t){if(G("Query.limitToFirst",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToFirst: First argument must be a positive integer.");return new L(this.j,this.path,this.C.ue(t))},L.prototype.limitToFirst=L.prototype.ue,L.prototype.ve=function(t){if(G("Query.limitToLast",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToLast: First argument must be a positive integer.");return new L(this.j,this.path,this.C.ve(t))},L.prototype.limitToLast=L.prototype.ve,L.prototype.Hc=function(t){if(G("Query.orderBy",1,1,arguments.length),"$key"===t)throw Error('Query.orderBy: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw Error('Query.orderBy: "$priority" is invalid. Use Query.orderByPriority() instead.');return hc("Query.orderBy",1,t,!1),new L(this.j,this.path,this.C.Hc(new Mb(t)))},L.prototype.orderBy=L.prototype.Hc,L.prototype.gg=function(){return G("Query.orderByKey",0,0,arguments.length),new L(this.j,this.path,this.C.Hc(Pb))},L.prototype.orderByKey=L.prototype.gg,L.prototype.hg=function(){return G("Query.orderByPriority",0,0,arguments.length),new L(this.j,this.path,this.C.Hc(F))},L.prototype.orderByPriority=L.prototype.hg,L.prototype.Id=function(t,e){if(G("Query.startAt",0,2,arguments.length),fc("Query.startAt",1,t,!0),hc("Query.startAt",2,e,!0),this.C.Ja&&this.C.sa&&!Ub(this.C))throw Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.");return m(t)||(e=t=null),new L(this.j,this.path,this.C.Id(t,e))},L.prototype.startAt=L.prototype.Id,L.prototype.fd=function(t,e){if(G("Query.endAt",0,2,arguments.length),fc("Query.endAt",1,t,!0),hc("Query.endAt",2,e,!0),this.C.wa&&this.C.sa&&!Ub(this.C))throw Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.");return new L(this.j,this.path,this.C.fd(t,e))},L.prototype.endAt=L.prototype.fd,L.prototype.Of=function(t,e){return G("Query.equalTo",1,2,arguments.length),fc("Query.equalTo",1,t,!1),hc("Query.equalTo",2,e,!0),this.Id(t,e).fd(t,e)},L.prototype.equalTo=L.prototype.Of,L.prototype.Da=function(){var t=Ab(yc(this));return"{}"===t?"default":t},N.prototype.toString=function(){for(var t="",e=this.da;e=this.A.length)return null;for(var t=[],e=this.da;e=this.A.length};var R=new N("");N.prototype.aa=function(t){if(O(this)!==O(t))return!1;for(var e=this.da,n=t.da;e<=this.A.length;e++,n++)if(this.A[e]!==t.A[n])return!1;return!0},N.prototype.contains=function(t){var e=this.da,n=t.da;if(O(this)>O(t))return!1;for(;ee?n=n.left:e>0&&(n=n.right)}return null},h.e=function(){return this.oa.e()},h.count=function(){return this.oa.count()},h.Dc=function(){return this.oa.Dc()},h.Vb=function(){return this.oa.Vb()},h.Ba=function(t){return this.oa.Ba(t)},h.Aa=function(t){return new Jc(this.oa,null,this.Ha,!1,t)},h.rb=function(t,e){return new Jc(this.oa,t,this.Ha,!1,e)},h.Ob=function(t,e){return new Jc(this.oa,t,this.Ha,!0,e)},h.cf=function(t){return new Jc(this.oa,null,this.Ha,!0,t)},h=Kc.prototype,h.Z=function(t,e,n,i,r){return new Kc(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=i?i:this.left,null!=r?r:this.right)},h.count=function(){return this.left.count()+1+this.right.count()},h.e=function(){return!1},h.Ba=function(t){return this.left.Ba(t)||t(this.key,this.value)||this.right.Ba(t)},h.Dc=function(){return Lc(this).key},h.Vb=function(){return this.right.e()?this.key:this.right.Vb()},h.La=function(t,e,n){var i,r;return r=this,i=n(t,r.key),r=0>i?r.Z(null,null,null,r.left.La(t,e,n),null):0===i?r.Z(null,e,null,null,null):r.Z(null,null,null,null,r.right.La(t,e,n)),Mc(r)},h.remove=function(t,e){var n,i;if(n=this,0>e(t,n.key))n.left.e()||n.left.ca()||n.left.left.ca()||(n=Oc(n)),n=n.Z(null,null,null,n.left.remove(t,e),null);else{if(n.left.ca()&&(n=Pc(n)),n.right.e()||n.right.ca()||n.right.left.ca()||(n=Qc(n),n.left.left.ca()&&(n=Pc(n),n=Qc(n))),0===e(t,n.key)){if(n.right.e())return Hc;i=Lc(n.right),n=n.Z(i.key,i.value,null,null,Nc(n.right))}n=n.Z(null,null,null,null,n.right.remove(t,e))}return Mc(n)},h.ca=function(){return this.color},h=Sc.prototype,h.Z=function(){return this},h.La=function(t,e){return new Kc(t,e,null)},h.remove=function(){return this},h.count=function(){return 0},h.e=function(){return!0},h.Ba=function(){return!1},h.Dc=function(){return null},h.Vb=function(){return null},h.ca=function(){return!1};var Hc=new Sc;h=Uc.prototype,h.R=function(){return!0},h.Q=function(){return this.ia},h.gb=function(t){return new Uc(this.D,t)},h.I=function(t){return".priority"===t?this.ia:E},h.P=function(t){return t.e()?this:".priority"===J(t)?this.ia:E},h.$=function(){return!1},h.bf=function(){return null},h.w=function(t,e){return".priority"===t?this.gb(e):E.w(t,e).gb(this.ia)},h.u=function(t,e){var n=J(t);return null===n?e:(x(".priority"!==n||1===O(t),".priority must be the last token in a path"),this.w(n,E.u(Q(t),e)))},h.e=function(){return!1},h.Za=function(){return 0},h.O=function(t){return t&&!this.Q().e()?{".value":this.ra(),".priority":this.Q().O()}:this.ra()},h.hash=function(){if(null===this.xb){var t="";this.ia.e()||(t+="priority:"+Wc(this.ia.O())+":");var e=typeof this.D,t=t+(e+":"),t="number"===e?t+Db(this.D):t+this.D;this.xb=lb(t)}return this.xb},h.ra=function(){return this.D},h.fe=function(t){if(t===E)return 1;if(t instanceof Xc)return-1;x(t.R(),"Unknown node type");var e=typeof t.D,n=typeof this.D,i=Ja(Yc,e),r=Ja(Yc,n);return x(i>=0,"Unknown leaf type: "+e),x(r>=0,"Unknown leaf type: "+n),i===r?"object"===n?0:this.Di){var o,s=[];for(o in e)s[o]=e[o];return s}return t&&!this.Q().e()&&(e[".priority"]=this.Q().O()),e},h.hash=function(){if(null===this.xb){var t="";this.Q().e()||(t+="priority:"+Wc(this.Q().O())+":"),this.ga(F,function(e,n){var i=n.hash();""!==i&&(t+=":"+e+":"+i)}),this.xb=""===t?"":lb(t)}return this.xb},h.bf=function(t,e,n){return(n=fd(this,n))?(t=Ic(n,new C(t,e)))?t.name:null:Ic(this.m,t)},h.ga=function(t,e){var n=fd(this,t);return n?n.Ba(function(t){return e(t.name,t.L)}):this.m.Ba(e)},h.Aa=function(t){return this.rb(t.ye(),t)},h.rb=function(t,e){var n=fd(this,e);return n?n.rb(t,function(t){return t}):this.m.rb(t.name,Tc)},h.cf=function(t){return this.Ob(t.xe(),t)},h.Ob=function(t,e){var n=fd(this,e);return n?n.Ob(t,function(t){return t}):this.m.Ob(t.name,Tc)},h.fe=function(t){return this.e()?t.e()?0:-1:t.R()||t.e()?1:t===Nb?-1:0},h.hb=function(t){if(t===Pb||id(this.sb.Sb,t.toString()))return this;var e=this.sb,n=this.m;x(t!==Pb,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var i=[],r=!1,n=n.Aa(Tc),o=T(n);o;)r=r||t.qe(o.L),i.push(o),o=T(n);return i=r?bd(i,Kb(t)):Jb,r=t.toString(),n=jd(e.Sb),n[r]=t,t=jd(e.od),t[r]=i,new Xc(this.m,this.ia,new Zc(t,n))},h.Ub=function(t){return t===Pb||id(this.sb.Sb,t.toString())},h.aa=function(t){if(t===this)return!0;if(t.R())return!1;if(this.Q().aa(t.Q())&&this.m.count()===t.m.count()){var e=this.Aa(F);t=t.Aa(F);for(var n=T(e),i=T(t);n&&i;){if(n.name!==i.name||!n.L.aa(i.L))return!1;n=T(e),i=T(t)}return null===n&&null===i}return!1},h.toString=function(){var t="{",e=!0;return this.ga(F,function(n,i){e?e=!1:t+=", ",t+='"'+n+'" : '+i.toString()}),t+="}"};var kd=Math.log(2),E=new Xc(new Gc(Hb),null,dd);oa(nd,Xc),h=nd.prototype,h.fe=function(t){return t===this?0:1},h.aa=function(t){return t===this},h.Q=function(){throw ib("Why is this called?")},h.I=function(){return E},h.e=function(){return!1};var Nb=new nd,Lb=new C("[MIN_NAME]",E);K.prototype.O=function(){return G("Firebase.DataSnapshot.val",0,0,arguments.length),this.J.O()},K.prototype.val=K.prototype.O,K.prototype.Ze=function(){return G("Firebase.DataSnapshot.exportVal",0,0,arguments.length),this.J.O(!0)},K.prototype.exportVal=K.prototype.Ze,K.prototype.B=function(t){G("Firebase.DataSnapshot.child",0,1,arguments.length),ga(t)&&(t=String(t)),ic("Firebase.DataSnapshot.child",t);var e=new N(t),n=this.Y.B(e);return new K(this.J.P(e),n,F)},K.prototype.child=K.prototype.B,K.prototype.$=function(t){G("Firebase.DataSnapshot.hasChild",1,1,arguments.length),ic("Firebase.DataSnapshot.hasChild",t);var e=new N(t);return!this.J.P(e).e()},K.prototype.hasChild=K.prototype.$,K.prototype.Q=function(){return G("Firebase.DataSnapshot.getPriority",0,0,arguments.length),this.J.Q().O()},K.prototype.getPriority=K.prototype.Q,K.prototype.forEach=function(t){if(G("Firebase.DataSnapshot.forEach",1,1,arguments.length),I("Firebase.DataSnapshot.forEach",1,t,!1),this.J.R())return!1;var e=this;return!!this.J.ga(this.G,function(n,i){return t(new K(i,e.Y.B(n),F))})},K.prototype.forEach=K.prototype.forEach,K.prototype.kd=function(){return G("Firebase.DataSnapshot.hasChildren",0,0,arguments.length),this.J.R()?!1:!this.J.e()},K.prototype.hasChildren=K.prototype.kd,K.prototype.name=function(){return G("Firebase.DataSnapshot.name",0,0,arguments.length),this.Y.name()},K.prototype.name=K.prototype.name,K.prototype.Za=function(){return G("Firebase.DataSnapshot.numChildren",0,0,arguments.length),this.J.Za()},K.prototype.numChildren=K.prototype.Za,K.prototype.bc=function(){return G("Firebase.DataSnapshot.ref",0,0,arguments.length),this.Y},K.prototype.ref=K.prototype.bc,od.prototype.Rd=function(t){for(var e=this.Bc[t]||[],n=0;n=t.length){var e=Number(t);if(!isNaN(e)){r.Oe=e,r.frames=[],t=null;break t}}r.Oe=1,r.frames=[]}null!==t&&Md(r,t)}},this.na.onerror=function(t){r.f("WebSocket error. Closing connection."),(t=t.message||t.data)&&r.f(t),r.$a()}},Jd.prototype.start=function(){},Jd.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var e=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);e&&1parseFloat(e[1])&&(t=!0)}return!t&&null!==Id&&!Kd},Jd.responsesRequiredToBeHealthy=2,Jd.healthyTimeout=3e4,h=Jd.prototype,h.rd=function(){va.remove("previous_websocket_failure")},h.send=function(t){Ld(this),t=v(t),this.mb+=t.length,Bd(this.Ea,"bytes_sent",t.length),t=Bb(t,16384),1o.status){try{t=sa(o.responseText)}catch(e){}n(null,t)}else n(500<=o.status&&600>o.status?U("SERVER_ERROR"):U("NETWORK_ERROR"));n=null,$e(window,"beforeunload",i)}},"GET"===s)t+=(/\?/.test(t)?"":"?")+cf(e),r=null;else{var a=this.options.headers.content_type;"application/json"===a&&(r=v(e)),"application/x-www-form-urlencoded"===a&&(r=cf(e))}o.open(s,t,!0),t={"X-Requested-With":"XMLHttpRequest",Accept:"application/json;text/plain"},zd(t,this.options.headers);for(var h in t)o.setRequestHeader(h,t[h]);o.send(r)},gf.isAvailable=function(){return!!window.XMLHttpRequest&&"string"==typeof(new XMLHttpRequest).responseType&&(!(navigator.userAgent.match(/MSIE/)||navigator.userAgent.match(/Trident/))||ff())},gf.prototype.oc=function(){return"json"},hf.prototype.open=function(t,e,n){function i(){n&&(n(U("USER_CANCELLED")),n=null)}var r,o=this,s=ub(Te);e.requestId=this.Qc,e.redirectTo=s.scheme+"://"+s.host+"/blank/page.html",t+=/\?/.test(t)?"":"?",t+=cf(e),(r=window.open(t,"_blank","location=no"))&&ha(r.addEventListener)?(r.addEventListener("loadstart",function(t){var e;if(e=t&&t.url)t:{var s=t.url;try{var a=document.createElement("a");a.href=s,e=a.host===ub(Te).host&&"/blank/page.html"===a.pathname;break t}catch(h){}e=!1}e&&(t=bf(t.url),r.removeEventListener("exit",i),r.close(),t=new Ue(null,null,{requestId:o.Qc,requestKey:t}),o.lf.requestWithCredential("/auth/session",t,n),n=null)}),r.addEventListener("exit",i)):n(U("TRANSPORT_UNAVAILABLE"))},na("fb.login.transports.CordovaInAppBrowser.prototype.open",hf.prototype.open),hf.isAvailable=function(){return ef()},hf.prototype.oc=function(){return"redirect"},jf.prototype.open=function(t,e,n){function i(t){if(o&&(document.body.removeChild(o),o=void 0),c&&(c=clearInterval(c)),$e(window,"message",r),$e(window,"unload",i),u&&!t)try{u.close()}catch(e){s.postMessage("die",h)}u=s=void 0}function r(t){if(t.origin===h)try{var e=sa(t.data);"ready"===e.a?s.postMessage(l,h):"error"===e.a?(i(!1),n&&(n(e.d),n=null)):"response"===e.a&&(i(e.Ag),n&&(n(null,e.d),n=null))}catch(r){}}var o,s,a=ff(),h=af(t);if(h!==af(this.options.relay_url))n&&setTimeout(function(){n(Error("invalid arguments: origin of url and relay_url must match"))},0);else{a&&(o=document.createElement("iframe"),o.setAttribute("src",this.options.relay_url),o.style.display="none",o.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(o),s=o.contentWindow),t+=(/\?/.test(t)?"":"?")+cf(e);var u=window.open(t,this.options.window_name,this.options.window_features);s||(s=u);var c=setInterval(function(){u&&u.closed&&(i(!1),n&&(n(U("USER_CANCELLED")),n=null))},500),l=v({a:"request",d:e});Ze(window,"unload",i),Ze(window,"message",r)}},na("fb.login.transports.Popup.prototype.open",jf.prototype.open),jf.isAvailable=function(){return"postMessage"in window&&!/^file:\//.test(location.href)&&!(ef()||navigator.userAgent.match(/Windows Phone/)||window.Windows&&/^ms-appx:/.test(location.href)||navigator.userAgent.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i)||navigator.userAgent.match(/CriOS/)||navigator.userAgent.match(/Twitter for iPhone/)||navigator.userAgent.match(/FBAN\/FBIOS/)||window.navigator.standalone)&&!navigator.userAgent.match(/PhantomJS/)},jf.prototype.oc=function(){return"popup"},kf.prototype.open=function(t,e,n){function i(){n&&(n(U("REQUEST_INTERRUPTED")),n=null)}function r(){setTimeout(function(){delete window.__firebase_auth_jsonp[o],wd(window.__firebase_auth_jsonp)&&delete window.__firebase_auth_jsonp;try{var t=document.getElementById(o);t&&t.parentNode.removeChild(t)}catch(e){}},1),$e(window,"beforeunload",i)}var o="fn"+(new Date).getTime()+Math.floor(99999*Math.random());e[this.options.callback_parameter]="__firebase_auth_jsonp."+o,t+=(/\?/.test(t)?"":"?")+cf(e),Ze(window,"beforeunload",i),window.__firebase_auth_jsonp[o]=function(t){n&&(n(null,t),n=null),r()},lf(o,t,n)},kf.isAvailable=function(){return!ef()},kf.prototype.oc=function(){return"json"},mf.prototype.set=function(t,e){if(!e){if(!this.Md.length)throw Error("fb.login.SessionManager : No storage options available!");e=this.Md[0]}e.set(this.Ee,t)},mf.prototype.get=function(){var t=Ma(this.Md,q(this.Sf,this)),t=La(t,function(t){return null!==t});return Ua(t,function(t,e){return qe(e.token)-qe(t.token)}),0=i(o,n)&&(o=T(r));o;)t=t.w(o.name,E),o=T(r);return t},oa(Rf,Qf),Rf.prototype.ya=function(t,e,n,i){if(e.type===Mf&&e.source.ke){var r=e.path,o=e.children,s=W(t);if(s&&r.e()&&ud(o,function(t,e){return s.$(e)})){var a;return(e=n.za(i||t.k||t.g))?a=this.n(this.X(e)):(a=s||E,A(o,function(t,e){a=a.w(e,t)}),a=this.n(this.X(a))),t.o?new X(t.k,t.g,a,null):new X(t.k,t.g,null,a)}}return Rf.Ne.ya.call(this,t,e,n,i)},Rf.prototype.n=function(t){if(Pf(this,t),t.R())return E;var e,n,i;if(2*this.wb=o(r,n)&&it?-1:1}),dg=new bg(null);h=bg.prototype,h.e=function(){return null===this.value&&this.children.e()},h.subtree=function(t){if(t.e())return this;var e=this.children.get(J(t));return null!==e?e.subtree(Q(t)):dg},h.set=function(t,e){if(t.e())return new bg(e,this.children);var n=J(t),i=(this.children.get(n)||dg).set(Q(t),e),n=this.children.La(n,i);return new bg(this.value,n)},h.remove=function(t){if(t.e())return this.children.e()?dg:new bg(null,this.children);var e=J(t),n=this.children.get(e);return n?(t=n.remove(Q(t)),e=t.e()?this.children.remove(e):this.children.La(e,t),null===this.value&&e.e()?dg:new bg(this.value,e)):this},h.get=function(t){if(t.e())return this.value;var e=this.children.get(J(t));return e?e.get(Q(t)):null},h=qg.prototype,h.e=function(){return wd(this.xa)},h.ya=function(t,e,n){var i=t.source.Nc;if(null!==i)return i=u(this.xa,i),x(null!=i,"SyncTree gave us an op for an invalid query."),i.ya(t,e,n);var r=[];return A(this.xa,function(i){r=r.concat(i.ya(t,e,n))}),r},h.Fb=function(t,e,n,i,r){var o=t.Da(),s=u(this.xa,o);return s||(n=(s=n.za(i))?null:n.$d(r),i=new X(i,r,s,n),s=new Zf(t,i),this.xa[o]=s),s.Fb(e),t=s,(o=W(t.la))?(i=Gf(t.ed,ag,t.la,R),e=Wf(t.Ye,i,o,e?[e]:t.Ka)):e=[],e},h.eb=function(t,e,n){var i=t.Da(),r=[],o=[],s=null!=rg(this);if("default"===i){var a=this;A(this.xa,function(t,i){o=o.concat(t.eb(e,n)),t.e()&&(delete a.xa[i],Xb(t.Y.C)||r.push(t.Y))})}else{var h=u(this.xa,i);h&&(o=o.concat(h.eb(e,n)),h.e()&&(delete this.xa[i],Xb(h.Y.C)||r.push(h.Y)))}return s&&null==rg(this)&&r.push(new M(t.j,t.path)),{lg:r,Pf:o}},h.ma=function(t){var e=rg(this);return null!=e&&(e=e.ma())?e.P(t):null},h=ug.prototype,h.Kb=function(t){var e=fg(this.V,t);if(e){var n=e.value;return t=S(e.path,t),n.P(t)}return null},h.za=function(t,e,n,i){var r,o;return n||i?(r=this.V.subtree(t),!i&&r.e()?e:i||null!==e||null!==r.value?(r=yg(this.pa,function(e){return!(!e.visible&&!i||n&&0<=Ja(n,e.Ud)||!e.path.contains(t)&&!t.contains(e.path))},t),o=e||E,ng(r,function(t,e){o=o.u(t,e)}),o):null):(r=fg(this.V,t))?(e=S(r.path,t),r.value.P(e)):(r=this.V.subtree(t),r.e()?e:e||r.value?(o=e||E,ng(r,function(t,e){o=o.u(t,e)}),o):null)},h.$d=function(t,e){var n=!1,i=E,r=this.Kb(t);return r?(r.R()||r.ga(F,function(t,e){i=i.w(t,e)}),i):e?(i=e,pg(this.V.subtree(t),function(t,e){i=i.w(t,e)}),i):(pg(this.V.subtree(t),function(t,e){n=!0,i=i.w(t,e)}),n?i:null)},h.Wa=function(t,e,n,i){if(x(n||i,"Either existingEventSnap or existingServerSnap must exist"),t=t.B(e),fg(this.V,t))return null;if(t=this.V.subtree(t),t.e())return i.P(e);var r,o;return n?(r=!1,o=n.P(e)):(r=!0,o=i.P(e)),ng(t,function(t,e){r||o.P(t).aa(e)||(r=!0),r&&(o=o.u(t,e))}),r?o:null},h.ae=function(t,e,n,i){if(x(i,"We should have an event cache already."),t=t.B(e),fg(this.V,t))return null;var r=i.P(e),o=!1,s=this.V.subtree(t);return A(n,function(t,e){var n=new N(e),i=fg(s,n);if(i){var a=S(i.path,n),i=i.value.P(a);r=r.u(n,i)}else if(o=!0,i=s.subtree(n),i.e())r=r.u(n,t);else{var h=t;ng(i,function(t,e){h=h.u(t,e)}),r=r.u(n,h)}}),o?r:null},h.be=function(t,e,n,i,r,o){var s;if(t=this.V.subtree(t),t.value?s=t.value:e&&(s=e,ng(t,function(t,e){s=s.u(t,e)})),s){for(e=[],t=Kb(F),r=r?s.Ob(n,o):s.rb(n,o),o=T(r);o&&e.lengthr.zc,"Stacking an older write on top of newer ones"),m(o)||(o=!0),r.pa.push({path:t,Qa:e,Ud:n,visible:o}),o&&(r.V=Ag(r.V,t,e)),r.zc=n,i?Kg(this,new Dg(Fg,t,e)):[]},h.Yd=function(t,e,n){var i=this.bb;return x(n>i.zc,"Stacking an older merge on top of newer ones"),i.pa.push({path:t,children:e,Ud:n,visible:!0}),i.V=Bg(i.V,t,e),i.zc=n,Kg(this,new Gg(Fg,t,e))},h.Ga=function(t,e){e=e||!1;var n=vg(this.bb,t);return null==n?[]:Kg(this,new Eg(n,e))},h.jb=function(t,e){return Kg(this,new Dg(Ig,t,e))},h.Xd=function(t,e){return Kg(this,new Gg(Ig,t,e))},h.Fb=function(t,e){var n=t.path,i=null,r=!1;lg(this.ja,n,function(t,e){var o=S(t,n);return i=e.ma(o),r=r||null!=rg(e),!i});var o=this.ja.get(n);o?(r=r||null!=rg(o),i=i||o.ma(R)):(o=new qg,this.ja=this.ja.set(n,o));var s=null;if(!i){var a=!1,s=E;pg(this.ja.subtree(n),function(t,e){var n=e.ma(R);n&&(a=!0,s=s.w(t,n))}),a||(s=null)}var h=null!=tg(o,t);if(!h&&!Xb(t.C)){var u=Og(t);x(!(u in this.ac),"View does not exist, but we have a tag");var c=Pg++;this.ac[u]=c,this.Nd["_"+c]=u}return u=o.Fb(t,e,new Cg(n,this.bb),i,s),h||r||(o=tg(o,t),u=u.concat(Qg(this,t,o))),u},h.eb=function(t,e,n){var i=t.path,r=this.ja.get(i),o=[];if(r&&("default"===t.Da()||null!=tg(r,t))){o=r.eb(t,e,n),r.e()&&(this.ja=this.ja.remove(i)),r=o.lg,o=o.Pf,e=-1!==Qa(r,function(t){return Xb(t.C)});var s=jg(this.ja,i,function(t,e){return null!=rg(e)});if(e&&!s&&(i=this.ja.subtree(i),!i.e()))for(var i=Rg(i),a=0;ar;r++)e+=" ";console.log(e+i)}}},h.Le=function(t){Bd(this.Ea,t),this.wf.Me[t]=!0},h.f=function(){kb("r:"+this.U.id+":",arguments)},ca(rh),rh.prototype.tb=function(){for(var t in this.dc)this.dc[t].tb()},rh.prototype.interrupt=rh.prototype.tb,rh.prototype.ec=function(){for(var t in this.dc)this.dc[t].ec()},rh.prototype.resume=rh.prototype.ec,sh.prototype.Zb=function(t){var e,n=this;try{e=sa(t.data)}catch(i){}e&&"request"===e.a&&($e(window,"message",this.Zb),this.Od=t.origin,this.nc&&setTimeout(function(){n.nc(n.Od,e.d,function(t,e){n.If=!e,n.nc=void 0,th(n,{a:"response",d:t,forceKeepWindowOpen:e})})},0))},sh.prototype.dg=function(){try{$e(this.nd,"message",this.jf)}catch(t){}this.nc&&(th(this,{a:"error",d:"unknown closed window"}),this.nc=void 0);try{window.close()}catch(e){}},sh.prototype.jf=function(t){if(this.If&&"die"===t.data)try{window.close()}catch(e){}};var Y={Qf:function(){Td=Kd=!0}};Y.forceLongPolling=Y.Qf,Y.Rf=function(){Ud=!0},Y.forceWebSockets=Y.Rf,Y.rg=function(t,e){t.j.U.Ie=e},Y.setSecurityDebugCallback=Y.rg,Y.Ke=function(t,e){t.j.Ke(e)},Y.stats=Y.Ke,Y.Le=function(t,e){t.j.Le(e)},Y.statsIncrementCounter=Y.Le,Y.cd=function(t){return t.j.cd},Y.dataUpdateCount=Y.cd,Y.Uf=function(t,e){t.j.pe=e},Y.interceptServerData=Y.Uf,Y.ag=function(t){new sh(t)},Y.onPopupOpen=Y.ag,Y.og=function(t){Te=t},Y.setAuthenticationServer=Y.og,Z.prototype.cancel=function(t){G("Firebase.onDisconnect().cancel",0,1,arguments.length),I("Firebase.onDisconnect().cancel",1,t,!0),this.Oc.Ae(this.Ca,t||null)},Z.prototype.cancel=Z.prototype.cancel,Z.prototype.remove=function(t){G("Firebase.onDisconnect().remove",0,1,arguments.length),jc("Firebase.onDisconnect().remove",this.Ca),I("Firebase.onDisconnect().remove",1,t,!0),eh(this.Oc,this.Ca,null,t)},Z.prototype.remove=Z.prototype.remove,Z.prototype.set=function(t,e){G("Firebase.onDisconnect().set",1,2,arguments.length),jc("Firebase.onDisconnect().set",this.Ca),bc("Firebase.onDisconnect().set",t,!1),I("Firebase.onDisconnect().set",2,e,!0),eh(this.Oc,this.Ca,t,e)},Z.prototype.set=Z.prototype.set,Z.prototype.Db=function(t,e,n){G("Firebase.onDisconnect().setWithPriority",2,3,arguments.length),jc("Firebase.onDisconnect().setWithPriority",this.Ca),bc("Firebase.onDisconnect().setWithPriority",t,!1),fc("Firebase.onDisconnect().setWithPriority",2,e,!1),I("Firebase.onDisconnect().setWithPriority",3,n,!0),fh(this.Oc,this.Ca,t,e,n)},Z.prototype.setWithPriority=Z.prototype.Db,Z.prototype.update=function(t,e){if(G("Firebase.onDisconnect().update",1,2,arguments.length),jc("Firebase.onDisconnect().update",this.Ca),ea(t)){for(var n={},i=0;i=0;o--)r[o]="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(n%64),n=Math.floor(n/64);if(x(0===n,"Cannot push at time == 0"),n=r.join(""),i){for(o=11;o>=0&&63===e[o];o--)e[o]=0;e[o]++}else for(o=0;12>o;o++)e[o]=Math.floor(64*Math.random());for(o=0;12>o;o++)n+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(e[o]);return x(20===n.length,"NextPushId: Length should be 20."),n}}();oa(M,L),na("Firebase",M),M.prototype.name=function(){G("Firebase.name",0,0,arguments.length);var t;return this.path.e()?t=null:(t=this.path,t=t.da\\n
\\n \\n \\n \\n

Hacker News

\\n \\n Built with Vue.js |\\n Source\\n \\n
\\n \\n
\";\nmodule.exports = {\n el: '#app',\n data: {\n view: '',\n params: {\n page: 1,\n userId: null,\n itemId: null\n }\n },\n filters: {\n fromNow: require('./filters/from-now'),\n domain: require('./filters/domain')\n },\n components: {\n 'news-view': require('./views/news-view.vue'),\n 'item-view': require('./views/item-view.vue'),\n 'user-view': require('./views/user-view.vue')\n }\n}\nmodule.exports.template = __vue_template__;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/app.vue\n ** module id = 1\n ** module chunks = 0\n **/","var _ = require('./util')\nvar extend = _.extend\n\n/**\n * The exposed Vue constructor.\n *\n * API conventions:\n * - public API methods/properties are prefiexed with `$`\n * - internal methods/properties are prefixed with `_`\n * - non-prefixed properties are assumed to be proxied user\n * data.\n *\n * @constructor\n * @param {Object} [options]\n * @public\n */\n\nfunction Vue (options) {\n this._init(options)\n}\n\n/**\n * Mixin global API\n */\n\nextend(Vue, require('./api/global'))\n\n/**\n * Vue and every constructor that extends Vue has an\n * associated options object, which can be accessed during\n * compilation steps as `this.constructor.options`.\n *\n * These can be seen as the default options of every\n * Vue instance.\n */\n\nVue.options = {\n directives : require('./directives'),\n filters : require('./filters'),\n partials : {},\n transitions : {},\n components : {}\n}\n\n/**\n * Build up the prototype\n */\n\nvar p = Vue.prototype\n\n/**\n * $data has a setter which does a bunch of\n * teardown/setup work\n */\n\nObject.defineProperty(p, '$data', {\n get: function () {\n return this._data\n },\n set: function (newData) {\n this._setData(newData)\n }\n})\n\n/**\n * Mixin internal instance methods\n */\n\nextend(p, require('./instance/init'))\nextend(p, require('./instance/events'))\nextend(p, require('./instance/scope'))\nextend(p, require('./instance/compile'))\n\n/**\n * Mixin public API methods\n */\n\nextend(p, require('./api/data'))\nextend(p, require('./api/dom'))\nextend(p, require('./api/events'))\nextend(p, require('./api/child'))\nextend(p, require('./api/lifecycle'))\n\nmodule.exports = _.Vue = Vue\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/vue/src/vue.js\n ** module id = 2\n ** module chunks = 0\n **/","\n\n//\n// Generated on Sat Dec 06 2014 16:08:09 GMT-0500 (EST) by Charlie Robbins, Paolo Fragomeni & the Contributors (Using Codesurgeon).\n// Version 1.2.4\n//\n\n(function (exports) {\n\n/*\n * browser.js: Browser specific functionality for director.\n *\n * (C) 2011, Charlie Robbins, Paolo Fragomeni, & the Contributors.\n * MIT LICENSE\n *\n */\n\nvar dloc = document.location;\n\nfunction dlocHashEmpty() {\n // Non-IE browsers return '' when the address bar shows '#'; Director's logic\n // assumes both mean empty.\n return dloc.hash === '' || dloc.hash === '#';\n}\n\nvar listener = {\n mode: 'modern',\n hash: dloc.hash,\n history: false,\n\n check: function () {\n var h = dloc.hash;\n if (h != this.hash) {\n this.hash = h;\n this.onHashChanged();\n }\n },\n\n fire: function () {\n if (this.mode === 'modern') {\n this.history === true ? window.onpopstate() : window.onhashchange();\n }\n else {\n this.onHashChanged();\n }\n },\n\n init: function (fn, history) {\n var self = this;\n this.history = history;\n\n if (!Router.listeners) {\n Router.listeners = [];\n }\n\n function onchange(onChangeEvent) {\n for (var i = 0, l = Router.listeners.length; i < l; i++) {\n Router.listeners[i](onChangeEvent);\n }\n }\n\n //note IE8 is being counted as 'modern' because it has the hashchange event\n if ('onhashchange' in window && (document.documentMode === undefined\n || document.documentMode > 7)) {\n // At least for now HTML5 history is available for 'modern' browsers only\n if (this.history === true) {\n // There is an old bug in Chrome that causes onpopstate to fire even\n // upon initial page load. Since the handler is run manually in init(),\n // this would cause Chrome to run it twise. Currently the only\n // workaround seems to be to set the handler after the initial page load\n // http://code.google.com/p/chromium/issues/detail?id=63040\n setTimeout(function() {\n window.onpopstate = onchange;\n }, 500);\n }\n else {\n window.onhashchange = onchange;\n }\n this.mode = 'modern';\n }\n else {\n //\n // IE support, based on a concept by Erik Arvidson ...\n //\n var frame = document.createElement('iframe');\n frame.id = 'state-frame';\n frame.style.display = 'none';\n document.body.appendChild(frame);\n this.writeFrame('');\n\n if ('onpropertychange' in document && 'attachEvent' in document) {\n document.attachEvent('onpropertychange', function () {\n if (event.propertyName === 'location') {\n self.check();\n }\n });\n }\n\n window.setInterval(function () { self.check(); }, 50);\n\n this.onHashChanged = onchange;\n this.mode = 'legacy';\n }\n\n Router.listeners.push(fn);\n\n return this.mode;\n },\n\n destroy: function (fn) {\n if (!Router || !Router.listeners) {\n return;\n }\n\n var listeners = Router.listeners;\n\n for (var i = listeners.length - 1; i >= 0; i--) {\n if (listeners[i] === fn) {\n listeners.splice(i, 1);\n }\n }\n },\n\n setHash: function (s) {\n // Mozilla always adds an entry to the history\n if (this.mode === 'legacy') {\n this.writeFrame(s);\n }\n\n if (this.history === true) {\n window.history.pushState({}, document.title, s);\n // Fire an onpopstate event manually since pushing does not obviously\n // trigger the pop event.\n this.fire();\n } else {\n dloc.hash = (s[0] === '/') ? s : '/' + s;\n }\n return this;\n },\n\n writeFrame: function (s) {\n // IE support...\n var f = document.getElementById('state-frame');\n var d = f.contentDocument || f.contentWindow.document;\n d.open();\n d.write(\" + - \ No newline at end of file + diff --git a/package.json b/package.json index ebc8b98..6721a23 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,9 @@ "name": "vue-hackernews", "version": "1.0.0", "description": "HN clone with Vue.js using HN API", - "main": "index.js", "scripts": { - "dev": "webpack --module-bind \"vue=vue\" --watch --devtool source-map src/main.js build/build.js", - "build": "webpack --module-bind \"vue=vue\" --plugin webpack/lib/optimize/UglifyJsPlugin src/main.js build/build.js" + "dev": "webpack-dev-server --inline --hot --no-info", + "build": "cross-env NODE_ENV=production webpack --progress --hide-modules" }, "repository": { "type": "git", @@ -18,13 +17,26 @@ }, "homepage": "https://github.com/yyx990803/vue-hackernews", "devDependencies": { - "stylus": "^0.49.3", - "vue-loader": "^1.1.0", - "webpack": "^1.4.13" + "babel-core": "^6.0.0", + "babel-loader": "^6.0.0", + "babel-plugin-transform-runtime": "^6.0.0", + "babel-preset-es2015": "^6.0.0", + "babel-runtime": "^6.0.0", + "cross-env": "^2.0.1", + "css-loader": "^0.24.0", + "stylus": "^0.54.5", + "stylus-loader": "^2.1.1", + "vue-hot-reload-api": "^1.2.0", + "vue-html-loader": "^1.0.0", + "vue-loader": "^8.0.0", + "vue-style-loader": "^1.0.0", + "webpack": "^1.12.2", + "webpack-dev-server": "^1.12.0" }, "dependencies": { - "director": "^1.2.3", - "firebase": "^1.1.1", - "vue": "0.11.3" + "es6-promise": "^3.0.2", + "firebase": "^3.4.1", + "vue": "^1.0.26", + "vue-router": "^0.7.13" } } diff --git a/src/app.vue b/src/app.vue deleted file mode 100644 index dbfbd62..0000000 --- a/src/app.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/App.vue b/src/components/App.vue new file mode 100644 index 0000000..39271d5 --- /dev/null +++ b/src/components/App.vue @@ -0,0 +1,93 @@ + + + diff --git a/src/components/Comment.vue b/src/components/Comment.vue new file mode 100644 index 0000000..914e83e --- /dev/null +++ b/src/components/Comment.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/src/components/Item.vue b/src/components/Item.vue new file mode 100644 index 0000000..215130e --- /dev/null +++ b/src/components/Item.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/src/components/ItemView.vue b/src/components/ItemView.vue new file mode 100644 index 0000000..1be4c33 --- /dev/null +++ b/src/components/ItemView.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/components/NewsView.vue b/src/components/NewsView.vue new file mode 100644 index 0000000..3872f90 --- /dev/null +++ b/src/components/NewsView.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/src/components/UserView.vue b/src/components/UserView.vue new file mode 100644 index 0000000..a62b12d --- /dev/null +++ b/src/components/UserView.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/components/comment.vue b/src/components/comment.vue deleted file mode 100644 index 6fa7b90..0000000 --- a/src/components/comment.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/item.vue b/src/components/item.vue deleted file mode 100644 index c3fa8f1..0000000 --- a/src/components/item.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/filters/domain.js b/src/filters/domain.js deleted file mode 100644 index 6aec14d..0000000 --- a/src/filters/domain.js +++ /dev/null @@ -1,6 +0,0 @@ -var parser = document.createElement('a') - -module.exports = function (url) { - parser.href = url - return parser.hostname -} \ No newline at end of file diff --git a/src/filters/from-now.js b/src/filters/from-now.js deleted file mode 100644 index 85539d4..0000000 --- a/src/filters/from-now.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = function (time) { - var between = Date.now() / 1000 - Number(time) - if (between < 3600) { - return ~~(between / 60) + ' minutes' - } else if (between < 86400) { - return ~~(between / 3600) + ' hours' - } else { - return ~~(between / 86400) + ' days' - } -} \ No newline at end of file diff --git a/src/filters/index.js b/src/filters/index.js new file mode 100644 index 0000000..e14a6fd --- /dev/null +++ b/src/filters/index.js @@ -0,0 +1,25 @@ +const urlParser = document.createElement('a') + +export function domain (url) { + urlParser.href = url + return urlParser.hostname +} + +export function fromNow (time) { + const between = Date.now() / 1000 - Number(time) + if (between < 3600) { + return pluralize(~~(between / 60), ' minute') + } else if (between < 86400) { + return pluralize(~~(between / 3600), ' hour') + } else { + return pluralize(~~(between / 86400), ' day') + } +} + +function pluralize(time, label) { + if (time === 1) { + return time + label + } + + return time + label + 's'; +} diff --git a/src/main.js b/src/main.js index 6b0c172..d1a5e7b 100644 --- a/src/main.js +++ b/src/main.js @@ -1,34 +1,39 @@ -/** - * Boot up the Vue instance and wire up the router. - */ +import Vue from 'vue' +import Router from 'vue-router' +import { domain, fromNow } from './filters' +import App from './components/App.vue' +import NewsView from './components/NewsView.vue' +import ItemView from './components/ItemView.vue' +import UserView from './components/UserView.vue' -var Vue = require('vue') -var Router = require('director').Router -var app = new Vue(require('./app.vue')) -var router = new Router() +// install router +Vue.use(Router) -router.on('/news/:page', function (page) { - window.scrollTo(0, 0) - app.view = 'news-view' - app.params.page = +page -}) +// register filters globally +Vue.filter('fromNow', fromNow) +Vue.filter('domain', domain) -router.on('/user/:id', function (id) { - window.scrollTo(0, 0) - app.view = 'user-view' - app.params.userId = id +// routing +var router = new Router() + +router.map({ + '/news/:page': { + component: NewsView + }, + '/user/:id': { + component: UserView + }, + '/item/:id': { + component: ItemView + } }) -router.on('/item/:id', function (id) { +router.beforeEach(function () { window.scrollTo(0, 0) - app.view = 'item-view' - app.params.itemId = id }) -router.configure({ - notfound: function () { - router.setRoute('/news/1') - } +router.redirect({ + '*': '/news/1' }) -router.init('/news/1') \ No newline at end of file +router.start(App, '#app') diff --git a/src/store.js b/src/store.js deleted file mode 100644 index 95f68f4..0000000 --- a/src/store.js +++ /dev/null @@ -1,77 +0,0 @@ -var Firebase = require('firebase') -var api = new Firebase('https://hacker-news.firebaseio.com/v0') -var storiesPerPage = 30 -var cachedStoryIds = [] -var Emitter = require('events').EventEmitter -var store = module.exports = new Emitter() - -/** - * Subscribe to real time updates of the top 100 stories, - * and cache the IDs locally. - */ - -api.child('topstories').on('value', function (snapshot) { - cachedStoryIds = snapshot.val() - store.emit('update') -}) - -/** - * Fetch an item data with given id. - * - * @param {Number} id - * @param {Function} cb(item) - */ - -store.fetchItem = function (id, cb) { - api.child('item/' + id).once('value', function (snapshot) { - cb(snapshot.val()) - }) -} - -/** - * Fetch a user data with given id. - * - * @param {Number} id - * @param {Function} cb(user) - */ - -store.fetchUser = function (id, cb) { - api.child('user/' + id).once('value', function (snapshot) { - cb(snapshot.val()) - }) -} - -/** - * Fetch the given list of items. - * - * @param {Array} ids - * @param {Function} cb(items) - */ - -store.fetchItems = function (ids, cb) { - if (!ids || !ids.length) return cb([]) - var items = [] - ids.forEach(function (id) { - store.fetchItem(id, addItem) - }) - function addItem (item) { - items.push(item) - if (items.length >= ids.length) { - cb(items) - } - } -} - -/** - * Fetch items for the given page. - * - * @param {Number} page - * @param {Function} cb(stories) - */ - -store.fetchItemsByPage = function (page, cb) { - var start = (page - 1) * storiesPerPage - var end = page * storiesPerPage - var ids = cachedStoryIds.slice(start, end) - store.fetchItems(ids, cb) -} \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js new file mode 100644 index 0000000..34360a1 --- /dev/null +++ b/src/store/index.js @@ -0,0 +1,92 @@ +import Firebase from 'firebase/app' +import Database from 'firebase/database' +import { EventEmitter } from 'events' +import { Promise } from 'es6-promise' + +const config = { + databaseURL: 'https://hacker-news.firebaseio.com' +} +Firebase.initializeApp(config) +const version = '/v0' +const api = Firebase.database().ref(version) +const itemsCache = Object.create(null) +const store = new EventEmitter() +const storiesPerPage = store.storiesPerPage = 30 + +let topStoryIds = [] + +export default store + +/** + * Subscribe to real time updates of the top 100 stories, + * and cache the IDs locally. + */ + +api.child('topstories').on('value', snapshot => { + topStoryIds = snapshot.val() + store.emit('topstories-updated') +}) + +/** + * Fetch an item data with given id. + * + * @param {Number} id + * @return {Promise} + */ + +store.fetchItem = id => { + return new Promise((resolve, reject) => { + if (itemsCache[id]) { + resolve(itemsCache[id]) + } else { + api.child('item/' + id).once('value', snapshot => { + const story = itemsCache[id] = snapshot.val() + resolve(story) + }, reject) + } + }) +} + +/** + * Fetch the given list of items. + * + * @param {Array} ids + * @return {Promise} + */ + +store.fetchItems = ids => { + if (!ids || !ids.length) { + return Promise.resolve([]) + } else { + return Promise.all(ids.map(id => store.fetchItem(id))) + } +} + +/** + * Fetch items for the given page. + * + * @param {Number} page + * @return {Promise} + */ + +store.fetchItemsByPage = page => { + const start = (page - 1) * storiesPerPage + const end = page * storiesPerPage + const ids = topStoryIds.slice(start, end) + return store.fetchItems(ids) +} + +/** + * Fetch a user data with given id. + * + * @param {Number} id + * @return {Promise} + */ + +store.fetchUser = id => { + return new Promise((resolve, reject) => { + api.child('user/' + id).once('value', snapshot => { + resolve(snapshot.val()) + }, reject) + }) +} diff --git a/src/shared.styl b/src/variables.styl similarity index 100% rename from src/shared.styl rename to src/variables.styl diff --git a/src/views/item-view.vue b/src/views/item-view.vue deleted file mode 100644 index ff23894..0000000 --- a/src/views/item-view.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/news-view.vue b/src/views/news-view.vue deleted file mode 100644 index 2417209..0000000 --- a/src/views/news-view.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/user-view.vue b/src/views/user-view.vue deleted file mode 100644 index da0c22e..0000000 --- a/src/views/user-view.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - \ No newline at end of file diff --git a/static/build.js b/static/build.js new file mode 100644 index 0000000..1072695 --- /dev/null +++ b/static/build.js @@ -0,0 +1,52 @@ +!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="/static/",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}var r=n(75),o=i(r),s=n(68),a=i(s),u=n(23),c=n(63),h=i(c),l=n(66),f=i(l),p=n(65),d=i(p),v=n(67),g=i(v);o.default.use(a.default),o.default.filter("fromNow",u.fromNow),o.default.filter("domain",u.domain);var b=new a.default;b.map({"/news/:page":{component:f.default},"/user/:id":{component:g.default},"/item/:id":{component:d.default}}),b.beforeEach(function(){window.scrollTo(0,0)}),b.redirect({"*":"/news/1"}),b.start(h.default,"#app")},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e=0&&b.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function u(t,e){var n,i,r;if(e.singleton){var o=g++;n=v||(v=a(e)),i=c.bind(null,n,o,!1),r=c.bind(null,n,o,!0)}else n=a(e),i=h.bind(null,n),r=function(){s(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}function c(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=m(e,r);else{var o=document.createTextNode(r),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(o,s[e]):t.appendChild(o)}}function h(t,e){var n=e.css,i=e.media,r=e.sourceMap;if(i&&t.setAttribute("media",i),r&&(n+="\n/*# sourceURL="+r.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var l={},f=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},p=f(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),d=f(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,g=0,b=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=p()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var n=r(t);return i(n,e),function(t){for(var o=[],s=0;s0?i:n)(t)}},function(t,e,n){var i=n(36),r=n(30);t.exports=function(t){return i(r(t))}},function(t,e){(function(e){/*! @license Firebase v3.6.0 + Build: 3.6.0-rc.3 + Terms: https://developers.google.com/terms */ +var n=null;!function(){function t(t,e){function n(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function i(t,e,n,i){var r,o=arguments.length,s=3>o?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if(r=f.Reflect,"object"==typeof r&&"function"==typeof r.decorate)s=r.decorate(t,e,n,i);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(s=(3>o?r(s):3"}),n=this.W+": "+n+" ("+t+").",n=new _t(t,n);for(i in e)e.hasOwnProperty(i)&&"_"!==i.slice(-1)&&(n[i]=e[i]);return n};var kt=vt,Ct=function(t,e,n){var i=this;this.I=n,this.J=!1,this.i={},this.C=e,this.F=o(void 0,t),t="serviceAccount"in this.F,("credential"in this.F||t)&&"undefined"!=typeof console&&console.log("The '"+(t?"serviceAccount":"credential")+"' property specified in the first argument to initializeApp() is deprecated and will be removed in the next major version. You should instead use the 'firebase-admin' package. See https://firebase.google.com/docs/admin/setup for details on how to get started."),Object.keys(n.INTERNAL.factories).forEach(function(t){var e=n.INTERNAL.useAsService(i,t);null!==e&&(e=i.S.bind(i,e),i[t]=e)})};Ct.prototype.delete=function(){var t=this;return new kt(function(e){At(t),e()}).then(function(){return t.I.INTERNAL.removeApp(t.C),kt.all(Object.keys(t.i).map(function(e){return t.i[e].INTERNAL.delete()}))}).then(function(){t.J=!0,t.i={}})},Ct.prototype.S=function(t){return At(this),void 0===this.i[t]&&(this.i[t]=this.I.INTERNAL.factories[t](this,this.R.bind(this))),this.i[t]},Ct.prototype.R=function(t){o(this,t)};var At=function(t){t.J&&h(l("deleted",{name:t.C}))};d.Object.defineProperties(Ct.prototype,{name:{configurable:!0,enumerable:!0,get:function(){return At(this),this.C}},options:{configurable:!0,enumerable:!0,get:function(){return At(this),this.F}}}),Ct.prototype.name&&Ct.prototype.options||Ct.prototype.delete||console.log("dc"),"undefined"!=typeof n&&(n=c())}(),n.SDK_VERSION="3.6.0",t.exports=n}).call(e,function(){return this}())},function(t,e,n){var i,r,o={};n(71),i=n(19),r=n(59),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=i(r);e.default={name:"Comment",props:{comment:Object},data:function(){return{childComments:[],open:!0}},created:function(){var t=this;this.comment.kids&&o.default.fetchItems(this.comment.kids).then(function(e){t.childComments=e})}}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"Item",props:{item:Object,index:Number},computed:{href:function(){return this.item.url||"#/item/"+this.item.id},showInfo:function(){return"story"===this.item.type||"poll"===this.item.type},showDomain:function(){return"story"===this.item.type}}}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=i(r),s=n(17),a=i(s),u=n(64),c=i(u);e.default={name:"ItemView",components:{Item:a.default,Comment:c.default},data:function(){return{item:{},comments:[],pollOptions:null}},route:{data:function(t){var e=t.to;return o.default.fetchItem(e.params.id).then(function(t){return document.title=t.title+" | Vue.js HN Clone",{item:t,comments:o.default.fetchItems(t.kids),pollOptions:"poll"===t.type?o.default.fetchItems(t.parts):null}})}},computed:{isJob:function(){return"job"===this.item.type},hasText:function(){return this.item.hasOwnProperty("text")}}}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=i(r),s=n(17),a=i(s);e.default={name:"NewsView",components:{Item:a.default},data:function(){return{page:1,items:[]}},route:{data:function(t){var e=t.to,n=+e.params.page;return document.title="Vue.js HN Clone",o.default.fetchItemsByPage(n).then(function(t){return{page:n,items:t}})}},created:function(){o.default.on("topstories-updated",this.update)},destroyed:function(){o.default.removeListener("topstories-updated",this.update)},methods:{update:function(){var t=this;o.default.fetchItemsByPage(this.page).then(function(e){t.items=e})}},filters:{formatItemIndex:function(t){return(this.page-1)*o.default.storiesPerPage+t+1}}}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=i(r);e.default={name:"UserView",data:function(){return{user:{}}},route:{data:function(t){var e=t.to;return document.title="Profile: "+e.params.id+" | Vue.js HN Clone",{user:o.default.fetchUser(e.params.id)}}}}},function(t,e){"use strict";function n(t){return o.href=t,o.hostname}function i(t){var e=Date.now()/1e3-Number(t);return e<3600?r(~~(e/60)," minute"):e<86400?r(~~(e/3600)," hour"):r(~~(e/86400)," day")}function r(t,e){return 1===t?t+e:t+e+"s"}Object.defineProperty(e,"__esModule",{value:!0}),e.domain=n,e.fromNow=i;var o=document.createElement("a")},function(t,e,n){t.exports={default:n(25),__esModule:!0}},function(t,e,n){n(47);var i=n(8).Object;t.exports=function(t,e){return i.create(t,e)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(15),r=n(44),o=n(43);t.exports=function(t){return function(e,n,s){var a,u=i(e),c=r(u.length),h=o(s,c);if(t&&n!=n){for(;c>h;)if(a=u[h++],a!=a)return!0}else for(;c>h;h++)if((t||h in u)&&u[h]===n)return t||h||0;return!t&&-1}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var i=n(26);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i=n(5),r=n(8),o=n(29),s=n(33),a="prototype",u=function(t,e,n){var c,h,l,f=t&u.F,p=t&u.G,d=t&u.S,v=t&u.P,g=t&u.B,b=t&u.W,m=p?r:r[e]||(r[e]={}),y=m[a],w=p?i:d?i[e]:(i[e]||{})[a];p&&(n=e);for(c in n)h=!f&&w&&void 0!==w[c],h&&c in m||(l=h?w[c]:n[c],m[c]=p&&"function"!=typeof w[c]?n[c]:g&&h?o(l,i):b&&w[c]==l?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e[a]=t[a],e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[c]=l,t&u.R&&y&&!y[c]&&s(y,c,l)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var i=n(12),r=n(41);t.exports=n(4)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){t.exports=n(5).document&&document.documentElement},function(t,e,n){t.exports=!n(4)&&!n(11)(function(){return 7!=Object.defineProperty(n(9)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(28);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,n){var i=n(6),r=n(38),o=n(10),s=n(13)("IE_PROTO"),a=function(){},u="prototype",c=function(){var t,e=n(9)("iframe"),i=o.length,r="<",s=">";for(e.style.display="none",n(34).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(r+"script"+s+"document.F=Object"+r+"/script"+s),t.close(),c=t.F;i--;)delete c[u][o[i]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[u]=i(t),n=new a,a[u]=null,n[s]=t):n=c(),void 0===e?n:r(n,e)}},function(t,e,n){var i=n(12),r=n(6),o=n(40);t.exports=n(4)?Object.defineProperties:function(t,e){r(t);for(var n,s=o(e),a=s.length,u=0;a>u;)i.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var i=n(32),r=n(15),o=n(27)(!1),s=n(13)("IE_PROTO");t.exports=function(t,e){var n,a=r(t),u=0,c=[];for(n in a)n!=s&&i(a,n)&&c.push(n);for(;e.length>u;)i(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var i=n(39),r=n(10);t.exports=Object.keys||function(t){return i(t,r)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var i=n(5),r="__core-js_shared__",o=i[r]||(i[r]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,n){var i=n(14),r=Math.max,o=Math.min;t.exports=function(t,e){return t=i(t),t<0?r(t+e,0):o(t,e)}},function(t,e,n){var i=n(14),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t,e,n){var i=n(7);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},function(t,e,n){var i=n(31);i(i.S,"Object",{create:n(37)})},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,"body,html{font-family:Verdana;font-size:13px;height:100%}ul{list-style-type:none;padding:0;margin:0}a{color:#000;cursor:pointer;text-decoration:none}#wrapper{background-color:#f6f6ef;width:85%;min-height:80px;margin:0 auto}#header,#wrapper{position:relative}#header{background-color:#f60;height:24px}#header h1{font-weight:700;font-size:13px;display:inline-block;vertical-align:middle;margin:0}#header .source{color:#fff;font-size:11px;position:absolute;top:4px;right:4px}#header .source a{color:#fff}#header .source a:hover{text-decoration:underline}#yc{border:1px solid #fff;margin:2px;display:inline-block}#yc,#yc img{vertical-align:middle}.view{position:absolute;background-color:#f6f6ef;width:100%;-webkit-transition:opacity .2s ease;transition:opacity .2s ease;box-sizing:border-box;padding:8px 20px}.view.v-enter,.view.v-leave{opacity:0}@media screen and (max-width:700px){body,html{margin:0}#wrapper{width:100%}}",""])},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,".comhead{font-size:11px;margin-bottom:8px}.comhead,.comhead a{color:#828282}.comhead a:hover{text-decoration:underline}.comhead .toggle{margin-right:4px}.comment-content{margin:0 0 16px 24px;word-wrap:break-word}.comment-content code{white-space:pre-wrap}.child-comments{margin:8px 0 8px 22px}",""])},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,".item{padding:2px 0 2px 40px;position:relative;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.item p{margin:2px 0}.item .index,.item .title:visited{color:#828282}.item .index{position:absolute;width:30px;text-align:right;left:0;top:4px}.item .domain,.item .subtext{font-size:11px;color:#828282}.item .domain a,.item .subtext a{color:#828282}.item .subtext a:hover{text-decoration:underline}",""])},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,".item-view .item{padding-left:0;margin-bottom:30px}.item-view .item .index{display:none}.item-view .poll-options{margin-left:30px;margin-bottom:40px}.item-view .poll-options li{margin:12px 0}.item-view .poll-options p{margin:8px 0}.item-view .poll-options .subtext{color:#828282;font-size:11px}.item-view .itemtext{color:#828282;margin-top:0;margin-bottom:30px}.item-view .itemtext p{margin:10px 0}",""])},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,'.news-view{padding-left:5px;padding-right:15px}.news-view.loading:before{content:"Loading...";position:absolute;top:16px;left:20px}.news-view .nav{padding:10px 10px 10px 40px;margin-top:10px;border-top:2px solid #f60}.news-view .nav a{margin-right:10px}.news-view .nav a:hover{text-decoration:underline}',""])},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,".user-view{color:#828282}.user-view li{margin:5px 0}.user-view .label{display:inline-block;min-width:60px}.user-view .about{margin-top:1em}.user-view .links a{text-decoration:underline}",""])},function(t,e){/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version 3.3.1 + */ +!function(n,i){"object"==typeof e&&"undefined"!=typeof t?t.exports=i():"function"==typeof define&&define.amd?define(i):n.ES6Promise=i()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function e(t){return"function"==typeof t}function n(t){Q=t}function i(t){G=t}function r(){return function(){return process.nextTick(c)}}function o(){return function(){q(c)}}function s(){var t=0,e=new z(c),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function a(){var t=new MessageChannel;return t.port1.onmessage=c,function(){return t.port2.postMessage(0)}}function u(){var t=setTimeout;return function(){return t(c,1)}}function c(){for(var t=0;t0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var r=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,r,s,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,r=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(module,exports,__webpack_require__){var firebase=__webpack_require__(16);/*! @license Firebase v3.6.0 + Build: 3.6.0-rc.3 + Terms: https://developers.google.com/terms + + --- + + typedarray.js + Copyright (c) 2010, Linden Research, Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. */ +!function(){function n(t){return void 0!==t}function ba(){}function ca(t){t.Vb=function(){return t.Ye?t.Ye:t.Ye=new t}}function da(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&"undefined"!=typeof t.splice&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof t.call&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&"undefined"==typeof t.call)return"object";return e}function ea(t){return"array"==da(t)}function fa(t){var e=da(t);return"array"==e||"object"==e&&"number"==typeof t.length}function p(t){return"string"==typeof t}function ga(t){return"number"==typeof t}function ha(t){return"function"==da(t)}function ia(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function ja(t,e,n){return t.call.apply(t.bind,arguments)}function ka(t,e,n){if(!t)throw Error();if(2r;r++)i[r]=e.charCodeAt(n)<<24|e.charCodeAt(n+1)<<16|e.charCodeAt(n+2)<<8|e.charCodeAt(n+3),n+=4;else for(r=0;16>r;r++)i[r]=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],n+=4;for(r=16;80>r;r++){var o=i[r-3]^i[r-8]^i[r-14]^i[r-16];i[r]=4294967295&(o<<1|o>>>31)}e=t.M[0],n=t.M[1];for(var s,a=t.M[2],u=t.M[3],c=t.M[4],r=0;80>r;r++)40>r?20>r?(o=u^n&(a^u),s=1518500249):(o=n^a^u,s=1859775393):60>r?(o=n&a|u&(n|a),s=2400959708):(o=n^a^u,s=3395469782),o=(e<<5|e>>>27)+o+c+s+i[r]&4294967295,c=u,u=a,a=4294967295&(n<<30|n>>>2),n=e,e=o;t.M[0]=t.M[0]+e&4294967295,t.M[1]=t.M[1]+n&4294967295,t.M[2]=t.M[2]+a&4294967295,t.M[3]=t.M[3]+u&4294967295,t.M[4]=t.M[4]+c&4294967295}function r(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function pa(t,e){var n,i={};for(n in t)i[n]=e.call(void 0,t[n],n,t);return i}function qa(t,e){for(var n in t)if(!e.call(void 0,t[n],n,t))return!1;return!0}function ra(t){var e,n=0;for(e in t)n++;return n}function sa(t){for(var e in t)return e}function ta(t){var e,n=[],i=0;for(e in t)n[i++]=t[e];return n}function ua(t){var e,n=[],i=0;for(e in t)n[i++]=e;return n}function va(t,e){for(var n in t)if(t[n]==e)return!0;return!1}function wa(t,e,n){for(var i in t)if(e.call(n,t[i],i,t))return i}function xa(t,e){var n=wa(t,e,void 0);return n&&t[n]}function ya(t){for(var e in t)return!1;return!0}function za(t){var e,n={};for(e in t)n[e]=t[e];return n}function Aa(a){if(a=String(a),/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(t){}throw Error("Invalid JSON string: "+a)}function Ba(){this.Dd=void 0}function Ca(t,e,n){switch(typeof e){case"string":Da(e,n);break;case"number":n.push(isFinite(e)&&!isNaN(e)?e:"null");break;case"boolean":n.push(e);break;case"undefined":n.push("null");break;case"object":if(null==e){n.push("null");break}if(ea(e)){var i=e.length;n.push("[");for(var r="",o=0;oe?n+="000":256>e?n+="00":4096>e&&(n+="0"),Ea[t]=n+e.toString(16)}),'"')}function Oa(t,e){var n=Pa(t,e,void 0);return 0>n?null:p(t)?t.charAt(n):t[n]}function Pa(t,e,n){for(var i=t.length,r=p(t)?t.split(""):t,o=0;o=arguments.length?v.slice.call(t,e):v.slice.call(t,e,n)}function Sa(t,e){t.sort(e||Ta)}function Ta(t,e){return t>e?1:t>2,o=(3&o)<<4|a>>4,a=(15&a)<<2|c>>6,c=63&c;u||(c=64,s||(a=64)),i.push(n[h],n[o],n[a],n[c])}return i.join("")}function bb(){if(!Ya){Ya={},Za={},$a={};for(var t=0;65>t;t++)Ya[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t),Za[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(t),$a[Za[t]]=t,62<=t&&($a["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t)]=t)}}function cb(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function w(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function db(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function x(t,e,n,i){var r;if(in&&(r=0===n?"none":"no more than "+n),r)throw Error(t+" failed: Was called with "+i+(1===i?" argument.":" arguments.")+" Expects "+r+".")}function y(t,e,n){var i="";switch(e){case 1:i=n?"first":"First";break;case 2:i=n?"second":"Second";break;case 3:i=n?"third":"Third";break;case 4:i=n?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4. Need to update it?")}return t=t+" failed: "+(i+" argument ")}function A(t,e,i,r){if((!r||n(i))&&!ha(i))throw Error(y(t,e,r)+"must be a valid function.")}function eb(t,e,i){if(n(i)&&(!ia(i)||null===i))throw Error(y(t,e,!0)+"must be a valid context object.")}function fb(t){var e=[];return db(t,function(t,n){ea(n)?Ja(n,function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}),e.length?"&"+e.join("&"):""}function hb(){var t=this;this.reject=this.resolve=null,this.ra=new gb(function(e,n){t.resolve=e,t.reject=n})}function ib(t,e){return function(n,i){n?t.reject(n):t.resolve(i),ha(e)&&(jb(t.ra),1===e.length?e(n):e(n,i))}}function jb(t){t.then(void 0,ba)}function kb(t,e){if(!t)throw lb(e)}function lb(t){return Error("Firebase Database ("+firebase.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)}function mb(t){for(var e=[],n=0,i=0;i=r&&(r-=55296,i++,kb(ir?e[n++]=r:(2048>r?e[n++]=r>>6|192:(65536>r?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return e}function nb(t){for(var e=0,n=0;ni?e++:2048>i?e+=2:55296<=i&&56319>=i?(e+=4,n++):e+=3}return e}function ob(t){return"undefined"!=typeof JSON&&n(JSON.parse)?JSON.parse(t):Aa(t)}function B(t){if("undefined"!=typeof JSON&&n(JSON.stringify))t=JSON.stringify(t);else{var e=[];Ca(new Ba,t,e),t=e.join("")}return t}function pb(t,e){this.committed=t,this.snapshot=e}function qb(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test("undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"")}function rb(t){this.qe=t,this.zd=[],this.Qb=0,this.Wd=-1,this.Fb=null}function sb(t,e,n){t.Wd=e,t.Fb=n,t.Wd>4),64!=a&&(i.push(s<<4&240|a>>2),64!=u&&i.push(a<<6&192|u))}if(8192>i.length)e=String.fromCharCode.apply(null,i);else{for(t="",n=0;nt.$b?t.update(t.xd,56-t.$b):t.update(t.xd,t.Wa-(t.$b-56));for(var i=t.Wa-1;56<=i;i--)t.Ud[i]=255&n,n/=256;for(oa(t,t.Ud),i=n=0;5>i;i++)for(var r=24;0<=r;r-=8)e[n]=t.M[i]>>r&255,++n;return ab(e)}function vc(t){for(var e="",n=0;n.firebaseio.com instead"),n&&"undefined"!=n||Ac("Cannot parse Firebase url. Please use https://.firebaseio.com"),i||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&O("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),{jc:new Hb(e,i,n,"ws"===r||"wss"===r),path:new L(o)}}function Cc(t){return ga(t)&&(t!=t||t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY)}function Dc(t){if("complete"===document.readyState)t();else{var e=!1,n=function(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}}function hc(t,e){if(t===e)return 0;if("[MIN_NAME]"===t||"[MAX_NAME]"===e)return-1;if("[MIN_NAME]"===e||"[MAX_NAME]"===t)return 1;var n=Ec(t),i=Ec(e);return null!==n?null!==i?0==n-i?t.length-e.length:n-i:-1:null!==i?1:tt?n.push(t.substring(i,t.length)):n.push(t.substring(i,i+e));return n}function Ic(t,e){if(ea(t))for(var n=0;nt,t=Math.abs(t),t>=Math.pow(2,-1022)?(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023),n=i+1023,i=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,i=Math.round(t/Math.pow(2,-1074)))),r=[],t=52;t;--t)r.push(i%2?1:0),i=Math.floor(i/2);for(t=11;t;--t)r.push(n%2?1:0),n=Math.floor(n/2);for(r.push(e?1:0),r.reverse(),e=r.join(""),n="",t=0;64>t;t+=8)i=parseInt(e.substr(t,8),2).toString(16),1===i.length&&(i="0"+i),n+=i;return n.toLowerCase()}function Ec(t){return Kc.test(t)&&(t=Number(t),-2147483648<=t&&2147483647>=t)?t:null}function ub(t){try{t()}catch(t){setTimeout(function(){throw O("Exception was thrown by user callback.",t.stack||""),t},Math.floor(0))}}function Lc(t,e,n){Object.defineProperty(t,e,{get:n})}function Mc(t,e){var n=setTimeout(t,e);return"object"==typeof n&&n.unref&&n.unref(),n}function Nc(t){var e={},n={},i={},r="";try{var o=t.split("."),e=ob(tc(o[0])||""),n=ob(tc(o[1])||""),r=o[2],i=n.d||{};delete n.d}catch(t){}return{tg:e,Ie:n,data:i,mg:r}}function Oc(t){t=Nc(t);var e=t.Ie;return!!t.mg&&!!e&&"object"==typeof e&&e.hasOwnProperty("iat")}function Pc(t){return t=Nc(t).Ie,"object"==typeof t&&!0===w(t,"admin")}function Qc(t,e,n){this.f=yc("p:rest:"),this.L=t,this.Gb=e,this.Td=n,this.$={}}function Rc(t,e){return n(e)?"tag$"+e:(H(Sc(t.m),"should have a tag if it's not a default query."),t.path.toString())}function Uc(t,e,n,i){n=n||{},n.format="export",t.Td.getToken(!1).then(function(r){(r=r&&r.accessToken)&&(n.auth=r);var o=(t.L.Rc?"https://":"http://")+t.L.host+e+"?"+fb(n);t.f("Sending REST request for "+o);var s=new XMLHttpRequest;s.onreadystatechange=function(){if(i&&4===s.readyState){t.f("REST Response for "+o+" received. status:",s.status,"response:",s.responseText);var e=null;if(200<=s.status&&300>s.status){try{e=ob(s.responseText)}catch(t){O("Failed to parse JSON response for "+o+": "+s.responseText)}i(null,e)}else 401!==s.status&&404!==s.status&&O("Got unsuccessful REST response for "+o+" Status: "+s.status),i(s.status);i=null}},s.open("GET",o,!0),s.send()})}function Vc(t,e,n){this.type=Wc,this.source=t,this.path=e,this.children=n}function Xc(t,e){this.rf={},this.Uc=new Mb(t),this.va=e;var n=1e4+2e4*Math.random();Mc(q(this.lf,this),Math.floor(n))}function $c(t){return t=t.toString(),Yc[t]||(Yc[t]=new Kb),Yc[t]}function ad(t,e){var n=t.toString();return Zc[n]||(Zc[n]=e()),Zc[n]}function cd(t,e,n,i){this.Xd=t,this.f=yc(this.Xd),this.frames=this.yc=null,this.pb=this.qb=this.Ce=0,this.Va=$c(e),t={v:"5"},"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f"),n&&(t.s=n),i&&(t.ls=i),this.Je=Jb(e,"websocket",t)}function fd(t,e){if(t.frames.push(e),t.frames.length==t.Ce){var n=t.frames.join("");t.frames=null,n=ob(n),t.Xf(n)}}function ed(t){clearInterval(t.yc),t.yc=setInterval(function(){t.Ia&&gd(t,"0"),ed(t)},Math.floor(45e3))}function gd(t,e){try{t.Ia.send(e)}catch(e){t.f("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(q(t.bb,t),0)}}function hd(){this.fb={}}function jd(t,e){var n=e.type,i=e.Xa;H("child_added"==n||"child_changed"==n||"child_removed"==n,"Only child changes supported for tracking"),H(".priority"!==i,"Only non-priority child changes can be tracked.");var r=w(t.fb,i);if(r){var o=r.type;if("child_added"==n&&"child_removed"==o)t.fb[i]=new I("child_changed",e.Ja,i,r.Ja);else if("child_removed"==n&&"child_added"==o)delete t.fb[i];else if("child_removed"==n&&"child_changed"==o)t.fb[i]=new I("child_removed",r.ne,i);else if("child_changed"==n&&"child_added"==o)t.fb[i]=new I("child_added",e.Ja,i);else{if("child_changed"!=n||"child_changed"!=o)throw sc("Illegal combination of changes: "+e+" occurred after "+r);t.fb[i]=new I("child_changed",e.Ja,i,r.ne)}}else t.fb[i]=e}function kd(t){this.V=t,this.g=t.m.g}function ld(t,e,n,i){var r=[],o=[];return Ja(e,function(e){"child_changed"===e.type&&t.g.ld(e.ne,e.Ja)&&o.push(new I("child_moved",e.Ja,e.Xa))}),md(t,r,"child_removed",e,i,n),md(t,r,"child_added",e,i,n),md(t,r,"child_moved",o,i,n),md(t,r,"child_changed",e,i,n),md(t,r,cc,e,i,n),r}function md(t,e,n,i,r,o){i=Ka(i,function(t){return t.type===n}),Sa(i,q(t.Ff,t)),Ja(i,function(n){var i=nd(t,n,o);Ja(r,function(r){r.nf(n.type)&&e.push(r.createEvent(i,t.V))})})}function nd(t,e,n){return"value"!==e.type&&"child_removed"!==e.type&&(e.Bd=n.Ve(e.Xa,e.Ja,t.g)),e}function od(t,e){this.Qd=t,this.Df=e}function pd(t){this.U=t}function xd(t,e,n,i,r,o){var s=e.N;if(null!=i.lc(n))return e;var a;if(n.e())H(dc(e.w()),"If change path is empty, we must have complete server data"),ec(e.w())?(r=ac(e),i=i.qc(r instanceof P?r:G)):i=i.Aa(ac(e)),o=t.U.ya(e.N.j(),i,o);else{var u=J(n);if(".priority"==u)H(1==Ad(n),"Can't have a priority with additional path components"),o=s.j(),a=e.w().j(),i=i.Zc(n,o,a),o=null!=i?t.U.fa(o,i):s.j();else{var c=D(n);Zb(s,u)?(a=e.w().j(),i=i.Zc(n,s.j(),a),i=null!=i?s.j().Q(u).F(c,i):s.j().Q(u)):i=i.pc(u,e.w()),o=null!=i?t.U.F(s.j(),u,i,c,r,o):s.j()}}return vd(e,o,s.da||n.e(),t.U.Na())}function rd(t,e,n,i,r,o,s,a){var u=e.w();if(s=s?t.U:t.U.Ub(),n.e())i=s.ya(u.j(),i,null);else if(s.Na()&&!u.Sb)i=u.j().F(n,i),i=s.ya(u.j(),i,null);else{var c=J(n);if(!fc(u,n)&&1document.domain="'+document.domain+'";'),t=""+t+"";try{this.Ea.gb.open(),this.Ea.gb.write(t),this.Ea.gb.close()}catch(t){E("frame writing exception"),t.stack&&E(t.stack),E(t)}}function we(t){if(t.Sd&&t.Id&&t.se.count()<(0=t.Pc[0].Oe.length+30+n.length;){var r=t.Pc.shift(),n=n+"&seg"+i+"="+r.jg+"&ts"+i+"="+r.pg+"&d"+i+"="+r.Oe;i++}return xe(t,e+n,t.Yd),!0}return!1}function xe(t,e,n){function i(){t.se.remove(n),we(t)}t.se.add(n,1);var r=setTimeout(i,Math.floor(25e3));ve(t,e,function(){clearTimeout(r),i()})}function ve(t,e,n){setTimeout(function(){try{if(t.Id){var i=t.Ea.gb.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){var t=i.readyState;t&&"loaded"!==t&&"complete"!==t||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),n())},i.onerror=function(){E("Long-poll script failed to load: "+e),t.Id=!1,t.close()},t.Ea.gb.body.appendChild(i)}}catch(t){}},Math.floor(1))}function ye(t){ze(this,t)}function ze(t,e){var n=cd&&cd.isAvailable(),i=n&&!(yb.Ze||!0===yb.get("previous_websocket_failure"));if(e.qg&&(n||O("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)t.Vc=[cd];else{var r=t.Vc=[];Ic(Ae,function(t,e){e&&e.isAvailable()&&r.push(e)})}}function Be(t){if(0=t.pf?(t.f("Secondary connection is healthy."),t.Bb=!0,t.D.qd(),t.D.start(),t.f("sending client ack on secondary"),t.D.send({t:"c",d:{t:"a",d:{}}}),t.f("Ending transmission on primary"),t.I.send({t:"c",d:{t:"n",d:{}}}),t.Wc=t.D,Ie(t)):(t.f("sending ping on secondary."),t.D.send({t:"c",d:{t:"p",d:{}}}))}function Ke(t){t.Bb||(t.ue--,0>=t.ue&&(t.f("Primary connection is healthy."),t.Bb=!0,t.I.qd()))}function He(t,e){t.D=new e("c:"+t.id+":"+t.Ke++,t.L,t.qf),t.pf=e.responsesRequiredToBeHealthy||0,t.D.open(Ee(t,t.D),Fe(t,t.D)),Mc(function(){t.D&&(t.f("Timed out trying to upgrade."),t.D.close())},Math.floor(6e4))}function Ge(t,e,n){t.f("Realtime connection established."),t.I=e,t.Ua=1,t.Kc&&(t.Kc(n,t.qf),t.Kc=null),0===t.ue?(t.f("Primary connection is healthy."),t.Bb=!0):Mc(function(){Le(t)},Math.floor(5e3))}function Le(t){t.Bb||1!==t.Ua||(t.f("sending ping on primary."),Ne(t,{t:"c",d:{t:"p",d:{}}}))}function Ne(t,e){if(1!==t.Ua)throw"Connection is not connected";t.Wc.send(e)}function Je(t){t.f("Shutting down all connections"),t.I&&(t.I.close(),t.I=null),t.D&&(t.D.close(),t.D=null),t.kd&&(clearTimeout(t.kd),t.kd=null)}function L(t,e){if(1==arguments.length){this.o=t.split("/");for(var n=0,i=0;i=t.o.length?null:t.o[t.Y]}function Ad(t){return t.o.length-t.Y}function D(t){var e=t.Y;return e10485760/3&&10485760n?i=i.left:0r)t=this.ie?t.left:t.right;else{if(0===r){this.Pa.push(t);break}this.Pa.push(t),t=this.ie?t.right:t.left}}function R(t){if(0===t.Pa.length)return null;var e,n=t.Pa.pop();if(e=t.Fd?t.Fd(n.key,n.value):{key:n.key,value:n.value},t.ie)for(n=n.left;!n.e();)t.Pa.push(n),n=n.right;else for(n=n.right;!n.e();)t.Pa.push(n),n=n.left;return e}function zf(t){if(0===t.Pa.length)return null;var e;return e=t.Pa,e=e[e.length-1],t.Fd?t.Fd(e.key,e.value):{key:e.key,value:e.value}}function Af(t,e,n,i,r){this.key=t,this.value=e,this.color=null==n||n,this.left=null!=i?i:wf,this.right=null!=r?r:wf}function Bf(t){return t.left.e()?t:Bf(t.left)}function Df(t){return t.left.e()?wf:(t.left.ea()||t.left.left.ea()||(t=Ef(t)),t=t.X(null,null,null,Df(t.left),null),Cf(t))}function Cf(t){return t.right.ea()&&!t.left.ea()&&(t=Hf(t)),t.left.ea()&&t.left.left.ea()&&(t=Ff(t)),t.left.ea()&&t.right.ea()&&(t=Gf(t)),t}function Ef(t){return t=Gf(t),t.right.left.ea()&&(t=t.X(null,null,null,null,Ff(t.right)),t=Hf(t),t=Gf(t)),t}function Hf(t){return t.right.X(null,null,t.color,t.X(null,null,!0,null,t.right.left),null)}function Ff(t){return t.left.X(null,null,t.color,null,t.X(null,null,!0,t.left.right,null))}function Gf(t){return t.X(null,null,!t.color,t.left.X(null,null,!t.left.color,null,null),t.right.X(null,null,!t.right.color,null,null))}function If(){}function P(t,e,n){this.k=t,(this.aa=e)&&Sd(this.aa),t.e()&&H(!this.aa||this.aa.e(),"An empty node cannot have a priority"),this.yb=n,this.Db=null}function Qd(t,e){var n;return n=(n=Kf(t,e))?(n=n.Fc())&&n.name:t.k.Fc(),n?new K(n,t.k.get(n)):null}function Rd(t,e){var n;return n=(n=Kf(t,e))?(n=n.ec())&&n.name:t.k.ec(),n?new K(n,t.k.get(n)):null}function Kf(t,e){return e===Fd?null:t.yb.get(e.toString())}function M(t,e){if(null===t)return G;var n=null;if("object"==typeof t&&".priority"in t?n=t[".priority"]:"undefined"!=typeof e&&(n=e),H(null===n||"string"==typeof n||"number"==typeof n||"object"==typeof n&&".sv"in n,"Invalid priority type found: "+typeof n),"object"==typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!=typeof t||".sv"in t)return new qc(t,M(n));if(t instanceof Array){var i=G,o=t;return r(o,function(t,e){if(cb(o,e)&&"."!==e.substring(0,1)){var n=M(t);!n.J()&&n.e()||(i=i.T(e,n))}}),i.fa(M(n))}var s=[],a=!1,u=t;if(db(u,function(t){if("string"!=typeof t||"."!==t.substring(0,1)){var e=M(u[t]);e.e()||(a=a||!e.C().e(),s.push(new K(t,e)))}}),0==s.length)return G;var c=le(s,gc,function(t){return t.name},ic);if(a){var h=le(s,Pd(N));return new P(c,M(n),new je({".priority":h},{".priority":N}))}return new P(c,M(n),ne)}function Mf(t){this.count=parseInt(Math.log(t+1)/Lf,10),this.Ne=this.count-1,this.Cf=t+1&parseInt(Array(this.count+1).join("1"),2)}function Nf(t){var e=!(t.Cf&1<s.Ac,"Stacking an older write on top of newer ones"),n(a)||(a=!0),s.la.push({path:e,Ga:i,Yc:r,visible:a}),a&&(s.S=sg(s.S,e,i)),s.Ac=r,o?fh(t,new Ab(ng,e,i)):[]}function gh(t,e,n,i){var r=t.jb;return H(i>r.Ac,"Stacking an older merge on top of newer ones"),r.la.push({path:e,children:n,Yc:i,visible:!0}),r.S=tg(r.S,e,n),r.Ac=i,n=bg(n),fh(t,new Vc(ng,e,n))}function hh(t,e,n){n=n||!1;var i=Dg(t.jb,e);if(t.jb.Cd(e)){var r=Q;return null!=i.Ga?r=r.set(C,!0):db(i.children,function(t,e){r=r.set(new L(t),e)}),fh(t,new mg(i.path,r,n))}return[]}function ih(t,e,n){return n=bg(n),fh(t,new Vc(pg,e,n))}function jh(t,e,n,i){if(i=kh(t,i),null!=i){var r=lh(i);return i=r.path,r=r.Hb,e=T(i,e),n=new Ab(new og(!1,!0,r,!0),e,n),mh(t,i,n)}return[]}function nh(t,e,n,i){if(i=kh(t,i)){var r=lh(i);return i=r.path,r=r.Hb,e=T(i,e),n=bg(n),n=new Vc(new og(!1,!0,r,!0),e,n),mh(t,i,n)}return[]}function rh(t){return eg(t,function(t,e,n){if(e&&null!=zg(e))return[zg(e)];var i=[];return e&&(i=Ag(e)),r(n,function(t){i=i.concat(t)}),i})}function vh(t,e){for(var n=0;nn?Math.max(0,t.length+n):n,p(t))return p(e)&&1==e.length?t.indexOf(e,n):-1;for(;nparseFloat(n))?String(e):n)}();var Ya=null,Za=null,$a=null,gb=firebase.Promise;vb.prototype.set=function(t,e){null==e?delete this.oc[t]:this.oc[t]=e},vb.prototype.get=function(t){return cb(this.oc,t)?this.oc[t]:null},vb.prototype.remove=function(t){delete this.oc[t]},vb.prototype.Ze=!0,g=wb.prototype,g.set=function(t,e){null==e?this.tc.removeItem(this.Ad+t):this.tc.setItem(this.Ad+t,B(e))},g.get=function(t){return t=this.tc.getItem(this.Ad+t),null==t?null:ob(t)},g.remove=function(t){this.tc.removeItem(this.Ad+t)},g.Ze=!1,g.toString=function(){return this.tc.toString()};var yb=xb("localStorage"),zb=xb("sessionStorage");Ab.prototype.Lc=function(t){return this.path.e()?new Ab(this.source,C,this.Ga.Q(t)):new Ab(this.source,D(this.path),this.Ga)},Ab.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" overwrite: "+this.Ga.toString()+")"},Cb.prototype.Lc=function(){return this.path.e()?new Cb(this.source,C):new Cb(this.source,D(this.path))},Cb.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" listen_complete)"},Eb.prototype.getToken=function(t){return this.Ee.INTERNAL.getToken(t).then(null,function(t){return t&&"auth/token-not-initialized"===t.code?(E("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)})},Gb.prototype.j=function(t){return this.Hd.P(t)},Gb.prototype.toString=function(){return this.Hd.toString()},Hb.prototype.toString=function(){var t=(this.Rc?"https://":"http://")+this.host;return this.gf&&(t+="<"+this.gf+">"),t},Kb.prototype.get=function(){return za(this.sc)},Mb.prototype.get=function(){var t=this.Ef.get(),e=za(t);if(this.pd)for(var n in this.pd)e[n]-=this.pd[n];return this.pd=t,e},Pb.prototype.add=function(t){this.gd.push(t)},Pb.prototype.Yb=function(){return this.qa},Ub.prototype.Yb=function(){var t=this.Kd.wb();return"value"===this.fd?t.path:t.getParent().path},Ub.prototype.de=function(){return this.fd},Ub.prototype.Tb=function(){return this.Zd.Tb(this)},Ub.prototype.toString=function(){return this.Yb().toString()+":"+this.fd+":"+B(this.Kd.Qe())},Vb.prototype.Yb=function(){return this.path},Vb.prototype.de=function(){return"cancel"},Vb.prototype.Tb=function(){return this.Zd.Tb(this)},Vb.prototype.toString=function(){return this.path.toString()+":cancel"},Wb.prototype.Te=function(){return null},Wb.prototype.ce=function(){return null};var Xb=new Wb;Yb.prototype.Te=function(t){var e=this.Ka.N;return Zb(e,t)?e.j().Q(t):(e=null!=this.wd?new $b(this.wd,!0,!1):this.Ka.w(),this.xf.pc(t,e))},Yb.prototype.ce=function(t,e,n){var i=null!=this.wd?this.wd:ac(this.Ka);return t=this.xf.Vd(i,e,1,n,t),0===t.length?null:t[0]};var cc="value";$b.prototype.j=function(){return this.A};var rc=function(){var t=1;return function(){return t++}}(),H=kb,sc=lb,Tb=null,wc=!0,Kc=/^-?\d{1,10}$/;g=Qc.prototype,g.$e=function(t,e,n,i){var r=t.path.toString();this.f("Listen called for "+r+" "+t.ja());var o=Rc(t,n),s={};this.$[o]=s,t=Tc(t.m);var a=this;Uc(this,r+".json",t,function(t,e){var u=e;404===t&&(t=u=null),null===t&&a.Gb(r,u,!1,n),w(a.$,o)===s&&i(t?401==t?"permission_denied":"rest_error:"+t:"ok",null)})},g.uf=function(t,e){var n=Rc(t,e);delete this.$[n]},g.kf=function(){},g.oe=function(){},g.cf=function(){},g.vd=function(){},g.put=function(){},g.af=function(){},g.ve=function(){},Vc.prototype.Lc=function(t){return this.path.e()?(t=this.children.subtree(new L(t)),t.e()?null:t.value?new Ab(this.source,C,t.value):new Vc(this.source,C,t)):(H(J(this.path)===t,"Can't get a merge for a child not on the path of the operation"),new Vc(this.source,D(this.path),this.children))},Vc.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},Xc.prototype.lf=function(){var t,e=this.Uc.get(),n={},i=!1;for(t in e)0=t.length){var e=Number(t);if(!isNaN(e)){i.Ce=e,i.frames=[],t=null;break t}}i.Ce=1,i.frames=[]}null!==t&&fd(i,t)}},this.Ia.onerror=function(t){i.f("WebSocket error. Closing connection."),(t=t.message||t.data)&&i.f(t),i.bb()}},cd.prototype.start=function(){},cd.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var e=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);e&&1parseFloat(e[1])&&(t=!0)}return!t&&null!==bd&&!dd},cd.responsesRequiredToBeHealthy=2,cd.healthyTimeout=3e4,g=cd.prototype,g.qd=function(){yb.remove("previous_websocket_failure")},g.send=function(t){ed(this),t=B(t),this.qb+=t.length,Lb(this.Va,"bytes_sent",t.length),t=Hc(t,16384),1=this.g.compare(this.Tc,t)&&0>=this.g.compare(t,this.uc)},g.F=function(t,e,n,i,r,o){return this.matches(new K(e,n))||(n=G),this.ee.F(t,e,n,i,r,o)},g.ya=function(t,e,n){e.J()&&(e=G);var i=e.nb(this.g),i=i.fa(G),r=this;return e.O(N,function(t,e){r.matches(new K(t,e))||(i=i.T(t,G))}),this.ee.ya(t,i,n)},g.fa=function(t){return t},g.Na=function(){return!0},g.Ub=function(){return this.ee},g=Md.prototype,g.F=function(t,e,n,i,r,o){return this.sa.matches(new K(e,n))||(n=G),t.Q(e).Z(n)?t:t.Eb()=this.g.compare(this.sa.Tc,s):0>=this.g.compare(s,this.sa.uc)))break;i=i.T(s.name,s.R),r++}}else{i=e.nb(this.g),i=i.fa(G);var a,u,c;if(this.Ib){e=i.We(this.g),a=this.sa.uc,u=this.sa.Tc;var h=Pd(this.g);c=function(t,e){return h(e,t)}}else e=i.Wb(this.g),a=this.sa.Tc,u=this.sa.uc,c=Pd(this.g);for(var r=0,l=!1;0=c(a,s)&&(l=!0),(o=l&&r=c(s,u))?r++:i=i.T(s.name,G)}return this.sa.Ub().ya(t,i,n)},g.fa=function(t){return t},g.Na=function(){return!0},g.Ub=function(){return this.sa.Ub()};var Td=["object","boolean","number","string"];g=qc.prototype,g.J=function(){return!0},g.C=function(){return this.aa},g.fa=function(t){return new qc(this.B,t)},g.Q=function(t){return".priority"===t?this.aa:G},g.P=function(t){return t.e()?this:".priority"===J(t)?this.aa:G},g.Da=function(){return!1},g.Ve=function(){return null},g.T=function(t,e){return".priority"===t?this.fa(e):e.e()&&".priority"!==t?this:G.T(t,e).fa(this.aa)},g.F=function(t,e){var n=J(t);return null===n?e:e.e()&&".priority"!==n?this:(H(".priority"!==n||1===Ad(t),".priority must be the last token in a path"),this.T(n,G.F(D(t),e)))},g.e=function(){return!1},g.Eb=function(){return 0},g.O=function(){return!1},g.H=function(t){return t&&!this.C().e()?{".value":this.Ca(),".priority":this.C().H()}:this.Ca()},g.hash=function(){if(null===this.Db){var t="";this.aa.e()||(t+="priority:"+Ud(this.aa.H())+":");var e=typeof this.B,t=t+(e+":"),t="number"===e?t+Jc(this.B):t+this.B;this.Db=uc(t)}return this.Db},g.Ca=function(){return this.B},g.rc=function(t){if(t===G)return 1;if(t instanceof P)return-1;H(t.J(),"Unknown node type");var e=typeof t.B,n=typeof this.B,i=Ia(Td,e),r=Ia(Td,n);return H(0<=i,"Unknown leaf type: "+e),H(0<=r,"Unknown leaf type: "+n),i===r?"object"===n?0:this.B=this.o.length)return null;for(var t=[],e=this.Y;e=this.o.length},g.Z=function(t){if(Ad(this)!==Ad(t))return!1;for(var e=this.Y,n=t.Y;e<=this.o.length;e++,n++)if(this.o[e]!==t.o[n])return!1;return!0},g.contains=function(t){var e=this.Y,n=t.Y;if(Ad(this)>Ad(t))return!1;for(;eo;o++)e[o]=Math.floor(64*Math.random());for(o=0;12>o;o++)n+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(e[o]);return H(20===n.length,"nextPushId: Length should be 20."),n}}();g=vf.prototype,g.Oa=function(t,e){return new vf(this.La,this.ba.Oa(t,e,this.La).X(null,null,!1,null,null))},g.remove=function(t){return new vf(this.La,this.ba.remove(t,this.La).X(null,null,!1,null,null))},g.get=function(t){for(var e,n=this.ba;!n.e();){if(e=this.La(t,n.key),0===e)return n.value;0>e?n=n.left:0i?r.X(null,null,null,r.left.Oa(t,e,n),null):0===i?r.X(null,e,null,null,null):r.X(null,null,null,null,r.right.Oa(t,e,n)),Cf(r)},g.remove=function(t,e){var n,i;if(n=this,0>e(t,n.key))n.left.e()||n.left.ea()||n.left.left.ea()||(n=Ef(n)),n=n.X(null,null,null,n.left.remove(t,e),null);else{if(n.left.ea()&&(n=Ff(n)),n.right.e()||n.right.ea()||n.right.left.ea()||(n=Gf(n),n.left.left.ea()&&(n=Ff(n),n=Gf(n))),0===e(t,n.key)){if(n.right.e())return wf;i=Bf(n.right),n=n.X(i.key,i.value,null,null,Df(n.right))}n=n.X(null,null,null,null,n.right.remove(t,e))}return Cf(n)},g.ea=function(){return this.color},g=If.prototype,g.X=function(){return this},g.Oa=function(t,e){return new Af(t,e,null)},g.remove=function(){return this},g.count=function(){return 0},g.e=function(){return!0},g.ha=function(){return!1},g.Fc=function(){return null},g.ec=function(){return null},g.ea=function(){return!1};var wf=new If;g=P.prototype,g.J=function(){return!1},g.C=function(){return this.aa||G},g.fa=function(t){return this.k.e()?this:new P(this.k,t,this.yb)},g.Q=function(t){return".priority"===t?this.C():(t=this.k.get(t),null===t?G:t)},g.P=function(t){var e=J(t);return null===e?this:this.Q(e).P(D(t))},g.Da=function(t){return null!==this.k.get(t)},g.T=function(t,e){if(H(e,"We should always be passing snapshot nodes"),".priority"===t)return this.fa(e);var n,i,r=new K(t,e);return e.e()?(n=this.k.remove(t),r=me(this.yb,r,this.k)):(n=this.k.Oa(t,e),r=ke(this.yb,r,this.k)),i=n.e()?G:this.aa,new P(n,i,r)},g.F=function(t,e){var n=J(t);if(null===n)return e;H(".priority"!==J(t)||1===Ad(t),".priority must be the last token in a path");var i=this.Q(n).F(D(t),e);return this.T(n,i)},g.e=function(){return this.k.e()},g.Eb=function(){return this.k.count()};var Jf=/^(0|[1-9]\d*)$/;g=P.prototype,g.H=function(t){if(this.e())return null;var e={},n=0,i=0,r=!0;if(this.O(N,function(o,s){e[o]=s.H(t),n++,r&&Jf.test(o)?i=Math.max(i,Number(o)):r=!1}),!t&&r&&i<2*n){var o,s=[];for(o in e)s[o]=e[o];return s}return t&&!this.C().e()&&(e[".priority"]=this.C().H()),e},g.hash=function(){if(null===this.Db){var t="";this.C().e()||(t+="priority:"+Ud(this.C().H())+":"),this.O(N,function(e,n){var i=n.hash();""!==i&&(t+=":"+e+":"+i)}),this.Db=""===t?"":uc(t)}return this.Db},g.Ve=function(t,e,n){return(n=Kf(this,n))?(t=xf(n,new K(t,e)))?t.name:null:xf(this.k,t)},g.O=function(t,e){var n=Kf(this,t);return n?n.ha(function(t){return e(t.name,t.R)}):this.k.ha(e)},g.Wb=function(t){return this.Xb(t.Gc(),t)},g.Xb=function(t,e){var n=Kf(this,e);if(n)return n.Xb(t,function(t){return t});for(var n=this.k.Xb(t.name,jc),i=zf(n);null!=i&&0>e.compare(i,t);)R(n),i=zf(n);return n},g.We=function(t){return this.Zb(t.Ec(),t)},g.Zb=function(t,e){var n=Kf(this,e);if(n)return n.Zb(t,function(t){return t});for(var n=this.k.Zb(t.name,jc),i=zf(n);null!=i&&0=t)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.m.xa)throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new X(this.u,this.path,this.m.ke(t),this.Mc)},g.le=function(t){if(x("Query.limitToLast",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.m.xa)throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new X(this.u,this.path,this.m.le(t),this.Mc)},g.ag=function(t){if(x("Query.orderByChild",1,1,arguments.length),"$key"===t)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');lf("Query.orderByChild",t),Xf(this,"Query.orderByChild");var e=new L(t);if(e.e())throw Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");return e=new Yd(e),e=he(this.m,e),Vf(e),new X(this.u,this.path,e,!0)},g.bg=function(){x("Query.orderByKey",0,0,arguments.length),Xf(this,"Query.orderByKey");var t=he(this.m,Fd);return Vf(t),new X(this.u,this.path,t,!0)},g.cg=function(){x("Query.orderByPriority",0,0,arguments.length),Xf(this,"Query.orderByPriority");var t=he(this.m,N);return Vf(t),new X(this.u,this.path,t,!0)},g.dg=function(){x("Query.orderByValue",0,0,arguments.length),Xf(this,"Query.orderByValue");var t=he(this.m,de);return Vf(t),new X(this.u,this.path,t,!0)},g.Ld=function(t,e){x("Query.startAt",0,2,arguments.length),df("Query.startAt",t,this.path,!0),kf("Query.startAt",e);var i=this.m.Ld(t,e);if(Wf(i),Vf(i),this.m.ka)throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return n(t)||(e=t=null),new X(this.u,this.path,i,this.Mc)},g.ed=function(t,e){x("Query.endAt",0,2,arguments.length),df("Query.endAt",t,this.path,!0),kf("Query.endAt",e);var n=this.m.ed(t,e);if(Wf(n),Vf(n),this.m.na)throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new X(this.u,this.path,n,this.Mc)},g.If=function(t,e){if(x("Query.equalTo",1,2,arguments.length),df("Query.equalTo",t,this.path,!1),kf("Query.equalTo",e),this.m.ka)throw Error("Query.equalTo: Starting point was already set (by another call to endAt or equalTo).");if(this.m.na)throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.Ld(t,e).ed(t,e)},g.toString=function(){x("Query.toString",0,0,arguments.length);for(var t=this.path,e="",n=t.Y;n=e&&Eg(a,n.path)?i=!1:n.path.contains(a.path)&&(o=!0)),s--}if(i){if(o)this.S=Fg(this.la,Gg,C),this.Ac=0 "},function(t,e){t.exports="
  • {{open ? '[-]' : '[+]'}} {{comment.by}} {{comment.time | fromNow}} ago

    {{{comment.text}}}

  • "},function(t,e){t.exports="
    {{index}}.

    {{{item.title}}} ({{item.url | domain}})

    {{item.score}} points by {{item.by}} {{item.time | fromNow}} ago | {{item.descendants}} {{item.descendants | pluralize 'comment'}}

    "},function(t,e){t.exports='

    • {{option.text}}

      {{option.score}} points

    No comments yet.

    '},function(t,e){t.exports=' '},function(t,e){t.exports="
    • user: {{user.id}}
    • created: {{user.created | fromNow}} ago
    • karma: {{user.karma}}
    • about:
      {{{user.about}}}
    "},function(t,e,n){var i,r,o={};n(69),r=n(57),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){var i,r,o={};n(70),i=n(18),r=n(58),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){var i,r,o={};n(72),i=n(20),r=n(60),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){var i,r,o={};n(73),i=n(21),r=n(61),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){var i,r,o={};n(74),i=n(22),r=n(62),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){/*! + * vue-router v0.7.13 + * (c) 2016 Evan You + * Released under the MIT License. + */ +!function(e,n){t.exports=n()}(this,function(){"use strict";function t(t,e,n){this.path=t,this.matcher=e,this.delegate=n}function e(t){this.routes={},this.children={},this.target=t}function n(e,i,r){return function(o,s){var a=e+o;return s?void s(n(a,i,r)):new t(e+o,i,r)}}function i(t,e,n){for(var i=0,r=0,o=t.length;r can only be used inside a router-enabled app.");this._isDynamicLiteral=!0,n.bind.call(this);for(var e=void 0,i=this.vm;i;){if(i._routerView){e=i._routerView;break}i=i.$parent}if(e)this.parentView=e,e.childView=this;else{var r=t.router;r._rootView=this}var o=t.router._currentTransition;if(!e&&o.done||e&&e.activated){var s=e?e.depth+1:0;$(this,o,s)}},unbind:function(){this.parentView&&(this.parentView.childView=null),n.unbind.call(this)}}),t.elementDirective("router-view",i)}function H(t){function e(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port}function n(t,e,n){if(e=e.trim(),e.indexOf(" ")===-1)return void n(t,e);for(var i=e.split(/\s+/),r=0,o=i.length;r-1&&n.updateClasses(i,t.el)})},unbind:function(){this.vm.$off(c,this.cb)}}),t.directive("link",{priority:u-2,bind:function(){var t=this.vm;if(!t.$route)return void _("v-link can only be used inside a router-enabled app.");this.router=t.$route.router,this.unwatch=t.$watch("$route",r(this.onRouteUpdate,this));var e=this.el.getAttribute(c);e&&(this.el.removeAttribute(c),this.activeIds=e.split(",")),"A"===this.el.tagName&&"_blank"===this.el.getAttribute("target")||(this.handler=r(this.onClick,this),this.el.addEventListener("click",this.handler))},update:function(t){this.target=t,o(t)&&(this.append=t.append,this.exact=t.exact,this.prevActiveClass=this.activeClass,this.activeClass=t.activeClass),this.onRouteUpdate(this.vm.$route)},onClick:function(t){if(!(t.metaKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||0!==t.button)){var n=this.target;if(n)t.preventDefault(),this.router.go(n);else{for(var i=t.target;"A"!==i.tagName&&i!==this.el;)i=i.parentNode;if("A"===i.tagName&&e(i)){t.preventDefault();var r=i.pathname;this.router.history.root&&(r=r.replace(this.router.history.rootRE,"")),this.router.go({path:r,replace:n&&n.replace,append:n&&n.append})}}}},onRouteUpdate:function(t){var e=this.router.stringifyPath(this.target);this.path!==e&&(this.path=e,this.updateActiveMatch(),this.updateHref()),this.activeIds?this.vm.$emit(c,this,t.path):this.updateClasses(t.path,this.el)},updateActiveMatch:function(){this.activeRE=this.path&&!this.exact?new RegExp("^"+this.path.replace(/\/$/,"").replace(st,"").replace(ot,"\\$&")+"(\\/|$)"):null},updateHref:function(){if("A"===this.el.tagName){var t=this.path,e=this.router,n="/"===t.charAt(0),i=t&&("hash"===e.mode||n)?e.history.formatPath(t,this.append):t;i?this.el.href=i:this.el.removeAttribute("href")}},updateClasses:function(t,e){var i=this.activeClass||this.router._linkActiveClass;this.prevActiveClass&&this.prevActiveClass!==i&&n(e,this.prevActiveClass,a);var r=this.path.replace(st,"");t=t.replace(st,""),this.exact?r===t||"/"!==r.charAt(r.length-1)&&r===t.replace(rt,"")?n(e,i,s):n(e,i,a):this.activeRE&&this.activeRE.test(t)?n(e,i,s):n(e,i,a)},unbind:function(){this.el.removeEventListener("click",this.handler),this.unwatch&&this.unwatch()}})}function U(t,e){var n=e.component;ut.util.isPlainObject(n)&&(n=e.component=ut.extend(n)),"function"!=typeof n&&(e.component=null,_('invalid component for route "'+t+'".'))}var W={};W.classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.prototype={to:function(t,e){var n=this.delegate;if(n&&n.willAddRoute&&(t=n.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),e){if(0===e.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,e,this.delegate)}return this}},e.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,i,r,o){var s=new e(i);this.children[t]=s;var a=n(t,s,o);o&&o.contextEntered&&o.contextEntered(i,a),r(a)}};var B=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],V=new RegExp("(\\"+B.join("|\\")+")","g"),q=!1;c.prototype={eachChar:function(t){for(var e,n=this.string,i=0,r=n.length;i2&&"[]"===s.slice(a-2)&&(u=!0,s=s.slice(0,a-2),n[s]||(n[s]=[])),r=o[1]?w(o[1]):""),u?n[s].push(r):n[s]=r}return n},recognize:function(t,e){q=e;var n,i,r,o,s=[this.rootState],u={},c=!1;if(o=t.indexOf("?"),o!==-1){var h=t.substr(o+1,t.length);t=t.substr(0,o),h&&(u=this.parseQueryString(h))}if(t=a(t)){for("/"!==t.charAt(0)&&(t="/"+t),n=t.length,n>1&&"/"===t.charAt(n-1)&&(t=t.substr(0,n-1),c=!0),i=0,r=t.length;i-1?"&"+location.search.slice(1):location.search;t.onChange(e.replace(/^#!?/,"")+r)},window.addEventListener("hashchange",this.listener),this.listener()},t.prototype.stop=function(){window.removeEventListener("hashchange",this.listener)},t.prototype.go=function(t,e,n){t=this.formatPath(t,n),e?location.replace(t):location.hash=t},t.prototype.formatPath=function(t,e){var n="/"===t.charAt(0),i="#"+(this.hashbang?"!":"");return n?i+t:i+x(location.hash.replace(/^#!?/,""),t,e)},t}(),tt=function(){function t(e){var n=e.onChange;W.classCallCheck(this,t),this.onChange=n,this.currentPath="/"}return t.prototype.start=function(){this.onChange("/")},t.prototype.stop=function(){},t.prototype.go=function(t,e,n){t=this.currentPath=this.formatPath(t,n),this.onChange(t)},t.prototype.formatPath=function(t,e){return"/"===t.charAt(0)?t:x(this.currentPath,t,e)},t}(),et=function(){function t(e,n,i){W.classCallCheck(this,t),this.router=e,this.to=n,this.from=i,this.next=null,this.aborted=!1,this.done=!1}return t.prototype.abort=function(){if(!this.aborted){this.aborted=!0;var t=!this.from.path&&"/"===this.to.path;t||this.router.replace(this.from.path||"/")}},t.prototype.redirect=function(t){this.aborted||(this.aborted=!0,"string"==typeof t?t=E(t,this.to.params,this.to.query):(t.params=t.params||this.to.params,t.query=t.query||this.to.query),this.router.replace(t))},t.prototype.start=function(t){for(var e=this,n=[],i=this.router._rootView;i;)n.unshift(i),i=i.childView;var r=n.slice().reverse(),o=this.activateQueue=I(this.to.matched).map(function(t){return t.handler}),s=void 0,a=void 0;for(s=0;s0&&(a=r.slice(0,s),n=r.slice(s).reverse(),o=o.slice(s)),e.runQueue(n,j,function(){e.runQueue(o,T,function(){e.runQueue(n,O,function(){if(e.router._onTransitionValidated(e),a&&a.forEach(function(t){return N(t,e)}),n.length){var i=n[n.length-1],r=a?a.length:0;$(i,e,r,t)}else t()})})})},t.prototype.runQueue=function(t,e,n){function i(o){o>=t.length?n():e(t[o],r,function(){i(o+1)})}var r=this;i(0)},t.prototype.callHook=function(t,e,n){var i=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],r=i.expectBoolean,o=void 0!==r&&r,s=i.postActivate,a=void 0!==s&&s,u=i.processData,c=i.cleanup,h=this,l=!1,f=function(){c&&c(),h.abort()},p=function(t){if(a?v():f(),t&&!h.router._suppress)throw _("Uncaught error during transition: "),t instanceof Error?t:new Error(t)},d=function(t){try{p(t)}catch(t){setTimeout(function(){throw t},0)}},v=function(){return l?void _("transition.next() should be called only once."):(l=!0,h.aborted?void(c&&c()):void(n&&n()))},g=function(e){"boolean"==typeof e?e?v():f():k(e)?e.then(function(t){t?v():f()},d):t.length||v()},b=function(t){var e=void 0;try{e=u(t)}catch(t){return p(t)}k(e)?e.then(v,d):v()},m={to:h.to,from:h.from,abort:f,next:u?b:v,redirect:function(){h.redirect.apply(h,arguments)}},y=void 0;try{y=t.call(e,m)}catch(t){return p(t)}o?g(y):k(y)?u?y.then(b,d):y.then(v,d):u&&M(y)?b(y):t.length||v()},t.prototype.callHooks=function(t,e,n,i){var r=this;Array.isArray(t)?this.runQueue(t,function(t,n,o){r.aborted||r.callHook(t,e,o,i)},n):this.callHook(t,e,n,i)},t}(),nt=/^(component|subRoutes|fullPath)$/,it=function t(e,n){var i=this;W.classCallCheck(this,t);var r=n._recognizer.recognize(e);r&&([].forEach.call(r,function(t){for(var e in t.handler)nt.test(e)||(i[e]=t.handler[e])}),this.query=r.queryParams,this.params=[].reduce.call(r,function(t,e){if(e.params)for(var n in e.params)t[n]=e.params[n];return t},{})),this.path=e,this.matched=r||n._notFoundHandler,Object.defineProperty(this,"router",{enumerable:!1,value:n}),Object.freeze(this)},rt=/\/$/,ot=/[-.*+?^${}()|[\]\/\\]/g,st=/\?.*$/,at={abstract:tt,hash:Z,html5:Y},ut=void 0,ct=function(){function t(){var e=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=n.hashbang,r=void 0===i||i,o=n.abstract,s=void 0!==o&&o,a=n.history,u=void 0!==a&&a,c=n.saveScrollPosition,h=void 0!==c&&c,l=n.transitionOnLoad,f=void 0!==l&&l,p=n.suppressTransitionError,d=void 0!==p&&p,v=n.root,g=void 0===v?null:v,b=n.linkActiveClass,m=void 0===b?"v-link-active":b;if(W.classCallCheck(this,t),!t.installed)throw new Error("Please install the Router with Vue.use() before creating an instance.");this.app=null,this._children=[],this._recognizer=new G,this._guardRecognizer=new G,this._started=!1,this._startCb=null,this._currentRoute={},this._currentTransition=null,this._previousTransition=null,this._notFoundHandler=null,this._notFoundRedirect=null,this._beforeEachHooks=[],this._afterEachHooks=[],this._rendered=!1,this._transitionOnLoad=f,this._root=g,this._abstract=s,this._hashbang=r;var y="undefined"!=typeof window&&window.history&&window.history.pushState;this._history=u&&y,this._historyFallback=u&&!y;var w=ut.util.inBrowser;this.mode=!w||this._abstract?"abstract":this._history?"html5":"hash";var _=at[this.mode];this.history=new _({root:g,hashbang:this._hashbang,onChange:function(t,n,i){e._match(t,n,i)}}),this._saveScrollPosition=h,this._linkActiveClass=m,this._suppress=d}return t.prototype.map=function(t){for(var e in t)this.on(e,t[e]);return this},t.prototype.on=function(t,e){return"*"===t?this._notFound(e):this._addRoute(t,e,[]),this},t.prototype.redirect=function(t){for(var e in t)this._addRedirect(e,t[e]);return this},t.prototype.alias=function(t){for(var e in t)this._addAlias(e,t[e]);return this},t.prototype.beforeEach=function(t){return this._beforeEachHooks.push(t),this},t.prototype.afterEach=function(t){return this._afterEachHooks.push(t),this},t.prototype.go=function(t){var e=!1,n=!1;ut.util.isObject(t)&&(e=t.replace,n=t.append),t=this.stringifyPath(t),t&&this.history.go(t,e,n)},t.prototype.replace=function(t){"string"==typeof t&&(t={path:t}),t.replace=!0,this.go(t)},t.prototype.start=function(t,e,n){if(this._started)return void _("already started.");if(this._started=!0,this._startCb=n,!this.app){if(!t||!e)throw new Error("Must start vue-router with a component and a root container.");if(t instanceof ut)throw new Error("Must start vue-router with a component, not a Vue instance.");this._appContainer=e;var i=this._appConstructor="function"==typeof t?t:ut.extend(t);i.options.name=i.options.name||"RouterApp"}if(this._historyFallback){var r=window.location,o=new Y({root:this._root}),s=o.root?r.pathname.replace(o.rootRE,""):r.pathname;if(s&&"/"!==s)return void r.assign((o.root||"")+"/"+this.history.formatPath(s)+r.search)}this.history.start()},t.prototype.stop=function(){this.history.stop(),this._started=!1},t.prototype.stringifyPath=function(t){var e="";if(t&&"object"==typeof t){if(t.name){var n=ut.util.extend,i=this._currentTransition&&this._currentTransition.to.params,r=t.params||{},o=i?n(n({},i),r):r;e=encodeURI(this._recognizer.generate(t.name,o))}else t.path&&(e=encodeURI(t.path));if(t.query){var s=this._recognizer.generateQueryString(t.query);e+=e.indexOf("?")>-1?"&"+s.slice(1):s}}else e=encodeURI(t?t+"":"");return e},t.prototype._addRoute=function(t,e,n){if(U(t,e),e.path=t,e.fullPath=(n.reduce(function(t,e){return t+e.path},"")+t).replace("//","/"),n.push({path:t,handler:e}),this._recognizer.add(n,{as:e.name}),e.subRoutes)for(var i in e.subRoutes)this._addRoute(i,e.subRoutes[i],n.slice())},t.prototype._notFound=function(t){U("*",t),this._notFoundHandler=[{handler:t}]},t.prototype._addRedirect=function(t,e){"*"===t?this._notFoundRedirect=e:this._addGuard(t,e,this.replace)},t.prototype._addAlias=function(t,e){this._addGuard(t,e,this._match)},t.prototype._addGuard=function(t,e,n){var i=this;this._guardRecognizer.add([{path:t,handler:function(t,r){var o=E(e,t.params,r);n.call(i,o)}}])},t.prototype._checkGuard=function(t){var e=this._guardRecognizer.recognize(t,!0);return e?(e[0].handler(e[0],e.queryParams),!0):this._notFoundRedirect&&(e=this._recognizer.recognize(t),!e)?(this.replace(this._notFoundRedirect),!0):void 0},t.prototype._match=function(t,e,n){var i=this;if(!this._checkGuard(t)){var r=this._currentRoute,o=this._currentTransition;if(o){if(o.to.path===t)return;if(r.path===t)return o.aborted=!0,void(this._currentTransition=this._prevTransition);o.aborted=!0}var s=new it(t,this),a=new et(this,s,r);this._prevTransition=o,this._currentTransition=a,this.app||!function(){var t=i;i.app=new i._appConstructor({el:i._appContainer,created:function(){this.$router=t},_meta:{$route:s}})}();var u=this._beforeEachHooks,c=function(){a.start(function(){i._postTransition(s,e,n)})};u.length?a.runQueue(u,function(t,e,n){a===i._currentTransition&&a.callHook(t,null,n,{expectBoolean:!0})},c):c(),!this._rendered&&this._startCb&&this._startCb.call(null),this._rendered=!0}},t.prototype._onTransitionValidated=function(t){var e=this._currentRoute=t.to;this.app.$route!==e&&(this.app.$route=e,this._children.forEach(function(t){t.$route=e})),this._afterEachHooks.length&&this._afterEachHooks.forEach(function(e){return e.call(null,{to:t.to,from:t.from})}),this._currentTransition.done=!0},t.prototype._postTransition=function(t,e,n){var i=e&&e.pos;i&&this._saveScrollPosition?ut.nextTick(function(){window.scrollTo(i.x,i.y)}):n&&ut.nextTick(function(){var t=document.getElementById(n.slice(1));t&&window.scrollTo(window.scrollX,t.offsetTop)})},t}();return ct.installed=!1,ct.install=function(t){return ct.installed?void _("already installed."):(ut=t,D(ut),L(ut),H(ut),K.Vue=ut,void(ct.installed=!0))},"undefined"!=typeof window&&window.Vue&&window.Vue.use(ct),ct})},function(t,e,n){var i=n(48);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(49);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(50);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(51);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(52);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(53);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){/*! + * Vue.js v1.0.28 + * (c) 2016 Evan You + * Released under the MIT License. + */ +"use strict";function i(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void i(t._data,e,n);var r=t.__ob__;if(!r)return void(t[e]=n);if(r.convert(e,n),r.dep.notify(),r.vms)for(var s=r.vms.length;s--;){var a=r.vms[s];a._proxy(e),a._digest()}return n}function r(t,e){if(o(t,e)){delete t[e];var n=t.__ob__;if(!n)return void(t._isVue&&(delete t._data[e],t._digest()));if(n.dep.notify(),n.vms)for(var i=n.vms.length;i--;){var r=n.vms[i];r._unproxy(e),r._digest()}}}function o(t,e){return Vn.call(t,e)}function s(t){return qn.test(t)}function a(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function u(t){return null==t?"":t.toString()}function c(t){if("string"!=typeof t)return t;var e=Number(t);return isNaN(e)?t:e}function h(t){return"true"===t||"false"!==t&&t}function l(t){var e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e!==n||34!==e&&39!==e?t:t.slice(1,-1)}function f(t){return t.replace(Qn,p)}function p(t,e){return e?e.toUpperCase():""}function d(t){return t.replace(Gn,"$1-$2").replace(Gn,"$1-$2").toLowerCase()}function v(t){return t.replace(Jn,p)}function g(t,e){return function(n){var i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,n):t.call(e)}}function b(t,e){e=e||0;for(var n=t.length-e,i=new Array(n);n--;)i[n]=t[n+e];return i}function m(t,e){for(var n=Object.keys(e),i=n.length;i--;)t[n[i]]=e[n[i]];return t}function y(t){return null!==t&&"object"==typeof t}function w(t){return Kn.call(t)===zn}function _(t,e,n,i){Object.defineProperty(t,e,{value:n,enumerable:!!i,writable:!0,configurable:!0})}function x(t,e){var n,i,r,o,s,a=function a(){var u=Date.now()-o;u=0?n=setTimeout(a,e-u):(n=null,s=t.apply(r,i),n||(r=i=null))};return function(){return r=this,i=arguments,o=Date.now(),n||(n=setTimeout(a,e)),s}}function k(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function C(t){var e=function e(){if(!e.cancelled)return t.apply(this,arguments)};return e.cancel=function(){e.cancelled=!0},e}function A(t,e){return t==e||!(!y(t)||!y(e))&&JSON.stringify(t)===JSON.stringify(e)}function E(t){return/native code/.test(t.toString())}function S(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap=Object.create(null)}function j(){return vi.charCodeAt(mi+1)}function T(){return vi.charCodeAt(++mi)}function O(){return mi>=bi}function $(){for(;j()===$i;)T()}function N(t){return t===Si||t===ji}function F(t){return Ni[t]}function P(t,e){return Fi[t]===e}function R(){for(var t,e=T();!O();)if(t=T(),t===Oi)T();else if(t===e)break}function M(t){for(var e=0,n=t;!O();)if(t=j(),N(t))R();else if(n===t&&e++,P(n,t)&&e--,T(),0===e)break}function I(){for(var t=mi;!O();)if(yi=j(),N(yi))R();else if(F(yi))M(yi);else if(yi===Ti){if(T(),yi=j(),yi!==Ti){wi!==ki&&wi!==Ei||(wi=Ci);break}T()}else{if(yi===$i&&(wi===Ai||wi===Ei)){$();break}wi===Ci&&(wi=Ai),T()}return vi.slice(t+1,mi)||null}function D(){for(var t=[];!O();)t.push(L());return t}function L(){var t,e={};return wi=Ci,e.name=I().trim(),wi=Ei,t=H(),t.length&&(e.args=t),e}function H(){for(var t=[];!O()&&wi!==Ci;){var e=I();if(!e)break;t.push(U(e))}return t}function U(t){if(xi.test(t))return{value:c(t),dynamic:!1};var e=l(t),n=e===t;return{value:n?t:e,dynamic:n}}function W(t){var e=_i.get(t);if(e)return e;vi=t,gi={},bi=vi.length,mi=-1,yi="",wi=ki;var n;return vi.indexOf("|")<0?gi.expression=vi.trim():(gi.expression=I().trim(),n=D(),n.length&&(gi.filters=n)),_i.put(t,gi),gi}function B(t){return t.replace(Ri,"\\$&")}function V(){var t=B(Bi.delimiters[0]),e=B(Bi.delimiters[1]),n=B(Bi.unsafeDelimiters[0]),i=B(Bi.unsafeDelimiters[1]);Ii=new RegExp(n+"((?:.|\\n)+?)"+i+"|"+t+"((?:.|\\n)+?)"+e,"g"),Di=new RegExp("^"+n+"((?:.|\\n)+?)"+i+"$"),Mi=new S(1e3)}function q(t){Mi||V();var e=Mi.get(t);if(e)return e;if(!Ii.test(t))return null;for(var n,i,r,o,s,a,u=[],c=Ii.lastIndex=0;n=Ii.exec(t);)i=n.index,i>c&&u.push({value:t.slice(c,i)}),r=Di.test(n[0]),o=r?n[1]:n[2],s=o.charCodeAt(0),a=42===s,o=a?o.slice(1):o,u.push({tag:!0,value:o.trim(),html:r,oneTime:a}),c=i+n[0].length;return c1?t.map(function(t){return G(t,e)}).join("+"):G(t[0],e,!0)}function G(t,e,n){return t.tag?t.oneTime&&e?'"'+e.$eval(t.value)+'"':J(t.value,n):'"'+t.value+'"'}function J(t,e){if(Li.test(t)){var n=W(t);return n.filters?"this._applyFilters("+n.expression+",null,"+JSON.stringify(n.filters)+",false)":"("+t+")"}return e?t:"("+t+")"}function K(t,e,n,i){Y(t,1,function(){e.appendChild(t)},n,i)}function z(t,e,n,i){Y(t,1,function(){rt(t,e)},n,i)}function X(t,e,n){Y(t,-1,function(){st(t)},e,n)}function Y(t,e,n,i,r){var o=t.__v_trans;if(!o||!o.hooks&&!ai||!i._isCompiled||i.$parent&&!i.$parent._isCompiled)return n(),void(r&&r());var s=e>0?"enter":"leave";o[s](n,r)}function Z(t){if("string"==typeof t){t=document.querySelector(t)}return t}function tt(t){if(!t)return!1;var e=t.ownerDocument.documentElement,n=t.parentNode;return e===t||e===n||!(!n||1!==n.nodeType||!e.contains(n))}function et(t,e){var n=t.getAttribute(e);return null!==n&&t.removeAttribute(e),n}function nt(t,e){var n=et(t,":"+e);return null===n&&(n=et(t,"v-bind:"+e)),n}function it(t,e){return t.hasAttribute(e)||t.hasAttribute(":"+e)||t.hasAttribute("v-bind:"+e)}function rt(t,e){e.parentNode.insertBefore(t,e)}function ot(t,e){e.nextSibling?rt(t,e.nextSibling):e.parentNode.appendChild(t)}function st(t){t.parentNode.removeChild(t)}function at(t,e){e.firstChild?rt(t,e.firstChild):e.appendChild(t)}function ut(t,e){var n=t.parentNode;n&&n.replaceChild(e,t)}function ct(t,e,n,i){t.addEventListener(e,n,i)}function ht(t,e,n){t.removeEventListener(e,n)}function lt(t){var e=t.className;return"object"==typeof e&&(e=e.baseVal||""),e}function ft(t,e){ii&&!/svg$/.test(t.namespaceURI)?t.className=e:t.setAttribute("class",e)}function pt(t,e){if(t.classList)t.classList.add(e);else{var n=" "+lt(t)+" ";n.indexOf(" "+e+" ")<0&&ft(t,(n+e).trim())}}function dt(t,e){if(t.classList)t.classList.remove(e);else{for(var n=" "+lt(t)+" ",i=" "+e+" ";n.indexOf(i)>=0;)n=n.replace(i," ");ft(t,n.trim())}t.className||t.removeAttribute("class")}function vt(t,e){var n,i;if(mt(t)&&kt(t.content)&&(t=t.content),t.hasChildNodes())for(gt(t),i=e?document.createDocumentFragment():document.createElement("div");n=t.firstChild;)i.appendChild(n);return i}function gt(t){for(var e;e=t.firstChild,bt(e);)t.removeChild(e);for(;e=t.lastChild,bt(e);)t.removeChild(e)}function bt(t){return t&&(3===t.nodeType&&!t.data.trim()||8===t.nodeType)}function mt(t){return t.tagName&&"template"===t.tagName.toLowerCase()}function yt(t,e){var n=Bi.debug?document.createComment(t):document.createTextNode(e?" ":"");return n.__v_anchor=!0,n}function wt(t){if(t.hasAttributes())for(var e=t.attributes,n=0,i=e.length;n=u.length){for(var t=0;t=97&&e<=122||e>=65&&e<=90?"ident":e>=49&&e<=57?"number":"else"}function Bt(t){var e=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(s(e)?l(e):"*"+e)}function Vt(t){function e(){var e=t[h+1];if(l===dr&&"'"===e||l===vr&&'"'===e)return h++,i="\\"+e,p[or](),!0}var n,i,r,o,s,a,u,c=[],h=-1,l=cr,f=0,p=[];for(p[sr]=function(){void 0!==r&&(c.push(r),r=void 0)},p[or]=function(){void 0===r?r=i:r+=i},p[ar]=function(){p[or](),f++},p[ur]=function(){if(f>0)f--,l=pr,p[or]();else{if(f=0,r=Bt(r),r===!1)return!1;p[sr]()}};null!=l;)if(h++,n=t[h],"\\"!==n||!e()){if(o=Wt(n),u=mr[l],s=u[o]||u.else||br,s===br)return;if(l=s[0],a=p[s[1]],a&&(i=s[2],i=void 0===i?n:i,a()===!1))return;if(l===gr)return c.raw=t,c}}function qt(t){var e=rr.get(t);return e||(e=Vt(t),e&&rr.put(t,e)),e}function Qt(t,e){return ee(e).get(t)}function Gt(t,e,n){var r=t;if("string"==typeof e&&(e=Vt(e)),!e||!y(t))return!1;for(var o,s,a=0,u=e.length;a-1?n.replace(jr,Xt):n,e+"scope."+n)}function Xt(t,e){return Nr[e]}function Yt(t){Cr.test(t),Nr.length=0;var e=t.replace(Sr,Kt).replace(Ar,"");return e=(" "+e).replace(Or,zt).replace(jr,Xt),Zt(e)}function Zt(t){try{return new Function("scope","return "+t+";")}catch(t){return Jt}}function te(t){var e=qt(t);if(e)return function(t,n){Gt(t,e,n)}}function ee(t,e){t=t.trim();var n=wr.get(t);if(n)return e&&!n.set&&(n.set=te(n.exp)),n;var i={exp:t};return i.get=ne(t)&&t.indexOf("[")<0?Zt("scope."+t):Yt(t),e&&(i.set=te(t)),wr.put(t,i),i}function ne(t){return Tr.test(t)&&!$r.test(t)&&"Math."!==t.slice(0,5)}function ie(){Pr.length=0,Rr.length=0,Mr={},Ir={},Dr=!1}function re(){for(var t=!0;t;)t=!1,oe(Pr),oe(Rr),Pr.length?t=!0:(ti&&Bi.devtools&&ti.emit("flush"),ie())}function oe(t){for(var e=0;e0){var s=o+(i?e:Ct(e));r=Yr.get(s),r||(r=ze(n,t.$options,!0),Yr.put(s,r))}else r=ze(n,t.$options,!0);this.linker=r}function xe(t,e,n){var i=t.node.previousSibling;if(i){for(t=i.__v_frag;!(t&&t.forId===n&&t.inserted||i===e);){if(i=i.previousSibling,!i)return;t=i.__v_frag}return t}}function ke(t){for(var e=-1,n=new Array(Math.floor(t));++e47&&e<58?parseInt(t,10):1===t.length&&(e=t.toUpperCase().charCodeAt(0),e>64&&e<91)?e:wo[t]});return n=[].concat.apply([],n),function(e){if(n.indexOf(e.keyCode)>-1)return t.call(this,e)}}function Te(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function Oe(t){return function(e){return e.preventDefault(),t.call(this,e)}}function $e(t){return function(e){if(e.target===e.currentTarget)return t.call(this,e)}}function Ne(t){if(Ao[t])return Ao[t];var e=Fe(t);return Ao[t]=Ao[e]=e,e}function Fe(t){t=d(t);var e=f(t),n=e.charAt(0).toUpperCase()+e.slice(1);Eo||(Eo=document.createElement("div"));var i,r=xo.length;if("filter"!==e&&e in Eo.style)return{kebab:t,camel:e};for(;r--;)if(i=ko[r]+n,i in Eo.style)return{kebab:xo[r]+t,camel:i}}function Pe(t){var e=[];if(Xn(t))for(var n=0,i=t.length;n=r?n():t[o].call(e,i)}var r=t.length,o=0;t[0].call(e,i)}function Ie(t,e,n){for(var i,r,o,a,u,c,h,l=[],p=n.$options.propsData,v=Object.keys(e),g=v.length;g--;)if(r=v[g],i=e[r]||Wo,u=f(r),Bo.test(u)){if(h={name:r,path:u,options:i,mode:Uo.ONE_WAY,raw:null},o=d(r),null===(a=nt(t,o))&&(null!==(a=nt(t,o+".sync"))?h.mode=Uo.TWO_WAY:null!==(a=nt(t,o+".once"))&&(h.mode=Uo.ONE_TIME)),null!==a)h.raw=a,c=W(a),a=c.expression,h.filters=c.filters,s(a)&&!c.filters?h.optimizedLiteral=!0:h.dynamic=!0,h.parentPath=a;else if(null!==(a=et(t,o)))h.raw=a;else if(p&&null!==(a=p[r]||p[u]))h.raw=a;else;l.push(h)}return De(l)}function De(t){return function(e,n){e._props={};for(var i,r,s,a,u,f=e.$options.propsData,p=t.length;p--;)if(i=t[p],u=i.raw,r=i.path,s=i.options,e._props[r]=i,f&&o(f,r)&&He(e,i,f[r]),null===u)He(e,i,void 0);else if(i.dynamic)i.mode===Uo.ONE_TIME?(a=(n||e._context||e).$get(i.parentPath),He(e,i,a)):e._context?e._bindDir({name:"prop",def:qo,prop:i},null,null,n):He(e,i,e.$get(i.parentPath));else if(i.optimizedLiteral){var v=l(u);a=v===u?h(c(u)):v,He(e,i,a)}else a=s.type===Boolean&&(""===u||u===d(i.name))||u,He(e,i,a)}}function Le(t,e,n,i){var r=e.dynamic&&ne(e.parentPath),o=n;void 0===o&&(o=We(t,e)),o=Ve(e,o,t);var s=o!==n;Be(e,o,t)||(o=void 0),r&&!s?Rt(function(){i(o)}):i(o)}function He(t,e,n){Le(t,e,n,function(n){Ht(t,e.path,n)})}function Ue(t,e,n){Le(t,e,n,function(n){t[e.path]=n})}function We(t,e){var n=e.options;if(!o(n,"default"))return n.type!==Boolean&&void 0;var i=n.default;return y(i),"function"==typeof i&&n.type!==Function?i.call(t):i}function Be(t,e,n){if(!t.options.required&&(null===t.raw||null==e))return!0;var i=t.options,r=i.type,o=!r,s=[];if(r){Xn(r)||(r=[r]);for(var a=0;ae?-1:t===e?0:1}),e=0,n=a.length;ep.priority)&&(p=f,h=r.name,a=mn(r.name),s=r.value,c=u[1],l=u[2]));return p?gn(t,c,s,n,p,h,l,a):void 0}function vn(){}function gn(t,e,n,i,r,o,s,a){var u=W(n),c={name:e,arg:s,expression:u.expression,filters:u.filters,raw:n,attr:o,modifiers:a,def:r};"for"!==e&&"router-view"!==e||(c.ref=wt(t));var h=function(t,e,n,i,r){c.ref&&Ht((i||t).$refs,c.ref,null),t._bindDir(c,e,n,i,r)};return h.terminal=!0,h}function bn(t,e){function n(t,e,n){var i=n&&wn(n),r=!i&&W(o);v.push({name:t,attr:s,raw:a,def:e,arg:c,modifiers:h,expression:r&&r.expression,filters:r&&r.filters,interp:n,hasOneTime:i})}for(var i,r,o,s,a,u,c,h,l,f,p,d=t.length,v=[];d--;)if(i=t[d],r=s=i.name,o=a=i.value,f=q(o),c=null,h=mn(r),r=r.replace(ss,""),f)o=Q(f),c=r,n("bind",Do.bind,f);else if(as.test(r))h.literal=!is.test(r),n("transition",ns.transition);else if(rs.test(r))c=r.replace(rs,""),n("on",Do.on);else if(is.test(r))u=r.replace(is,""),"style"===u||"class"===u?n(u,ns[u]):(c=u,n("bind",Do.bind));else if(p=r.match(os)){if(u=p[1],c=p[2],"else"===u)continue;l=Ft(e,"directives",u,!0),l&&n(u,l)}if(v.length)return yn(v)}function mn(t){var e=Object.create(null),n=t.match(ss);if(n)for(var i=n.length;i--;)e[n[i].slice(1)]=!0;return e}function yn(t){return function(e,n,i,r,o){for(var s=t.length;s--;)e._bindDir(t[s],n,i,r,o)}}function wn(t){for(var e=t.length;e--;)if(t[e].oneTime)return!0}function _n(t){return"SCRIPT"===t.tagName&&(!t.hasAttribute("type")||"text/javascript"===t.getAttribute("type"))}function xn(t,e){return e&&(e._containerAttrs=Cn(t)),mt(t)&&(t=pe(t)),e&&(e._asComponent&&!e.template&&(e.template=""),e.template&&(e._content=vt(t),t=kn(t,e))),kt(t)&&(at(yt("v-start",!0),t),t.appendChild(yt("v-end",!0))),t}function kn(t,e){var n=e.template,i=pe(n,!0);if(i){var r=i.firstChild;if(!r)return i;var o=r.tagName&&r.tagName.toLowerCase();return e.replace?(t===document.body,i.childNodes.length>1||1!==r.nodeType||"component"===o||Ft(e,"components",o)||it(r,"is")||Ft(e,"elementDirectives",o)||r.hasAttribute("v-for")||r.hasAttribute("v-if")?i:(e._replacerAttrs=Cn(r),An(t,r),r)):(t.appendChild(i),t)}}function Cn(t){if(1===t.nodeType&&t.hasAttributes())return b(t.attributes)}function An(t,e){for(var n,i,r=t.attributes,o=r.length;o--;)n=r[o].name,i=r[o].value,e.hasAttribute(n)||hs.test(n)?"class"===n&&!q(i)&&(i=i.trim())&&i.split(/\s+/).forEach(function(t){pt(e,t)}):e.setAttribute(n,i)}function En(t,e){if(e){for(var n,i,r=t._slotContents=Object.create(null),o=0,s=e.children.length;o1?b(n):n;var r=e&&n.some(function(t){return t._fromParent});r&&(i=!1);for(var o=b(arguments,1),s=0,a=n.length;se?o:-o}var n=null,i=void 0;t=bs(t);var r=b(arguments,1),o=r[r.length-1];"number"==typeof o?(o=o<0?-1:1,r=r.length>1?r.slice(0,-1):r):o=1;var s=r[0];return s?("function"==typeof s?n=function(t,e){return s(t,e)*o}:(i=Array.prototype.concat.apply([],r),n=function(t,r,o){return o=o||0,o>=i.length-1?e(t,r,o):e(t,r,o)||n(t,r,o+1)}),t.slice().sort(n)):t}function Wn(t,e){var n;if(w(t)){var i=Object.keys(t);for(n=i.length;n--;)if(Wn(t[i[n]],e))return!0}else if(Xn(t)){for(n=t.length;n--;)if(Wn(t[n],e))return!0}else if(null!=t)return t.toString().toLowerCase().indexOf(e)>-1}function Bn(t){function e(t){return new Function("return function "+v(t)+" (options) { this._init(options) }")()}t.options={directives:Do,elementDirectives:gs,filters:ys,transitions:{},components:{},partials:{},replace:!0},t.util=nr,t.config=Bi,t.set=i,t.delete=r,t.nextTick=fi,t.compiler=ls,t.FragmentFactory=_e,t.internalDirectives=ns,t.parsers={path:yr,text:Hi,template:zr,directive:Pi,expression:Fr},t.cid=0;var n=1;t.extend=function(t){t=t||{};var i=this,r=0===i.cid;if(r&&t._Ctor)return t._Ctor;var o=t.name||i.options.name,s=e(o||"VueComponent");return s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.cid=n++,s.options=Nt(i.options,t),s.super=i,s.extend=i.extend,Bi._assetTypes.forEach(function(t){s[t]=i[t]}),o&&(s.options.components[o]=s),r&&(t._Ctor=s),s},t.use=function(t){if(!t.installed){var e=b(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):t.apply(null,e),t.installed=!0,this}},t.mixin=function(e){t.options=Nt(t.options,e)},Bi._assetTypes.forEach(function(e){t[e]=function(n,i){return i?("component"===e&&w(i)&&(i.name||(i.name=n),i=t.extend(i)),this.options[e+"s"][n]=i,i):this.options[e+"s"][n]}}),m(t.transition,qi)}var Vn=Object.prototype.hasOwnProperty,qn=/^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/,Qn=/-(\w)/g,Gn=/([^-])([A-Z])/g,Jn=/(?:^|[-_\/])(\w)/g,Kn=Object.prototype.toString,zn="[object Object]",Xn=Array.isArray,Yn="__proto__"in{},Zn="undefined"!=typeof window&&"[object Object]"!==Object.prototype.toString.call(window),ti=Zn&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,ei=Zn&&window.navigator.userAgent.toLowerCase(),ni=ei&&ei.indexOf("trident")>0,ii=ei&&ei.indexOf("msie 9.0")>0,ri=ei&&ei.indexOf("android")>0,oi=ei&&/iphone|ipad|ipod|ios/.test(ei),si=void 0,ai=void 0,ui=void 0,ci=void 0;if(Zn&&!ii){var hi=void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend,li=void 0===window.onanimationend&&void 0!==window.onwebkitanimationend;si=hi?"WebkitTransition":"transition",ai=hi?"webkitTransitionEnd":"transitionend",ui=li?"WebkitAnimation":"animation",ci=li?"webkitAnimationEnd":"animationend"}var fi=function(){function t(){n=!1;var t=e.slice(0);e.length=0;for(var i=0;i=this.length&&(this.length=Number(t)+1),this.splice(t,1,e)[0]}),_(Yi,"$remove",function(t){if(this.length){var e=k(this,t);return e>-1?this.splice(e,1):void 0}});var tr=Object.getOwnPropertyNames(Zi),er=!0;Mt.prototype.walk=function(t){for(var e=Object.keys(t),n=0,i=e.length;n",""],tr:[2,"","
    "],col:[2,"","
    "]};Vr.td=Vr.th=[3,"","
    "],Vr.option=Vr.optgroup=[1,'"],Vr.thead=Vr.tbody=Vr.colgroup=Vr.caption=Vr.tfoot=[1,"","
    "],Vr.g=Vr.defs=Vr.symbol=Vr.use=Vr.image=Vr.text=Vr.circle=Vr.ellipse=Vr.line=Vr.path=Vr.polygon=Vr.polyline=Vr.rect=[1,'',""];var qr=/<([\w:-]+)/,Qr=/&#?\w+?;/,Gr=/