import{b as g}from"./vendor-vue-runtime-dom-B2rky8vu.js";import{r as b}from"./fieldsStore-CNpVuoPu.js";import{u as x}from"./translationsStore-D6vLzgNA.js";import{u as k}from"./settingsStore-8bwiLMEn.js";import{_ as q}from"./RequiredHint.vue_vue_type_style_index_0_lang-DGTCbwUk.js";import{d as F,e as n,f as c,i as s,x as i,k as S,t as d,B as T,z as B}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as V,u as o}from"./vendor-vue-reactivity-CheHbvBM.js";import{t as y,a as R}from"./vendor-vue-shared-DrzsEcag.js";import"./vendor-pinia-BSPefQhS.js";import"./appStore-CFAkQG2b.js";import"./convert-case-to-camel-case.utils-CK5dBN7n.js";import"./vendor-moment-Cv92BTSA.js";import"./vendor-bootstrap-CCU-90um.js";import"./vendor-jspdf-UFhKzYHA.js";import"./vendor-php-date-formatter-DSpPwBF8.js";import"./callbackStore-BhxBUA6V.js";const w={class:"ccb-order-field__wrapper"},C={class:"ccb-order-field__label"},N={key:0,class:"ccb-order-required-mark"},O=["placeholder"],Q=F({__name:"OrderPhone",props:{field:{}},setup(u){const p=u,{field:r}=V(p);r.value.value===void 0&&(r.value.value="");const{checkFieldRequired:m}=b(),f=x(),v=k(),_=n(()=>{var a,t;return((t=(a=v.getWarningTexts)==null?void 0:a.formFields)==null?void 0:t.phoneField)||f.getTranslations.requiredField}),h=a=>{let e=a.target.value;e=e.replace(/[^0-9+]/g,""),e.includes("+")&&(e.indexOf("+")!==0&&(e=e.replace(/\+/g,"")),(e.match(/\+/g)||[]).length>1&&(e="+"+e.replace(/\+/g,""))),r.value.value=e},l=n(()=>r.value.required?m(r.value):!1);return(a,t)=>(s(),c("div",{class:R(["ccb-order-field ccb-order-phone",{[`ccb-col-${o(r).fieldWidth}`]:!0,"ccb-order-field--required":l.value}])},[i("div",w,[l.value?(s(),S(q,{key:0,text:_.value},null,8,["text"])):d("",!0),i("label",C,[B(y(o(r).label)+" ",1),o(r).required?(s(),c("span",N,"*")):d("",!0)]),T(i("input",{type:"tel",placeholder:o(r).placeholder,"onUpdate:modelValue":t[0]||(t[0]=e=>o(r).value=e),onInput:h,pattern:"[0-9+]*"},null,40,O),[[g,o(r).value]])])],2))}});export{Q as default};
//# sourceMappingURL=OrderPhone-DtdyL3Ge.js.map
