import{g as v,x as C,o as d,c,a as e,n as i,t as l,d as m,w as r,N as x,q as N,a0 as u}from"./app-583c7dce.js";const S=["id","aria-labelledby"],I={class:"modal-dialog modal-dialog-centered"},M={class:"modal-content"},k={class:"modal-body"},w={class:"text-left"},E={class:"text-left font-weight-bold msg-white"},T={key:0,class:"text-center"},$={class:"text-left"},L={class:"text-left"},V=["disabled"],q={__name:"ConformationModal",props:{modalId:{type:String,default:"app-conformation-modal"},title:String,icon:String,subTitle:String,message:String,modalClass:String,firstButtonName:String,firstButtonClass:String,secondButtonName:String,secondButtonClass:String,preloader:{type:Boolean,default:!1}},emits:["cancel","confirm"],setup(t,{emit:b}){const o=t,s=b,f=()=>{B(),s("cancel",!1)},g=()=>{s("confirm")},y=()=>{new u(document.getElementById(o.modalId)).show()},B=()=>{u.getInstance(document.getElementById(o.modalId)).hide()};return v(()=>{y();let a=document.getElementById(o.modalId),n=document.getElementsByTagName("html")[0];a.addEventListener("hidden.bs.modal",()=>{s("cancel"),n.style.overflowY="auto"}),a.addEventListener("shown.bs.modal",()=>{n.style.overflowY="hidden"})}),(a,n)=>{const h=C("app-button-loader");return d(),c("div",{class:"modal fade",id:t.modalId,tabindex:"-1","aria-labelledby":`${t.modalId}-ModalLabel`,"aria-hidden":"true"},[e("div",I,[e("div",M,[e("div",k,[e("div",w,[e("i",{class:i([[t.icon?t.icon:"bi bi-check-circle",t.modalClass?t.modalClass:"text-brand"],"custom-delete-icon display-3"])},null,2)]),n[1]||(n[1]=e("br",null,null,-1)),e("h4",E,l(t.title?t.title:a.$t("are_you_sure")),1),t.subTitle?(d(),c("p",T,l(t.subTitle),1)):m("",!0),e("p",$,l(t.message),1),n[2]||(n[2]=e("div",{class:"border-top my-4"},null,-1)),e("div",L,[e("button",{type:"button",class:i(["mx-1 me-2 d-inline-flex align-items-center",[t.firstButtonClass?t.firstButtonClass:"btn btn-primary"]]),disabled:t.preloader,"data-dismiss":"modal",onClick:r(g,["prevent"])},[t.preloader?(d(),x(h,{key:0})):m("",!0),n[0]||(n[0]=e("i",{class:"bi bi-check-circle me-2"},null,-1)),N(" "+l(t.firstButtonName?t.firstButtonName:a.$t("yes")),1)],10,V),e("button",{type:"button",class:i(["d-inline-flex align-items-center",[t.secondButtonClass?t.secondButtonClass:"btn btn-primary-outline"]]),"data-dismiss":"modal",onClick:r(f,["prevent"])},l(t.secondButtonName?t.secondButtonName:a.$t("no")),3)])])])])],8,S)}}};export{q as _};
