(function(t){function e(e){for(var o,a,c=e[0],s=e[1],l=e[2],m=0,h=[];m0?n("b-row",{staticClass:"pl-4",attrs:{"align-h":"center"}},[n("b-col",{attrs:{cols:"8"}},[t.numberOfItemsToShow=this.documents.length||this.numberOfItemsToShow+3>=this.documents.length?this.numberOfItemsToShow=this.documents.length:this.numberOfItemsToShow+=3}}},O=x,E=(n("e043"),Object(m["a"])(O,F,T,!1,null,null,null)),S=E.exports,$={name:"CollectionList",components:{DocumentList:S},data:function(){return{}},mounted:function(){this.$store.dispatch("documents/getCollectionList")},computed:{collections:{get:function(){return this.$store.state.documents.collectionList}},emailVerified:{get:function(){return!this.$store.auth.gracePeriod}},accessDate:{get:function(){return Date.parse(this.$store.auth.graceUntil)}},hoursUntilAccessExpires:{get:function(){var t=this.accessDate-Date.now();return Math.floor(t/36e5)}}},watch:{},methods:{}},M=$,A=(n("7406"),Object(m["a"])(M,L,I,!1,null,null,null)),j=A.exports,P=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("b-container",{attrs:{fluid:""}},[n("b-row",[n("b-col")],1),n("b-row",{attrs:{"align-h":"center"}},[n("b-col",{attrs:{cols:"12",md:"11"}},[t.collection?n("document-list",{attrs:{collection:t.collection}}):t._e()],1)],1)],1)],1)},U=[],R={name:"Collection",components:{DocumentList:S},props:{name:String},data:function(){return{}},mounted:function(){0==this.$store.state.documents.collectionList.length&&this.$store.dispatch("documents/getCollectionList")},computed:{collection:{get:function(){var t=this,e=this.$store.state.documents.collectionList.filter((function(e){return e.name.toUpperCase()===t.name.toUpperCase()}));return e.length>=1?e[0]:null}},emailVerified:{get:function(){return!this.$store.auth.gracePeriod}},accessDate:{get:function(){return Date.parse(this.$store.auth.graceUntil)}},hoursUntilAccessExpires:{get:function(){var t=this.accessDate-Date.now();return Math.floor(t/36e5)}}},watch:{},methods:{}},N=R,J=(n("b79b"),Object(m["a"])(N,P,U,!1,null,null,null)),z=J.exports,H=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"callback"},[t._v("Logging in...")])},q=[],Y=(n("a481"),{name:"AuthCallback",mounted:function(){var t=this;this.$store.dispatch("auth/handleAuthentication").then((function(e){var n=t.$store.getters["auth/initialURI"];t.$store.commit("auth/setInitialURI",null),n?t.$router.replace(n):t.$router.replace("/browse")}),(function(e){console.log("err..."),console.log(e),t.$router.replace({name:"auth-error",params:{error:e.error,errorDescription:e.errorDescription,errorObj:e}})}))}}),B=Y,K=Object(m["a"])(B,H,q,!1,null,null,null),V=K.exports,W=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"auth-error"},[n("b-container",[n("b-row",[n("b-col",{attrs:{md:"3",sm:"2"}}),n("b-col",[n("b-card",{staticClass:"my-5",attrs:{id:"auth-error-card",header:t.messageHeader,"border-variant":"danger","header-text-variant":"white","header-border-variant":"danger","header-bg-variant":"danger",align:"center","header-class":"font-weight-bold text-capitalize"}},[n("p",[t._v("\n There was a problem logging in.\n ")]),t.errorDescription?n("div",[n("p",[t._v("\n The message from the authentication server was: "),n("br"),n("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.errorDescription))])]),n("hr")]):t._e(),n("p",[t._v("\n This usually isn't because you got your password wrong.\n\n Check your email to see if your spam filter accidently flagged\n anything from Safearth ID, and make sure you've verified your account by\n clicking the link in the welcome email.\n ")]),n("hr"),t._v("\n\n You can also try to "),n("b-button",{attrs:{variant:"outline-primary"},on:{click:t.login}},[t._v("Log In")]),t._v(" again.\n ")],1)],1),n("b-col",{attrs:{md:"3",sm:"2"}})],1)],1)],1)},X=[],G={name:"AuthError",props:{error:{default:null,type:String},errorDescription:{default:null,type:String},errorObj:{default:null,type:Object}},computed:{messageHeader:function(){var t="Auth. Error";return this.error&&(t+=": "+this.error),t}},methods:{login:function(){this.$store.dispatch("auth/forceLogin")}}},Q=G,Z=Object(m["a"])(Q,W,X,!1,null,null,null),tt=Z.exports,et=(n("ac6a"),n("96cf"),n("3b8d")),nt=(n("20d6"),n("bc3a")),ot=n.n(nt),rt=function(t){var e=ot.a.create({baseURL:"https://cdn.safearth.dev/library",headers:{"Cache-Control":"no-cache"}}),n=t.accessToken;return n&&(e.defaults.headers.common["Authorization"]="Bearer ".concat(n)),e},it={collectionList:[],fetchingCollections:!1,fetchingCollectionsFailed:!1,fetchingCollectionsErrorMessage:""},at={},ct={setCollectionList:function(t,e){var n;for(n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=localStorage.getItem(t);return void 0===n||null===n?e:n},ft=function(){var t={idToken:ht("auth:id_token"),accessToken:ht("auth:access_token"),expiresAt:ht("auth:expires_at"),user:JSON.parse(ht("auth:user","{}"))};return t},dt=function(t){localStorage.setItem("auth:id_token",t.idToken),localStorage.setItem("auth:access_token",t.accessToken),localStorage.setItem("auth:expires_at",t.expiresAt),localStorage.setItem("auth:user",JSON.stringify(t.user))},gt=function(){localStorage.removeItem("auth:id_token"),localStorage.removeItem("auth:access_token"),localStorage.removeItem("auth:expires_at"),localStorage.removeItem("auth:user")},pt=function(t){var e=1e3*t+(new Date).getTime();return JSON.stringify(e)},bt=ft(),vt={authenticated:function(t){var e=(new Date).getTime();return e