import{_ as d}from"./index-CwP5gtrp-D2vs7vDd.js";import{_ as n,c as r,o as m,w as h,a as f}from"./index-D02r7Zsc.js";import"./index-C0p9vHHI-DoOEDIMw.js";import"./getElement-DrDVR-jO-jZgQ3Xxs.js";import"./BButton.vue_vue_type_script_setup_true_lang-D5Eg7-Zv-DDRCX2AG.js";import"./BSpinner.vue_vue_type_script_setup_true_lang-H1MzHypA-D8AXjJB0.js";import"./dom-DVb-f0ZG-Crdf0-mU.js";import"./useDefaults-DESCdb0p-CFLjYrdG.js";import"./useColorVariantClasses-ZDE19TZw-Cvu7SygP.js";import"./BLink.vue_vue_type_script_setup_true_lang-Ct47WhzE-DDPYis_D.js";import"./object-0ALvRU0O-3BORTTD-.js";import"./stringUtils-gJJ6T6UC-g5BZrMym.js";import"./BCloseButton.vue_vue_type_script_setup_true_lang-byZmQ_ot-CWP55Z5N.js";import"./useId-t29UARy6-BH5d2231.js";import"./useShowHide-717t6y_D-BZTBbOpd.js";import"./classes-BW_GpXTu-AKwVND4h.js";const c={props:{modalInfos:{type:Object,required:!0},id:{type:String,required:!1}},created:function(){this.id&&this.subscribe("open_modal_"+this.id,()=>{this.isModalVisible=!0,this.modalInfos.start=!0})},data(){return{isModalVisible:!1}},watch:{"modalInfos.start"(e){e&&(this.isModalVisible=!0,(this.modalInfos.headerBg==="danger"||this.modalInfos.headerBg==="warning")&&typeof window.navigator.vibrate=="function"&&window.navigator.vibrate(500))}},methods:{getHeaderClass(){return`${this.modalInfos.headerBg==="danger"||this.modalInfos.headerBg==="info"||this.modalInfos.headerBg==="success"?"text-light":"text-dark"} title`},handleOk(){(this.modalInfos.type==="confirmModal"||this.modalInfos.type==="okModal"&&this.modalInfos.method)&&this.$emit("modal_"+this.modalInfos.method,this.modalInfos.params||{})},handleHidden(){this.isModalVisible=!1,this.modalInfos.start=!1,this.modalInfos.handleClose&&this.publish("modalClosed")}}},u=["innerHTML"];function p(e,a,t,g,i,o){const s=d;return m(),r(s,{modelValue:i.isModalVisible,"onUpdate:modelValue":a[0]||(a[0]=l=>i.isModalVisible=l),title:t.modalInfos.content?.title,"ok-only":t.modalInfos.type==="okModal","ok-title":e.$t("modal."+(t.modalInfos.type==="okModal"?"okButton":"yesButton")),"ok-variant":"outline-success","cancel-title":e.$t("modal.noButton"),"cancel-variant":"outline-danger","header-bg-variant":t.modalInfos.headerBg,"header-class":o.getHeaderClass(),"footer-class":"p-2","hide-header-close":!0,"body-bg-variant":"light","footer-bg-variant":"light","no-header-close":"",centered:"",onOk:o.handleOk,onHidden:o.handleHidden},{default:h(()=>[f("div",{class:"text-justify",innerHTML:t.modalInfos.content?.message},null,8,u)]),_:1},8,["modelValue","title","ok-only","ok-title","cancel-title","header-bg-variant","header-class","onOk","onHidden"])}const L=n(c,[["render",p]]);export{L as default};
