import{r as t,o as C,g as V,w as o,h as e,p as $,i as j,t as z,j as p,q as N}from"./vendor-cf98dd49.js";import{_ as T}from"./_plugin-vue_export-helper-c27b6911.js";const b={expose:["deleteTool"],data:()=>({DeleteDialog:!1,resolve:null,reject:null,message:null,title:null}),methods:{async deleteTool(l,s){await this.open("Confirm","Are you sure you want to delete tool: #"+l+" "+s+"?")&&this.deleteRecord(l)},open(l,s,n){return this.DeleteDialog=!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/tool/delete/"+l,null,{}).then(n=>{s=n.response.data,this.$root.$refs.overlay.showOverlay(!1),s.status=="Success"&&(this.DeleteDialog=!1,this.$emit("load-tools"))})},agree(){this.resolve(!0),this.DeleteDialog=!1},cancel(){this.resolve(!1),this.DeleteDialog=!1}}};function B(l,s,n,c,i,a){const d=t("v-icon"),f=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"),k=t("v-dialog");return C(),V(k,{modelValue:l.DeleteDialog,"onUpdate:modelValue":s[0]||(s[0]=r=>l.DeleteDialog=r),width:"auto",persistent:"",onKeydown:N(a.cancel,["esc"])},{default:o(()=>[e(w,null,{default:o(()=>[e(m,null,{default:o(()=>[e(_,{justify:"end",class:"pt-2"},{default:o(()=>[e(f,null,{default:o(({isHovering:r,props:x})=>[e(d,$({size:"small"},x,{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-book-remove"})]),_:1})]),_:1}),e(u,{align:"center",cols:"12",style:{"font-size":"16px",color:"#EF5350"}},{default:o(()=>[j("strong",null,z(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(()=>[p("No")]),_:1},8,["onClick"]),e(y),e(v,{color:"green-darken-1",text:"",onClick:a.agree},{default:o(()=>[p("Yes")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue","onKeydown"])}const O=T(b,[["render",B]]);export{O as default};
