text: webpackJsonp([10],{125:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(67),a=n(471),i=n(226),o=n(225);r.default.use(a.a);var s=new a.a.Store({modules:{user:i.a,shared:o.a}})},186:function(e,t,n){"use strict";var r=n(67),a=n(470),i=n(224),o=function(){return n.e(8).then(n.bind(null,472))},s=function(){return n.e(6).then(n.bind(null,474))},u=function(){return n.e(1).then(n.bind(null,473))},c=function(){return n.e(5).then(n.bind(null,475))},d=function(){return n.e(2).then(n.bind(null,478))},l=function(){return n.e(3).then(n.bind(null,477))},f=function(){return n.e(4).then(n.bind(null,476))};r.default.use(a.a),t.a=new a.a({routes:[{path:"/",name:"Home",component:o},{path:"/profile",name:"Profile",component:s,beforeEnter:i.a},{path:"/chat",name:"Chat",component:u,beforeEnter:i.a},{path:"/queue",name:"Queue",component:c,beforeEnter:i.a},{path:"/signup",name:"Signup",component:d,beforeEnter:i.b},{path:"/signin",name:"Signin",component:l,beforeEnter:i.b},{path:"/resetpassword",name:"Reset Password",component:f,beforeEnter:i.b}],mode:"history"})},187:function(e,t,n){"use strict";function r(e){for(var t="",n="_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=n.length,a=0;a<e;a++)t+=n.charAt(Math.floor(Math.random()*r));return t}t.a=r},190:function(e,t,n){"use strict";var r=n(228),a=n.n(r),i=n(229),o=n.n(i),s=n(206),u=n.n(s),c=n(88),d=n.n(c),l=function(){function e(){a()(this,e)}return o()(e,null,[{key:"selfDestructAccount",value:function(e){return u.a.get("https://us-central1-"+d.a.firebase.projectId+".cloudfunctions.net/"+this.SELF_DESTRUCT_ACCOUNT,{params:e})}},{key:"enterQueue",value:function(e){return u.a.get("https://us-central1-"+d.a.firebase.projectId+".cloudfunctions.net/"+this.ENTER_QUEUE,{params:e})}},{key:"exitQueue",value:function(e){return u.a.get("https://us-central1-"+d.a.firebase.projectId+".cloudfunctions.net/"+this.EXIT_QUEUE,{params:e})}},{key:"notifySupervisor",value:function(e){return u.a.get("https://us-central1-"+d.a.firebase.projectId+".cloudfunctions.net/"+this.NOTIFY_SUPERVISOR,{params:e})}},{key:"adminSuperviseQueue",value:function(e){return u.a.get("https://us-central1-"+d.a.firebase.projectId+".cloudfunctions.net/"+this.ADMIN_SUPERVISE_QUEUE,{params:e})}},{key:"adminDeleteQueue",value:function(e){return u.a.get("https://us-central1-"+d.a.firebase.projectId+".cloudfunctions.net/"+this.ADMIN_DELETE_QUEUE,{params:e})}},{key:"adminNotifyClient",value:function(e){return u.a.get("https://us-central1-"+d.a.firebase.projectId+".cloudfunctions.net/"+this.ADMIN_NOTIFY_CLIENT,{params:e})}}]),e}();l.SELF_DESTRUCT_ACCOUNT="selfDestructAccount",l.ENTER_QUEUE="enterQueue",l.EXIT_QUEUE="exitQueue",l.NOTIFY_SUPERVISOR="notifySupervisor",l.ADMIN_SUPERVISE_QUEUE="adminSuperviseQueue",l.ADMIN_DELETE_QUEUE="adminDeleteQueue",l.ADMIN_NOTIFY_CLIENT="adminNotifyClient",t.a=l},223:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(188),a=(n.n(r),n(67)),i=n(189),o=n.n(i),s=n(68),u=(n.n(s),n(186)),c=n(125),d=n(88),l=n.n(d),f=n(187),m=function(){return n.e(0).then(n.bind(null,468))},h=function(){return n.e(7).then(n.bind(null,469))};a.default.use(o.a),a.default.config.productionTip=!1,u.a.beforeEach(function(e,t,n){document.title=l.a.app_name+" | "+e.name,n()}),a.default.component("app-alert",h),new a.default({el:"#app",router:u.a,store:c.a,template:"<App/>",components:{App:m},created:function(){var e=this;null===localStorage.getItem("client_id")&&localStorage.setItem("client_id",n.i(f.a)(20)),this.$store.dispatch("setClientId",localStorage.getItem("client_id")),s.initializeApp(l.a.firebase),s.auth().onAuthStateChanged(function(t){t&&s.auth().currentUser.getIdTokenResult().then(function(t){var n={uid:t.claims.user_id,name:t.claims.name||"Unknown",email:t.claims.email,photoUrl:t.claims.picture,admin:t.claims.admin||!1};e.$store.dispatch("autoSignIn",n)})}),s.database().ref(".info/connected").on("value",function(t){!0===t.val()?(null!==e.$store.getters.user&&void 0!==e.$store.getters.user&&e.$store.dispatch("goOnline"),e.$store.commit("setOffline",!1)):e.$store.commit("setOffline",!0)});var t=s.messaging();t.onMessage(function(e){var t=e.notification.title,n={body:e.notification.body,icon:"/static/img/icons/android-chrome-192x192.png"};new Notification(t,n)}),t.usePublicVapidKey(l.a.firebaseMessagingPublicVapidKey),Notification.requestPermission().then(function(e){return t.getToken()}).then(function(t){e.$store.dispatch("setFcm",t),null!==e.$store.getters.user&&void 0!==e.$store.getters.user&&e.$store.dispatch("addActiveDevice",{uid:e.$store.getters.user.id})}).catch(function(e){}),t.onTokenRefresh(function(){t.getToken().then(function(t){e.$store.dispatch("setFcm",t),null!==e.$store.getters.user&&void 0!==e.$store.getters.user&&e.$store.dispatch("addActiveDevice",{uid:e.$store.getters.user.id})}).catch(function(e){})})}})},224:function(e,t,n){"use strict";function r(e,t,n){i.a.getters.user?n():n("/signin")}function a(e,t,n){i.a.getters.user?n("/"):n()}t.a=r,t.b=a;var i=n(125)},225:function(e,t,n){"use strict";var r=n(138),a=n.n(r),i=n(137),o=n.n(i),s=n(230),u=n.n(s),c=n(68);n.n(c);t.a={state:{offline:!1,client_id:"",fcm:"",loading:!1,error:null},mutations:{setOffline:function(e,t){e.offline=t},setClientId:function(e,t){e.client_id=t},setFcm:function(e,t){e.fcm=t},setLoading:function(e,t){e.loading=t},setError:function(e,t){e.error=t},clearError:function(e){e.error=null}},actions:{setClientId:function(e,t){(0,e.commit)("setClientId",t)},setFcm:function(e,t){(0,e.commit)("setFcm",t)},clearError:function(e){(0,e.commit)("clearError")},setError:function(e,t){(0,e.commit)("setError",t)},addActiveDevice:function(e,t){var n=(e.commit,e.state),r={client:window.navigator.userAgent,datetime:(new Date).getTime(),fcm:n.fcm};c.database().ref("/users/"+t.uid+"/devices").set(u()({},n.client_id,r))},removeActiveDevice:function(e,t){var n=this,r=(e.commit,e.state);return o()(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.database().ref("/users/"+t.uid+"/devices").child(r.client_id).remove();case 2:case"end":return e.stop()}},e,n)}))()}},getters:{offline:function(e){return e.offline},client_id:function(e){return e.client_id},fcm:function(e){return e.fcm},loading:function(e){return e.loading},error:function(e){return e.error}}}},226:function(e,t,n){"use strict";var r=n(138),a=n.n(r),i=n(137),o=n.n(i),s=n(68),u=(n.n(s),n(190));t.a={state:{user:null,metadata:null,ref_metadata:null},mutations:{setUser:function(e,t){e.user=t},setMetadata:function(e,t){e.metadata=t}},actions:{updateMetadata:function(e,t){(0,e.commit)("setMetadata",t)},updateUserProfile:function(e,t){var n=e.commit;e.state;n("setLoading",!0),n("clearError");var r=s.auth().currentUser;r.updateProfile(t).then(function(){n("setLoading",!1),n("clearError");var e={uid:r.uid,name:r.displayName||"Unknown",email:r.email,photoUrl:r.photoURL};s.database().ref("/users_public/"+r.uid).set({name:r.displayName||"Unknown",photoUrl:r.photoURL}),n("setUser",e)}).catch(function(e){n("setLoading",!1),n("setError",e)})},selfDestructAccount:function(e,t){var n=e.commit;e.dispatch,e.state;n("setLoading",!0),s.auth().currentUser.getIdToken(!0).then(function(e){return u.a.selfDestructAccount({token:e})}).then(function(e){n("setLoading",!1),n("clearError"),s.auth().signOut(),n("setUser",null)}).catch(function(e){n("setLoading",!1),n("setError",e)})},signUserUp:function(e,t){var n=e.commit,r=e.dispatch,a=e.state;n("setLoading",!0),n("clearError"),s.auth().createUserWithEmailAndPassword(t.email,t.password).then(function(e){n("setLoading",!1);var t={uid:e.user.uid,name:e.user.displayName,email:e.user.email,photoUrl:e.user.photoURL};n("setUser",t),r("addActiveDevice",{uid:a.user.uid})}).catch(function(e){n("setLoading",!1),n("setError",e)})},signUserIn:function(e,t){var n=e.commit,r=e.dispatch,a=e.state;n("setLoading",!0),n("clearError"),s.auth().signInWithEmailAndPassword(t.email,t.password).then(function(e){n("setLoading",!1);var t={uid:e.user.uid,name:e.user.displayName,email:e.user.email,photoUrl:e.user.photoURL};n("setUser",t),r("addActiveDevice",{uid:a.user.uid}),r("goOnline")}).catch(function(e){n("setLoading",!1),n("setError",e)})},signUserInGoogle:function(e){var t=e.commit,n=e.dispatch,r=e.state;t("setLoading",!0),t("clearError"),s.auth().signInWithPopup(new s.auth.GoogleAuthProvider).then(function(e){t("setLoading",!1);var a={uid:e.user.uid,name:e.user.displayName,email:e.user.email,photoUrl:e.user.photoURL};t("setUser",a),n("addActiveDevice",{uid:r.user.uid}),n("goOnline")}).catch(function(e){t("setLoading",!1),t("setError",e)})},signUserInFacebook:function(e){var t=e.commit;t("setLoading",!0),t("clearError"),s.auth().signInWithPopup(new s.auth.FacebookAuthProvider).then(function(e){t("setLoading",!1);var n={uid:e.user.uid,name:e.user.displayName,email:e.user.email,photoUrl:e.user.photoURL};t("setUser",n)}).catch(function(e){t("setLoading",!1),t("setError",e)})},signUserInGithub:function(e){var t=e.commit;t("setLoading",!0),t("clearError"),s.auth().signInWithPopup(new s.auth.GithubAuthProvider).then(function(e){t("setLoading",!1);var n={uid:e.user.uid,name:e.user.displayName,email:e.user.email,photoUrl:e.user.photoURL};t("setUser",n)}).catch(function(e){t("setLoading",!1),t("setError",e)})},signUserInTwitter:function(e){var t=e.commit;t("setLoading",!0),t("clearError"),s.auth().signInWithPopup(new s.auth.TwitterAuthProvider).then(function(e){t("setLoading",!1);var n={uid:e.user.uid,name:e.user.displayName,email:e.user.email,photoUrl:e.user.photoURL};t("setUser",n)}).catch(function(e){t("setLoading",!1),t("setError",e)})},autoSignIn:function(e,t){var n=e.commit,r=e.dispatch;n("setUser",{uid:t.uid,name:t.name,email:t.email,photoUrl:t.photoUrl,admin:t.admin||!1}),r("goOnline")},resetPasswordWithEmail:function(e,t){var n=e.commit,r=t.email;n("setLoading",!0),s.auth().sendPasswordResetEmail(r).then(function(){n("setLoading",!1)}).catch(function(e){n("setLoading",!1),n("setError",e)})},goOnline:function(e){var t=e.state,n=e.dispatch,r=s.database().ref("/users/"+t.user.uid+"/online");r.onDisconnect().set(!1),r.set(!0);var a=s.database().ref("/users/"+t.user.uid+"/last_online");a.onDisconnect().set(s.database.ServerValue.TIMESTAMP),a.set(s.database.ServerValue.TIMESTAMP),t.ref_metadata=s.database().ref("/users/"+t.user.uid),t.ref_metadata.on("value",function(e){n("updateMetadata",e.val())})},goOffline:function(e){var t=this,n=e.state;return o()(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.database().ref("/users/"+n.user.uid+"/online").set(!1);case 2:return e.next=4,s.database().ref("/users/"+n.user.uid+"/last_online").set(s.database.ServerValue.TIMESTAMP);case 4:null!==n.ref_metadata&&n.ref_metadata.off("value");case 5:case"end":return e.stop()}},e,t)}))()},logout:function(e){var t=e.commit,n=e.dispatch;n("removeActiveDevice",{uid:e.state.user.uid}),n("goOffline"),t("setUser",null),t("setMetadata",null),s.auth().signOut()}},getters:{user:function(e){return e.user},metadata:function(e){return e.metadata}}}},88:function(e,t){e.exports={app_name:"FireFlutter",firebase:{apiKey:"AIzaSyDqnMO3jiIVhs8hRj7SInrcIb0yYP_UOWo",authDomain:"fireflutter-f1304.firebaseapp.com",databaseURL:"https://fireflutter-f1304.firebaseio.com",projectId:"fireflutter-f1304",storageBucket:"fireflutter-f1304.appspot.com",messagingSenderId:"436808076830",appId:"1:436808076830:web:203de1b486bf426d"},firebaseMessagingPublicVapidKey:"BJsIg3YzlzWtHZRRAJZtszJycz8t8M5sxtTMNUgs86Dhv-3u-Y5lCnLehbhnBIoE6JFv5MeDVjxB6pZlDsGv90Q"}}},[223]);