(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{920:function(a,b,c){"use strict";function d(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function e(a){return function(){var b=this,c=arguments;return new Promise(function(e,f){function g(a){d(i,e,f,g,h,"next",a)}function h(a){d(i,e,f,g,h,"throw",a)}var i=a.apply(b,c);g(void 0)})}}c.r(b);var f=function(){var a=this,b=a.$createElement,c=a._self._c||b;return c("div",[c("base-alert",{directives:[{name:"show",rawName:"v-show",value:a.alert.type,expression:"alert.type"}],attrs:{apperance:a.alert.type},on:{close:function(){a.alert={}}}},[c("span",{domProps:{innerHTML:a._s(a.alert.message)}})]),a._v(" "),a.showDeleteModal?c("base-modal",{attrs:{title:"Deseja realmente excluir a agenda?",size:"medium"},on:{close:a.handleCloseDelete}},[c("div",{staticClass:"padding-medium text-center"},[a._v("\n      Ao excluir essa agenda, seus hor\xE1rios e configura\xE7\xF5es ser\xE3o permanentemente apagados.\n      "),c("div",{staticClass:"top-margin-large flex gap-2 center-xs"},[c("base-button",{attrs:{apperance:"success",square:"",size:"medium"},nativeOn:{click:function(b){return a.handleConfirmDelete(b)}}},[a._v("\n          Confirmar\n        ")]),a._v(" "),c("base-button",{attrs:{apperance:"error",square:"",size:"medium"},nativeOn:{click:function(b){return a.handleCloseDelete(b)}}},[a._v("\n          Cancelar\n        ")])],1)])]):a._e()],1)};f._withStripped=!0;var g=c(398),h=c(21),i=c(3),j=document.getElementById("base-urls").dataset.baseUrlLoja,k=document.body.getAttribute("data-token"),l={name:"ScheduleDelete",components:{BaseAlert:function(){return c.e(14).then(c.bind(null,53))},BaseModal:function(){return Promise.all([c.e(5),c.e(25)]).then(c.bind(null,208))},BaseButton:function(){return c.e(6).then(c.bind(null,167))},ScheduleEdit:function(){return c.e(46).then(c.bind(null,919))}},props:{scheduleID:{type:String|Number},showDeleteModal:{type:Boolean,default:!1}},data:function(){return{alert:{}}},methods:{handleConfirmDelete:function(){var a=this;return e(regeneratorRuntime.mark(function b(){return regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,Object(i.a)({method:"POST",url:j+"admin/index.php?route=sale/schedule/deleteScheduleHasNotOrder&token="+k,data:Object(i.b)({schedule_id:a.scheduleID})}).then(function(b){var c=b.data;a.alert={type:c.type,message:c.message},"success"==c.type&&(g.a.dispatch("getIdToDeleteSchedule",a.scheduleID),setTimeout(function(){return a.handleCloseDelete()},3e3))}).catch(function(b){console.error(b),a.alert={type:"warning",message:"N\xE3o foi poss\xEDvel deletar a agenda!"}});case 2:case"end":return b.stop();}},b)}))()},handleCloseDelete:function(){this.$emit("callbackDeleteModal",!1)}}},m=c(596),n=Object(m.a)(l,f,[],!1,null,null,null);n.options.__file="assets/components/components/Schedule/ScheduleDelete/index.vue";b["default"]=n.exports}}]);