1import{d as Z,u as D,r,w,a as me,c as ie,b as ue,o as c,e as h,f as t,t as a,g as o,h as m,i as p,j as g,n as H,k as d,l as A,m as O,_ as ce,p as pe,q as de,s as _e,v as fe,x as ve}from"./entry.b95a3a31.js";import{_ as he}from"./BRadio.vue.ddba8296.js";import{_ as ge}from"./BInput.vue.50de32db.js";import{_ as be}from"./BSelect.vue.a07d8b99.js";import{_ as $e}from"./BTextarea.vue.b93398ad.js";import{_ as Ve}from"./BInputFile.vue.4f72db99.js";import{_ as ye}from"./BLink.vue.3b220584.js";import{_ as ke}from"./BCheckbox.vue.f989b3b7.js";import{f as R}from"./useFetchAPI.27e33220.js";import"./useModelValue.6fe4f3e8.js";import"./index.7ba3721b.js";import"./useClickOutside.c35ca915.js";const we=C=>(pe("data-v-36d21f0f"),C=C(),de(),C),Ce={class:"container mt-80 md:mt-120 xl:mt-140"},qe={class:"complaint"},xe={class:"complaint__head"},Ee=["innerHTML"],Ie={class:"t-p3 mt-10 md:mt-15"},Se={class:"complaint__form-group"},Ue={key:0},Ne={class:"t-h3 uppercase text-white"},Te={class:"form__el"},Pe={class:"t-p4-bold text-white"},je={key:1},Me={class:"t-h3 uppercase text-white"},Ae={class:"flex lg:py-5"},Be={key:2},Fe={class:"t-h3 uppercase text-white"},Le={key:3},ze={class:"t-h3 uppercase text-white"},He={key:4},Re={class:"t-h3 uppercase text-white"},Ze={class:"form__el flex items-center flex-wrap gap-10 md:gap-24"},De={key:5,class:"complaint__success"},Oe={class:"max-w-[380px] lg:max-w-[526px] text-center mx-auto"},Ge={class:"t-h3 uppercase text-white"},Je={class:"t-p3 mt-10 text-white"},Ke=we(()=>t("br",null,null,-1)),Qe={class:"complaint__success-footer form__el"},We={key:6,class:"flex justify-between mt-20 md:mt-30 xl:mt-40"},Xe=Z({__name:"ComplaintForm",async setup(C){let q,T;const{t:i}=D(),b=r(1),n=r(1),_=r(""),x=r("");w(_,()=>{x.value=""});const f=r(0),B=e=>{f.value=e},u=r(""),y=r("");w(u,()=>{y.value=""});const v=r(""),E=r("");w(v,()=>{E.value=""});const $=r(null),S=r("");w($,()=>{S.value=""});let F;const G=async()=>{R("/forms/complaints/settings").then(e=>{F=e.locations})};[q,T]=me(()=>G()),await q,T();const J=ie(()=>F.map(({id:e,name:l})=>({id:e,label:l}))??[]),V=r(""),U=r("");w(V,()=>{U.value=""});const I=r([]),K=r(""),k=r(!1),N=r(!1);w(k,()=>{N.value=!1});const Q=()=>{n.value>1&&n.value--},W=ue(),X=async()=>{n.value===1&&b.value===2&&await W.push({path:"/about/contacts"}),n.value!==5&&L(n.value)&&n.value<6&&n.value++},Y=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ee=/^\d{11}$/,L=e=>{let l=!0;switch(e){case 2:_.value===""?(x.value=i("form.complaint.rule_required"),l=!1):_.value.length>255&&(x.value=i("form.complaint.rule_max")+" - 255",l=!1),u.value===""?(y.value=i("form.complaint.rule_required"),l=!1):f.value===0?Y.test(u.value.toLowerCase())||(y.value=i("form.complaint.rule_email"),l=!1):f.value===1&&(ee.test(u.value)||(y.value=i("form.complaint.rule_phone"),l=!1));break;case 3:v.value===""?(E.value=i("form.complaint.rule_required"),l=!1):v.value.length>255&&(E.value=i("form.complaint.rule_max")+" - 255",l=!1);break;case 4:$.value===null&&(S.value=i("form.complaint.rule_required"),l=!1);break;case 5:V.value===""&&(U.value=i("form.complaint.rule_required"),l=!1),k.value===!1&&(N.value=!0,l=!1);break}return l},le=async()=>{if(!L(n.value))return;const{success:e}=await R("/forms/complaints",{body:{full_name:_.value,email:f.value===0?u.value:"",phone:f.value===1?u.value:"",department:v.value,complaint_location_id:$.value,message:V.value,message_files:I.value},method:"POST"});e&&(n.value++,oe())},oe=()=>{_.value="",x.value="",f.value=0,u.value="",y.value="",v.value="",E.value="",$.value=null,S.value="",V.value="",U.value="",I.value=[],k.value=!1,N.value=!1},ae=()=>{n.value=1};return(e,l)=>{const z=he,P=ge,te=be,se=$e,ne=Ve,j=ce,M=ye,re=ke;return c(),h("section",Ce,[t("div",qe,[t("div",xe,[t("h1",{class:"t-h1 text-brand",innerHTML:e.$t("form.complaint.title")},null,8,Ee),t("div",Ie,a(e.$t("form.complaint.sub_title")),1)]),t("div",Se,[o(n)===1?(c(),h("div",Ue,[t("h3",Ne,a(e.$t("form.complaint.step"))+" 1 "+a(e.$t("form.complaint.from"))+" 5 ",1),t("div",Te,[t("label",Pe,a(e.$t("form.complaint.user_type_label"))+" *",1),m(z,{modelValue:o(b),"onUpdate:modelValue":l[0]||(l[0]=s=>p(b)?b.value=s:null),label:e.$t("form.complaint.user_type_employee"),value:1,name:"userType",class:"mt-5 md:mt-6 lg:mt-8"},null,8,["modelValue","label","value"]),m(z,{modelValue:o(b),"onUpdate:modelValue":l[1]||(l[1]=s=>p(b)?b.value=s:null),label:e.$t("form.complaint.user_type_buyer"),value:2,name:"userType",class:"mt-5 md:mt-6 lg:mt-8"},null,8,["modelValue","label","value"])])])):o(n)===2?(c(),h("div",je,[t("h3",Me,a(e.$t("form.complaint.step"))+" 2 "+a(e.$t("form.complaint.from"))+" 5 ",1),m(P,{modelValue:o(_),"onUpdate:modelValue":l[2]||(l[2]=s=>p(_)?_.value=s:null),"error-message":o(x),mode:"green",name:"name",label:e.$t("form.complaint.fio_label"),placeholder:"",class:"form__el","aria-required":""},null,8,["modelValue","error-message","label"]),m(P,{modelValue:o(u),"onUpdate:modelValue":l[5]||(l[5]=s=>p(u)?u.value=s:null),"error-message":o(y),mode:"green",name:"emailPhone",label:e.$t("form.complaint.email_or_phone_label"),placeholder:"",class:"form__el","aria-required":""},{default:g(()=>[t("div",Ae,[t("button",{class:H(["toggler toggler--left",o(f)===0?"toggler--active":""]),onClick:l[3]||(l[3]=s=>B(0))},a(e.$t("form.complaint.email_label")),3),t("button",{class:H(["toggler toggler--right",o(f)===1?"toggler--active":""]),onClick:l[4]||(l[4]=s=>B(1))},a(e.$t("form.complaint.phone_label")),3)])]),_:1},8,["modelValue","error-message","label"])])):o(n)===3?(c(),h("div",Be,[t("h3",Fe,a(e.$t("form.complaint.step"))+" 3 "+a(e.$t("form.complaint.from"))+" 5 ",1),m(P,{modelValue:o(v),"onUpdate:modelValue":l[6]||(l[6]=s=>p(v)?v.value=s:null),"error-message":o(E),mode:"green",name:"department",label:e.$t("form.complaint.department_label"),placeholder:"",class:"form__el","aria-required":""},null,8,["modelValue","error-message","label"])])):o(n)===4?(c(),h("div",Le,[t("h3",ze,a(e.$t("form.complaint.step"))+" 4 "+a(e.$t("form.complaint.from"))+" 5 ",1),m(te,{modelValue:o($),"onUpdate:modelValue":l[7]||
1(l[7]=s=>p($)?$.value=s:null),modelModifiers:{number:!0},items:o(J),"error-message":o(S),placeholder:e.$t("form.complaint.location_placeholder"),label:e.$t("form.complaint.location_label"),class:"form__el max-w-[560px]","aria-required":""},null,8,["modelValue","items","error-message","placeholder","label"])])):o(n)===5?(c(),h("div",He,[t("h3",Re,a(e.$t("form.complaint.step"))+" 5 "+a(e.$t("form.complaint.from"))+" 5 ",1),m(se,{modelValue:o(V),"onUpdate:modelValue":l[8]||(l[8]=s=>p(V)?V.value=s:null),"error-message":o(U),mode:"green",label:e.$t("form.complaint.message_label"),placeholder:e.$t("form.complaint.message_placeholder"),class:"form__el","aria-required":""},null,8,["modelValue","error-message","label","placeholder"]),m(ne,{modelValue:o(I),"onUpdate:modelValue":l[9]||(l[9]=s=>p(I)?I.value=s:null),"error-message":o(K),mode:"green",name:"message_files",label:e.$t("form.complaint.message_files_label"),class:"mt-8 md:mt-10 lg:mt-6",multiple:""},null,8,["modelValue","error-message","label"]),t("div",Ze,[m(j,{class:"mobile:w-full justify-center",type:"submit",onClick:le},{default:g(()=>[d(a(e.$t("form.complaint.send_button")),1)]),_:1}),m(re,{modelValue:o(k),"onUpdate:modelValue":l[10]||(l[10]=s=>p(k)?k.value=s:null),value:!0,"false-value":!1,mode:"green","is-error":o(N),class:"agreement"},{default:g(()=>[t("span",null,[d(a(e.$t("form.complaint.checkbox_agree"))+" ",1),m(M,{to:"/personaldata",color:"white",target:"_blank"},{default:g(()=>[d(a(e.$t("form.complaint.checkbox_agree_link")),1)]),_:1})])]),_:1},8,["modelValue","is-error"])])])):o(n)===6?(c(),h("div",De,[t("div",Oe,[t("h3",Ge,a(e.$t("form.complaint.sending_success")),1),t("div",Je,[d(a(e.$t("form.complaint.sending_success_message_part_1")),1),Ke,d(" "+a(e.$t("form.complaint.sending_success_message_part_2")),1)])]),t("div",Qe,[m(j,{is:"button",type:"button",color:"orange",class:"w-full justify-center !px-20",onClick:l[11]||(l[11]=s=>ae())},{default:g(()=>[d(a(e.$t("form.complaint.add_complaint")),1)]),_:1}),m(j,{is:"a",to:"/",color:"orange-outline",class:"w-full justify-center !px-20"},{default:g(()=>[d(a(e.$t("form.complaint.button_to_home")),1)]),_:1})])])):A("",!0),o(n)!==6?(c(),h("div",We,[o(n)!==1?(c(),O(M,{key:0,is:"div",color:"white",onClick:Q},{default:g(()=>[d(a(e.$t("form.complaint.button_back")),1)]),_:1})):A("",!0),m(M,{is:"div",color:o(n)===5?"dark-grey":"orange","icon-arrow":"",onClick:X},{default:g(()=>[d(a(e.$t("form.complaint.button_next")),1)]),_:1},8,["color"])])):A("",!0)])])])}}});const Ye=_e(Xe,[["__scopeId","data-v-36d21f0f"]]),pl=Z({__name:"index",setup(C){const{t:q}=D();return fe(ve({title:q("complaint.seo_title"),description:q("complaint.seo_description")})),(T,i)=>(c(),O(Ye))}});export{pl as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.