!function(t){function e(i){if(s[i])return s[i].exports;var n=s[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var s={};return e.m=t,e.c=s,e.p="",e(0)}([function(t,e){t.exports={el:"#users",data:function(){return _.merge({users:!1,config:{filter:this.$session.get("user.filter",{order:"username asc"})},pages:0,count:"",selected:[]},window.$data)},ready:function(){this.resource=this.$resource("api/user{/id}"),this.load()},watch:{"config.page":"load","config.filter":{handler:function(t){this.load(0),this.$session.set("user.filter",t)},deep:!0}},computed:{statuses:function(){var t=[{text:this.$trans("New"),value:"new"}].concat(_.map(this.config.statuses,function(t,e){return{text:t,value:e}}));return[{label:this.$trans("Filter by"),options:t}]},roles:function(){var t=this.config.roles.map(function(t){return{text:t.name,value:t.id}});return[{label:this.$trans("Filter by"),options:t}]}},methods:{active:function(t){return-1!=this.selected.indexOf(t.id)},save:function(t){this.resource.save({id:t.id},{user:t}).then(function(){this.load(),this.$notify("User saved.")},function(t){this.load(),this.$notify(t.data,"danger")})},status:function(t){var e=this.getSelected();e.forEach(function(e){e.status=t}),this.resource.save({id:"bulk"},{users:e}).then(function(){this.load(),this.$notify("Users saved.")},function(t){this.load(),this.$notify(t.data,"danger")})},remove:function(){this.resource["delete"]({id:"bulk"},{ids:this.selected}).then(function(){this.load(),this.$notify("Users deleted.")},function(t){this.load(),this.$notify(t.data,"danger")})},toggleStatus:function(t){t.status=t.status?0:1,this.save(t)},showVerified:function(t){return this.config.emailVerification&&t.data.verified},showRoles:function(t){return _.reduce(t.roles,function(t,e){var s=_.find(this.config.roles,"id",e);return 2!==e&&s&&t.push(s.name),t},[],this).join(", ")},load:function(t){t=void 0!==t?t:this.config.page,this.resource.query({filter:this.config.filter,page:t}).then(function(e){var s=e.data;this.$set("users",s.users),this.$set("pages",s.pages),this.$set("count",s.count),this.$set("config.page",t),this.$set("selected",[])},function(){this.$notify("Loading failed.","danger")})},getSelected:function(){return this.users.filter(function(t){return-1!==this.selected.indexOf(t.id)},this)}}},Vue.ready(t.exports)}]);