(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2350f6fc"],{"15ca":function(e,t,n){},"2a90":function(e,t,n){"use strict";n("15ca")},"80f5":function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("bee2"),s=n("d4ec"),o=n("262e"),r=n("2caf"),a=n("ade3"),c=n("9d56"),l=function(e){Object(o["a"])(n,e);var t=Object(r["a"])(n);function n(){return Object(s["a"])(this,n),t.apply(this,arguments)}return Object(i["a"])(n)}(c["a"]);Object(a["a"])(l,"resource","comment")},ae7d:function(e,t,n){"use strict";n.r(t);n("b0c0");var i=function(){var e=this,t=e._self._c;return t("transition",[t("div",{staticClass:"tree",style:e.indent},[t("div",{staticClass:"item-comentario"},[t("div",{staticClass:"meu-perfil"},[""===e.autor.picture||null===e.autor.picture?t("div",{staticClass:"foto"}):t("div",{staticClass:"logox"},[t("img",{attrs:{src:e.autor.picture}})])]),t("div",{staticClass:"item comentario-simples animationMenu2"},[t("h6",[e._v(" "+e._s(e.autor.name)),t("span",[e._v(e._s(e._f("moment")(e.criacao)))]),"draft"===e.status?t("span",[e._v(" "+e._s(e.$t("player.tree_comentarios.awaiting_moderation"))+" ")]):e._e()]),t("p",{staticClass:"animationOpacity2"},[e._v(e._s(e.label))]),e.textAreaResp?t("div",[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.minhaResposta,expression:"minhaResposta"}],staticClass:"animationOpacity",attrs:{id:"myComment",type:"text",placeholder:e.$t("player.placeholder_comentario")},domProps:{value:e.minhaResposta},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.resposta(e.id)},input:function(t){t.target.composing||(e.minhaResposta=t.target.value)}}}),t("button",{staticClass:"btnResp cancelaBtn animationOpacity2",on:{click:function(t){t.preventDefault(),e.textAreaResp=!1}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.cancelar"))+" ")]),t("button",{staticClass:"btnResp animationOpacity2",on:{click:function(t){return t.preventDefault(),e.resposta(e.id)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.responder"))+" ")])]):e._e(),e.isMobile?e._e():t("div",{staticClass:"like-resposta"},[!1===e.liked?t("a",{on:{click:function(t){return e.toggleLike(e.fatherId?e.fatherId:null)}}},[t("span",{staticClass:"numberLiked"},[e._v(" "+e._s(e.likes_count)+" ")]),e._v(" "+e._s(e.$t("player.tree_comentarios.curtir"))+" ")]):t("a",{on:{click:function(t){return e.toggleLike(e.fatherId?e.fatherId:null)}}},[t("span",{staticClass:"numberLiked"},[e._v(" "+e._s(e.likes_count)+" ")]),e._v(" "+e._s(e.$t("player.tree_comentarios.descurtir"))+" ")]),t("a",{on:{click:function(t){return e.openResp(e.id)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.responder2"))+" ")]),e.permission&&"draft"===e.status?t("a",{staticClass:"btnAprovar",on:{click:function(t){return e.aprovComment(e.id)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.aprovar"))+" ")]):e._e(),e.permission?t("a",{staticClass:"btnDeletar",on:{click:function(t){return e.deleteComment(e.id)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.deletar"))+" ")]):e._e(),e.isMine?t("a",{on:{click:function(t){return e.editComment(e.id,e.label)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.editar"))+" ")]):e._e()]),e.isMobile?t("div",{staticClass:"like-resposta"},[!1===e.liked?t("a",{on:{click:function(t){return e.toggleLike(e.fatherId?e.fatherId:null)}}},[t("span",{staticClass:"numberLiked"},[e._v(" "+e._s(e.likes_count)+" ")]),e._v(" "+e._s(e.$t("player.tree_comentarios.curtir"))+" ")]):t("a",{on:{click:function(t){return e.toggleLike(e.fatherId?e.fatherId:null)}}},[t("span",{staticClass:"numberLiked"},[e._v(" "+e._s(e.likes_count)+" ")]),e._v(" "+e._s(e.$t("player.tree_comentarios.descurtir"))+" ")]),t("a",{on:{click:function(t){return e.openResp(e.id)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.responder2"))+" ")]),e.isMine?t("a",{on:{click:function(t){return e.editComment(e.id,e.label)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.editar"))+" ")]):e._e()]):e._e(),e.isMobile?t("div",{staticClass:"like-resposta",class:{spaceActionsMobile:e.isMobile}},[e.permission&&"draft"===e.status?t("a",{staticClass:"btnAprovar",on:{click:function(t){return e.aprovComment(e.id)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.aprovar"))+" ")]):e._e(),e.permission?t("a",{staticClass:"btnDeletar",on:{click:function(t){return e.deleteComment(e.id)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.deletar"))+" ")]):e._e()]):e._e(),t("div",{staticClass:"ver-respostas"},[!e.showChildren&&e.nodes.length?t("a",{attrs:{href:""},on:{click:function(t){return t.preventDefault(),e.toggleChildren.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.ver_respostas"))+" "+e._s(e.nodes.length)+" "+e._s(e.$t("player.tree_comentarios.ver_respostas2"))+" ")]):t("a",{directives:[{name:"show",rawName:"v-show",value:e.nodes.length,expression:"nodes.length"}],attrs:{href:""},on:{click:function(t){return t.preventDefault(),e.toggleChildren.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("player.tree_comentarios.ocultar_respostas"))+" "+e._s(e.nodes.length)+" "+e._s(e.$t("player.tree_comentarios.ocultar_respostas2"))+" ")])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showChildren,expression:"showChildren"}]},e._l(e.nodes,(function(n,i){return t("TreeComentarios",{key:i,attrs:{comment:n,comments:e.comments,fatherId:e.comment.id,nodes:n.replies,label:n.comment,autor:n.member,criacao:n.created_at,isMine:n.is_mine,liked:n.liked,likes_count:n.likes_count,status:n.status,id:n.id,depth:e.depth+1}})})),1)])])])])},s=[],o=n("2909"),r=(n("7db0"),n("d3b7"),n("c1df")),a=n.n(r),c=n("a78e"),l=n.n(c),u=n("f26f"),m=n("80f5"),d=u["a"].build(),p=m["a"].build(),f={props:["label","nodes","depth","autor","criacao","status","id","isMine","liked","likes_count","comments","comment","isReply","fatherId"],data:function(){return{showChildren:!1,permission:!1,openRespId:"",textAreaResp:!1,minhaResposta:"",animeDelete:!1,client:{width:0}}},name:"TreeComentarios",created:function(){window.addEventListener("resize",this.handleResize),this.handleResize()},computed:{indent:function(){return{transform:"translate(".concat(5*this.depth,"px)")}},isMobile:function(){return this.client.width<=576}},methods:{toggleLike:function(e){var t,n=this,i=this.$route.params,s={id:"/"+i.curso+"/module/"+i.modulo+"/lesson/"+i.aula+"/comment/"+this.comment.id+"/like"};this.$root.$emit("loadOn"),this.sentLikeRequest(!this.comment.liked,s);var r=Object(o["a"])(this.comments),a=e?null===(t=r.find((function(t){return t.id===e})))||void 0===t?void 0:t.replies.find((function(e){return e.id===n.comment.id})):r.find((function(e){return e.id===n.comment.id}));a&&(a.liked=!a.liked,a.likes_count+=a.liked?1:-1,this.$emit("updateComments",r))},sentLikeRequest:function(e,t){var n=this;e?d.updateId(t).finally((function(){n.$root.$emit("loadOff")})):d.destroy(t).finally((function(){n.$root.$emit("loadOff")}))},handleResize:function(){this.client.width=window.innerWidth},resposta:function(e){var t=this,n=this.$route.params,i={id:n.curso+"/module/"+n.modulo+"/lesson/"+n.aula+"/comment",comment:this.minhaResposta,parent_lesson_comment_id:e},s=Object(o["a"])(this.comments),r=s.find((function(t){return t.id===e}));d.postID(i).then((function(e){t.minhaResposta="",t.textAreaResp=!1,r?(r.replies=r.replies||[],r.replies.push(e),t.$emit("updateComments",s)):t.$root.$emit("getComments")})).catch((function(e){return console.error(e)})).finally((function(){return t.$root.$emit("loadOff")}))},editComment:function(e,t){this.$root.$emit("editComments",{id:e,comentario:t})},openResp:function(e){this.openRespId=e,this.textAreaResp=!0},aprovComment:function(e){var t=this;this.$root.$emit("loadOn"),p.postID({id:e,status:"published"}).then((function(){return t.$root.$emit("getComments")})).catch((function(e){return console.error(e)})).finally((function(){return t.$root.$emit("loadOff")}))},deleteComment:function(e){var t=this;this.animeDelete=!0;var n=this.$route.params;this.$root.$emit("loadOn"),d.destroy(n.curso+"/module/"+n.modulo+"/lesson/"+n.aula+"/comment/"+e).then((function(){t.animeDelete=!1,t.$root.$emit("getComments",e)})).catch((function(e){return console.error(e)})).finally((function(){return t.$root.$emit("loadOff")}))},toggleChildren:function(){this.showChildren=!this.showChildren},getPermission:function(){var e=l.a.get("access_level"),t=l.a.get("type_student");if("admin"===e||"owner"===e){if(1===t||"1"===t)return void(this.permission=!1);this.permission=!0}else this.permission=!1}},mounted:function(){this.getPermission()},filters:{moment:function(e){return a()(e).format("DD/MM/YY hh:ss")}}},_=f,h=(n("2a90"),n("2877")),v=Object(h["a"])(_,i,s,!1,null,"428c13e0",null);t["default"]=v.exports}}]);
//# sourceMappingURL=chunk-2350f6fc.712f8a24.js.map