!function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e){t.exports={name:"comment",el:"#comments",data:function(){return _.merge({posts:[],config:{filter:this.$session.get("comments.filter",{})},comments:!1,pages:0,count:"",selected:[],user:window.$pagekit.user,replyComment:{},editComment:{}},window.$data)},ready:function(){this.Comments=this.$resource("api/blog/comment{/id}"),this.$watch("config.page",this.load,{immediate:!0}),UIkit.init(this.$el)},watch:{"config.filter":{handler:function(t){this.config.page?this.config.page=0:this.load(),this.$session.set("comments.filter",t)},deep:!0}},computed:{statusOptions:function(){var t=_.map(this.$data.statuses,function(t,e){return{text:t,value:e}});return[{label:this.$trans("Filter by"),options:t}]}},methods:{active:function(t){return this.selected.indexOf(t.id)!=-1},submit:function(){this.save(this.editComment.id?this.editComment:this.replyComment)},save:function(t){return this.Comments.save({id:t.id},{comment:t}).then(function(){this.load(),this.$notify("Comment saved.")},function(t){this.$notify(t.data,"danger")})},status:function(t){var e=this.getSelected();e.forEach(function(e){e.status=t}),this.Comments.save({id:"bulk"},{comments:e}).then(function(){this.load(),this.$notify("Comments saved.")})},remove:function(){this.Comments["delete"]({id:"bulk"},{ids:this.selected}).then(function(){this.load(),this.$notify("Comments deleted.")})},load:function(){this.cancel(),this.Comments.query({filter:this.config.filter,post:this.config.post&&this.config.post.id||0,page:this.config.page,limit:this.config.limit}).then(function(t){var e=t.data;this.$set("posts",e.posts),this.$set("comments",e.comments),this.$set("pages",e.pages),this.$set("count",e.count),this.$set("selected",[])})},getSelected:function(){var t=this;return this.comments.filter(function(e){return t.selected.indexOf(e.id)!==-1})},getStatusText:function(t){return this.statuses[t.status]},cancel:function(){this.$set("replyComment",{}),this.$set("editComment",{})},reply:function(t){this.cancel(),this.$set("replyComment",{parent_id:t.id,post_id:t.post_id,author:this.user.name,email:this.user.email})},edit:function(t){this.cancel(),this.$set("editComment",_.merge({},t))},toggleStatus:function(t){t.status=1===t.status?0:1,this.save(t)}},partials:{"default-row":"#default-row","edit-row":"#edit-row"}},Vue.ready(t.exports)}]);