import{j as e,B,b as p,r as f,ck as x,cl as b,aw as l,ac as u,V as j,cm as k,k as P,D as S,cn as E}from"./index-DnB1XXdB.js";import{Field as a,useFormikContext as $,FieldArray as F}from"./formik.esm-CViySNZ7.js";import{F as A}from"./Checkbox-Dr7-zLsV.js";import{F as L,W as T,T as W,a as q,U as I,C as R,f as D}from"./CoordinatesAddress-CKpzjR4-.js";import{A as w}from"./Accordion-B6z9hydE.js";import"./Checkbox-BEJf4qTi.js";import"./Select-RXijXI1w.js";import"./styles-Ph5RSrcV.js";import"./Work-D3nWOd1G.js";import"./Phone-SkqePKWB.js";import"./Add-Dmtzz_h1.js";import"./Switch-BWuGlUof.js";import"./Switch-DO6l0lT9.js";import"./usePlacesAutocompleteService-BE2Z_pob.js";import"./index-XP0w1PvT.js";import"./schema-DL3SvpT6.js";function h({sx:r,...s}){return e.jsx(B,{...s,sx:t=>({display:{sm:"flex"},alignItems:{sm:"flex-start"},"& > &":{marginBottom:0,minWidth:{sm:"calc(50% - 9px)"}},"& > *:not(:last-child)":{marginBottom:{xs:6,sm:0},marginRight:{sm:4.5}},...typeof r=="function"?r(t):r})})}function te({onChange:r=()=>{},prefix:s=""}){const t=p();return f.useContext(x)?e.jsxs(b,{children:[e.jsxs(h,{children:[e.jsx(a,{simpleErrors:!0,required:!0,id:"wifi-form-ssid",type:"text",name:`${s}ssid`,inputProps:{maxLength:100},label:t.formatMessage({id:"builder.formsStep2.wifi.ssid.label"}),placeholder:t.formatMessage({id:"builder.formsStep2.wifi.ssid.placeholder"}),component:l,onChange:r,onBlur:r}),e.jsx(a,{simpleErrors:!0,id:"wifi-form-password",type:"text",name:`${s}password`,inputProps:{maxLength:100},label:t.formatMessage({id:"builder.formsStep2.wifi.password.label"}),placeholder:t.formatMessage({id:"builder.formsStep2.wifi.password.placeholder"}),component:l,onChange:r,onBlur:r})]}),e.jsxs(h,{children:[e.jsx(a,{id:"wifi-form-authType",required:!0,type:"text",name:`${s}authType`,label:t.formatMessage({id:"builder.formsStep2.wifi.authType.label"}),component:o=>e.jsxs(L,{...o,style:{width:163},children:[e.jsx(u,{value:"WEP",children:e.jsx(j,{id:"wifi.enciptationOption.wep"})}),e.jsx(u,{value:"WPA",children:e.jsx(j,{id:"wifi.enciptationOption.wpa"})}),e.jsx(u,{value:"WPA2-EAP",children:e.jsx(j,{id:"wifi.enciptationOption.wpaeap"})}),e.jsx(u,{value:"nopass",children:e.jsx(j,{id:"wifi.enciptationOption.nopass"})})]}),onChange:r,onBlur:r}),e.jsx("div",{style:{height:50,padding:"1px 0",alignSelf:"flex-end"},children:e.jsx(a,{id:"wifi-form-hidden",type:"checkbox",name:`${s}hidden`,label:t.formatMessage({id:"builder.formsStep2.wifi.hidden.label"}),background:!0,component:A,onChange:r})})]})]}):null}function se({onChange:r=()=>{},prefix:s=""}){const t=p();return f.useContext(x)?e.jsxs(b,{children:[e.jsx(a,{simpleErrors:!0,id:"sms-form-number",type:"text",name:`${s}number`,inputProps:{maxLength:50},label:t.formatMessage({id:"builder.formsStep2.sms.number"}),component:l,onChange:r,onBlur:r}),e.jsx(a,{simpleErrors:!0,id:"sms-form-message",type:"text",name:`${s}message`,inputProps:{maxLength:160},label:t.formatMessage({id:"builder.formsStep2.email.message"}),multiline:!0,maxRows:3,component:l,onChange:r,onBlur:r})]}):null}function oe({onChange:r=()=>{},prefix:s=""}){const t=p();return f.useContext(x)?e.jsxs(b,{children:[e.jsx(a,{simpleErrors:!0,required:!0,id:"email-form-email",type:"text",name:`${s}email`,inputProps:{maxLength:100},label:t.formatMessage({id:"common.email"}),component:l,onChange:r,onBlur:r}),e.jsx(a,{simpleErrors:!0,id:"email-form-subject",type:"text",name:`${s}subject`,inputProps:{maxLength:100},label:t.formatMessage({id:"builder.formsStep2.email.subject"}),component:l,onChange:r,onBlur:r}),e.jsx(a,{simpleErrors:!0,id:"email-form-body",type:"text",name:`${s}body`,inputProps:{maxLength:200},label:t.formatMessage({id:"builder.formsStep2.email.message"}),multiline:!0,maxRows:3,component:l,onChange:r,onBlur:r})]}):null}function ie({onChange:r=()=>{},prefix:s=""}){const t=p();return f.useContext(x)?e.jsxs(b,{children:[e.jsx(a,{simpleErrors:!0,id:"sms-form-number",type:"text",name:`${s}number`,inputProps:{maxLength:50},label:t.formatMessage({id:"builder.formsStep2.sms.number"}),component:l,onChange:r,onBlur:r}),e.jsx(a,{simpleErrors:!0,id:"sms-form-message",type:"text",name:`${s}message`,inputProps:{maxLength:160},label:t.formatMessage({id:"builder.formsStep2.email.message"}),multiline:!0,maxRows:3,component:l,onChange:r,onBlur:r})]}):null}function ae({onChange:r=()=>{},prefix:s=""}){const t=p();return f.useContext(x)?e.jsx(b,{children:e.jsx(h,{children:e.jsx(a,{id:"textForm-text",name:`${s}text`,required:!0,inputProps:{maxLength:300},InputProps:{required:!1},simpleErrors:!0,component:l,label:t.formatMessage({id:"builder.formsStep2.text.labels.text"}),multiline:!0,placeholder:t.formatMessage({id:"builder.formsStep2.text.placeholders.message"}),onChange:r,onBlur:r})})}):null}function N({type:r="",name:s="address",wrapperType:t="accordion",accordionProps:d={},handleChange:o=()=>{}}){const i=p(),{values:y}=$(),c=k(y,s),m=(c==null?void 0:c.type)||"full",g=n=>{n!==m&&o({customData:{name:s,value:{type:n,data:void 0}}})},M=n=>{o({customData:{name:n.target.name,value:n.target.value}})},v={name:`${s}.data`,value:c,change:o};return e.jsxs(T,{type:t,accordionProps:d,children:[e.jsx(W,{value:m,onChange:g}),!P(r)&&m==="full"&&(r===S.vcardPlus||r===S.business)&&e.jsx(a,{name:"locationBehaviour",label:i.formatMessage({id:"builder.formsStep2.location.locationBehaviour.label"}),component:n=>e.jsxs(L,{...n,value:n.field.value||"show",children:[e.jsx(u,{value:"hide",children:i.formatMessage({id:"builder.formsStep2.location.locationBehaviour.options.option1"})}),e.jsx(u,{value:"show",children:i.formatMessage({id:"builder.formsStep2.location.locationBehaviour.options.option2"})}),e.jsx(u,{value:"showMap",children:i.formatMessage({id:"builder.formsStep2.location.locationBehaviour.options.option3"})})]}),onChange:M,onBlur:M}),m==="full"&&e.jsx(q,{...v}),m==="url"&&e.jsx(I,{...v}),m==="coordinates"&&e.jsx(R,{...v})]})}function le({prefix:r="",values:s={},errors:t={},isValid:d=!1,onChange:o=()=>{}}){const i=p();return f.useContext(x)?e.jsx(b,{children:e.jsxs("div",{children:[e.jsxs(h,{width:"100%",mb:5.5,children:[e.jsx(a,{simpleErrors:!0,required:!0,id:"vcard-form-name",type:"text",name:`${r}name`,inputProps:{maxLength:70},label:i.formatMessage({id:"builder.formsStep2.vcard.info.name.label"}),placeholder:i.formatMessage({id:"builder.formsStep2.vcard.info.name.placeholder"}),component:l,onChange:o,onBlur:o}),e.jsx(a,{simpleErrors:!0,id:"vcard-form-lastName",type:"text",name:`${r}lastName`,inputProps:{maxLength:70},label:i.formatMessage({id:"builder.formsStep2.vcard.info.lastName.label"}),placeholder:i.formatMessage({id:"builder.formsStep2.vcard.info.lastName.placeholder"}),component:l,onChange:o,onBlur:o})]}),e.jsxs(w,{title:i.formatMessage({id:"builder.formsStep2.vcard.contactInfo"}),children:[e.jsx(F,{name:`${r}phone`,render:c=>{const m=`${r}phone`,g=E(c);return D({id:"vcard-form-phone",name:m,value:s.phone,errors:t.phone,hasText:!1})(g)}}),e.jsx(a,{simpleErrors:!0,id:"vcard-form-email",type:"text",name:`${r}email`,label:i.formatMessage({id:"common.email"}),placeholder:i.formatMessage({id:"common.placeholder.email"}),component:l,onChange:o,onBlur:o}),e.jsx(a,{simpleErrors:!0,id:"vcard-form-url",type:"text",name:`${r}url`,label:i.formatMessage({id:"builder.formsStep2.vcard.info.url.label"}),placeholder:i.formatMessage({id:"formikFields.buttons.urlPlaceholder"}),component:l,onChange:o,onBlur:o})]}),e.jsx(N,{type:"vcard",name:"data.address",handleChange:o}),e.jsx(w,{title:i.formatMessage({id:"common.company"}),children:e.jsxs(h,{children:[e.jsx(a,{simpleErrors:!0,id:"vcard-form-org",type:"text",name:`${r}org`,inputProps:{maxLength:50},label:i.formatMessage({id:"builder.formsStep2.vcard.info.org.label"}),placeholder:i.formatMessage({id:"builder.formsStep2.vcard.info.org.placeholder"}),component:l,onChange:o,onBlur:o}),e.jsx(a,{simpleErrors:!0,id:"vcard-form-title",type:"text",name:`${r}title`,inputProps:{maxLength:50},label:i.formatMessage({id:"builder.formsStep2.common.title"}),placeholder:i.formatMessage({id:"builder.formsStep2.vcard.info.titlePlaceholder"}),component:l,onChange:o,onBlur:o})]})})]})}):null}export{oe as EmailForm,ie as SmsForm,ae as TextForm,le as VcardForm,se as WhatsappForm,te as WifiForm};