import{aL as e,aK as l,k as a,g as i}from"./vendor-element-plus.js?ver=3.1.8";import{W as d,X as t,Y as o,a5 as s,J as n,az as r,a6 as m,c3 as u,ab as c,Z as p,a9 as f,aa as h,a8 as g}from"./vendor.js?ver=3.1.8";import{_ as V}from"./fc-bits-ui.js?ver=3.1.8";const v={style:{width:"100%"}},b=["type","placeholder"],C={key:2},k={class:"fc-verified-email-input-dialog-footer"};const y=V({name:"VerifiedEmailInput",props:["field","modelValue"],emits:["update:modelValue"],data(){return{selectedMail:this.modelValue,model:this.modelValue,dialogWarningVisible:!1,warningMessage:this.$t("Warning default email change")}},watch:{model(e){this.$emit("update:modelValue",e),null!=e&&e!=this.selectedMail&&(this.dialogWarningVisible=!0),null!=e&&e==this.selectedMail&&(this.dialogWarningVisible=!1)}},methods:{cancelChangeDefaultEmail(){this.model=this.selectedMail,this.dialogWarningVisible=!1},confirmChangeDefaultEmail(){this.dialogWarningVisible=!1,this.selectedMail=this.model}}},[["render",function(V,y,w,W,_,M){const E=e,$=l,D=a,j=i;return d(),t("div",v,[V.appVars.verified_senders.length?(d(),o($,{key:0,placeholder:w.field.placeholder,filterable:"","allow-create":"",modelValue:_.model,"onUpdate:modelValue":y[0]||(y[0]=e=>_.model=e)},{default:s(()=>[(d(!0),t(n,null,r(V.appVars.verified_senders,e=>(d(),o(E,{key:e,value:e},null,8,["value"]))),128))],void 0),_:1},8,["placeholder","modelValue"])):m((d(),t("input",{key:1,type:w.field.data_type,placeholder:w.field.placeholder,"onUpdate:modelValue":y[1]||(y[1]=e=>_.model=e),class:"fc-input-email"},null,8,b)),[[u,_.model]]),w.field.show_warning?(d(),t("div",C,[c(j,{title:V.$t("Confirm"),modelValue:_.dialogWarningVisible,"onUpdate:modelValue":y[2]||(y[2]=e=>_.dialogWarningVisible=e),"close-on-click-modal":!1,"append-to-body":!0,width:"30%"},{footer:s(()=>[p("span",k,[c(D,{onClick:M.cancelChangeDefaultEmail},{default:s(()=>[f(h(V.$t("Cancel")),1)],void 0,!0),_:1},8,["onClick"]),c(D,{type:"warning",onClick:M.confirmChangeDefaultEmail},{default:s(()=>[f(h(V.$t("Continue")),1)],void 0,!0),_:1},8,["onClick"])])]),default:s(()=>[p("span",null,[f(h(_.warningMessage+" "),1),p("strong",null,h(_.model+"."),1)])],void 0),_:1},8,["title","modelValue"])])):g("",!0)])}]]);export{y as V};
