import{r as t,o as x,g as C,w as o,h as e,p as V,i as $,t as j,j as f,q as z}from"./vendor-cf98dd49.js";import{_ as N}from"./_plugin-vue_export-helper-c27b6911.js";const b={expose:["deleteRole"],data:()=>({DeleteRoleDialog:!1,resolve:null,reject:null,message:null,title:null}),methods:{async deleteRole(l,s){await this.open("Confirm","Are you sure you want to delete role: #"+l+" "+s+"?")&&this.deleteRecord(l)},open(l,s,n){return this.DeleteRoleDialog=!0,this.title=l,this.message=s,new Promise((c,i)=>{this.resolve=c,this.reject=i})},async deleteRecord(l){let s;this.$root.$refs.overlay.showOverlay(!0),this.$root.axiosPost("/role-manager/delete/"+l,null,{}).then(n=>{s=n.response.data,this.$root.$refs.overlay.showOverlay(!1),s.status=="Success"&&(this.DeleteRoleDialog=!1,this.$emit("load-roles"))})},agree(){this.resolve(!0),this.DeleteRoleDialog=!1},cancel(){this.resolve(!1),this.DeleteRoleDialog=!1}}};function B(l,s,n,c,i,a){const d=t("v-icon"),p=t("v-hover"),_=t("v-row"),m=t("v-card-title"),h=t("v-avatar"),u=t("v-col"),g=t("v-card-text"),v=t("v-btn"),y=t("v-spacer"),D=t("v-card-actions"),w=t("v-card"),R=t("v-dialog");return x(),C(R,{modelValue:l.DeleteRoleDialog,"onUpdate:modelValue":s[0]||(s[0]=r=>l.DeleteRoleDialog=r),width:"auto",persistent:"",onKeydown:z(a.cancel,["esc"])},{default:o(()=>[e(w,null,{default:o(()=>[e(m,null,{default:o(()=>[e(_,{justify:"end",class:"pt-2"},{default:o(()=>[e(p,null,{default:o(({isHovering:r,props:k})=>[e(d,V({size:"small"},k,{color:r?"grey-darken-1":"grey-lighten-1",variant:"plain",icon:"mdi-close",onClick:a.cancel}),null,16,["color","onClick"])]),_:1})]),_:1})]),_:1}),e(g,null,{default:o(()=>[e(_,{class:"d-flex"},{default:o(()=>[e(u,{align:"center",cols:"12"},{default:o(()=>[e(h,{color:"red-lighten-1",size:"80"},{default:o(()=>[e(d,{size:"50",icon:"mdi-briefcase-remove"})]),_:1})]),_:1}),e(u,{align:"center",cols:"12",style:{"font-size":"16px",color:"#EF5350"}},{default:o(()=>[$("strong",null,j(l.message),1)]),_:1})]),_:1})]),_:1}),e(D,{class:"pt-3"},{default:o(()=>[e(v,{color:"red-darken-1",text:"",onClick:a.cancel},{default:o(()=>[f("No")]),_:1},8,["onClick"]),e(y),e(v,{color:"green-darken-1",text:"",onClick:a.agree},{default:o(()=>[f("Yes")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue","onKeydown"])}const O=N(b,[["render",B]]);export{O as default};
