const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Phone-C1Fsx5v8.css"])))=>i.map(i=>d[i]);
import{a as x,C as E,k as A,b as n,e as d,_ as c,m as l,g as a,p,q as o,f as u,u as i,L as D,n as P,D as m,r as R,I as F}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import{u as I,c as L,a as B,v as N,r as O}from"./widget-BUAABBRb.js";import{c as w}from"./ThankYouPage-bf4cLsjC.js";import{_ as f}from"./RequiredHint.vue_vue_type_style_index_0_lang-R4Bqx90z.js";import{u as U}from"./translationsStore-DBJu9sBR.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./index-CEuXXsrq.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const W={class:"ccb-field__label"},$={key:0,class:"ccb-required-tooltip"},z={class:"ccb-field__title"},M={key:0,class:"ccb-field-required-mark"},j={key:0,class:"ccb-field__descriptions ccb-before"},G={key:0,class:"ccb-field__description"},H={class:"ccb-field__input-wrapper"},J={key:1,class:"ccb-field__descriptions ccb-after"},K={key:0,class:"ccb-field__description"},se=x({__name:"ValidatedForm",props:{field:{}},setup(g){const T=g,{field:e}=E(T),s=A(""),v=I(),b=U(),_=L(),h=n(()=>{var r;return((r=B().getWarningTexts)==null?void 0:r.requiredMsg)||""}),C=n(()=>{var r;const t=(r=e.value)==null?void 0:r.fieldType;return t==="name"?d(()=>c(()=>import("./Name-mHoPKCU1.js"),[],import.meta.url)):t==="email"?d(()=>c(()=>import("./Email-BhD9SQ5Z.js"),[],import.meta.url)):t==="phone"?d(()=>c(()=>import("./Phone-C_RqlWvO.js"),__vite__mapDeps([0]),import.meta.url)):t==="website_url"?d(()=>c(()=>import("./WebsiteUrl-BnTW_yDB.js"),[],import.meta.url)):""}),S=t=>{var r,k;s.value="",((r=e.value)==null?void 0:r.fieldType)==="email"&&!N(t)&&t.trim()!==""?s.value="invalid_email":((k=e.value)==null?void 0:k.fieldType)==="website_url"&&!O(t)&&t.trim()!==""&&(s.value="invalid_url"),e.value.displayValue=t,_.updateField(e.value.alias,e.value)},V=t=>{e.value.defaultCountry=t,_.updateField(e.value.alias,e.value)},y=n(()=>s.value==="invalid_email"||s.value==="invalid_url"?!0:_.checkFieldRequired(e.value)),q=n(()=>{var t;return((t=e.value)==null?void 0:t.additionalStyles)||""});return(t,r)=>(a(),l("div",{class:F(["ccb-field ccb-field-quantity ccb-field-form-fields",{required:y.value,"ccb-field-disabled":i(e).disabled,[q.value]:!0}])},[p("div",W,[y.value?(a(),l("div",$,[s.value==="invalid_email"?(a(),u(f,{key:0,text:i(b).getTranslations.validEmailAddress},null,8,["text"])):s.value==="invalid_url"?(a(),u(f,{key:1,text:i(b).getTranslations.enterValidUrl},null,8,["text"])):(a(),u(f,{key:2,text:h.value},null,8,["text"]))])):o("",!0),p("div",z,[D(m(i(e).label),1),i(e).required?(a(),l("span",M,"*")):o("",!0),P(w)])]),i(v).getAppearanceDescriptionPosition==="before"?(a(),l("div",j,[i(e).description?(a(),l("div",G,m(i(e).description),1)):o("",!0)])):o("",!0),p("div",H,[(a(),u(R(C.value),{onUpdate:S,field:i(e),onCountryChanged:V},null,40,["field"]))]),i(v).getAppearanceDescriptionPosition==="after"?(a(),l("div",J,[i(e).description?(a(),l("div",K,m(i(e).description),1)):o("",!0)])):o("",!0)],2))}});export{se as default};
//# sourceMappingURL=index-DUCyUN4s.js.map
